CN112486466B - Method for realizing quick universal basic framework based on micro-service architecture - Google Patents
Method for realizing quick universal basic framework based on micro-service architecture Download PDFInfo
- Publication number
- CN112486466B CN112486466B CN202011460170.XA CN202011460170A CN112486466B CN 112486466 B CN112486466 B CN 112486466B CN 202011460170 A CN202011460170 A CN 202011460170A CN 112486466 B CN112486466 B CN 112486466B
- Authority
- CN
- China
- Prior art keywords
- micro
- service
- standard
- microservice
- general
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 72
- 238000013461 design Methods 0.000 claims abstract description 32
- 238000010276 construction Methods 0.000 claims abstract description 17
- 230000006870 function Effects 0.000 claims description 78
- 238000012360 testing method Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 9
- 238000005516 engineering process Methods 0.000 claims description 6
- 238000002955 isolation Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 claims description 3
- 238000010367 cloning Methods 0.000 claims description 3
- 230000002085 persistent effect Effects 0.000 claims description 3
- 230000004044 response Effects 0.000 claims description 3
- 238000004806 packaging method and process Methods 0.000 claims description 2
- 230000003362 replicative effect Effects 0.000 claims description 2
- 238000007726 management method Methods 0.000 description 29
- 238000010586 diagram Methods 0.000 description 14
- 230000018109 developmental process Effects 0.000 description 12
- 238000011161 development Methods 0.000 description 11
- 238000012986 modification Methods 0.000 description 8
- 230000004048 modification Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 239000002699 waste material Substances 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000033772 system development Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Abstract
The invention provides a method for realizing a quick and universal basic framework based on a micro-service architecture. The method comprises the steps of establishing a general basic framework based on the micro-services according to preset requirements, storing the general basic framework as the general basic framework of the micro-services, and designing the single micro-services one by one; standardizing the single micro-service and combining the single micro-service into at least one standard micro-service; performing distributed cache design of the standard micro-service, determining a storage method of the standard micro-service, and storing the storage method as a target standard micro-service; and finally, carrying out system construction and design according to the micro-service general type infrastructure and the target standard micro-service. The invention provides a method for designing standard micro-services and a basic framework according to requirements before establishing a basic framework, which has the characteristics of low risk of system quality and low resource cost.
Description
Technical Field
The invention relates to the field of enterprise management, in particular to a method for realizing a quick universal basic framework based on a micro-service architecture.
Background
In an initial stage of enterprise system construction, a system development basic framework is usually set up according to conditions such as enterprise IT planning, and the basic framework usually comprises contents such as a development language, a system architecture, a development specification, a naming rule, a code style and the like. Basic functions such as login, authentication, authority, synchronization, timing task and the like are generally included, and configuration and implementation of standard middleware and services such as uniformly planned databases, file servers, cache servers, external applications and the like in an enterprise are also included in a basic framework. Thereby forming a base software release early in the development of each system within the enterprise.
However, the existing basic software version implementation method has the following defects: when the information construction of an enterprise develops rapidly, the number of IT systems is increased, and at the moment, each system builds a system foundation frame respectively, so that risks in system quality, resource cost and time waste can be caused; the software architecture style inside the enterprise is not uniform, and the technical difference among teams inside the enterprise is large; the system development infrastructure within an enterprise is not standard and lacks a unified upgrade, modification and maintenance system.
Disclosure of Invention
In view of the above problems, the invention provides a method for realizing a quick and universal basic framework based on a micro-service architecture, which solves the problems of resource cost waste and large technical difference among teams in an enterprise during the design of basic software; the problem of lack of a unified upgrade, modification and maintenance system.
According to the embodiment of the invention, a method for realizing a quick universal basic framework based on a micro-service framework is provided, and the method for realizing the quick universal basic framework based on the micro-service framework comprises the following steps:
according to preset requirements, a general foundation framework based on the micro-service is established and stored as a general foundation framework of the micro-service;
according to each micro service function, carrying out single micro service design one by one;
standardizing the single micro-service and combining the single micro-service into at least one standard micro-service;
performing distributed cache design of the standard micro-service, determining a storage method of the standard micro-service, and storing the storage method as a target standard micro-service;
uploading all the micro-service general type basic frameworks and all the target standard micro-service packages to a warehouse management system;
a user downloads the micro-service general infrastructure and the target standard micro-service on the warehouse management system;
and modifying according to requirements based on the micro-service general basic architecture and the target standard micro-service, and completing system construction based on the micro-service architecture.
In one or more embodiments, preferably, the creating a general infrastructure based on micro services according to preset requirements, and saving the general infrastructure as the general infrastructure of micro services specifically includes:
starting to compile by adopting a Spring Boot architecture;
creating a parent level and setting preset project information;
creating a whole project purpose and functional design service registration center;
creating a new module according to a preset function, and inputting related project information;
and creating a structural directory of the project entirety, wherein the structural directory contains all the functional microservices.
In one or more embodiments, preferably, the full-featured microservice includes: the method comprises the steps of data connection pool providing, database design example providing, local caching, distributed caching implementation, remote calling implementation, persistent layer technology example, application security technology implementation, online document implementation, test data generation framework, system log method, event response implementation, unified error processing, unique main key generation strategy, distributed lock implementation, timed task implementation, unified management of local transactions, implementation of elasticity capability and unit test implementation.
In one or more embodiments, preferably, the performing, one by one, a single micro service design according to each micro service function specifically includes:
according to the micro-services with all functions, designing each micro-service function;
determining input modules for driving the micro services one by one;
determining output modules of each micro service one by one;
according to the input and the output, compiling and determining each micro-service module program by using JAVA;
and testing whether the functions of the micro-services can be independently operated one by one.
In one or more embodiments, preferably, the normalizing the single micro-service and merging the single micro-service into at least one standard micro-service specifically includes:
analyzing the functional similarity of the micro-services, classifying similar functions, and storing the functions as similar functions;
according to the similar functions, carrying out the same structure design on the micro-service, and storing the micro-service as at least one shared structure;
according to the special function design of the existing function case, the existing function case is stored as a special structure;
a common package is at least one standard microservice based on all of the common structures and all of the unique structures.
In one or more embodiments, preferably, the distributed caching method includes:
the distributed cache adopts a Redis sentinel mode;
the cache adopts a cluster mode of three sentinels with one master and two slaves;
the client is linked through a cluster mode and dispersedly uses the cache database;
the background disables the hazard commands keys, flush db, config, and Smembers.
In one or more embodiments, preferably, the storage architecture design method includes:
the database includes rereadable and read committed using a default transaction isolation level;
using an declarative transaction management mode, and controlling transactions in service layer codes;
the naming rule accords with select, search, get, query, find, load, list, count, is and page to be regarded as the read operation;
the naming rule accords with add, save, del, up and edge to be regarded as the write operation, and the transaction must be used;
when using read-only transactions, if there is only one sql query operation in a transaction, the transaction may not be used.
In one or more embodiments, preferably, the uploading all the microservice generic infrastructure and all the target standard microservice packages to a warehouse management system specifically includes:
building a warehouse on the warehouse management system;
cloning the newly built warehouse to the local;
replicating all of the microservice generic infrastructure and all of the target standard microservices;
adding all the micro-service general type basic frameworks and all the target standard micro-services to the newly-built warehouse, and storing the newly-built warehouse as a standard warehouse;
and uploading the standard warehouse to the warehouse management system.
In one or more embodiments, preferably, the microservice generic infrastructure includes: front end, reverse proxy, gateway, service, safety management, service management.
In one or more embodiments, preferably, the modifying is performed as required based on the universal micro-service infrastructure and the target standard micro-service, so as to complete the system building based on the micro-service architecture, specifically including:
building a micro-service architecture on the server;
confirming the required micro service function, updating the micro service architecture and confirming the requirement of the micro service function;
downloading the standard microservice module from the warehouse management system;
configuring the standard micro service module into different functions according to the micro service function requirements;
designing flow control among the standard micro services, and suspending flow transmission among the modules when the flow exceeds a preset margin;
configuring storage spaces of all the standard micro-service modules;
starting the whole basic framework based on the micro-service framework;
and starting a micro-service project, and verifying whether the micro-service is normally started by using browser browsing.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
in the embodiment of the invention, on the basis of function analysis, multi-type functions are fused, unified standardized micro-services are designed, and an enterprise management standard infrastructure is built on the basis of the unified standardized micro-services. The scheme provides a method for realizing all micro-service construction of a system foundation framework in the initial stage of IT system construction in an enterprise, and reduces the risks on system quality and the waste of resource cost caused by the fact that each system constructs the system foundation framework respectively under the condition of rapid development of information construction of the enterprise; designing uniform and same technical specifications of software architecture styles inside enterprises, and reducing technical differences among teams; the basic framework has standardization, and is convenient for unified upgrading and unified modification.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for implementing a quick and general infrastructure based on a microservice architecture according to an embodiment of the present invention.
Fig. 2 is a flowchart of creating a microservice-based general-purpose infrastructure in a method for implementing a microservice-based rapid general-purpose infrastructure according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of the overall functions of the micro service in the method for implementing the fast general infrastructure based on the micro service architecture according to an embodiment of the present invention.
Fig. 4 is a flowchart of performing single microservice design one by one in a method for implementing a fast generic infrastructure based on microservice architecture according to an embodiment of the present invention.
Fig. 5 is a flowchart of a single microservice standardization process in a microservice architecture-based fast common infrastructure implementation method according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of distributed caching of standard microservices in a method for implementing a fast generic infrastructure based on a microservice architecture according to an embodiment of the present invention.
Fig. 7 is a flowchart of a method for storing the standard microservice in a method for implementing a fast generic infrastructure based on a microservice architecture according to an embodiment of the present invention.
Fig. 8 is a flowchart of uploading the target standard microservice package to a warehouse management system in a method for implementing a quick universal basic framework based on a microservice architecture according to an embodiment of the present invention.
Fig. 9 is a schematic structural diagram of a micro-service general infrastructure in a method for implementing a micro-service architecture-based fast general infrastructure according to an embodiment of the present invention.
Fig. 10 is a flowchart of system setup for performing a microservice architecture based on the microservice general-type infrastructure and the target standard microservice in a method for implementing a microservice architecture-based fast general infrastructure according to an embodiment of the present invention.
Detailed Description
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In an initial stage of enterprise system construction, a system development basic framework is usually set up according to conditions such as enterprise IT planning, and the basic framework usually comprises contents such as a development language, a system architecture, a development specification, a naming rule, a code style and the like. Basic functions such as login, authentication, authority, synchronization, timing task and the like are generally included, and configuration and implementation of standard middleware and services such as uniformly planned databases, file servers, cache servers, external applications and the like in an enterprise are also included in a basic framework. Thereby forming a base software release early in the development of each system within the enterprise. The standard implementation method of the basic version software is the core subject of the patent.
However, the existing basic software version implementation method has the following defects: when the information construction of an enterprise develops rapidly, the number of IT systems is increased, and at the moment, each system builds a system foundation frame respectively, so that risks in system quality, resource cost and time waste can be caused; the software architecture style inside the enterprise is not uniform, and the technical difference among teams inside the enterprise is large; the system development infrastructure within an enterprise is not standard and lacks a unified upgrade, modification and maintenance system.
The invention provides a system which designs standard micro-services in advance according to requirements before a basic framework is established, and then uploads the standard micro-services to a warehouse.
Fig. 1 is a flowchart of a method for implementing a quick and general infrastructure based on a microservice architecture according to an embodiment of the present invention.
As shown in fig. 1, in one or more embodiments, preferably, there is provided a method for implementing a micro service architecture-based fast general infrastructure, where the method for implementing the micro service architecture-based fast general infrastructure includes:
s101, creating a general foundation framework based on the micro-service according to a preset requirement, and storing the general foundation framework as the general foundation framework of the micro-service;
specifically, the preset requirements refer to certain requirements that have been determined before the service general infrastructure is created, for example, the entire system includes two parts, namely a foreground part and a background part, where the foreground part includes which subsystems, and the background part includes which subsystems.
S102, designing single micro-service one by one according to each micro-service function;
s103, standardizing the single micro-service and combining the single micro-service into at least one standard micro-service;
s104, performing distributed cache design of the standard micro-service, determining a storage method of the standard micro-service, and storing the storage method as a target standard micro-service;
s105, packaging and uploading all the micro-service general type basic architectures and all the target standard micro-services to a warehouse management system;
s106, downloading the micro-service general infrastructure and the target standard micro-service on the warehouse management system by a user;
s107, modifying according to requirements based on the micro-service general basic architecture and the target standard micro-service, and completing system construction based on the micro-service architecture.
In the embodiment of the invention, the standard target micro-service is finally formed by designing the function from the basic framework of the micro-service to the single micro-service, and then the micro-service and the basic framework are utilized to complete the rapid IT management system construction. If different teams build in the same enterprise, the generated micro-services among the subsystems are compatible with each other due to the adoption of the same basic architecture.
Fig. 2 is a flowchart of creating a microservice-based general-purpose infrastructure in a method for implementing a microservice-based rapid general-purpose infrastructure according to an embodiment of the present invention.
As shown in fig. 2, in one or more embodiments, preferably, the creating a general infrastructure based on micro services according to preset requirements, and saving the general infrastructure as the general infrastructure of micro services specifically includes:
s201, starting to compile by adopting a Spring Boot architecture;
specifically, Spring Cloud is an ordered set of a series of frames. The Spring Cloud skillfully simplifies the development of infrastructure of a distributed system by utilizing the development convenience of the Spring Boot, such as service discovery registration, a configuration center, a message bus, load balancing, a breaker, data monitoring and the like, and can realize one-key starting and deployment by utilizing the development style of the Spring Boot.
S202, creating a parent level and setting preset project information;
s203, creating a whole project purpose and functional design service registration center;
s204, creating a new module according to a preset function, and inputting related project information;
s205, creating a structural directory of the whole project, wherein the structural directory comprises all the functional microservices.
In the embodiment of the invention, a set of construction modes based on the micro-service general type basic framework is provided, and the framework can be definitely constructed through Spring Cloud.
Fig. 3 is a schematic diagram of the overall functions of the micro service in the method for implementing the fast general infrastructure based on the micro service architecture according to an embodiment of the present invention.
In one or more embodiments, as shown in fig. 3, the full-featured microservices preferably include: the method comprises the steps of data connection pool providing, database design example providing, local caching, distributed caching implementation, remote calling implementation, persistent layer technology example, application security technology implementation, online document implementation, test data generation framework, system log method, event response implementation, unified error processing, unique main key generation strategy, distributed lock implementation, timed task implementation, unified management of local transactions, implementation of elasticity capability and unit test implementation. In the embodiment of the present invention, all the functions are given as currently known types of functions to be developed, and certainly not limited to all the functions mentioned in the embodiment, and during the execution process, a more comprehensive micro-service function can be obtained.
Fig. 4 is a flowchart of performing single microservice design one by one in a method for implementing a fast generic infrastructure based on microservice architecture according to an embodiment of the present invention.
As shown in fig. 4, in one or more embodiments, preferably, the performing of the single micro service design one by one according to each micro service function specifically includes:
s401, designing each micro-service function according to the micro-services with all functions;
s402, determining input modules for driving the micro services one by one;
s403, determining output modules of the micro services one by one;
s404, according to the input and the output, compiling and determining each micro-service module program by using JAVA;
specifically, the Java is an object-oriented programming language, which not only absorbs various advantages of the C + + language, but also abandons concepts such as multiple inheritance and pointers which are difficult to understand in the C + +, so that the Java language has two characteristics of strong function and simplicity and easiness in use. Because the micro-service may be multi-threaded, is a data processing mode with a parallel structure, and is written by adopting JAVA, the micro-service is simpler.
S405, testing whether the functions of the micro-services can operate independently one by one.
In the embodiment of the invention, a single design flow of the micro-service function is given, and the basic modules including the micro-service function are determined, specifically an input module and an output module. Of course, for some user-oriented functions, service-related function modules may be involved, and may be designed in a domain-driven manner to ensure that they can be directly and quickly used by service application personnel.
Fig. 5 is a flowchart of a single microservice standardization process in a microservice architecture-based fast common infrastructure implementation method according to an embodiment of the present invention.
As shown in fig. 5, in one or more embodiments, preferably, the normalizing the single micro service and merging the single micro service into at least one standard micro service specifically includes:
s501, analyzing the functional similarity of the micro-services, classifying similar functions and storing the functions as similar functions;
s502, according to the similar functions, performing same structure design on the micro-services, and storing the micro-services as at least one shared structure;
s503, designing according to the special functions of the existing functional case, and storing the special structures;
s504, according to all the common structures and all the special structures, the common package is at least one standard microservice.
In the embodiment of the invention, the similarity analysis is carried out on the micro-service functions to confirm the similarity functions in all the function blocks, and then the same standard program writing mode is adopted to complete the same functions. And independently designing different or dissimilar functions in each micro service function. The finally realized target standard micro-service adopts the same logic when executing the same or similar tasks, and the micro-service adopting the same logic has good compatibility when forming a large-scale IT system.
Fig. 6 is a schematic diagram of distributed caching of standard microservices in a method for implementing a fast generic infrastructure based on a microservice architecture according to an embodiment of the present invention.
As shown in fig. 6, in one or more embodiments, preferably, the distributed caching method includes:
s601, adopting a Redis sentinel mode for the distributed cache;
s602, the cache adopts a cluster mode of three sentinels with one master and two slaves;
s603, the clients are linked through a cluster mode and use the cache database in a scattered mode;
s605, background disable hazard commands keys, flush db, config, and Smembers.
In the embodiment of the invention, a master-slave equipment mode is adopted for design. The Master-Slave device mode is also called Master-Slave mode, and is called Master-Slave mode for short, the core idea is based on the concept of divide-and-conquer, an original task is decomposed into a plurality of subtasks with equivalent functions, and the tasks are executed in parallel by special worker threads, and the result of the original task is formed by integrating the processing results of the subtasks. By the method, the reliability of the data can be ensured, and the reliability of the whole system cannot be influenced by the damage of the main equipment.
Fig. 7 is a flowchart of a method for storing the standard microservice in a method for implementing a fast generic infrastructure based on a microservice architecture according to an embodiment of the present invention.
As shown in fig. 7, in one or more embodiments, preferably, the storage architecture design method includes:
s701, the database uses a default transaction isolation level to comprise a rereadable state and a read committed state;
s702, using an explicit transaction management mode, and controlling the transaction in a service layer code;
s703, regarding the naming rule which accords with select, search, get, query, find, load, list, count, is and page as a read operation;
s704, the naming rules are according with add, save, del, up and edge as writing operation, and the transaction must be used;
s705, when using read-only transaction, if there is only one sql query operation in one service, the transaction may not be used.
Fig. 8 is a flowchart of uploading the target standard microservice package to a warehouse management system in a method for implementing a quick universal basic framework based on a microservice architecture according to an embodiment of the present invention.
As shown in fig. 8, in one or more embodiments, preferably, the uploading all the microservice generic infrastructure and all the target standard microservice packages to a warehouse management system specifically includes:
s801, building a warehouse on the warehouse management system;
s802, cloning the newly built warehouse to a local place;
s803, copying all the micro-service general type basic frameworks and all the target standard micro-services;
s804, adding all the micro-service general type basic frameworks and all the target standard micro-services to the newly-built warehouse, and storing the micro-service general type basic frameworks and the target standard micro-services as a standard warehouse;
and S805, uploading the standard warehouse to the warehouse management system.
In one or more embodiments, the database uses a default transaction isolation level: readable Read and Read committed; using an declarative transaction management mode, and controlling transactions in service layer codes; controlling transaction propagation behavior by means of method naming, regarding a naming rule which accords with select, search, get, query, find, load, list, count, is and page as a read operation, using readOnly transaction, if there is only one sql query operation in one service, not using transaction; the naming convention conforms to add, save, del, up, edge as a write operation, and the transaction must be used, using the REQUERD level.
Fig. 9 is a schematic structural diagram of a micro-service general infrastructure in a method for implementing a micro-service architecture-based fast general infrastructure according to an embodiment of the present invention.
As shown in fig. 9, in one or more embodiments, preferably, the microservice general-purpose infrastructure includes: front end, reverse proxy, gateway, service, safety management, service management. In the embodiment of the invention, on the overall architecture, the authorization matrix service is adopted, the browser server is used for architecture mode design, the used program development language is Java, the spring cloud is used for realizing a service management system, and the spring boot is used as the main body of the basic architecture.
Fig. 10 is a flowchart of system setup for performing a microservice architecture based on the microservice general-type infrastructure and the target standard microservice in a method for implementing a microservice architecture-based fast general infrastructure according to an embodiment of the present invention.
As shown in fig. 10, in one or more embodiments, preferably, the modifying is performed as required based on the universal micro-service infrastructure and the target standard micro-service, so as to complete the system building based on the micro-service architecture, specifically including:
s1001, building a micro-service architecture on a server;
s1002, confirming a required micro service function, updating the micro service architecture and confirming a micro service function requirement;
s1003, downloading the standard micro service module from the warehouse management system;
s1004, configuring the standard micro-service module into different functions according to the micro-service function requirements;
s1005, designing the flow control among the standard micro services, and suspending the flow transmission among the modules when the flow exceeds a preset margin;
s1006, configuring storage spaces of all the standard micro-service modules;
s1007, starting the whole basic framework based on the micro-service framework;
and S1008, starting the micro service project, and verifying whether the micro service is normally started by using browser browsing.
In the embodiment of the invention, after the micro-service design is finished, corresponding tests are carried out, which mainly test whether the micro-service can independently and correctly work, and effective data interaction among the micro-services can be carried out, thereby ensuring the smooth operation of an IT management system.
In the embodiment of the invention, on the basis of function analysis, multi-type functions are fused, unified standardized micro-services are designed, and an enterprise management standard infrastructure is built on the basis of the unified standardized micro-services. The scheme provides a method for realizing all micro-service construction of a system foundation framework in the initial stage of IT system construction in an enterprise, and reduces the risks on system quality and the waste of resource cost caused by the fact that each system constructs the system foundation framework respectively under the condition of rapid development of information construction of the enterprise; the software architecture style inside an enterprise is unified and the same technical specification is designed, and the technical difference among teams is reduced; the basic framework has standardization, and is convenient for unified upgrading and unified modification.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (6)
1. A method for realizing a quick universal basic framework based on a micro-service architecture is characterized by comprising the following steps:
according to preset requirements, a general foundation framework based on the micro-service is established and stored as a general foundation framework of the micro-service;
according to each micro service function, carrying out single micro service design one by one;
standardizing the single micro-service and combining the single micro-service into at least one standard micro-service;
performing distributed cache design of the standard micro-service, determining a storage method of the standard micro-service, and storing the storage method as a target standard micro-service;
uploading all the micro-service general type basic frameworks and all the target standard micro-service packages to a warehouse management system;
a user downloads the micro-service general infrastructure and the target standard micro-service on the warehouse management system;
modifying according to requirements based on the micro-service general basic architecture and the target standard micro-service, and completing system construction based on the micro-service architecture;
wherein, the standardizing the single micro-service and combining the single micro-service into at least one standard micro-service specifically comprises:
analyzing the functional similarity of the micro-services, classifying similar functions, and storing the functions as similar functions;
according to the similar functions, carrying out the same structure design on the micro-service, and storing the micro-service as at least one shared structure;
according to the special function design of the existing function case, the existing function case is stored as a special structure;
sharing packaging into at least one of said standard microservices according to all of said common structure and all of said unique structures;
wherein the microservice generic infrastructure comprises: the system comprises a front end, a reverse proxy, a gateway, a business service, safety management and service management;
the uploading all the microservice general-type infrastructure and all the target standard microservice packages to a warehouse management system specifically comprises:
building a warehouse on the warehouse management system;
cloning the newly built warehouse to the local;
replicating all of the microservice generic infrastructure and all of the target standard microservices;
adding all the micro-service general type basic frameworks and all the target standard micro-services to the newly-built warehouse, and storing the newly-built warehouse as a standard warehouse;
uploading the standard warehouse to the warehouse management system;
the general basic architecture based on the microservice and the target standard microservice are modified according to requirements, and system construction based on the microservice architecture is completed, and the method specifically comprises the following steps:
building a micro-service general type basic framework on a server;
confirming the needed micro service function, updating the micro service general type basic framework and confirming the requirement of the micro service function;
downloading the target standard micro-service module from the warehouse management system;
configuring the target standard micro-service module into different functions according to the requirements of micro-service functions;
designing flow control among the target standard micro-services, and suspending flow transmission among the modules when the flow exceeds a preset margin;
configuring storage spaces of all the target standard micro-service modules;
starting the whole basic framework based on the micro-service framework;
and starting the micro-service project, and verifying whether the micro-service is normally started by using browser browsing.
2. The method according to claim 1, wherein the creating a general infrastructure based on microservice according to a preset requirement and saving the general infrastructure based on microservice as the general infrastructure based on microservice specifically comprises:
starting to compile by adopting a Spring Boot architecture;
creating a parent level and setting preset project information;
creating a whole project purpose and functional design service registration center;
creating a new module according to a preset function, and inputting related project information;
and creating a structural directory of the project entirety, wherein the structural directory contains all the functional microservices.
3. The method of claim 1, wherein the full-featured microservices comprise: the method comprises the steps of data connection pool providing, database design example providing, local caching, distributed caching implementation, remote calling implementation, persistent layer technology example, application security technology implementation, online document implementation, test data generation framework, system log method, event response implementation, unified error processing, unique main key generation strategy, distributed lock implementation, timed task implementation, unified management of local transactions, implementation of elasticity capability and unit test implementation.
4. The method according to claim 1, wherein the step of performing single micro service design one by one according to each micro service function specifically comprises:
designing each micro-service function according to the micro-services of all functions;
determining input modules for driving the micro services one by one;
determining output modules of the micro services one by one;
according to the input and the output, compiling and determining each micro-service module program by using JAVA;
and testing whether the functions of the micro-services can be independently operated one by one.
5. The method of claim 1, wherein the distributed cache design comprises:
the distributed cache adopts a Redis sentinel mode;
the distributed cache adopts a cluster mode of three sentinels with one master and two slaves;
the client is linked through a cluster mode and dispersedly uses the cache database;
the background disables the hazard commands keys, flush db, config, and Smembers.
6. The method for implementing a micro-service architecture-based fast generic infrastructure according to claim 1, wherein the storing method comprises:
the database includes rereadable and read committed using a default transaction isolation level;
using an declarative transaction management mode, and controlling transactions in service layer codes;
the naming rule accords with select, search, get, query, find, load, list, count, is and page to be regarded as the read operation;
the naming rule accords with add, save, del, up and edge to be regarded as the write operation, and the transaction must be used;
when using read-only transactions, if there is only one sql query operation in a transaction, the transaction may not be used.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011460170.XA CN112486466B (en) | 2020-12-11 | 2020-12-11 | Method for realizing quick universal basic framework based on micro-service architecture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011460170.XA CN112486466B (en) | 2020-12-11 | 2020-12-11 | Method for realizing quick universal basic framework based on micro-service architecture |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112486466A CN112486466A (en) | 2021-03-12 |
CN112486466B true CN112486466B (en) | 2022-02-08 |
Family
ID=74916742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011460170.XA Expired - Fee Related CN112486466B (en) | 2020-12-11 | 2020-12-11 | Method for realizing quick universal basic framework based on micro-service architecture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112486466B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113961173B (en) * | 2021-10-13 | 2024-04-30 | 天津大学 | Domain event driven based monomer system micro-service splitting method |
WO2023082034A1 (en) * | 2021-11-09 | 2023-05-19 | 国网信息通信产业集团有限公司 | Microservice generation method and apparatus |
CN114401276A (en) * | 2021-12-10 | 2022-04-26 | 深圳市顺易通信息科技有限公司 | Basic framework for unified architecture |
CN114895879B (en) * | 2022-07-14 | 2022-11-04 | 四川航天信息有限公司 | Management system design scheme determining method, device, equipment and storage medium |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107102847A (en) * | 2016-02-23 | 2017-08-29 | 中国水电工程顾问集团有限公司 | Software development methodology, apparatus and system based on micro services |
US10198250B1 (en) * | 2018-01-04 | 2019-02-05 | Accenture Global Solutions Limited | Partitioning based migration of systems to container and microservice based platforms |
CN108228217A (en) * | 2018-01-18 | 2018-06-29 | 晶晨半导体(上海)股份有限公司 | A kind of method for upgrading system |
CN108446111A (en) * | 2018-03-26 | 2018-08-24 | 国家电网公司客户服务中心 | A kind of micro services construction method based on Spring cloud |
CN109597610A (en) * | 2018-12-10 | 2019-04-09 | 南京华苏科技有限公司 | A kind of application structure modularization construction method based on micro services framework |
CN110134374A (en) * | 2019-05-10 | 2019-08-16 | 南京绿新能源研究院有限公司 | Method based on Spring cloud micro services framework cloud SCADA system |
CN111045648B (en) * | 2019-12-11 | 2024-03-15 | 盈佳云创科技(深圳)有限公司 | Micro-service development device |
CN111796834B (en) * | 2020-06-30 | 2022-10-14 | 福信富通科技股份有限公司 | Method, device and equipment for deploying combinable micro-service development framework |
CN111930355B (en) * | 2020-08-12 | 2021-10-26 | 创意信息技术股份有限公司 | Web back-end development framework and construction method thereof |
CN111935286A (en) * | 2020-08-12 | 2020-11-13 | 创意信息技术股份有限公司 | Micro-service framework for software development and construction method thereof |
-
2020
- 2020-12-11 CN CN202011460170.XA patent/CN112486466B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN112486466A (en) | 2021-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112486466B (en) | Method for realizing quick universal basic framework based on micro-service architecture | |
US11520639B2 (en) | Method for allocating and managing cluster resource on cloud platform | |
US20200183896A1 (en) | Upgrade of heterogeneous multi-instance database clusters | |
CN108076098B (en) | Service processing method and system | |
CN106156186B (en) | Data model management device, server and data processing method | |
US9413604B2 (en) | Instance host configuration | |
US11093232B2 (en) | Microservice update system | |
JP5982366B2 (en) | Systems and methods for private cloud computing | |
CN112424750A (en) | Multi-cluster supply and management method on cloud platform | |
CN108647265B (en) | Multi-platform data-based interactive system | |
CN112463144B (en) | Distributed storage command line service method, system, terminal and storage medium | |
US8966025B2 (en) | Instance configuration on remote platforms | |
CN113434158B (en) | Custom management method, device, equipment and medium for big data component | |
US20170220324A1 (en) | Data communication accelerator system | |
EP2948865A1 (en) | Instance host configuration | |
US6658644B1 (en) | Services-based architecture for a telecommunications enterprise | |
CN106406980B (en) | A kind of dispositions method and device of virtual machine | |
US11948005B2 (en) | Managed integration of constituent services of multi-service applications | |
US11941413B2 (en) | Managed control plane service | |
CN111324599A (en) | Block chain experiment system and management method | |
Lin et al. | Research on building an innovative electric power marketing business application system based on cloud computing and microservices architecture technologies | |
Chen et al. | MORE: A model-driven operation service for cloud-based IT systems | |
KR20180107983A (en) | Apparatus for creating and executing virtual platforms and method for the same | |
US10534640B2 (en) | System and method for providing a native job control language execution engine in a rehosting platform | |
US11748686B1 (en) | Automated onboarding service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220208 |
|
CF01 | Termination of patent right due to non-payment of annual fee |