GranularityDecisionofMicroserviceSplittinginViewof...

11
Research Article Granularity Decision of Microservice Splitting in View of Maintainability and Its Innovation Effect in Government Data Sharing Yan Li , 1 Chun-Zi Wang, 1 Ying-chao Li, 1,2 and Jia Su 3 1 School of Management, Xi’an Polytechnic University, Xi’an 710048, China 2 Emaplink Software Co., Ltd., Xi’an 710000, China 3 School of Management, Xi’an University of Architecture & Technology, Xi’an 710055, China Correspondence should be addressed to Yan Li; [email protected] Received 18 May 2020; Revised 23 June 2020; Accepted 16 July 2020; Published 4 August 2020 Guest Editor: Chi-Hua Chen Copyright © 2020 Yan Li et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. e reasonable sharing and effective integration of data is the premise of improving the comprehensive governance ability of society through data empowerment. It can be determined that the fine-grained splitting of microservice framework can promote the reasonable sharing and effective integration of data. However, how to determine the granularity of microservice splitting is a multiparameter and multiobjective decision-making problem, which is also a key basic problem to be solved urgently both in academic research and application. From the perspective of application, this paper puts forward the criteria and basic framework that can guide the microservice splitting, and for the first time, based on the perspective of maintainability, it gives the decision criteria and methods of microservice splitting granularity. After the theoretical research, this paper also takes the provincial microservice governance of food and drug regulation as an example: the example shows that the framework and methods proposed can effectively improve data sharing and system expandability. rough microservice governance, collaborative social governance featuring “one network to achieve management objectives, one network to realize comprehensive business processing, one network for comprehensive view of all information” can be achieved. It is an exemplary mode worth popularization. 1. Introduction As digitization evolves, humans are entering a finely re- solved society, also known as the granular society [1] in which everyone must go through the transformation from “a rational person” to “a granular person.” Technical innovation provides high-density and more detailed in- sight into all phenomena, and the high resolving process of digitization will also drive social system disintegration. As the result of this “resolving-disintegration” dual processes, population average value and outdated knowledge of the coarse-particle time will be phased out and the consequent “big-data mindset” will revolutionize the traditional philosophy of social governance. us, amid the granular time, how to innovate governance mode and modernize relative ability of the government is a significant issue urging for a solution. At present, the world is witnessing an upsurging trend of rapid transformation from data into information and knowledge and the improvement of data-driven government governance ability [2, 3]. As China’s reform enters the deep water zone, potential social contradictions and conflicts are looming. us, data-based speaking, decision, management, and innovation have become an effective way to enhance our comprehensive and collaborative social governance ability. On August 19, 2015, the State Council executive meeting adopted the Action Outline for Promoting Big Data De- velopment, which defined how to transform government functions and optimize service modes through data sharing and integration from the national top-layer policy design level. Implementation Plan for the Integration and Sharing of Government Information System (General Office of the State Council [2017] No. 39) requires the combination of investigation and elimination to speed up zombie Hindawi Discrete Dynamics in Nature and Society Volume 2020, Article ID 1057902, 11 pages https://doi.org/10.1155/2020/1057902

Transcript of GranularityDecisionofMicroserviceSplittinginViewof...

Page 1: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

Research ArticleGranularity Decision of Microservice Splitting in View ofMaintainability and Its Innovation Effect in GovernmentData Sharing

Yan Li 1 Chun-Zi Wang1 Ying-chao Li12 and Jia Su3

1School of Management Xirsquoan Polytechnic University Xirsquoan 710048 China2Emaplink Software Co Ltd Xirsquoan 710000 China3School of Management Xirsquoan University of Architecture amp Technology Xirsquoan 710055 China

Correspondence should be addressed to Yan Li sayidlixpueducn

Received 18 May 2020 Revised 23 June 2020 Accepted 16 July 2020 Published 4 August 2020

Guest Editor Chi-Hua Chen

Copyright copy 2020 Yan Li et al is is an open access article distributed under the Creative Commons Attribution License whichpermits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

e reasonable sharing and effective integration of data is the premise of improving the comprehensive governance ability ofsociety through data empowerment It can be determined that the fine-grained splitting of microservice framework can promotethe reasonable sharing and effective integration of data However how to determine the granularity of microservice splitting is amultiparameter and multiobjective decision-making problem which is also a key basic problem to be solved urgently both inacademic research and application From the perspective of application this paper puts forward the criteria and basic frameworkthat can guide the microservice splitting and for the first time based on the perspective of maintainability it gives the decisioncriteria and methods of microservice splitting granularity After the theoretical research this paper also takes the provincialmicroservice governance of food and drug regulation as an example the example shows that the framework and methodsproposed can effectively improve data sharing and system expandability rough microservice governance collaborative socialgovernance featuring ldquoone network to achieve management objectives one network to realize comprehensive business processingone network for comprehensive view of all informationrdquo can be achieved It is an exemplary mode worth popularization

1 Introduction

As digitization evolves humans are entering a finely re-solved society also known as the granular society [1] inwhich everyone must go through the transformation fromldquoa rational personrdquo to ldquoa granular personrdquo Technicalinnovation provides high-density and more detailed in-sight into all phenomena and the high resolving processof digitization will also drive social system disintegrationAs the result of this ldquoresolving-disintegrationrdquo dualprocesses population average value and outdatedknowledge of the coarse-particle time will be phased outand the consequent ldquobig-data mindsetrdquo will revolutionizethe traditional philosophy of social governance usamid the granular time how to innovate governance modeand modernize relative ability of the government is asignificant issue urging for a solution

At present the world is witnessing an upsurging trend ofrapid transformation from data into information andknowledge and the improvement of data-driven governmentgovernance ability [2 3] As Chinarsquos reform enters the deepwater zone potential social contradictions and conflicts arelooming us data-based speaking decision managementand innovation have become an effective way to enhance ourcomprehensive and collaborative social governance abilityOn August 19 2015 the State Council executive meetingadopted the Action Outline for Promoting Big Data De-velopment which defined how to transform governmentfunctions and optimize service modes through data sharingand integration from the national top-layer policy designlevel Implementation Plan for the Integration and Sharingof Government Information System (General Office of theState Council [2017] No 39) requires the combination ofinvestigation and elimination to speed up zombie

HindawiDiscrete Dynamics in Nature and SocietyVolume 2020 Article ID 1057902 11 pageshttpsdoiorg10115520201057902

information system removal and the integration and sharingof the internal information system of each department Onthis basis Notice on the Implementation of GovernmentInformation System Integration and Application Pilots(Department of High Technology Industry of NationalDevelopment and Reform Commission [2017] No 1714)issued by the National Development and Reform Com-mission also mentioned a couple of times that the foun-dation of information system integration and sharing is theintegration of government data and the establishment of aunified sharing platform is pointed out where thetransformation and upgrading of Chinarsquos e-governmentservice ecosystem should go Data integrated by e-govern-ment accounts for over 90 of the total amount of socialdata [4] As the granular mode increasingly intensifies datasharing and integration become the basic requirements forthe synergy and accuracy of comprehensive social gover-nance and represent a consensus reached by the academicand the industrial communities At present governmentdata sharing and integration are mainly implementedthrough enterprise service bus (ESB) [3 5 6] and data centersharing [4 7] As a key component of service-oriented ar-chitecture (SOA) ESB gathers middleware XML (ExtensibleMarkup Language) Web services and other technologies tosupport intra- or interenterprise heterogeneous systems inservice messaging or event interactions With standardopen protocols and a proven application integration modelit acts as a connection hub linking various applicationsystems for data sharing However responsiveness andmaintenance cost are where its development constraints liee exchange service configuration is complex and usershave to shoulder much workload Service updates can onlybe achieved by reconstructing the original system cleaningdata and transferring them to the terminal ese defectsshow that ESB can hardly meet exponentially growing in-teraction demands between information systems econcept of data center sharing is to build a large centralizeddata resource pool level by level and realize data sharingbetween different organs through the data resource servicecatalog e advantage is that it can form a unified datasource and ensure data consistency but this traditional datacollecting method will inevitably involve data collectioncomparison cleaning and heterogeneous data conversion ofdifferent organs and organizations which makes real-timedata hard to guarantee Considering the authority and re-sponsibility of departments information sharing faces re-sistance and obstacles in large areas Government dataintegration is greatly limited in many ways including in-formation degradation in the two-way funnel filteringprocess of the upper and the lower levels in departmentsinformation island caused by the interdepartment chimneysystem and information obstruction at the terminal end ledby the information asymmetry between the government andthe public [7 8]

Data sharing is the precondition of realizing the mutualfunction of big data and government governance ereforegovernment data sharing is a fundamental and key issue forboth academic research and practical applicationis paperbuilds an underlying platform of data sharing and service

connection based on the distributed microservice archi-tecture the overall chapter structure is as follows e firstsection is the introduction the second section summarizesthe history of software technology architecture and on thisbasis the third section clarifies the definition and advantagesof microservice In the fourth section the paper introducesthe framework and key technologies of the distributedmicroservice platform and for the first time discussesquantitative measurement indexes of microservice archi-tecture In the fifth section the availability of the architectureis verified by the example of the collaborative social gov-ernance system of Shaanxi Medical Products Administra-tion e sixth section is the summary of the whole paper

emain innovations and contributions of this paper areas follows (1) systematically summarizes the differences andadvantages between microservice architecture and otherthree mainstream architectures and clarifies the main ap-plication scenarios and functions of microservice (2) for thefirst time based on the perspective of maintainability givesthe decision-making standards and methods of microserviceresolution granularity and (3) from the perspective of ap-plication effect takes the provincial food and drug super-vision microservice governance An example is given todemonstrate the significance of the proposed criteria andmethods

2 The Characteristics and SplittingGranularity of Microservices

As a systematic sketch software architecture (SA) is thefoundation of software practices and the series of principlesand goals set by software systems ough the concept issimple it is hard to draw an accurate definition even adescriptive one so most engineers comprehend it from theintuitive perspective Based on years of experience in soft-ware industry this paper divides the evolution process of SAinto monolithic vertical service-oriented and microservicearchitectures

Monolithic architecture (Figure 1) has no unified defi-nition Essentially it organizes all basic applications into onemodule or unit [8] or in other words gathers all functionsinto a project during the development process and packsthem into a WAR for further server deployment Both time-and cost-saving it is simple in structure and suitable forsmall-scale projects Little interface interaction makes itrelatively easy to optimize and upgrade execution perfor-mance of the system However disadvantages also exist (1)all functions in one project impede the mutual expansionand maintenance work of multiple collaborators (2) gen-erally system upgrade must rely on the clustering on bothapplication and database levels which is costly and (3) massdata reading and writing technologies are still facingbottlenecks

Derived from the concept of the vertical structure innature (special vertical differentiation or stratification ofcommunities) vertical architecture targets at the limitationof monolithic application architecture As project com-plexity and the amount of users grew the acceleration drivenby cluster optimization in single applications tapered thus

2 Discrete Dynamics in Nature and Society

people began to raise efficiency by vertically dividing largeprojects and splitting them into multiple monolithic ar-chitecture projects (Figure 2) Vertical architecture can tosome extent alleviate the defects of traditional monolithicarchitecture For example vertical separation can resist theoriginal monolithic project from excessively expanding anddifferent technologies can be used on different verticalprojects making collaboration and maintenance easy tooperate by multiple people But at root it is still a contin-uation of monolithic architecture so the essential problemshave yet to be solved

With the boom of vertical architecture applications theinteraction problem between different applications becamesalient SOA gained popularity around 2000 (Figure 3) Ac-curately it is an architecture style [9 10] In this servicestructure featuring coarseness and loose coupling commu-nication between services is achieved through simple andprecisely defined interfaces involving no underlying pro-grammatic interfaces and communication models Funda-mental SOA consists of service provider consumer andregistration It abstracts repeatedly shared functions intomodules and provides services for each system in the way ofservice rough ESB multiple services in the project com-municate bymeans ofWeb service andRPCe advantages ofSOA are apparent (1) the extraction of shared modules raisesreusability and maintainability thus promoting efficiency (2)since ESB lowers the coupling degree between interfacesdifferent projects and services can adopt different technologiesand clustering and the optimization plan can be tailored due tothe characteristics of a certain service Meanwhile the vagueboundary between system and service hinders SOA develop-ment and maintenance ough with ESB the unfixed andvarious service interface agreements still impede systemmaintenance As a result services extracted are too coarse andthe coupling degree of system and service is high

As a new architecture concept put forward after 2010microservice architecture has no unified definition atpresent [11ndash13] e most representative one is proposed byMartin Fowler [12 14] who thinks MSA is a specific de-signing method transforming software applications into

independent and deployable service modules It is structuredin such a style that single applications are developed due toservice abilities into microservices independently running intheir own processes (Figure 4) Service communication isrealized on the basis of lightweight protocols (such asRESTful) and each service can be independently deployedby fully automated mechanisms is method which splitsout the service layer and extracts it into multiple small-scaleservices has obvious advantages Compared with traditionalSOA it performs split in a more refined way which en-hances resource recycling rate and efficiency e decen-tralization principle and lightweight communicationagreements adopted are more flexible than ESB whichmakes possible more accurate service optimization plansafter service simplification improves systemmaintainabilityand shortens product iteration cycle for the upgrading needof the Internet era For some scholars [15] the cost of MSAservice governance and service granularity promotion mustkeep balance and distributed development means largerchallenges for teams requiring higher technical costs

In practical service application challenges come from boththe service and the technique is section draws a detailedsummary of the features of the four architectures and analyzestheir key distinctions (Table 1) In terms of hierarchymonolithic and vertical architectures centralize functionalmodules of each hierarchy with high coupling degree SOAuncouples multiple functional modules of vertical and hori-zontal hierarchies of three or more tiers but public modulescan only be shared on horizontal hierarchies leading tounthorough uncoupling the fully self-service flexibilityachieved by simultaneous uncoupling on vertical and hori-zontal hierarchies represents the main characteristic ofmicroservice architecture however when putting large projectsinto practice development teams cannot comply with all thefeatures and they must consider the integration of irreplaceablesystems and promote the flexibility of full uncoupling withinacceptable changing rate Here the rules of systemmicroservicegovernance are summed up into two principles

Principle 1 Regarding the existing service system asservices which can participate in microservice archi-tecture namely regarding the external systems of eachmonolithic architecture as independent services clus-tered by autonomous agentsPrinciple 2 Based on the concept of microservicesusing SOA architecture which is controllable for thetechnical team to proceed uncoupling upgrade If thetechnical routes are closed then adopt verifiedupgraded SOA architecture if not use the brand newmicroservice one to explore

3 Microservice Framework andKey Technologies

Based on the principles of microservice governance thissection designs a whole set of microservice frameworks andcommon services and describes key functions in micro-service development including configuration managementservice discovery circuit breaker intelligent routing micro

Client

Balancer

Component 1 Component 2

Component 4 Component 5

Component 3

DB

Monolithic application

Figure 1 Framework of monolithic architecture

Discrete Dynamics in Nature and Society 3

Client

Balancer

Monolithic application 1 Monolithic application 2 Monolithic application 3

Component 1 Component 1Component 2

Component 4

Component 4

Component 5 Component 6 Component 6

Component 3 Component 3

DB 1 DB 2 DB 3

Figure 2 Framework of vertical architecture

Client

Balancer

ESB

Service 1 Service 2 Service 3 Service 4

Component 1 Component 2 Component 2 Component 1

Component 5Component 4

Component 3

Component 6 Component 6

DB 1 DB 2 DB 3 DB 4

Figure 3 Framework of service-oriented architecture

Client

Balancer

API gateway

Service 1 Service 2 Service 3 Service 4 Service 5 Service 6

Component 1 Component 2 Component 3 Component 4 Component 5 Component 6

DB 1 DB 2 DB 3 DB 4 DB 5 DB 6

Figure 4 Framework of microservice architecture

4 Discrete Dynamics in Nature and Society

brokers control bus distributed sessions and clusteringstate management Also it analyzes the relationship betweenthe underlying technical principle logical design andmodules so as to provide guidance and examples on how torapidly promote microservice governance and realize serviceand data connection and sharing Figure 5 shows the conciseprocessing flow diagram of microservice Key technologiesconsist of service registration and discovery remote servicecalling circuit-breaker mechanism service link trackingand annotation interfaces

31 Service Registration and Discovery e naming serviceexists as a basic service in microservice architecture withname servers as the central node Each service system definesa service name which is taken as the identifier by the systemand registered at the name server e server identifies eachservice system by its service name which provides routingrelays for mutual calls between multiple systems e de-tailed process is as follows

Step 1 When the service producer starts it registers theservice it provides at the service registration centerStep 2 When the service consumer starts it subscribesto the service it needs at the service registration centerStep 3 e registration center returns the address in-formation of the service provider to the consumerStep 4e consumer calls the service from the provider

32 Remote Service Calling Remote service calling clarifiesthe calling protocol for intersystem services which makesservices calling external systems the same as proxy localservices Remote service calling uses the Hypertext TransferProtocol (HTTP) POST protocol to establish an outgoingchannel for data service call As the HTTP protocol isstateless JWS authentication method is adopted in systemdesign to ensure secure access to internal resource servicesand prevent illegal access Each remote calling must use thetoken and the server will verify the token to assess thevalidity e basic principles are as follows

Step 1 e service caller performs remote calling re-quests according to the service nameStep 2 e service center picks up the service providerfrom the service list due to the requested service nameStep 3eHTTP connection is established between theservice caller and the finder and data is sent throughPOST After receiving the HTTP request the serviceprovider will first perform validity check and processesthe corresponding service according to the request dataif the check is passed When the processing is com-pleted the result data is returned to the service caller

33 Circuit-Breaker Mechanism e function of circuit-breaker mechanism is to avoid system failure fromspreading When a system or a function cannot provide

Table 1 Key differences between four architectures

Monolithic architecture Monolithicndashverticalarchitecture SOA architecture Microservices architecture

Time Before 1990s 1990ndash2000 2000ndash2010 After 2010sFeature Tight coupling Tight coupling Light coupling Decoupled

Advantage

(1) Simple architectureshort development cycleand low cost(2) It is relatively easy tooptimize and improveperformance because of lessinteraction betweeninterfaces

(1) Simple architectureshort development cycleand low cost(2) Vertical splitting oforiginal monomer projectsshould not be excessivelyenlarged(3) Different projects canadopt different technologies

(1) Extraction of commoncomponents improvesreusability maintainabilityand efficiency(2) Different projects orservices can adopt differenttechnologies(3) ESB further reduces thecoupling between systeminterfaces

(1) Finer granularity is moreconducive to resource reuseand efficiency improvement(2) Decentralization andlightweight communicationprotocol(3) e system has strongmaintainability and shortiteration period

Disadvantage

(1) All functions areintegrated in one projectwhich is not conducive tothe coexpansion andmaintenance of multiplecollaborators(2) Performanceoptimization depends onclustering which hasbottlenecks in high cost(3) Technology stackconstraints

(1) Simple decomposition ofmonolithic architecture(2) Not conducive to thedevelopment andmaintenance of large-scaleprojects(3) Performance expansionhas bottlenecks

(1) e boundary betweensystem and service isblurred which is notconducive to developmentand maintenance(2)e interface protocols ofservices are not fixed andthere are many kinds ofservices(3) e extracted servicegranularity is too large andthe coupling between systemand service is high

(1) ere should be areasonable balance betweenthe cost of service governanceand the refinement of servicegranularity(2) Challenges to developmentteam and high cost oftechnology

Scope ofapplication Small projects Medium-scale project Large project Large projects with frequent

and complex interactions

Discrete Dynamics in Nature and Society 5

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 2: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

information system removal and the integration and sharingof the internal information system of each department Onthis basis Notice on the Implementation of GovernmentInformation System Integration and Application Pilots(Department of High Technology Industry of NationalDevelopment and Reform Commission [2017] No 1714)issued by the National Development and Reform Com-mission also mentioned a couple of times that the foun-dation of information system integration and sharing is theintegration of government data and the establishment of aunified sharing platform is pointed out where thetransformation and upgrading of Chinarsquos e-governmentservice ecosystem should go Data integrated by e-govern-ment accounts for over 90 of the total amount of socialdata [4] As the granular mode increasingly intensifies datasharing and integration become the basic requirements forthe synergy and accuracy of comprehensive social gover-nance and represent a consensus reached by the academicand the industrial communities At present governmentdata sharing and integration are mainly implementedthrough enterprise service bus (ESB) [3 5 6] and data centersharing [4 7] As a key component of service-oriented ar-chitecture (SOA) ESB gathers middleware XML (ExtensibleMarkup Language) Web services and other technologies tosupport intra- or interenterprise heterogeneous systems inservice messaging or event interactions With standardopen protocols and a proven application integration modelit acts as a connection hub linking various applicationsystems for data sharing However responsiveness andmaintenance cost are where its development constraints liee exchange service configuration is complex and usershave to shoulder much workload Service updates can onlybe achieved by reconstructing the original system cleaningdata and transferring them to the terminal ese defectsshow that ESB can hardly meet exponentially growing in-teraction demands between information systems econcept of data center sharing is to build a large centralizeddata resource pool level by level and realize data sharingbetween different organs through the data resource servicecatalog e advantage is that it can form a unified datasource and ensure data consistency but this traditional datacollecting method will inevitably involve data collectioncomparison cleaning and heterogeneous data conversion ofdifferent organs and organizations which makes real-timedata hard to guarantee Considering the authority and re-sponsibility of departments information sharing faces re-sistance and obstacles in large areas Government dataintegration is greatly limited in many ways including in-formation degradation in the two-way funnel filteringprocess of the upper and the lower levels in departmentsinformation island caused by the interdepartment chimneysystem and information obstruction at the terminal end ledby the information asymmetry between the government andthe public [7 8]

Data sharing is the precondition of realizing the mutualfunction of big data and government governance ereforegovernment data sharing is a fundamental and key issue forboth academic research and practical applicationis paperbuilds an underlying platform of data sharing and service

connection based on the distributed microservice archi-tecture the overall chapter structure is as follows e firstsection is the introduction the second section summarizesthe history of software technology architecture and on thisbasis the third section clarifies the definition and advantagesof microservice In the fourth section the paper introducesthe framework and key technologies of the distributedmicroservice platform and for the first time discussesquantitative measurement indexes of microservice archi-tecture In the fifth section the availability of the architectureis verified by the example of the collaborative social gov-ernance system of Shaanxi Medical Products Administra-tion e sixth section is the summary of the whole paper

emain innovations and contributions of this paper areas follows (1) systematically summarizes the differences andadvantages between microservice architecture and otherthree mainstream architectures and clarifies the main ap-plication scenarios and functions of microservice (2) for thefirst time based on the perspective of maintainability givesthe decision-making standards and methods of microserviceresolution granularity and (3) from the perspective of ap-plication effect takes the provincial food and drug super-vision microservice governance An example is given todemonstrate the significance of the proposed criteria andmethods

2 The Characteristics and SplittingGranularity of Microservices

As a systematic sketch software architecture (SA) is thefoundation of software practices and the series of principlesand goals set by software systems ough the concept issimple it is hard to draw an accurate definition even adescriptive one so most engineers comprehend it from theintuitive perspective Based on years of experience in soft-ware industry this paper divides the evolution process of SAinto monolithic vertical service-oriented and microservicearchitectures

Monolithic architecture (Figure 1) has no unified defi-nition Essentially it organizes all basic applications into onemodule or unit [8] or in other words gathers all functionsinto a project during the development process and packsthem into a WAR for further server deployment Both time-and cost-saving it is simple in structure and suitable forsmall-scale projects Little interface interaction makes itrelatively easy to optimize and upgrade execution perfor-mance of the system However disadvantages also exist (1)all functions in one project impede the mutual expansionand maintenance work of multiple collaborators (2) gen-erally system upgrade must rely on the clustering on bothapplication and database levels which is costly and (3) massdata reading and writing technologies are still facingbottlenecks

Derived from the concept of the vertical structure innature (special vertical differentiation or stratification ofcommunities) vertical architecture targets at the limitationof monolithic application architecture As project com-plexity and the amount of users grew the acceleration drivenby cluster optimization in single applications tapered thus

2 Discrete Dynamics in Nature and Society

people began to raise efficiency by vertically dividing largeprojects and splitting them into multiple monolithic ar-chitecture projects (Figure 2) Vertical architecture can tosome extent alleviate the defects of traditional monolithicarchitecture For example vertical separation can resist theoriginal monolithic project from excessively expanding anddifferent technologies can be used on different verticalprojects making collaboration and maintenance easy tooperate by multiple people But at root it is still a contin-uation of monolithic architecture so the essential problemshave yet to be solved

With the boom of vertical architecture applications theinteraction problem between different applications becamesalient SOA gained popularity around 2000 (Figure 3) Ac-curately it is an architecture style [9 10] In this servicestructure featuring coarseness and loose coupling commu-nication between services is achieved through simple andprecisely defined interfaces involving no underlying pro-grammatic interfaces and communication models Funda-mental SOA consists of service provider consumer andregistration It abstracts repeatedly shared functions intomodules and provides services for each system in the way ofservice rough ESB multiple services in the project com-municate bymeans ofWeb service andRPCe advantages ofSOA are apparent (1) the extraction of shared modules raisesreusability and maintainability thus promoting efficiency (2)since ESB lowers the coupling degree between interfacesdifferent projects and services can adopt different technologiesand clustering and the optimization plan can be tailored due tothe characteristics of a certain service Meanwhile the vagueboundary between system and service hinders SOA develop-ment and maintenance ough with ESB the unfixed andvarious service interface agreements still impede systemmaintenance As a result services extracted are too coarse andthe coupling degree of system and service is high

As a new architecture concept put forward after 2010microservice architecture has no unified definition atpresent [11ndash13] e most representative one is proposed byMartin Fowler [12 14] who thinks MSA is a specific de-signing method transforming software applications into

independent and deployable service modules It is structuredin such a style that single applications are developed due toservice abilities into microservices independently running intheir own processes (Figure 4) Service communication isrealized on the basis of lightweight protocols (such asRESTful) and each service can be independently deployedby fully automated mechanisms is method which splitsout the service layer and extracts it into multiple small-scaleservices has obvious advantages Compared with traditionalSOA it performs split in a more refined way which en-hances resource recycling rate and efficiency e decen-tralization principle and lightweight communicationagreements adopted are more flexible than ESB whichmakes possible more accurate service optimization plansafter service simplification improves systemmaintainabilityand shortens product iteration cycle for the upgrading needof the Internet era For some scholars [15] the cost of MSAservice governance and service granularity promotion mustkeep balance and distributed development means largerchallenges for teams requiring higher technical costs

In practical service application challenges come from boththe service and the technique is section draws a detailedsummary of the features of the four architectures and analyzestheir key distinctions (Table 1) In terms of hierarchymonolithic and vertical architectures centralize functionalmodules of each hierarchy with high coupling degree SOAuncouples multiple functional modules of vertical and hori-zontal hierarchies of three or more tiers but public modulescan only be shared on horizontal hierarchies leading tounthorough uncoupling the fully self-service flexibilityachieved by simultaneous uncoupling on vertical and hori-zontal hierarchies represents the main characteristic ofmicroservice architecture however when putting large projectsinto practice development teams cannot comply with all thefeatures and they must consider the integration of irreplaceablesystems and promote the flexibility of full uncoupling withinacceptable changing rate Here the rules of systemmicroservicegovernance are summed up into two principles

Principle 1 Regarding the existing service system asservices which can participate in microservice archi-tecture namely regarding the external systems of eachmonolithic architecture as independent services clus-tered by autonomous agentsPrinciple 2 Based on the concept of microservicesusing SOA architecture which is controllable for thetechnical team to proceed uncoupling upgrade If thetechnical routes are closed then adopt verifiedupgraded SOA architecture if not use the brand newmicroservice one to explore

3 Microservice Framework andKey Technologies

Based on the principles of microservice governance thissection designs a whole set of microservice frameworks andcommon services and describes key functions in micro-service development including configuration managementservice discovery circuit breaker intelligent routing micro

Client

Balancer

Component 1 Component 2

Component 4 Component 5

Component 3

DB

Monolithic application

Figure 1 Framework of monolithic architecture

Discrete Dynamics in Nature and Society 3

Client

Balancer

Monolithic application 1 Monolithic application 2 Monolithic application 3

Component 1 Component 1Component 2

Component 4

Component 4

Component 5 Component 6 Component 6

Component 3 Component 3

DB 1 DB 2 DB 3

Figure 2 Framework of vertical architecture

Client

Balancer

ESB

Service 1 Service 2 Service 3 Service 4

Component 1 Component 2 Component 2 Component 1

Component 5Component 4

Component 3

Component 6 Component 6

DB 1 DB 2 DB 3 DB 4

Figure 3 Framework of service-oriented architecture

Client

Balancer

API gateway

Service 1 Service 2 Service 3 Service 4 Service 5 Service 6

Component 1 Component 2 Component 3 Component 4 Component 5 Component 6

DB 1 DB 2 DB 3 DB 4 DB 5 DB 6

Figure 4 Framework of microservice architecture

4 Discrete Dynamics in Nature and Society

brokers control bus distributed sessions and clusteringstate management Also it analyzes the relationship betweenthe underlying technical principle logical design andmodules so as to provide guidance and examples on how torapidly promote microservice governance and realize serviceand data connection and sharing Figure 5 shows the conciseprocessing flow diagram of microservice Key technologiesconsist of service registration and discovery remote servicecalling circuit-breaker mechanism service link trackingand annotation interfaces

31 Service Registration and Discovery e naming serviceexists as a basic service in microservice architecture withname servers as the central node Each service system definesa service name which is taken as the identifier by the systemand registered at the name server e server identifies eachservice system by its service name which provides routingrelays for mutual calls between multiple systems e de-tailed process is as follows

Step 1 When the service producer starts it registers theservice it provides at the service registration centerStep 2 When the service consumer starts it subscribesto the service it needs at the service registration centerStep 3 e registration center returns the address in-formation of the service provider to the consumerStep 4e consumer calls the service from the provider

32 Remote Service Calling Remote service calling clarifiesthe calling protocol for intersystem services which makesservices calling external systems the same as proxy localservices Remote service calling uses the Hypertext TransferProtocol (HTTP) POST protocol to establish an outgoingchannel for data service call As the HTTP protocol isstateless JWS authentication method is adopted in systemdesign to ensure secure access to internal resource servicesand prevent illegal access Each remote calling must use thetoken and the server will verify the token to assess thevalidity e basic principles are as follows

Step 1 e service caller performs remote calling re-quests according to the service nameStep 2 e service center picks up the service providerfrom the service list due to the requested service nameStep 3eHTTP connection is established between theservice caller and the finder and data is sent throughPOST After receiving the HTTP request the serviceprovider will first perform validity check and processesthe corresponding service according to the request dataif the check is passed When the processing is com-pleted the result data is returned to the service caller

33 Circuit-Breaker Mechanism e function of circuit-breaker mechanism is to avoid system failure fromspreading When a system or a function cannot provide

Table 1 Key differences between four architectures

Monolithic architecture Monolithicndashverticalarchitecture SOA architecture Microservices architecture

Time Before 1990s 1990ndash2000 2000ndash2010 After 2010sFeature Tight coupling Tight coupling Light coupling Decoupled

Advantage

(1) Simple architectureshort development cycleand low cost(2) It is relatively easy tooptimize and improveperformance because of lessinteraction betweeninterfaces

(1) Simple architectureshort development cycleand low cost(2) Vertical splitting oforiginal monomer projectsshould not be excessivelyenlarged(3) Different projects canadopt different technologies

(1) Extraction of commoncomponents improvesreusability maintainabilityand efficiency(2) Different projects orservices can adopt differenttechnologies(3) ESB further reduces thecoupling between systeminterfaces

(1) Finer granularity is moreconducive to resource reuseand efficiency improvement(2) Decentralization andlightweight communicationprotocol(3) e system has strongmaintainability and shortiteration period

Disadvantage

(1) All functions areintegrated in one projectwhich is not conducive tothe coexpansion andmaintenance of multiplecollaborators(2) Performanceoptimization depends onclustering which hasbottlenecks in high cost(3) Technology stackconstraints

(1) Simple decomposition ofmonolithic architecture(2) Not conducive to thedevelopment andmaintenance of large-scaleprojects(3) Performance expansionhas bottlenecks

(1) e boundary betweensystem and service isblurred which is notconducive to developmentand maintenance(2)e interface protocols ofservices are not fixed andthere are many kinds ofservices(3) e extracted servicegranularity is too large andthe coupling between systemand service is high

(1) ere should be areasonable balance betweenthe cost of service governanceand the refinement of servicegranularity(2) Challenges to developmentteam and high cost oftechnology

Scope ofapplication Small projects Medium-scale project Large project Large projects with frequent

and complex interactions

Discrete Dynamics in Nature and Society 5

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 3: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

people began to raise efficiency by vertically dividing largeprojects and splitting them into multiple monolithic ar-chitecture projects (Figure 2) Vertical architecture can tosome extent alleviate the defects of traditional monolithicarchitecture For example vertical separation can resist theoriginal monolithic project from excessively expanding anddifferent technologies can be used on different verticalprojects making collaboration and maintenance easy tooperate by multiple people But at root it is still a contin-uation of monolithic architecture so the essential problemshave yet to be solved

With the boom of vertical architecture applications theinteraction problem between different applications becamesalient SOA gained popularity around 2000 (Figure 3) Ac-curately it is an architecture style [9 10] In this servicestructure featuring coarseness and loose coupling commu-nication between services is achieved through simple andprecisely defined interfaces involving no underlying pro-grammatic interfaces and communication models Funda-mental SOA consists of service provider consumer andregistration It abstracts repeatedly shared functions intomodules and provides services for each system in the way ofservice rough ESB multiple services in the project com-municate bymeans ofWeb service andRPCe advantages ofSOA are apparent (1) the extraction of shared modules raisesreusability and maintainability thus promoting efficiency (2)since ESB lowers the coupling degree between interfacesdifferent projects and services can adopt different technologiesand clustering and the optimization plan can be tailored due tothe characteristics of a certain service Meanwhile the vagueboundary between system and service hinders SOA develop-ment and maintenance ough with ESB the unfixed andvarious service interface agreements still impede systemmaintenance As a result services extracted are too coarse andthe coupling degree of system and service is high

As a new architecture concept put forward after 2010microservice architecture has no unified definition atpresent [11ndash13] e most representative one is proposed byMartin Fowler [12 14] who thinks MSA is a specific de-signing method transforming software applications into

independent and deployable service modules It is structuredin such a style that single applications are developed due toservice abilities into microservices independently running intheir own processes (Figure 4) Service communication isrealized on the basis of lightweight protocols (such asRESTful) and each service can be independently deployedby fully automated mechanisms is method which splitsout the service layer and extracts it into multiple small-scaleservices has obvious advantages Compared with traditionalSOA it performs split in a more refined way which en-hances resource recycling rate and efficiency e decen-tralization principle and lightweight communicationagreements adopted are more flexible than ESB whichmakes possible more accurate service optimization plansafter service simplification improves systemmaintainabilityand shortens product iteration cycle for the upgrading needof the Internet era For some scholars [15] the cost of MSAservice governance and service granularity promotion mustkeep balance and distributed development means largerchallenges for teams requiring higher technical costs

In practical service application challenges come from boththe service and the technique is section draws a detailedsummary of the features of the four architectures and analyzestheir key distinctions (Table 1) In terms of hierarchymonolithic and vertical architectures centralize functionalmodules of each hierarchy with high coupling degree SOAuncouples multiple functional modules of vertical and hori-zontal hierarchies of three or more tiers but public modulescan only be shared on horizontal hierarchies leading tounthorough uncoupling the fully self-service flexibilityachieved by simultaneous uncoupling on vertical and hori-zontal hierarchies represents the main characteristic ofmicroservice architecture however when putting large projectsinto practice development teams cannot comply with all thefeatures and they must consider the integration of irreplaceablesystems and promote the flexibility of full uncoupling withinacceptable changing rate Here the rules of systemmicroservicegovernance are summed up into two principles

Principle 1 Regarding the existing service system asservices which can participate in microservice archi-tecture namely regarding the external systems of eachmonolithic architecture as independent services clus-tered by autonomous agentsPrinciple 2 Based on the concept of microservicesusing SOA architecture which is controllable for thetechnical team to proceed uncoupling upgrade If thetechnical routes are closed then adopt verifiedupgraded SOA architecture if not use the brand newmicroservice one to explore

3 Microservice Framework andKey Technologies

Based on the principles of microservice governance thissection designs a whole set of microservice frameworks andcommon services and describes key functions in micro-service development including configuration managementservice discovery circuit breaker intelligent routing micro

Client

Balancer

Component 1 Component 2

Component 4 Component 5

Component 3

DB

Monolithic application

Figure 1 Framework of monolithic architecture

Discrete Dynamics in Nature and Society 3

Client

Balancer

Monolithic application 1 Monolithic application 2 Monolithic application 3

Component 1 Component 1Component 2

Component 4

Component 4

Component 5 Component 6 Component 6

Component 3 Component 3

DB 1 DB 2 DB 3

Figure 2 Framework of vertical architecture

Client

Balancer

ESB

Service 1 Service 2 Service 3 Service 4

Component 1 Component 2 Component 2 Component 1

Component 5Component 4

Component 3

Component 6 Component 6

DB 1 DB 2 DB 3 DB 4

Figure 3 Framework of service-oriented architecture

Client

Balancer

API gateway

Service 1 Service 2 Service 3 Service 4 Service 5 Service 6

Component 1 Component 2 Component 3 Component 4 Component 5 Component 6

DB 1 DB 2 DB 3 DB 4 DB 5 DB 6

Figure 4 Framework of microservice architecture

4 Discrete Dynamics in Nature and Society

brokers control bus distributed sessions and clusteringstate management Also it analyzes the relationship betweenthe underlying technical principle logical design andmodules so as to provide guidance and examples on how torapidly promote microservice governance and realize serviceand data connection and sharing Figure 5 shows the conciseprocessing flow diagram of microservice Key technologiesconsist of service registration and discovery remote servicecalling circuit-breaker mechanism service link trackingand annotation interfaces

31 Service Registration and Discovery e naming serviceexists as a basic service in microservice architecture withname servers as the central node Each service system definesa service name which is taken as the identifier by the systemand registered at the name server e server identifies eachservice system by its service name which provides routingrelays for mutual calls between multiple systems e de-tailed process is as follows

Step 1 When the service producer starts it registers theservice it provides at the service registration centerStep 2 When the service consumer starts it subscribesto the service it needs at the service registration centerStep 3 e registration center returns the address in-formation of the service provider to the consumerStep 4e consumer calls the service from the provider

32 Remote Service Calling Remote service calling clarifiesthe calling protocol for intersystem services which makesservices calling external systems the same as proxy localservices Remote service calling uses the Hypertext TransferProtocol (HTTP) POST protocol to establish an outgoingchannel for data service call As the HTTP protocol isstateless JWS authentication method is adopted in systemdesign to ensure secure access to internal resource servicesand prevent illegal access Each remote calling must use thetoken and the server will verify the token to assess thevalidity e basic principles are as follows

Step 1 e service caller performs remote calling re-quests according to the service nameStep 2 e service center picks up the service providerfrom the service list due to the requested service nameStep 3eHTTP connection is established between theservice caller and the finder and data is sent throughPOST After receiving the HTTP request the serviceprovider will first perform validity check and processesthe corresponding service according to the request dataif the check is passed When the processing is com-pleted the result data is returned to the service caller

33 Circuit-Breaker Mechanism e function of circuit-breaker mechanism is to avoid system failure fromspreading When a system or a function cannot provide

Table 1 Key differences between four architectures

Monolithic architecture Monolithicndashverticalarchitecture SOA architecture Microservices architecture

Time Before 1990s 1990ndash2000 2000ndash2010 After 2010sFeature Tight coupling Tight coupling Light coupling Decoupled

Advantage

(1) Simple architectureshort development cycleand low cost(2) It is relatively easy tooptimize and improveperformance because of lessinteraction betweeninterfaces

(1) Simple architectureshort development cycleand low cost(2) Vertical splitting oforiginal monomer projectsshould not be excessivelyenlarged(3) Different projects canadopt different technologies

(1) Extraction of commoncomponents improvesreusability maintainabilityand efficiency(2) Different projects orservices can adopt differenttechnologies(3) ESB further reduces thecoupling between systeminterfaces

(1) Finer granularity is moreconducive to resource reuseand efficiency improvement(2) Decentralization andlightweight communicationprotocol(3) e system has strongmaintainability and shortiteration period

Disadvantage

(1) All functions areintegrated in one projectwhich is not conducive tothe coexpansion andmaintenance of multiplecollaborators(2) Performanceoptimization depends onclustering which hasbottlenecks in high cost(3) Technology stackconstraints

(1) Simple decomposition ofmonolithic architecture(2) Not conducive to thedevelopment andmaintenance of large-scaleprojects(3) Performance expansionhas bottlenecks

(1) e boundary betweensystem and service isblurred which is notconducive to developmentand maintenance(2)e interface protocols ofservices are not fixed andthere are many kinds ofservices(3) e extracted servicegranularity is too large andthe coupling between systemand service is high

(1) ere should be areasonable balance betweenthe cost of service governanceand the refinement of servicegranularity(2) Challenges to developmentteam and high cost oftechnology

Scope ofapplication Small projects Medium-scale project Large project Large projects with frequent

and complex interactions

Discrete Dynamics in Nature and Society 5

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 4: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

Client

Balancer

Monolithic application 1 Monolithic application 2 Monolithic application 3

Component 1 Component 1Component 2

Component 4

Component 4

Component 5 Component 6 Component 6

Component 3 Component 3

DB 1 DB 2 DB 3

Figure 2 Framework of vertical architecture

Client

Balancer

ESB

Service 1 Service 2 Service 3 Service 4

Component 1 Component 2 Component 2 Component 1

Component 5Component 4

Component 3

Component 6 Component 6

DB 1 DB 2 DB 3 DB 4

Figure 3 Framework of service-oriented architecture

Client

Balancer

API gateway

Service 1 Service 2 Service 3 Service 4 Service 5 Service 6

Component 1 Component 2 Component 3 Component 4 Component 5 Component 6

DB 1 DB 2 DB 3 DB 4 DB 5 DB 6

Figure 4 Framework of microservice architecture

4 Discrete Dynamics in Nature and Society

brokers control bus distributed sessions and clusteringstate management Also it analyzes the relationship betweenthe underlying technical principle logical design andmodules so as to provide guidance and examples on how torapidly promote microservice governance and realize serviceand data connection and sharing Figure 5 shows the conciseprocessing flow diagram of microservice Key technologiesconsist of service registration and discovery remote servicecalling circuit-breaker mechanism service link trackingand annotation interfaces

31 Service Registration and Discovery e naming serviceexists as a basic service in microservice architecture withname servers as the central node Each service system definesa service name which is taken as the identifier by the systemand registered at the name server e server identifies eachservice system by its service name which provides routingrelays for mutual calls between multiple systems e de-tailed process is as follows

Step 1 When the service producer starts it registers theservice it provides at the service registration centerStep 2 When the service consumer starts it subscribesto the service it needs at the service registration centerStep 3 e registration center returns the address in-formation of the service provider to the consumerStep 4e consumer calls the service from the provider

32 Remote Service Calling Remote service calling clarifiesthe calling protocol for intersystem services which makesservices calling external systems the same as proxy localservices Remote service calling uses the Hypertext TransferProtocol (HTTP) POST protocol to establish an outgoingchannel for data service call As the HTTP protocol isstateless JWS authentication method is adopted in systemdesign to ensure secure access to internal resource servicesand prevent illegal access Each remote calling must use thetoken and the server will verify the token to assess thevalidity e basic principles are as follows

Step 1 e service caller performs remote calling re-quests according to the service nameStep 2 e service center picks up the service providerfrom the service list due to the requested service nameStep 3eHTTP connection is established between theservice caller and the finder and data is sent throughPOST After receiving the HTTP request the serviceprovider will first perform validity check and processesthe corresponding service according to the request dataif the check is passed When the processing is com-pleted the result data is returned to the service caller

33 Circuit-Breaker Mechanism e function of circuit-breaker mechanism is to avoid system failure fromspreading When a system or a function cannot provide

Table 1 Key differences between four architectures

Monolithic architecture Monolithicndashverticalarchitecture SOA architecture Microservices architecture

Time Before 1990s 1990ndash2000 2000ndash2010 After 2010sFeature Tight coupling Tight coupling Light coupling Decoupled

Advantage

(1) Simple architectureshort development cycleand low cost(2) It is relatively easy tooptimize and improveperformance because of lessinteraction betweeninterfaces

(1) Simple architectureshort development cycleand low cost(2) Vertical splitting oforiginal monomer projectsshould not be excessivelyenlarged(3) Different projects canadopt different technologies

(1) Extraction of commoncomponents improvesreusability maintainabilityand efficiency(2) Different projects orservices can adopt differenttechnologies(3) ESB further reduces thecoupling between systeminterfaces

(1) Finer granularity is moreconducive to resource reuseand efficiency improvement(2) Decentralization andlightweight communicationprotocol(3) e system has strongmaintainability and shortiteration period

Disadvantage

(1) All functions areintegrated in one projectwhich is not conducive tothe coexpansion andmaintenance of multiplecollaborators(2) Performanceoptimization depends onclustering which hasbottlenecks in high cost(3) Technology stackconstraints

(1) Simple decomposition ofmonolithic architecture(2) Not conducive to thedevelopment andmaintenance of large-scaleprojects(3) Performance expansionhas bottlenecks

(1) e boundary betweensystem and service isblurred which is notconducive to developmentand maintenance(2)e interface protocols ofservices are not fixed andthere are many kinds ofservices(3) e extracted servicegranularity is too large andthe coupling between systemand service is high

(1) ere should be areasonable balance betweenthe cost of service governanceand the refinement of servicegranularity(2) Challenges to developmentteam and high cost oftechnology

Scope ofapplication Small projects Medium-scale project Large project Large projects with frequent

and complex interactions

Discrete Dynamics in Nature and Society 5

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 5: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

brokers control bus distributed sessions and clusteringstate management Also it analyzes the relationship betweenthe underlying technical principle logical design andmodules so as to provide guidance and examples on how torapidly promote microservice governance and realize serviceand data connection and sharing Figure 5 shows the conciseprocessing flow diagram of microservice Key technologiesconsist of service registration and discovery remote servicecalling circuit-breaker mechanism service link trackingand annotation interfaces

31 Service Registration and Discovery e naming serviceexists as a basic service in microservice architecture withname servers as the central node Each service system definesa service name which is taken as the identifier by the systemand registered at the name server e server identifies eachservice system by its service name which provides routingrelays for mutual calls between multiple systems e de-tailed process is as follows

Step 1 When the service producer starts it registers theservice it provides at the service registration centerStep 2 When the service consumer starts it subscribesto the service it needs at the service registration centerStep 3 e registration center returns the address in-formation of the service provider to the consumerStep 4e consumer calls the service from the provider

32 Remote Service Calling Remote service calling clarifiesthe calling protocol for intersystem services which makesservices calling external systems the same as proxy localservices Remote service calling uses the Hypertext TransferProtocol (HTTP) POST protocol to establish an outgoingchannel for data service call As the HTTP protocol isstateless JWS authentication method is adopted in systemdesign to ensure secure access to internal resource servicesand prevent illegal access Each remote calling must use thetoken and the server will verify the token to assess thevalidity e basic principles are as follows

Step 1 e service caller performs remote calling re-quests according to the service nameStep 2 e service center picks up the service providerfrom the service list due to the requested service nameStep 3eHTTP connection is established between theservice caller and the finder and data is sent throughPOST After receiving the HTTP request the serviceprovider will first perform validity check and processesthe corresponding service according to the request dataif the check is passed When the processing is com-pleted the result data is returned to the service caller

33 Circuit-Breaker Mechanism e function of circuit-breaker mechanism is to avoid system failure fromspreading When a system or a function cannot provide

Table 1 Key differences between four architectures

Monolithic architecture Monolithicndashverticalarchitecture SOA architecture Microservices architecture

Time Before 1990s 1990ndash2000 2000ndash2010 After 2010sFeature Tight coupling Tight coupling Light coupling Decoupled

Advantage

(1) Simple architectureshort development cycleand low cost(2) It is relatively easy tooptimize and improveperformance because of lessinteraction betweeninterfaces

(1) Simple architectureshort development cycleand low cost(2) Vertical splitting oforiginal monomer projectsshould not be excessivelyenlarged(3) Different projects canadopt different technologies

(1) Extraction of commoncomponents improvesreusability maintainabilityand efficiency(2) Different projects orservices can adopt differenttechnologies(3) ESB further reduces thecoupling between systeminterfaces

(1) Finer granularity is moreconducive to resource reuseand efficiency improvement(2) Decentralization andlightweight communicationprotocol(3) e system has strongmaintainability and shortiteration period

Disadvantage

(1) All functions areintegrated in one projectwhich is not conducive tothe coexpansion andmaintenance of multiplecollaborators(2) Performanceoptimization depends onclustering which hasbottlenecks in high cost(3) Technology stackconstraints

(1) Simple decomposition ofmonolithic architecture(2) Not conducive to thedevelopment andmaintenance of large-scaleprojects(3) Performance expansionhas bottlenecks

(1) e boundary betweensystem and service isblurred which is notconducive to developmentand maintenance(2)e interface protocols ofservices are not fixed andthere are many kinds ofservices(3) e extracted servicegranularity is too large andthe coupling between systemand service is high

(1) ere should be areasonable balance betweenthe cost of service governanceand the refinement of servicegranularity(2) Challenges to developmentteam and high cost oftechnology

Scope ofapplication Small projects Medium-scale project Large project Large projects with frequent

and complex interactions

Discrete Dynamics in Nature and Society 5

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 6: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

services due to failure the system should be automaticallytaken offline from the entire distributed platform In thisway large-area system crash caused by all requests waitingfor a response at that function point can be avoided ecircuit-breaker mechanism is as follows

Step 1 When a certain threshold is met (the defaultvalue is over 20 requests in 10 seconds)Step 2 When the failure rate reaches a certain level (thedefault value is over 50 request failure in 10 seconds)Step 3 When the above threshold is reached the circuitbreaker will turn onStep 4 When it turns on all requests will not beforwardedStep 5 After a while (taking 5 seconds as the defaultvalue) the breaker is half-open at this moment and willlet one of the requests be forwarded If this succeedsthe circuit breaker will turn off if not it will maintainopened and Step 4 will be repeated

34 Service Link Tracking Service link tracking providesfull-link tracking and monitoring during the completion ofthe entire function which can clearly show the relationshipbetween each service calling and accurately pinpoint whenproblems occur When the system is running the servicelink tracking module receives the real-time monitoringdata of each microservice system It mainly includes 4components

Component 1 collector which receives or collects datatransmitted by each applicationComponent 2 storage which stores data received orcollected in internal storage by default It currentlysupports Memory MySQL Cassandra etcComponent 3 API (query) which is responsible forquerying data stored in storage and providingsimple data obtained by JSON API mainly for webUI

Component 4 Web which provides simple Webinterfaces

35 Annotation Interfaces

Service registration interface EnableEurekaClient asan annotation this interface will go through scanningwhen the system starts If the annotation storage isscanned the configuration information of the namingserver is automatically obtained from the configurationfile to register the service systemRemote service call interface FeignClient this in-terface appears as an annotation and the annotation isadded when a remote service call is required After theremote service name is input the interface obtains theaddress of the remote service from the naming serverand establishes the http connectionCircuit-breaker interface EnableHystrix this inter-face starts the circuit breaking service and the corre-sponding mechanism will start automaticallyCircuit-breaker detection interface Enable-HystrixDashboard this interface launches the circuitbreaking monitoring UI page and visualizes all relevantdata on the interfaceService link tracking interface EnableZipkinServerthe service link interface starts the health monitoringservice collects trace information from the http pro-tocol from collector e client terminal callsapiv1spans orapiv2spans to report the trace information

4 Microservice Splitting Granularity Decisionand Calculation Formula

e core role of microservice architecture is to cope with thegrowing service capability within the system and the in-creasingly complex interaction demands between systemsAfter microservice governance is performed in accordancewith the principles and frameworks in the first two sections

Load balancing Service list

PC

Pad

Mobile Serv

ice g

atew

ay

Health monitoringService registration

Service A

Service B

Service C

Remote servicedata transmission

Fault toleranceproduction

Clustermonitoring

Figure 5 Concise request processing diagram of microservice architecture

6 Discrete Dynamics in Nature and Society

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 7: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

of this paper papers evaluating the effectiveness are quiterare Obviously according to the fine-grained servicedecoupling method in this paper service updates will bemore frequent and the iteration speed will be raised Toensure that software plays a greater role in overall valuecreation the maintainability measurement of microservicesystem is the most important index

Definition 1 (maintainability) Referring to the descriptionof Rowe et al [16] maintainability of microservice systemcan be defined as how the system can maintain effective andefficient when going through correction refinement ex-pansion or optimization

Based on Definition 1 the operation of maintainabilitycan be separated into two parts One is performing cor-rection and refinement when demands are stable the other isperforming expansion and optimization when demandschangeough lots of papers [17] have provided definitionson the maintainability of object-oriented system there hasbeen no unified conclusion when it comes to microservicesystem us on the basis of a large amount of literatureresearch [18ndash20] and practical experience this paper dis-cusses from three dimensions related to maintainabilitynamely size coupling degree and cohesion

For convenience we suppose microservice system Y iscomposed by n services namely Y S1 S2 Sn |Y| nService Si has m interaction interfaces namely Si SI1 SI2 SIm |Si|m

Definition 2 (size) e size of a microservice system is thesum size of all its subservices Obviously under the samecondition the larger the microservice system is the lower itsmaintainability is e traditional definition of size for aservice or operation is related to Lines of Code (LOC) [17]However in this paper the size of the service is representedby the weighted value of the operation amount contained inthe exposed interface of a service S namelySws 1113936SIisinS1113936OisinSIwlmk in which Wl(l 1 2 k) is theweighted value of operations within a certain interface (theweighted value can be set according to the amount of pa-rameters and the coarseness of the interface) and the size ofmicroservice system Y is Yws 1113936SisinYSws|Y|

Definition 3 (coupling degree) Coupling degree reflectshowmuch one service depends on others e lower it is thehigher the maintainability of microservice system is Ifservice Si relies on service Sj and vice versa then this is calledinterdependence which is what we have to avoid (andcombine the two services into one) in practice According to[19] SIOS is the importance of a service showing the amountof consumers depending on service S (the amount of clientsof interface SIi of the called service S) SDOS the dependenceof a service shows the amount of services depended on byservice S (the amount of services of which more than oneinterface is called by service S) e criticality of a serviceSCOS SIOS lowast SDOS ough lower coupling degree meanshigher maintainability in the transformation of micro-service system services low coupling degree will constitute abottleneck at is because service S will always be called or

calls other services and the coupling degree can to a largeextent help system designers find unreasonable calling

Definition 4 (cohesion) Cohesion refers to the contributionof the service operation to a certain task or functionere isa positive correlation between it and system maintainabilitye connotation of cohesion is quite complex semanticallyso it is hard to measure automatically According to [19] theinterface data cohesion (IDC) of service S is defined as thesimilarity of the parameter type of Srsquos internal interface SImnamely SIDC Ptypem in which Ptype is the data type ofinterface parameter When SIDC 1 the system cohesion ishigh Interface usage cohesion (IUC) represents the ratio ofthe internal interface amount of service S called by thecustomer and the total amount of interface data of service Snamely SIUC |SIinvok|m Similarly when SIUC 1 thesystem cohesion is high STIC the total interface cohesion(TIC) of service S equals (SIDC + SIUC)2

5 Practical Microservice Governance

Shaanxi Medical Products Administration (hereinafterreferred to as the Administration) has been usingmonolithic architecture and upgraded vertical architec-ture for information construction and connecting withsystems of other provincial departments through Webservice By the end of 2016 it has formed a comprehensiveservice platform covering all aspects of food and drugregulatory system and generalized it to the whole prov-ince However with the growing functions of the systemthe accumulating service data and the provincial-wideuser group the performance of the system has been undergreat pressure and gradually could not satisfy actual ap-plication needs any more is was manifested in (1) slowresponse which makes it failed to return data within areasonable time and (2) insufficient concurrency supportwhich means when services are centralized in a certainperiod abnormal conditions will happen such as servicedenial Besides as the system became more complex thecost and risk of new function development testing andlaunch greatly increased According to the overall re-quirements of the ldquoInternet + government servicesrdquo andthe 13th Five-Year Plan on Food and Drug Safety ofShaanxi Province and the actual problems existing in thesystem experts of the Administration discussed and de-cided to rearchitect the original system with the newarchitecture of distributed microservice governance Inthis way the service system can achieve infinite horizontalscaling and gain support in adapting to upgraded de-mands e platform also provides the unified data in-teraction service that truly integrates small systems into alarge one

51 Goal of Microservice Governance According to therequirements of China Food and Drug Administration andthe informatization of provincial food and drug adminis-trations the service framework of the food and drugregulatory system is shown in Figure 6 e system is

Discrete Dynamics in Nature and Society 7

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 8: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

mainly composed of three components the comprehensiveservice platform the enterprise service platform and thecollaborative social governance platform Among them thefirst platform is accessed through the unified identity au-thentication system and serves as the main working plat-form for supervisors at all levels After the enterprise serviceplatform is registered and logged in by enterprise users itcan conduct service declaration process progress inquiryand receive and give feedback on regulatory informatione third platform requires no registration and login andone can check or query through the Administrationrsquoswebsite or WeChat It integrates with the newly revisedwebsite of the Administration making data query andutilization more convenient

Based on the microservice concise processing frame-work of Figure 5 in Section 3 microservice upgrade andtransformation are performed on the original Shaanxiprovincial regulatory information system of small-scalefood workshops catering units and stall keepers e keytasks and goals include database table managementservice splitting of monolithic architecture workflowcustomization and establishment of microservice sup-porting platforms

(1) Database table management is to reasonably splitsome basic information tables that affect perfor-mance making each table as responsive as possi-ble In terms of the repetitive unreasonable fieldsleft over from the past uniform standards aredefined is part mainly contains splitting theenterprise principal information basic table(subtables and the main table are associatedthrough Universally Unique Identifier (UUID) byits uniquely identified subject) reencoding orga-nizational structure (managing the organizationalhierarchy by the custom encoding format andlisting administrative region codes as a commonattribute in order to flexibly adjust the organiza-tion level) splitting the service library (isolate theservice library table and sync and share commonbasic data Data that belongs to a specific module isregularized cut from the intersect with otherservice system data) and replacing triggers withactive service calling (use active remote servicecalling to replace triggers in data upgrade and syncas the large use of the latter may cause databasedeadlock)

(2) According to the actual service classification of theAdministration services of the original monolithicsystem are split into multiple subsystems that canfunction and be deployed independently includingmanagement of basic user authority regulatoryfiles administrative licensing daily inspectioninspection and handling random inspection publicnotice and external network report e relation-ship of different service systems is teased out Eachservice system provides the services they need torelease externally so that other systems can callthose services remotely To facilitate management

service systems are not allowed to implement thefunctions of others A unified standard for externalservices is adopted and JSON Web Token (JWT)authentication is used for service calling

(3) In order to improve the flexibility and adaptability ofthe administrative licensing process a workflowengine is utilized to realize licensing process cus-tomization More specifically by defining Bussi-nessKey enterprise users are linked with processdefinition which is then connected with the licensetype through keywords of the predefined licensetype e process node is associated with the actualsystem processing function through predefinedkeywords

(4) e establishment of microservice supporting sys-tem is the core part of microservice transformationFrom the perspective of service transformation eachservice system provides one or more specific servicesIn traditional architectures these systems are totallyindependent and can hardly utilize specific servicesof each other at is to say many functions arerepeatedly established rough open-sourceframework the system of the Administration canachieve basis platform functions such as namingremote service calling and load balancing circuit-breaker mechanism and service self-recovery andservice link tracking (Figure 7)

52 Results of Microservice Splitting Granularity DecisionAccording to the microservice framework in Section 3 andthe microservice governance goals of the Administration inSection 51 service analysis and service-oriented governancehave been performed on the original regulatory informationsystem e system was divided into 12 microservices in-cluding administrative licensing daily supervision doublerandom inspection inspection and enforcement randominspection risk and credit rating regulatory archives dataanalysis system maintenance system monitoring and in-formation submission Calculation results of the main-tainability indicators of each microservice are shown inTable 2 which shows that microservice transformationgreatly raises the scalability and maintainability of thesystem

e system of Shaanxi food and drug supervisioncompleted the start-up construction of governmentprocurement procedures in July 2017 and passed theexpert acceptance on July 4 2018 As of June 30 2018 thesystem has covered 14 county-level bureaus directlysubordinate to the municipal and provincial governments104 district and county bureaus more than 1400 regu-latory agencies 10715 supervisors and 284544 enterpriseusers namely nearly all food and drug supervisors andfood and drug regulatory targets of the province esupervisory terminal is logged in by 300000 people permonth and the enterprise terminal by 140000 In total thesystem produces 1364G structural data and 890G un-structured data

8 Discrete Dynamics in Nature and Society

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 9: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

e comprehensive service system of the Adminis-tration implemented the value effect of ldquothree portalsfour terminalsrdquo (Figure 8) e three portals mean theone-network-based governance for government regula-tion the one-network-based transaction for enterprisebusinesses and the one-network-based communicationfor public service which has achieved the ldquounified de-ployment in the province scale and hierarchical appli-cation on the prefectural and municipal levelrdquo throughmicroservice transformation e four terminals meanthat due to the microservice terminal adaptation function

the system can be accessed through multiple channelsincluding PC Android and IOS mobile terminals andWeChat official accounts e microservice transforma-tion result of Shaanxi province has won a large round ofapplause from acceptance review experts and insiders andappeared in the special reports in the ldquoAnnual Reviewduring the Two Sessionsrdquo program of CCTV and Office ofthe Central Cyberspace Affairs Commission As one of theldquo2018 National Intelligent Regulation Exemplary Casesrdquoit has been generalized and replicated in 11 provinces andcities

Unified user authentication cluster

Unified managed service gateway high availability cluster

Linktracking

Monitoringand

protection

Clustermonitoring

Faulttolerance

protection

Governanceand deployment

Serviceregistration

Messageservices

Deploymentmanagement

Unified usermanagement

Flow controlengine

Visualizedanalysis

Spatial data

Unified messagepush

Systemmonitoring

Logmangement

Serviceorchestration

Application supporting services

Microservice application system

Review andapprovalsystem

Dailysupervision

system

Inspection andenforcement

system

Examination andtesting system

Businessregistrartion

system

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Servicedatabase

Figure 7 Framework of the microservice-supporting platform

Comprehensive service platform Enterprise service platform Collaborative service governance platform

Open to supervisors and involving allservice systems including

administrative licensing dailyinspection inspection and

enforcement complaints and reports

Open to enterprise users andenabling them to perform onlinetransaction data reporting and

regulatory information query on it

Open to the public and enabling themto gain transparent regulatory and

enterprise information on it so as torealize mass supervision and

collaborative governance

Masssupervision

Serve the public

Unified identity authenticationUnified user management

Unified authority management

Microservice platform

SupportSupport

Government-enterpriseinteraction

DATA

DATA

Unified role managementUnified security authenticationSingle sign-on

Figure 6 Service framework of the provincial food and drug regulatory system

Discrete Dynamics in Nature and Society 9

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 10: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

6 Conclusion and Prospect

e data-driven concept can innovate the comprehensivesocial governance mechanism effectively and the premise ofutilizing data-intensive research paradigm is the full sharingand integration of datais paper first summarizes the criticalmeanings of government data sharing introduces the fourarchitectures of data integrated governance in a systematic wayand analyzes their differences advantages and disadvantagesen it provides the basic framework and the maintainabilitymeasure indexes of microservice from the perspective ofpractical application In the end it takes the microservicegovernance of a provincial food and drug regulatory system asan example to verify the framework and measure indexesproposed which as the practical result shows promote datasharing and the expandability and maintainability of the

system rough microservice governance collaborative socialgovernance featuring ldquoone-network-based governance trans-action and communicationrdquo can be achieved It is an exem-plary mode worth popularization

Microservice architecture is a practical technology de-rived from applications most of which are based on indi-vidual experience or understanding for granularitysegmentation of microservices is paper firstly analyzedand discussed the split decision-making process of micro-service from a rigorous theoretical analysis perspectivewhich has certain innovation significance in this fieldHowever the theoretical decision-making in this paper isonly from a simple application andmaintenance perspectivewithout considering some other factors erefore morefactors need to be integrated for rigorous theoretical analysisand cases in the subsequent research

Regulatory portal

Regulates regulatory processEnriches regulatory measures

Revolutionizes regulatory modelsPromotes regulatory efficiency

Enterprise portal

Optimizes service processInnovates service modeAdvances data sharing

Improves transaction efficiency

Public portal

Enriches appeal channelsBreaks information walls

Strengthens transparent governancePromotes collaborative governance

One-network-basedgovernance

PC Android mobileterminal

IOS mobileterminal

WeChat officialaccount

One-network-basedtransaction

One-network-basedcommunication

Figure 8 Value effect of ldquothree portals four terminalsrdquo

Table 2 Calculation results of the maintainability indicators

No Service name Interface number Operation number Sws SIOS SDOS SCOS SIDC SIUC STICS1 Administrative licensing (API) 5 8 035 8 3 24 09 060 075S2 Daily supervision (XML) 3 5 054 5 5 25 09 167 128S3 Double random check (API) 3 3 067 3 5 15 08 167 123S4 Enforcement of inspection (WSDL) 4 5 045 2 5 10 1 125 113S5 Sampling inspection (JSON) 2 5 070 2 3 6 07 150 110S6 Risk rating (API) 3 3 067 2 3 6 1 100 100S7 Credit rating (API) 3 3 067 2 3 6 1 100 100S8 Regulatory archives (API) 5 2 070 10 2 20 1 040 070S9 Data analysis (API) 2 10 060 2 10 20 03 500 265S10 System maintenance (XML) 3 5 053 2 10 20 1 333 217S11 System monitoring (XML) 2 10 060 1 10 10 1 500 300S12 Information submission (WSDL) 2 2 100 1 8 8 1 400 250

10 Discrete Dynamics in Nature and Society

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11

Page 11: GranularityDecisionofMicroserviceSplittinginViewof ...downloads.hindawi.com/journals/ddns/2020/1057902.pdfservice, messaging, or event interactions. With standard open protocols and

Data Availability

e data used to test the matching decision model of thisstudy are included within the article Additional data can beprovided by the corresponding author upon request

Conflicts of Interest

e authors declare no conflicts of interest

Acknowledgments

is research was supported by the Shaanxi ProvincialDepartment of Education serving the Special Project of LocalEnterprises under Grant no 2019TJ034 Research Project ofKey Projects of Statistical Science in Shaanxi Province underGrant no 19JC015 Xirsquoan Science and Technology PlanUniversity Talent Service Enterprise Project under Grant noGXYD77 and Xirsquoan Polytechnic University Doctoral Re-search Start-Up Fund under Grant no 107020342

References

[1] C Kucklick 6e Granular Society CITIC Group PressBeijing China 2017

[2] C-h Wang ldquoEvolution and innovation of ldquocomprehensivegovernancerdquo in Chinardquo Journal of Beijing AdministrativeCollege vol 2 pp 42ndash46 2015

[3] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of Elec-tronics Communications and Computer Sciences vol E103Ano 1 pp 265ndash267 2020

[4] Z-m Zeng and Y Qian-wen ldquoResearch on the data curationsystem of urban public security oriented to the fourth par-adigmrdquo Information Studies 6eory amp Application vol 2pp 82ndash87 2018

[5] Ye Tian Bo Yuan and Li Ting-li ldquoA massive and hetero-geneous data storage and sharing strategy for Internet ofthingsrdquo Acta Electronica Sinica vol 44 no 2 pp 247ndash2572016

[6] L I Xiao-tao H U Xiao-hui G U O Xiao-li and W-n LUldquoComplicated information sharing technology based onmetadatardquo Systems Engineering and Electronics vol 37 no 3pp 700ndash706 2015

[7] L Ming ldquoLarge data technology and public security infor-mation sharing abilityrdquo E-governmentvol 6 pp 10ndash19 2014

[8] B Lake ldquoAn empirical evaluation of an agile modular softwaredevelopment approach a case study with ericssonrdquo MS thesisStockholm University Stockholm Sweden 2012

[9] R Arnon SOA Patterns Manning Shelter Island ShelterIsland NY USA 2012

[10] D Sprot and L Wilkes Understanding Service Oriented Ar-chitecture Microsoft Developer Network 2004 httpsmsdnmicrosoftcomen-uslibraryaa480021aspxaj1soa_topic5

[11] J ones Micro-services IEEE Software ISSN 0740-7459152015

[12] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 2020

[13] G Gruman and A Morrison ldquoMicro-services the resurgenceof SOA principles and an alternative to the monolithrdquoTechnology Forecast Rethinking Integration vol 1 2014

[14] M Fowler ldquoMicro-servicesrdquo 2014 httpmartinfowlercomarticlesmicro-serviceshtml

[15] M Vianden H Lichter and A Steffens ldquoExperience on amicro-service-based reference architecture for measurementsystemsrdquo in Proceedings of the 21st Asia-Pacific SoftwareEngineering Conference IEEE Jeju South Korea 2014

[16] D Rowe J Leaney and D Lowe ldquoDefining systems archi-tecture evolvability-a taxonomy of changerdquo in Proceedings ofthe International Conference and Workshop Engineering ofComputer-Based Systems pp 45ndash52 Jerusalem Israel De-cember 1998

[17] M Perepletchikov C Ryan and F Keith ldquoComparing theimpact of service-oriented and object-oriented paradigms onthe structural properties of softwarerdquo Lecture Notes inComputer Science (Including Subseries Lecture Notes in Ar-tificial Intelligence and Lecture Notes in Bioinformatics) 3762LNCS pp 431ndash441 Springer Berlin Germany 2005

[18] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102-D no 7 pp 1374ndash1383 2019

[19] M Perepletchikov C Ryan and F Keith ldquoCohesion metricsfor predictingmaintainability of service-oriented softwarerdquo inProceedings of the Seventh International Conference on QualitySoftware (QSIC 2007) IEEE Portland OR USA pp 328ndash3352007

[20] D Rud A Schmietendorf and R R Dumke ldquoProduct metricsfor service-oriented infrastructuresrdquo in Proceedings of theIWSMMetriKon Montreal Canada 2006

Discrete Dynamics in Nature and Society 11