CN110427174A - A kind of micro services construction method based on database - Google Patents

A kind of micro services construction method based on database Download PDF

Info

Publication number
CN110427174A
CN110427174A CN201910717137.1A CN201910717137A CN110427174A CN 110427174 A CN110427174 A CN 110427174A CN 201910717137 A CN201910717137 A CN 201910717137A CN 110427174 A CN110427174 A CN 110427174A
Authority
CN
China
Prior art keywords
micro services
construction method
database
service
method based
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.)
Granted
Application number
CN201910717137.1A
Other languages
Chinese (zh)
Other versions
CN110427174B (en
Inventor
赵美如
杨继伟
魏金雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN201910717137.1A priority Critical patent/CN110427174B/en
Publication of CN110427174A publication Critical patent/CN110427174A/en
Application granted granted Critical
Publication of CN110427174B publication Critical patent/CN110427174B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Abstract

The present invention discloses a kind of micro services construction method based on database, is related to program control technology field.For many defects present in existing software development building process, technical solution is provided and uses framework of the SpringCloud as micro services, using Mysql or Oracle as database, using OAuth2 as safety guarantee, it is shown using vue as front end, pattern is shown as front end using bootstrap4, after based on this, service code is automatically generated by creation EurekaServer and is stored in business service, build the framework of micro services, business service is successively then registered to service centre, open Zull gateway, open Ribbon load balancing, the unitary construction that micro services are completed in operations such as it is monitored according to Dashbord, improve development efficiency, reduce non-traffic ratio of defects;In addition, by being multiplexed long-tested micro services framework, moreover it is possible to reduce framework risk, improve the safety of micro services structure.

Description

A kind of micro services construction method based on database
Technical field
The present invention relates to program control technology field, specifically a kind of micro services construction method based on database.
Background technique
The age is developed in traditional WEB, once fashionable for a time is to cooperate ORM frame, in addition changeable using Spring as core Front end frame, for constructing the service platform of enterprise oneself.
In this day and age, agility is quickly the necessary condition of small micro- Business survival.But due to necessity stream of software development Journey, although agile development solves subproblem to a certain extent, but still the expection of not up to enterprise;The building of software development simultaneously There are many repeated developments in the process, non-traffic property bug when software test causes software development efficiency not high, low Grade ratio of defects is high;Market quickly changes, and enterprise demand is uncertain, causes business change rate higher, the reply energy of software Power is insufficient.Various reasons are all carried out in the different degrees of business for hindering enterprise.
Summary of the invention
The present invention provides a kind of based on the micro- of database for many defects present in existing software development building process Service construction method, by solidifying architecture, sinking infrastructure service automatically generates service code, and completion rapidly and efficiently is micro- The building of service.
A kind of micro services construction method based on database of the invention solves the technical solution that above-mentioned technical problem uses It is as follows:
A kind of micro services construction method based on database, the construction method is using SpringCloud as micro services Framework, using OAuth2 as safety guarantee, shown using vue as front end using Mysql or Oracle as database, Pattern is shown as front end using bootstrap4;
The construction method the realization process includes:
1) EurekaServer is created;
2) business service is registered to service centre;
3) Zull gateway is opened;
4) Ribbon load balancing is opened;
5) it is monitored according to Dashbord.
Specifically, during involved construction method is realized,
EurekaServer is created in such a way that@EnableEurekaServer is explained;
Business service is registered to service centre in such a way that@EnableEurekaClient is explained;
It is registered in such a way that@EnableEurekaClient ,@EnableZuulProxy are explained and opens Zull gateway;
It is registered simultaneously in such a way that@EnableEurekaClient ,@EnableHystrix ,@LoadBalanced are explained Open Ribbon load balancing;
It is registered by@EnableHystrixDashboard, and is monitored according to Dashbord.
In step 1), before creating EurekaServer, need:
1.1) arrange Naming conventions;
1.2) business structure is designed
1.3) field remarks are designed, wherein comment no longer uses the formal layout of No. # separation, second is that tying using json The data of structure are handled;
1.4) code automatically generated is executed, and build the framework of micro services.
In step 1.1), agreement Naming conventions are specifically included:
1.1.1) the Naming conventions of default data base:
A. table name uses the format of a_b_c, and main table names a_b_info, and detail list names a_b_c_detail
B. field name uses the format of a_b_c
C. major key uniformly uses id
D. unify to include founder create_user_id, founder create_user_name, date created create_ Date modifies people update_user_id, modifies people update_user_name, modifies date update_date, remarks Remark field;
E. all fields must have remarks;
F. increase T_ before all table names, T_ can be modified, but must be had;
G. database only supports datetime, date, timestamp three types, wherein the date uses date, when band Between use timestamp, default value can be set in timestamp;
1.1.2) arrange the Naming conventions of java:
Class name is named using hump structure, and suffix adds * Controller, * Service, * Mapper;
1.1.3) arrange the Naming conventions of jsp, js:
It is named using hump structure.
In steps 1.3), field remarks are designed, need to proceed as follows:
1.3.1) when list typing, judge whether column need typing, wherein 1 indicates it is that 0 indicates no, usually default 1;
Hiding on the page for typing is not needed;
1.3.2) when table lookup, judge whether column need to be as querying conditions, wherein 1 indicates it is that 0 indicates no, usually silent Recognize 0, then do not need as querying condition, is hidden on the page;
1.3.3) verifying when list typing usually defaults 0, according to whether needValidator, wherein 1 indicates It is that 0 indicates no, adds the proof rule of " required item ";
1.3.4) whether need to show the column in table, usually default 1, according to whether needValidator wherein 1 Expression is that 0 indicates no, adds the proof rule of " required item ".
In step 1.4), the code automatically generated is executed, and builds the framework of micro services, concrete operations include:
By step 1.1), 1.2), 1.3) the personalized business demand that the rule and user arranged are filled in, with Mysql Or based on oracle database, * Controller.java, * Mapper.java, * Mapper.xml, * are automatically generated Service.java, * ServiceImpl.java, * Dao.java, * .js, * .jsp service code are simultaneously stored in business service portion Point;
Successively carried out in incognito according to the sequence of client, gateway, business service part, monitor portion, infrastructure service part Business framework is built.
A kind of micro services construction method based on database of the invention, has the advantage that compared with prior art It is:
The present invention is adopted using framework of the SpringCloud as micro services using Mysql or Oracle as database It uses OAuth2 as safety guarantee, is shown using vue as front end, pattern is shown as front end using bootstrap4, with this Based on after, automatically generate service code by creating EurekaServer and be stored in business service, build the frame of micro services Business service is then successively registered to service centre, opens Zull gateway, unlatching Ribbon load balancing, basis by structure Dashbord such as is monitored at the unitary construction that micro services are completed in operations, improves development efficiency, reduces non-traffic ratio of defects; In addition, by being multiplexed long-tested micro services framework, moreover it is possible to reduce framework risk, improve the safety of micro services structure.
Specific embodiment
The technical issues of to make technical solution of the present invention, solving and technical effect are more clearly understood, below in conjunction with tool Body embodiment carries out clear, complete description to technical solution of the present invention, it is clear that described embodiment is only this hair Bright a part of the embodiment, instead of all the embodiments.Based on the embodiment of the present invention, those skilled in the art are not doing All embodiments obtained under the premise of creative work out, all within protection scope of the present invention.
Embodiment one:
The present embodiment proposes that a kind of micro services construction method based on database, the construction method use SpringCloud As the framework of micro services, made using OAuth2 as safety guarantee using vue using Mysql or Oracle as database For front end displaying, pattern is shown as front end using bootstrap4;
The construction method the realization process includes:
1) EurekaServer is created, is defined in such a way that@EnableEurekaServer is explained;
2) business service is registered to service centre, is registered in such a way that@EnableEurekaClient is explained;
3) Zull gateway is opened, is carried out in such a way that@EnableEurekaClient ,@EnableZuulProxy are explained It registers and opens;
4) Ribbon load balancing is opened ,@EnableEurekaClient ,@EnableHystrix ,@are passed through The mode that LoadBalanced is explained is registered and opens load balancing;
5) it is monitored according to Dashbord, is registered by@EnableHystrixDashboard and opens monitoring.
In step 1), before creating EurekaServer, need:
1.1) arrange Naming conventions;
1.2) business structure is designed
1.3) field remarks are designed, wherein comment no longer uses the formal layout of No. # separation, second is that tying using json The data of structure are handled;
1.4) code automatically generated is executed, and builds the framework of micro services.
In step 1.1), agreement Naming conventions are specifically included:
1.1.1) the Naming conventions of default data base:
A. table name uses the format of a_b_c, and main table names a_b_info, and detail list names a_b_c_detail
B. field name uses the format of a_b_c
C. major key uniformly uses id
D. unify to include founder create_user_id, founder create_user_name, date created create_ Date modifies people update_user_id, modifies people update_user_name, modifies date update_date, remarks Remark field;
E. all fields must have remarks;
F. increase T_ before all table names, T_ can be modified, but must be had;
G. database only supports datetime, date, timestamp three types, wherein the date uses date, when band Between use timestamp, default value can be set in timestamp;
1.1.2) arrange the Naming conventions of java:
Class name is named using hump structure, and suffix adds * Controller, * Service, * Mapper;
1.1.3) arrange the Naming conventions of jsp, js:
It is named using hump structure.
In steps 1.3), field remarks are designed, need to proceed as follows:
1.3.1) when list typing, judge whether column need typing, wherein 1 indicates it is that 0 indicates no, usually default 1;
Hiding on the page for typing is not needed;
1.3.2) when table lookup, judge whether column need to be as querying conditions, wherein 1 indicates it is that 0 indicates no, usually silent Recognize 0, then do not need as querying condition, is hidden on the page;
1.3.3) verifying when list typing usually defaults 0, according to whether needValidator, wherein 1 indicates It is that 0 indicates no, adds the proof rule of " required item ";
1.3.4) whether need to show the column in table, usually default 1, according to whether needValidator wherein 1 Expression is that 0 indicates no, adds the proof rule of " required item ".
In step 1.4), the code automatically generated is executed, and builds the framework of micro services, concrete operations include:
By step 1.1), 1.2), 1.3) the personalized business demand that the rule and user arranged are filled in, with Mysql Or based on oracle database, * Controller.java, * Mapper.java, * Mapper.xml, * are automatically generated Service.java, * ServiceImpl.java, * Dao.java, * .js, * .jsp service code are simultaneously stored in business service portion Point;
Successively carried out in incognito according to the sequence of client, gateway, business service part, monitor portion, infrastructure service part Business framework is built.
Based on the service code and use SpringCloud for automatically generating and being stored in business service part as base The micro services framework that plinth is built, subsequent i.e. executable step 1), 2), 3), 4), 5), to complete the unitary construction of micro services.
In summary, using a kind of micro services construction method based on database of the invention, development efficiency is improved, is dropped Low non-traffic ratio of defects;In addition, by being multiplexed long-tested micro services framework, moreover it is possible to reduce framework risk, improve in incognito The safety for structure of being engaged in.
Use above specific case elaborates the principle of the present invention and embodiment, these embodiments are It is used to help understand core of the invention technology contents, the protection scope being not intended to restrict the invention, technical side of the invention Case is not limited in above-mentioned specific embodiment.Based on above-mentioned specific embodiment of the invention, those skilled in the art Without departing from the principle of the present invention, any improvement and modification to made by the present invention should all be fallen into of the invention special Sharp protection scope.

Claims (9)

1. a kind of micro services construction method based on database, which is characterized in that the construction method uses SpringCloud conduct The framework of micro services, using Mysql or Oracle as database, using OAuth2 as safety guarantee, before being used as using vue End is shown, shows pattern as front end using bootstrap4;
The construction method the realization process includes:
1) EurekaServer is created;
2) business service is registered to service centre;
3) Zull gateway is opened;
4) Ribbon load balancing is opened;
5) it is monitored according to Dashbord.
2. a kind of micro services construction method based on database according to claim 1, which is characterized in that the building side During method is realized,
EurekaServer is created in such a way that@EnableEurekaServer is explained;
Business service is registered to service centre in such a way that@EnableEurekaClient is explained;
It is registered in such a way that@EnableEurekaClient ,@EnableZuulProxy are explained and opens Zull gateway;
It registers and opens in such a way that@EnableEurekaClient ,@EnableHystrix ,@LoadBalanced are explained Ribbon load balancing;
It is registered by@EnableHystrixDashboard, and is monitored according to Dashbord.
3. a kind of micro services construction method based on database according to claim 1 or 2, which is characterized in that in step 1) it in, before creating EurekaServer, needs:
1.1) arrange Naming conventions;
1.2) business structure is designed
1.3) field remarks are designed, wherein comment no longer uses the formal layout of No. # separation, second is that using json structuring Data handled;
1.4) code automatically generated is executed, and builds the framework of micro services.
4. a kind of micro services construction method based on database according to claim 3, which is characterized in that in step 1.1) In, agreement Naming conventions specifically include:
1.1.1) the Naming conventions of default data base:
A. table name uses the format of a_b_c, and main table names a_b_info, and detail list names a_b_c_detail
B. field name uses the format of a_b_c
C. major key uniformly uses id
D. unify to include founder create_user_id, founder create_user_name, date created create_ Date modifies people update_user_id, modifies people update_user_name, modifies date update_date, remarks Remark field;
E. all fields must have remarks;
F. increase T_ before all table names, T_ can be modified, but must be had;
G. database only supports datetime, date, timestamp three types, wherein the date uses date, with the time Default value can be set using timestamp, timestamp;
1.1.2) arrange the Naming conventions of java:
Class name is named using hump structure, and suffix adds * Controller, * Service, * Mapper;
1.1.3) arrange the Naming conventions of jsp, js:
It is named using hump structure.
5. a kind of micro services construction method based on database according to claim 3, which is characterized in that in step 1.3) In, field remarks are designed, need to proceed as follows:
When list typing, judge whether column need typing, wherein 1 indicates it is that 0 indicates no, usually defaults 1;
Hiding on the page for typing is not needed.
6. a kind of micro services construction method based on database according to claim 5, which is characterized in that in step 1.3) In, design field remarks, it is also necessary to proceed as follows:
When table lookup, judge whether column, wherein 1 indicates it is that 0 indicates no, need to usually default 0, then be not required to as querying condition It to be hidden on the page as querying condition.
7. a kind of micro services construction method based on database according to claim 6, which is characterized in that in step 1.3) In, design field remarks, it is also necessary to proceed as follows:
Verifying when list typing usually defaults 0, according to whether needValidator, wherein 1 indicates it is that 0 indicates no, Add the proof rule of " required item ".
8. a kind of micro services construction method based on database according to claim 7, which is characterized in that in step 1.3) In, design field remarks, it is also necessary to proceed as follows:
Whether need to show the column in table, usually default 1, according to whether needValidator wherein 1 indicates to be 0 table Show no, the proof rule of addition " required item ".
9. a kind of micro services construction method based on database according to claim 3, which is characterized in that in step 1.4) code automatically generated, is executed, and builds the framework of micro services, concrete operations include:
By step 1.1), 1.2), 1.3) the personalized business demand that the rule of agreement and user fill in, with Mysql or Based on oracle database, * Controller.java, * Mapper.java, * Mapper.xml, * are automatically generated Service.java, * ServiceImpl.java, * Dao.java, * .js, * .jsp service code are simultaneously stored in business service portion Point;
Successively micro services frame is carried out according to the sequence of client, gateway, business service part, monitor portion, infrastructure service part Structure is built.
CN201910717137.1A 2019-08-05 2019-08-05 Micro-service construction method based on database Active CN110427174B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910717137.1A CN110427174B (en) 2019-08-05 2019-08-05 Micro-service construction method based on database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910717137.1A CN110427174B (en) 2019-08-05 2019-08-05 Micro-service construction method based on database

Publications (2)

Publication Number Publication Date
CN110427174A true CN110427174A (en) 2019-11-08
CN110427174B CN110427174B (en) 2024-01-16

Family

ID=68414196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910717137.1A Active CN110427174B (en) 2019-08-05 2019-08-05 Micro-service construction method based on database

Country Status (1)

Country Link
CN (1) CN110427174B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488145A (en) * 2020-04-30 2020-08-04 国网河北省电力有限公司信息通信分公司 Micro-service code generation system and method based on service domain data model base
CN113157796A (en) * 2020-01-22 2021-07-23 中国科学院沈阳自动化研究所 Data acquisition display system based on micro-service
WO2021164189A1 (en) * 2020-02-17 2021-08-26 福州大学 Android application microservice automatic generation method driven by application scenario

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120078682A1 (en) * 2010-09-29 2012-03-29 The Npd Group, Inc. Consumer receipt information methodologies and systems
CN107273440A (en) * 2017-05-25 2017-10-20 北京邮电大学 Computer application, date storage method, micro services and microdata storehouse
CN108011768A (en) * 2017-12-26 2018-05-08 杭州电子科技大学 A kind of aop intercept types HBase data store micro services framework construction method
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud
CN108600282A (en) * 2017-11-30 2018-09-28 深圳市牛鼎丰科技有限公司 Micro services dissemination method, device, storage medium and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120078682A1 (en) * 2010-09-29 2012-03-29 The Npd Group, Inc. Consumer receipt information methodologies and systems
CN107273440A (en) * 2017-05-25 2017-10-20 北京邮电大学 Computer application, date storage method, micro services and microdata storehouse
CN108600282A (en) * 2017-11-30 2018-09-28 深圳市牛鼎丰科技有限公司 Micro services dissemination method, device, storage medium and computer equipment
CN108011768A (en) * 2017-12-26 2018-05-08 杭州电子科技大学 A kind of aop intercept types HBase data store micro services framework construction method
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157796A (en) * 2020-01-22 2021-07-23 中国科学院沈阳自动化研究所 Data acquisition display system based on micro-service
WO2021164189A1 (en) * 2020-02-17 2021-08-26 福州大学 Android application microservice automatic generation method driven by application scenario
CN111488145A (en) * 2020-04-30 2020-08-04 国网河北省电力有限公司信息通信分公司 Micro-service code generation system and method based on service domain data model base
CN111488145B (en) * 2020-04-30 2023-05-30 国网河北省电力有限公司信息通信分公司 Micro-service code generation system and method based on service domain data model library

Also Published As

Publication number Publication date
CN110427174B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN110427174A (en) A kind of micro services construction method based on database
US20180101506A1 (en) User Interface
US20100269089A1 (en) Method and system for generation of reusable design patterns
Baldissone et al. Formaldehyde production plant modification: Risk based decision making
US20090265682A1 (en) Method for transforming data from a model into a secondary model to optimize code generation
Walletzky et al. Conceptualization of services in The Smart City, a Layered Approach
Nicolò et al. The “Start-up a Business” Strategy in the Succession Process Planning at the Top of Family Firms.
Miravet et al. Using standards to build the DIMAG connected mobile applications framework
Rossi et al. Public-private partnerships: problem or solution? Features and trends in EU-28
Benassi et al. Paraconsistent Provability Logic and rational epistemic agents
Cirafici et al. Sguardi su Capri. Moda e rappresentazioni di un’icona dell’immaginario contemporaneo
D'Amore et al. Architecture 3.0: Digital Transition in Construction. H-BIM implementation for traditional building energy improvement
Siano et al. Ingredient Brand Strategy in manufacturing sector: enhancing the value proposition
Bazán et al. Formalizing the conceptualization of services and their relationships with software components
Cocco La deriva del progetto urbano. Perdere e riprendere la rotta= The urban project adrift. Losing and finding the route
Ciotti et al. Linguistic and textual aspects of multilingualism in South India and Sri Lanka
CN114816360A (en) Dynamic service configuration system
Siano et al. The impact of new brand co-creation perspectives on the Resource-Based Management model
Angelo et al. What makes creative partnerships work
Andrea et al. Results from the OpenAIRE Call for Innovation: Enrich local data via the OpenAIRE Graph
Casati et al. makeSense: Easy Programming of Integrated Wireless Sensor Networks
Bertram et al. Employment conditions in the international road haulage sector
Cifaldi Social security and insecurity
Ascenzi Building complex N-containing species on Titan's atmosphere: an experimental mass spectrometric approach
Anous et al. A new look at the Y tetraquarks and Omega _c baryons in the diquark model

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
CB02 Change of applicant information

Address after: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Applicant after: Inspur cloud Information Technology Co.,Ltd.

Address before: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Applicant before: Tidal Cloud Information Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant