[go: up one dir, main page]

CN110825391B - Service management method, device, electronic equipment and storage medium - Google Patents

Service management method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110825391B
CN110825391B CN201911054615.1A CN201911054615A CN110825391B CN 110825391 B CN110825391 B CN 110825391B CN 201911054615 A CN201911054615 A CN 201911054615A CN 110825391 B CN110825391 B CN 110825391B
Authority
CN
China
Prior art keywords
map data
data structure
target service
target
deployed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911054615.1A
Other languages
Chinese (zh)
Other versions
CN110825391A (en
Inventor
蔡志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911054615.1A priority Critical patent/CN110825391B/en
Publication of CN110825391A publication Critical patent/CN110825391A/en
Application granted granted Critical
Publication of CN110825391B publication Critical patent/CN110825391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Quality & Reliability (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a service management method, a device, electronic equipment and a storage medium, which are applied to the technical field of computers, and the method comprises the following steps: acquiring each target service to be deployed and an association relation of each target service, wherein the association relation comprises a plurality of map data structures, and the map data structures represent the sequential order of chained deployment of each target service with a dependency relation; and deploying the target services of each map data structure according to the sequence of chained deployment of each target service with a dependency relationship in each map data structure by using a preset thread group. According to the service management method provided by the embodiment of the application, the target services of each map data structure are deployed according to the sequence of chained deployment of each target service with a dependency relationship in the map data structure, so that automatic deployment of each target service can be realized, the manual workload is reduced, and the service deployment efficiency is improved.

Description

服务管理方法、装置、电子设备及存储介质Service management method, device, electronic equipment and storage medium

技术领域Technical field

本申请涉及计算机技术领域,特别是涉及服务管理方法、装置、电子设备及存储介质。This application relates to the field of computer technology, and in particular to service management methods, devices, electronic equipment and storage media.

背景技术Background technique

企业云的上层业务系统包含两大子系统,分别是租户控制台、业务运营平台。上层业务系统涵盖了多个业务线,多个支撑平台等上百个服务,并且各服务所使用的语言也不同,例如,包含JAVA、Python、Golang、PHP(Hypertext Preprocessor,超文本预处理器)、JS(JavaScript)等语言的服务,各服务的部署的环境和方法也多种多样,技术栈存在也不统一等。The upper-layer business system of the enterprise cloud includes two major subsystems, namely the tenant console and the business operation platform. The upper-level business system covers multiple business lines, multiple support platforms and hundreds of services, and the languages used by each service are also different, including JAVA, Python, Golang, PHP (Hypertext Preprocessor, hypertext preprocessor) , JS (JavaScript) and other language services, the environments and methods for deploying each service are also diverse, and the technology stack is not uniform.

相关技术中,需要运营人员人工将各服务编译、打包、部署到用户的私有环境中,人工工作量大。In related technologies, operators are required to manually compile, package, and deploy each service into the user's private environment, which requires a large amount of manual work.

发明内容Contents of the invention

本申请实施例的目的在于提供一种服务管理方法、装置、电子设备及存储介质,以实现减少人工工作量。具体技术方案如下:The purpose of the embodiments of this application is to provide a service management method, device, electronic device and storage medium to reduce manual workload. The specific technical solutions are as follows:

第一方面,本申请实施例提供了一种服务管理方法,所述方法包括:In a first aspect, embodiments of the present application provide a service management method, which method includes:

获取待部署的各目标服务及各所述目标服务的关联关系,其中,所述关联关系包括多个地图数据结构,所述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;Obtain each target service to be deployed and the association relationship of each target service, wherein the association relationship includes multiple map data structures, and the map data structure represents the sequence of chain deployment of each target service with dependencies;

利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务。Using the preset thread group, the target services of each of the map data structures are deployed according to the sequence of chain deployment of the target services that have dependencies in each of the map data structures.

在一种可能的实施方式中,所述预设线程组包括多个线程,其中,所述多个线程用于并行部署各所述地图数据结构的目标服务。In a possible implementation, the preset thread group includes multiple threads, wherein the multiple threads are used to deploy target services of each of the map data structures in parallel.

在一种可能的实施方式中,所述方法还包括:In a possible implementation, the method further includes:

获取所述关联关系中地图数据结构的数量,得到目标数量;Obtain the number of map data structures in the association relationship and obtain the target number;

按照所述目标数量,建立包括所述目标数量的线程的预设线程组。According to the target number, a preset thread group including the target number of threads is established.

在一种可能的实施方式中,所述利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务,包括:In one possible implementation, the preset thread group is used to deploy the target services of each of the map data structures according to the sequence of chain deployment of the target services that have dependencies in each of the map data structures. include:

确定所述预设线程组中每个线程各自对应的地图数据结构;Determine the map data structure corresponding to each thread in the preset thread group;

针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务。For each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, the thread corresponding to the map data structure is used to deploy the target services of the map data structure.

在一种可能的实施方式中,所述针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署各所述地图数据结构的目标服务,包括:In a possible implementation, for each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, the thread corresponding to the map data structure is used to deploy each target service. The target services of the map data structure include:

针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务;For each map data structure, based on the sequence of chain deployment of each target service with dependencies in the map data structure, determine the target service currently to be deployed in the map data structure;

若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;If the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it;

若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务;If the target service currently to be deployed in the map data structure has not been compiled and packaged, use the thread corresponding to the map data structure to compile, package and deploy the current target service to be deployed;

返回上述针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务的步骤继续执行,直至各所述地图数据结构的目标服务均部署完成。Return to the above steps for each map data structure, based on the sequence of chain deployment of each target service with dependencies in the map data structure, and determine the target service currently to be deployed in the map data structure. Continue until each step is described. The target services of the map data structure have been deployed.

在一种可能的实施方式中,所述方法还包括:In a possible implementation, the method further includes:

将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置;Cache the compiled and packaged target service storage, and store the identifier of each cached compiled and packaged target service in the specified location;

所述若该地图数据结构中当前待部署的目标服务已经编译及打包过,包括:If the target service currently to be deployed in the map data structure has been compiled and packaged, it includes:

若所述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识;If the specified location stores the identification of the target service currently to be deployed in the map data structure;

所述若该地图数据结构中当前待部署的目标服务尚未编译及打包过,包括:If the target service currently to be deployed in the map data structure has not been compiled and packaged, it includes:

若所述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识。If the specified location does not store the identification of the target service currently to be deployed in the map data structure.

在一种可能的实施方式中,所述方法还包括:In a possible implementation, the method further includes:

在满足预设备份规则时,记录各所述目标服务的部署状态;When the preset backup rules are met, record the deployment status of each target service;

当获取到部署状态恢复指令时,按照所述部署状态,继续对各所述目标服务进行部署。When the deployment status recovery instruction is obtained, each target service is continued to be deployed according to the deployment status.

第二方面,本申请实施例提供了一种服务管理装置,所述装置包括:In a second aspect, embodiments of the present application provide a service management device, which includes:

关联关系获取模块,用于获取待部署的各目标服务及各所述目标服务的关联关系,其中,所述关联关系包括多个地图数据结构,所述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;The association relationship acquisition module is used to obtain each target service to be deployed and the association relationship of each of the target services, wherein the association relationship includes multiple map data structures, and the map data structure represents each target service with a dependency relationship. The sequence of chain deployment;

目标服务部署模块,用于利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务。The target service deployment module is used to utilize the preset thread group to deploy the target services of each of the map data structures according to the order of chain deployment of the target services that have dependencies in each of the map data structures.

在一种可能的实施方式中,所述预设线程组包括多个线程,其中,所述多个线程用于并行部署各所述地图数据结构的目标服务。In a possible implementation, the preset thread group includes multiple threads, wherein the multiple threads are used to deploy target services of each of the map data structures in parallel.

在一种可能的实施方式中,所述装置还包括:In a possible implementation, the device further includes:

目标数据获取模块,用于获取所述关联关系中地图数据结构的数量,得到目标数量;The target data acquisition module is used to obtain the number of map data structures in the association relationship and obtain the target number;

线程组建立模块,用于按照所述目标数量,建立包括所述目标数量的线程的预设线程组。A thread group establishment module, configured to establish a preset thread group including the target number of threads according to the target number.

在一种可能的实施方式中,所述目标服务部署模块,包括:In a possible implementation, the target service deployment module includes:

对应关系确定子模块,用于确定所述预设线程组中每个线程各自对应的地图数据结构;Correspondence determination sub-module, used to determine the map data structure corresponding to each thread in the preset thread group;

目标服务部署子模块,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务。The target service deployment sub-module is used for each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, using the thread corresponding to the map data structure to deploy the map data structure target service.

在一种可能的实施方式中,所述目标服务部署子模块,包括:In a possible implementation, the target service deployment sub-module includes:

当前服务确定单元,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务;The current service determination unit is used for determining, for each map data structure, the target service currently to be deployed in the map data structure based on the sequence of chain deployment of each target service with dependencies in the map data structure;

第一部署单元,用于若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The first deployment unit is used to, if the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it;

第二部署单元,用于若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务;The second deployment unit is used to use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed if the target service currently to be deployed in the map data structure has not been compiled and packaged;

返回执行单元,返回上述当前服务确定单元继续执行,直至各所述地图数据结构的目标服务均部署完成。Return to the execution unit and return to the current service determination unit to continue execution until the target services of each map data structure are deployed.

在一种可能的实施方式中,所述装置还包括:In a possible implementation, the device further includes:

数据缓存模块,用于将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置;The data caching module is used to cache the compiled and packaged target service storage, and store the identifier of each cached compiled and packaged target service in a designated location;

所述第一部署单元,具体用于:若所述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The first deployment unit is specifically used to: if the identification of the target service currently to be deployed in the map data structure is stored in the specified location, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed. Deploy the target service and deploy it;

所述第二部署单元,具体用于若所述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务。The second deployment unit is specifically used to use the thread corresponding to the map data structure to compile, package and deploy the current target service to be deployed if the identification of the target service currently to be deployed in the map data structure is not stored in the specified location. target service.

在一种可能的实施方式中,所述装置还包括:In a possible implementation, the device further includes:

部署状态记录模块,用于在满足预设备份规则时,记录各所述目标服务的部署状态;The deployment status recording module is used to record the deployment status of each target service when the preset backup rules are met;

部署状态恢复模块,用于当获取到部署状态恢复指令时,按照所述部署状态,继续对各所述目标服务进行部署。The deployment status recovery module is configured to continue deploying each of the target services according to the deployment status when the deployment status recovery instruction is obtained.

第三方面,本申请实施例提供了一种电子设备,包括处理器及存储器;In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory;

所述存储器,用于存放计算机程序;The memory is used to store computer programs;

所述处理器,用于执行所述存储器上所存放的程序时,实现上述第一方面任一所述的服务管理方法。The processor is configured to implement the service management method described in any one of the above first aspects when executing a program stored on the memory.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面任一所述的服务管理方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, any one of the above-mentioned aspects of the first aspect is implemented. Service management methods.

本申请实施例提供的服务管理方法、装置、电子设备及存储介质,获取待部署的各目标服务及各目标服务的关联关系,其中,关联关系包括多个地图数据结构,地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;利用预设线程组,按照各地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各地图数据结构的目标服务。按照地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各地图数据结构的目标服务,能够实现各目标服务的自动部署,减少人工工作量,提高服务部署效率。当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。The service management method, device, electronic device and storage medium provided by the embodiments of the present application obtain each target service to be deployed and the association relationship of each target service, wherein the association relationship includes multiple map data structures, and the map data structure represents a dependency The sequence of the chain deployment of each target service of the relationship; use the preset thread group to deploy the target services of each map data structure according to the sequence of the chain deployment of each target service that has a dependency relationship in each map data structure. According to the sequence of chain deployment of target services with dependencies in the map data structure, the target services of each map data structure are deployed, which can realize automatic deployment of each target service, reduce manual workload, and improve service deployment efficiency. Of course, implementing any product or method of the present application does not necessarily require achieving all the above-mentioned advantages simultaneously.

附图说明Description of the drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1为本申请实施例的服务管理方法的第一种示意图;Figure 1 is a first schematic diagram of a service management method according to an embodiment of the present application;

图2为本申请实施例的服务管理方法的第二种示意图;Figure 2 is a second schematic diagram of the service management method according to the embodiment of the present application;

图3为本申请实施例的服务管理方法的第三种示意图;Figure 3 is a third schematic diagram of the service management method according to the embodiment of the present application;

图4为本申请实施例的服务管理方法的第四种示意图;Figure 4 is a fourth schematic diagram of the service management method according to the embodiment of the present application;

图5为本申请实施例的服务管理装置的一种示意图;Figure 5 is a schematic diagram of the service management device according to the embodiment of the present application;

图6为本申请实施例的电子设备的一种示意图。FIG. 6 is a schematic diagram of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

相关技术中,在私有云环境建立的过程中,需要运营人员人工将各服务编译、打包、部署到用户的私有环境中,人工工作量大,部署效率低。In related technologies, in the process of establishing a private cloud environment, operators are required to manually compile, package, and deploy each service into the user's private environment. The manual workload is large and the deployment efficiency is low.

有鉴于此,本申请提供了一种服务管理方法,参见图1,该方法包括:In view of this, this application provides a service management method, see Figure 1. The method includes:

S101,获取待部署的各目标服务及各上述目标服务的关联关系,其中,上述关联关系包括多个地图数据结构,上述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序。S101. Obtain each target service to be deployed and the association relationship of each of the above-mentioned target services, wherein the above-mentioned association relationship includes multiple map data structures, and the above-mentioned map data structure represents the sequence of chain deployment of each target service with dependencies.

本申请实施例的服务管理方法可以通过上层业务系统实现,具体可以通过上层业务系统中的服务器实现。The service management method in the embodiment of the present application can be implemented through the upper-layer business system, specifically through the server in the upper-layer business system.

各目标服务的关联关系包括多个MAP Data Structure(地图数据结构),地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序。在一种可能的实施方式中,在S101之前,上述方法还包括:获取各目标服务的依赖关系,按照各目标服务的依赖关系,确定各目标服务的关联关系。具体的,可以利用预设脚本,例如deploy脚本,梳理各目标服务的依赖关系,对于存在依赖关系的目标服务,采用链表的数据结构存储,形成依赖链,对于无依赖关系的目标服务使用MAP Data Structure(以下简称MAP)的数据结构存储,从而得到多个MAP的链表,即各目标服务的关联关系。The association relationship between each target service includes multiple MAP Data Structures. The map data structure represents the sequence of chain deployment of each target service with dependencies. In a possible implementation, before S101, the above method further includes: obtaining the dependency relationship of each target service, and determining the association relationship of each target service according to the dependency relationship of each target service. Specifically, you can use preset scripts, such as deploy scripts, to sort out the dependencies of each target service. For target services with dependencies, use the linked list data structure to store them to form a dependency chain. For target services without dependencies, use MAP Data Structure (hereinafter referred to as MAP) data structure storage, thereby obtaining a linked list of multiple MAPs, that is, the association relationship of each target service.

S102,利用预设线程组,按照各上述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各上述地图数据结构的目标服务。S102, use the preset thread group to deploy the target services of each of the above map data structures according to the sequence of chain deployment of the target services that have dependencies in each of the above map data structures.

预设线程组中包括线程,通过线程完成各目标服务的部署。在一种可能的实施方式中,上述预设线程组包括多个线程,其中,上述多个线程用于并行部署各上述地图数据结构的目标服务。利用各线程并行部署各地图数据结构的目标服务,能够增加整体服务的部署效率,节约服务部署时间。The preset thread group includes threads, and the deployment of each target service is completed through threads. In a possible implementation, the above-mentioned preset thread group includes multiple threads, wherein the above-mentioned multiple threads are used to deploy target services of each of the above-mentioned map data structures in parallel. Using each thread to deploy target services of each map data structure in parallel can increase the overall service deployment efficiency and save service deployment time.

针对每个地图数据结构,分别按照该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,依次部署各目标服务。For each map data structure, each target service is deployed sequentially according to the order of chain deployment of each target service with dependencies in the map data structure.

例如,地图数据结构A中记录了有依赖关系的目标服务链式部署的先后顺序为:目标服务1→目标服务8→目标服务3→目标服务4,则依次部署目标服务1、目标服务8、目标服务3及目标服务4。For example, map data structure A records the sequence of chain deployment of target services with dependencies as: target service 1→target service 8→target service 3→target service 4, then target service 1, target service 8, and target service 4 are deployed in sequence. Target Service 3 and Target Service 4.

对于存在支路的情况,并不限定各支路的部署顺序,例如,地图数据结构B中记录了有依赖关系的目标服务链式部署的先后顺序为:目标服务目标服务4,支路1包括目标服务8,支路2包括目标服务3及目标服务5,支路1与支路2之间部署的先后顺序不做限定。但是支路1与支路2均需要在目标服务1部署完成后部署、且需要在目标服务4部署前部署。For the case where there are branches, the deployment order of each branch is not limited. For example, the map data structure B records the sequence of chain deployment of target services with dependencies as: target service Target service 4, branch 1 includes target service 8, branch 2 includes target service 3 and target service 5, and the order of deployment between branch 1 and branch 2 is not limited. However, both branch 1 and branch 2 need to be deployed after target service 1 is deployed, and they need to be deployed before target service 4 is deployed.

在本申请实施例中,按照地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各地图数据结构的目标服务,能够实现各目标服务的自动部署,减少人工工作量,提高服务部署效率。In the embodiment of the present application, the target services of each map data structure are deployed according to the order of chain deployment of each target service with dependencies in the map data structure, which can realize the automatic deployment of each target service, reduce manual workload, and improve Service deployment efficiency.

在一种可能的实施方式中,参见图2,上述方法还包括:In a possible implementation, referring to Figure 2, the above method further includes:

S201,获取上述关联关系中地图数据结构的数量,得到目标数量。S201: Obtain the number of map data structures in the above association relationship and obtain the target number.

有依赖关系的各目标服务以链表的方式存储在一个地图数据结构中,不同地图数据结构中的目标服务间不存在依赖关系。获取关联关系中地图数据结构的数量,作为目标数量。Each target service with dependencies is stored in a map data structure in the form of a linked list. There is no dependency between target services in different map data structures. Get the number of map data structures in the relationship as the target number.

S202,按照上述目标数量,建立包括上述目标数量的线程的预设线程组。S202: According to the above target number, establish a default thread group including the above target number of threads.

按照目标数量,建立目标数量的线程,目标数量的线程组成预设线程组。获取地图数据结构的数量,通过线程组的方式采用多线程并行执行。具体的,每个线程均可以负责一个地图数据结构中各目标服务的部署。利用各线程,按照各地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各地图数据结构的目标服务。采用多线程并发部署的方法,对目标服务进行并行部署。而在每个线程内部,获取该线程对应的链表,针对该链表结构,可以采用for循环等方式,依次进行编译、打包、部署,以提高服务的整体部署效率。According to the target number, a target number of threads is established, and the target number of threads form a preset thread group. Get the number of map data structures and use multi-thread parallel execution through thread groups. Specifically, each thread can be responsible for the deployment of each target service in a map data structure. Each thread is used to deploy the target services of each map data structure according to the sequence of chain deployment of target services with dependencies in each map data structure. Use multi-threaded concurrent deployment method to deploy target services in parallel. Within each thread, the linked list corresponding to the thread is obtained. For the linked list structure, a for loop or other methods can be used to compile, package, and deploy in order to improve the overall deployment efficiency of the service.

在一种可能的实施方式中,上述利用预设线程组,按照各上述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各上述地图数据结构的目标服务,包括:In one possible implementation, the above-mentioned method uses a preset thread group to deploy the target services of each of the above-mentioned map data structures according to the order of chain deployment of each target service that has a dependency relationship in each of the above-mentioned map data structures, including:

步骤一,确定上述预设线程组中每个线程各自对应的地图数据结构。Step 1: Determine the map data structure corresponding to each thread in the above-mentioned preset thread group.

预设线程组包括多个线程,每个线程负责部署不同地图数据结构中的目标服务。线程与地图数据结构的对应方式可以利用相关负载均衡技术进行确定,例如,可以为每个线程随机分配对应的地图数据结构,或可以为每个线程平均分配对应的地图数据结构等。The default thread group includes multiple threads, each thread is responsible for deploying target services in different map data structures. The correspondence between threads and map data structures can be determined using relevant load balancing technologies. For example, the corresponding map data structure can be randomly assigned to each thread, or the corresponding map data structure can be evenly assigned to each thread.

步骤二,针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务。Step 2: For each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, use the thread corresponding to the map data structure to deploy the target services of the map data structure.

本申请实施例中,利用多个线程并行部署各地图数据结构的目标服务,能够增加整体服务的部署效率,节约服务部署时间。In the embodiment of this application, multiple threads are used to deploy target services of each map data structure in parallel, which can increase the deployment efficiency of the overall service and save service deployment time.

在一种可能的实施方式中,参见图3,上述针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务,包括:In a possible implementation, see Figure 3, for each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, using the thread corresponding to the map data structure, Deploy the target service of the map data structure, including:

S301,针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务。S301: For each map data structure, determine the target service currently to be deployed in the map data structure based on the sequence of chain deployment of target services with dependencies in the map data structure.

针对任一地图数据结构,按照该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务。For any map data structure, determine the target service currently to be deployed in the map data structure according to the sequence of chain deployment of each target service with dependencies in the map data structure.

S302,若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署。S302: If the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it.

若该地图数据结构中当前待部署的目标服务已经编译及打包过,便不可以不再重新编译及打包该目标服务,直接获取编译及打包后目标服务部署即可。If the target service currently to be deployed in the map data structure has been compiled and packaged, the target service can no longer be recompiled and packaged, and the compiled and packaged target service can be deployed directly.

S303,若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务。S303: If the target service currently to be deployed in the map data structure has not been compiled and packaged, use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed.

若该地图数据结构中当前待部署的目标服务尚未编译及打包过,则需要编译及打包该目标服务,然后在部署编译及打包后目标服务部署。If the target service currently to be deployed in the map data structure has not been compiled and packaged, the target service needs to be compiled and packaged, and then the target service is deployed after deployment, compilation and packaging.

S304,返回上述S301继续执行,直至各上述地图数据结构的目标服务均部署完成。S304, return to the above S301 and continue execution until the target services of each of the above map data structures are deployed.

一个目标服务部署完成后,照地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,继续选取当前待部署的目标服务,重复执行上述步骤S301-S303,直至地图数据结构的目标服务均部署完成。本领域人员可以理解的是,在实际执行过程中,需要针对每个地图数据结构均执行本申请实施例的方法步骤。After the deployment of a target service is completed, continue to select the current target service to be deployed according to the sequence of chain deployment of each target service with dependencies in the map data structure, and repeat the above steps S301-S303 until the target service of the map data structure is reached. All deployments are completed. Persons in the art can understand that during actual implementation, the method steps of the embodiments of the present application need to be executed for each map data structure.

在本申请实施例中,已经编译及打包过的目标服务直接获取使用即可,不用每次加载一个服务时均重新编译及打包,减少编译及打包的时间,节约系统资源,并且可以进一步提升服务部署的效率。In the embodiment of this application, the compiled and packaged target service can be directly obtained and used. There is no need to recompile and package each time a service is loaded, which reduces the compilation and packaging time, saves system resources, and can further improve the service. Deployment efficiency.

可以通过判断指定存储位置中是否存在当前待部署的目标服务的打包标识,来确定其是否已经编译及打包过。在一种可能的实施方式中,上述方法还包括:将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置;You can determine whether it has been compiled and packaged by determining whether the packaging ID of the target service currently to be deployed exists in the specified storage location. In a possible implementation, the above method further includes: caching the compiled and packaged target service, and storing the identifier of each cached compiled and packaged target service in a designated location;

上述若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署,包括:If the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it, including:

若上述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;If the identification of the target service currently to be deployed in the map data structure is stored in the above specified location, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it;

上述若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务,包括If the target service currently to be deployed in the map data structure has not been compiled and packaged, use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed, including

若上述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务。If the identifier of the target service currently to be deployed in the map data structure is not stored in the above specified location, use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed.

每个目标服务均有唯一的标识,例如Tag(标签)号等。在缓存编译及打包后的目标服务存储的同时,还可以将该编译及打包后的目标服务的标识存储到指定位置,例如内存中等,在判断当前待部署的目标服务是否已经编译及打包过时,直接查询内存中的相应位置,判断是否存在当前待部署的目标服务的标识即可。Each target service has a unique identification, such as Tag number, etc. While caching the compiled and packaged target service, you can also store the compiled and packaged target service identifier in a designated location, such as memory, etc., to determine whether the currently to-be-deployed target service has been compiled and packaged out of date. Simply query the corresponding location in the memory to determine whether there is an identifier of the target service currently to be deployed.

在一种可能的方式中,参见图4,上述方法还包括:In a possible way, referring to Figure 4, the above method also includes:

S401,在满足预设备份规则时,记录各上述目标服务的部署状态。S401: When the preset backup rules are met, record the deployment status of each of the above target services.

预设备份规则可以根据实际情况进行设定,例如设置为没间隔预设时间,便记录一次各目标服务的部署状态;或每完成一定数量的目标服务的部署,便记录一次各目标服务的部署状态,也可以实时记录各目标服务的部署状态等。目标服务的部署状态表示各目标服务的部署情况,例如可以针对目标服务的每个状态,包括编译、打包、部署等,设置一个Point值,通过目标服务Point值确定目标服务的部署状态。Default backup rules can be set according to the actual situation. For example, set to record the deployment status of each target service once every preset time interval; or record the deployment status of each target service every time a certain number of target services are deployed. Status, you can also record the deployment status of each target service in real time. The deployment status of the target service represents the deployment status of each target service. For example, a Point value can be set for each status of the target service, including compilation, packaging, deployment, etc., and the deployment status of the target service can be determined by the target service Point value.

S402,当获取到部署状态恢复指令时,按照上述部署状态,继续对各上述目标服务进行部署。S402: When the deployment status recovery instruction is obtained, continue to deploy each of the above target services according to the above deployment status.

部署状态恢复指令可以为用户输入的,也可以为系统自动生成的。例如,在服务部署过程中,当系统从断电或宕机等意外情况恢复后,自动生成部署状态恢复指令。可以通过缓存机制以及代码遍历等方式,直接从各目标服务的部署状态表示的阶段处往下继续执行,从而快速实现断点处继续执行的效果。进一步增加部署的效率。Deployment status recovery instructions can be input by the user or automatically generated by the system. For example, during the service deployment process, when the system recovers from unexpected situations such as power outage or downtime, deployment status recovery instructions are automatically generated. The cache mechanism and code traversal can be used to directly continue execution from the stage indicated by the deployment status of each target service, thereby quickly achieving the effect of continuing execution at the breakpoint. Further increase the efficiency of deployment.

本申请实施例还提供了一种服务管理装置,参见图5,该装置包括:An embodiment of the present application also provides a service management device. See Figure 5. The device includes:

关联关系获取模块501,用于获取待部署的各目标服务及各上述目标服务的关联关系,其中,上述关联关系包括多个地图数据结构,上述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;The association relationship acquisition module 501 is used to obtain each target service to be deployed and the association relationship of each of the above-mentioned target services, wherein the above-mentioned association relationship includes multiple map data structures, and the above-mentioned map data structure represents a chain of each target service with a dependency relationship. Deployment sequence;

目标服务部署模块502,用于利用预设线程组,按照各上述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各上述地图数据结构的目标服务。The target service deployment module 502 is used to utilize a preset thread group to deploy the target services of each of the above-mentioned map data structures in accordance with the sequence of chain deployment of each target service that has a dependency relationship in each of the above-mentioned map data structures.

在一种可能的方式中,上述预设线程组包括多个线程,其中,上述多个线程用于并行部署各上述地图数据结构的目标服务。In a possible manner, the above-mentioned preset thread group includes multiple threads, wherein the above-mentioned multiple threads are used to deploy target services of each of the above-mentioned map data structures in parallel.

在一种可能的方式中,上述装置还包括:In a possible way, the above device also includes:

目标数据获取模块,用于获取上述关联关系中地图数据结构的数量,得到目标数量;The target data acquisition module is used to obtain the number of map data structures in the above association relationship and obtain the target number;

线程组建立模块,用于按照上述目标数量,建立包括上述目标数量的线程的预设线程组。The thread group establishment module is used to establish a preset thread group including the above target number of threads according to the above target number.

在一种可能的实施方式中,上述目标服务部署模块502,包括:In a possible implementation, the above target service deployment module 502 includes:

对应关系确定子模块,用于确定上述预设线程组中每个线程各自对应的地图数据结构;Correspondence determination sub-module, used to determine the map data structure corresponding to each thread in the above-mentioned preset thread group;

目标服务部署子模块,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务。The target service deployment sub-module is used for each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, using the thread corresponding to the map data structure to deploy the map data structure target service.

在一种可能的实施方式中,上述目标服务部署子模块,包括:In a possible implementation, the above target service deployment sub-module includes:

当前服务确定单元,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务;The current service determination unit is used for determining, for each map data structure, the target service currently to be deployed in the map data structure based on the sequence of chain deployment of each target service with dependencies in the map data structure;

第一部署单元,用于若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The first deployment unit is used to, if the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it;

第二部署单元,用于若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务;The second deployment unit is used to use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed if the target service currently to be deployed in the map data structure has not been compiled and packaged;

返回执行单元,返回上述当前服务确定单元继续执行,直至各上述地图数据结构的目标服务均部署完成。Return to the execution unit and return to the current service determination unit to continue execution until the target services of each of the above map data structures are deployed.

在一种可能的实施方式中,上述装置还包括:In a possible implementation, the above device further includes:

数据缓存模块,用于将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置;The data caching module is used to cache the compiled and packaged target service storage, and store the identifier of each cached compiled and packaged target service in a designated location;

上述第一部署单元,具体用于:若上述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The above-mentioned first deployment unit is specifically used to: if the identification of the target service currently to be deployed in the map data structure is stored in the above-mentioned designated location, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed. Target services and deploy;

上述第二部署单元,具体用于若上述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务。The above-mentioned second deployment unit is specifically used to use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed if the identification of the target service currently to be deployed in the map data structure is not stored in the above-mentioned designated location. Serve.

本申请实施例还提供了一种电子设备,包括:处理器及存储器;An embodiment of the present application also provides an electronic device, including: a processor and a memory;

上述存储器,用于存放计算机程序;The above-mentioned memory is used to store computer programs;

上述处理器用于执行上述存储器存放的计算机程序时,实现如下步骤:When the above-mentioned processor is used to execute the computer program stored in the above-mentioned memory, the following steps are implemented:

获取待部署的各目标服务及各上述目标服务的关联关系,其中,上述关联关系包括多个地图数据结构,上述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;Obtain each target service to be deployed and the association relationship of each of the above-mentioned target services, wherein the above-mentioned association relationship includes multiple map data structures, and the above-mentioned map data structure represents the sequence of chain deployment of each target service with dependencies;

利用预设线程组,按照各上述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各上述地图数据结构的目标服务。Using the preset thread group, the target services of each of the above map data structures are deployed according to the sequence of chain deployment of the target services that have dependencies in each of the above map data structures.

可选的,参见图6,本申请实施例的电子设备还包括通信接口602和通信总线604,其中,处理器601,通信接口602,存储器603通过通信总线604完成相互间的通信。Optionally, referring to FIG. 6 , the electronic device in this embodiment of the present application also includes a communication interface 602 and a communication bus 604 , in which the processor 601 , the communication interface 602 , and the memory 603 complete communication with each other through the communication bus 604 .

可选的,上述处理器用于执行上述存储器存放的计算机程序时,还能够实现上述任一服务管理方法。Optionally, when the above processor is used to execute the computer program stored in the above memory, it can also implement any of the above service management methods.

上述电子设备提到的通信总线可以是PCI(Peripheral ComponentInterconnect,外设部件互连标准)总线或EISA(Extended Industry StandardArchitecture,扩展工业标准结构)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic equipment may be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the above-mentioned electronic devices and other devices.

存储器可以包括RAM(Random Access Memory,随机存取存储器),也可以包括NVM(Non-Volatile Memory,非易失性存储器),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include RAM (Random Access Memory) or NVM (Non-Volatile Memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.

上述的处理器可以是通用处理器,包括CPU(Central Processing Unit,中央处理器)、NP(Network Processor,网络处理器)等;还可以是DSP(Digital Signal Processing,数字信号处理器)、ASIC(Application Specific Integrated Circuit,专用集成电路)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor can be a general-purpose processor, including CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor), etc.; it can also be DSP (Digital Signal Processing, digital signal processor), ASIC ( Application Specific Integrated Circuit (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

本申请实施例还提供了一种计算机可读存储介质,上述计算机可读存储介质内存储有计算机程序,上述计算机程序被处理器执行时实现如下步骤:Embodiments of the present application also provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the above-mentioned computer program is executed by a processor, the following steps are implemented:

获取待部署的各目标服务及各上述目标服务的关联关系,其中,上述关联关系包括多个地图数据结构,上述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;Obtain each target service to be deployed and the association relationship of each of the above-mentioned target services, wherein the above-mentioned association relationship includes multiple map data structures, and the above-mentioned map data structure represents the sequence of chain deployment of each target service with dependencies;

利用预设线程组,按照各上述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各上述地图数据结构的目标服务。Using the preset thread group, the target services of each of the above map data structures are deployed according to the sequence of chain deployment of the target services that have dependencies in each of the above map data structures.

可选的,上述计算机程序被处理器执行时,还能够实现上述任一服务管理方法。Optionally, when the above computer program is executed by the processor, it can also implement any of the above service management methods.

需要说明的是,在本文中,各个可选方案中的技术特征只要不矛盾均可组合来形成方案,这些方案均在本申请公开的范围内。诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, the technical features in each optional solution can be combined to form a solution as long as there is no contradiction, and these solutions are all within the scope of the disclosure of this application. Relational terms such as first, second, etc. are used only to distinguish one entity or operation from another entity or operation and do not necessarily require or imply that any such actual relationship exists between these entities or operations or order. Furthermore, the terms "comprises," "comprises," or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article, or apparatus that includes the stated element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备及存储介质的实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner. The same and similar parts between the various embodiments can be referred to each other. Each embodiment focuses on its differences from other embodiments. In particular, for the embodiments of devices, electronic equipment and storage media, since they are basically similar to the method embodiments, the descriptions are relatively simple. For relevant details, please refer to the partial description of the method embodiments.

以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above descriptions are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application are included in the protection scope of this application.

Claims (6)

1.一种服务管理方法,其特征在于,所述方法包括:1. A service management method, characterized in that the method includes: 获取待部署的各目标服务及各所述目标服务的关联关系,其中,所述关联关系包括多个地图数据结构,所述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;Obtain each target service to be deployed and the association relationship of each target service, wherein the association relationship includes multiple map data structures, and the map data structure represents the sequence of chain deployment of each target service with dependencies; 利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务;Using the preset thread group, deploy the target services of each of the map data structures according to the sequence of chain deployment of the target services that have dependencies in each of the map data structures; 所述方法还包括:The method also includes: 在满足预设备份规则时,记录各所述目标服务的部署状态;When the preset backup rules are met, record the deployment status of each target service; 当获取到部署状态恢复指令时,按照所述部署状态,继续对各所述目标服务进行部署;When the deployment status recovery instruction is obtained, continue to deploy each of the target services according to the deployment status; 所述预设线程组包括多个线程,其中,所述多个线程用于并行部署各所述地图数据结构的目标服务;The preset thread group includes multiple threads, wherein the multiple threads are used to deploy target services of each of the map data structures in parallel; 所述利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务,包括:The preset thread group is used to deploy the target services of each of the map data structures according to the sequence of chain deployment of the target services that have dependencies in each of the map data structures, including: 确定所述预设线程组中每个线程各自对应的地图数据结构;Determine the map data structure corresponding to each thread in the preset thread group; 针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务;For each map data structure, based on the sequence of chain deployment of each target service with dependencies in the map data structure, use the thread corresponding to the map data structure to deploy the target service of the map data structure; 所述针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署各所述地图数据结构的目标服务,包括:For each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, the thread corresponding to the map data structure is used to deploy the target services of each map data structure, including : 针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务;For each map data structure, based on the sequence of chain deployment of each target service with dependencies in the map data structure, determine the target service currently to be deployed in the map data structure; 若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;If the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it; 若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务;If the target service currently to be deployed in the map data structure has not been compiled and packaged, use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed; 返回上述针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务的步骤继续执行,直至各所述地图数据结构的目标服务均部署完成;Return to the above steps for each map data structure, based on the sequence of chain deployment of each target service with dependencies in the map data structure, and determine the target service currently to be deployed in the map data structure. Continue until each step is described. The target services of the map data structure have been deployed; 所述方法还包括:The method also includes: 将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置,每个目标服务均有唯一的标识;Cache the compiled and packaged target services, and store the identifiers of each cached compiled and packaged target services in designated locations. Each target service has a unique identifier; 所述若该地图数据结构中当前待部署的目标服务已经编译及打包过,包括:If the target service currently to be deployed in the map data structure has been compiled and packaged, it includes: 若所述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识;If the specified location stores the identification of the target service currently to be deployed in the map data structure; 所述若该地图数据结构中当前待部署的目标服务尚未编译及打包过,包括:If the target service currently to be deployed in the map data structure has not been compiled and packaged, it includes: 若所述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识。If the specified location does not store the identification of the target service currently to be deployed in the map data structure. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that, the method further comprises: 获取所述关联关系中地图数据结构的数量,得到目标数量;Obtain the number of map data structures in the association relationship and obtain the target number; 按照所述目标数量,建立包括所述目标数量的线程的预设线程组。According to the target number, a preset thread group including the target number of threads is established. 3.一种服务管理装置,其特征在于,所述装置包括:3. A service management device, characterized in that the device includes: 关联关系获取模块,用于获取待部署的各目标服务及各所述目标服务的关联关系,其中,所述关联关系包括多个地图数据结构,所述地图数据结构表示有依赖关系的各目标服务链式部署的先后顺序;The association relationship acquisition module is used to obtain each target service to be deployed and the association relationship of each of the target services, wherein the association relationship includes multiple map data structures, and the map data structure represents each target service with a dependency relationship. The sequence of chain deployment; 目标服务部署模块,用于利用预设线程组,按照各所述地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,部署各所述地图数据结构的目标服务;The target service deployment module is used to utilize the preset thread group to deploy the target services of each of the map data structures according to the sequence of chain deployment of the target services that have dependencies in each of the map data structures; 所述装置还包括:The device also includes: 部署状态记录模块,用于在满足预设备份规则时,记录各所述目标服务的部署状态;The deployment status recording module is used to record the deployment status of each target service when the preset backup rules are met; 部署状态恢复模块,用于当获取到部署状态恢复指令时,按照所述部署状态,继续对各所述目标服务进行部署;A deployment status recovery module, configured to continue deploying each of the target services according to the deployment status when the deployment status recovery instruction is obtained; 所述预设线程组包括多个线程,其中,所述多个线程用于并行部署各所述地图数据结构的目标服务;The preset thread group includes multiple threads, wherein the multiple threads are used to deploy target services of each of the map data structures in parallel; 所述目标服务部署模块,包括:The target service deployment module includes: 对应关系确定子模块,用于确定所述预设线程组中每个线程各自对应的地图数据结构;Correspondence determination sub-module, used to determine the map data structure corresponding to each thread in the preset thread group; 目标服务部署子模块,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,利用该地图数据结构对应的线程,部署该地图数据结构的目标服务;The target service deployment sub-module is used for each map data structure, based on the sequence of chain deployment of target services with dependencies in the map data structure, using the thread corresponding to the map data structure to deploy the map data structure target service; 所述目标服务部署子模块,包括:The target service deployment sub-module includes: 当前服务确定单元,用于针对每个地图数据结构,基于该地图数据结构中有依赖关系的各目标服务链式部署的先后顺序,确定该地图数据结构中当前待部署的目标服务;The current service determination unit is used for determining, for each map data structure, the target service currently to be deployed in the map data structure based on the sequence of chain deployment of each target service with dependencies in the map data structure; 第一部署单元,用于若该地图数据结构中当前待部署的目标服务已经编译及打包过,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The first deployment unit is used to, if the target service currently to be deployed in the map data structure has been compiled and packaged, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed and deploy it; 第二部署单元,用于若该地图数据结构中当前待部署的目标服务尚未编译及打包过,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务;The second deployment unit is used to use the thread corresponding to the map data structure to compile, package and deploy the target service currently to be deployed if the target service currently to be deployed in the map data structure has not been compiled and packaged; 返回执行单元,返回上述当前服务确定单元继续执行,直至各所述地图数据结构的目标服务均部署完成;Return to the execution unit, return to the above-mentioned current service determination unit and continue execution until the target services of each of the map data structures are deployed; 所述装置还包括:The device also includes: 数据缓存模块,用于将编译及打包后的目标服务存储进行缓存,并将各已缓存的编译及打包后的目标服务的标识存储到指定位置;The data caching module is used to cache the compiled and packaged target service storage, and store the identifier of each cached compiled and packaged target service in a designated location; 所述第一部署单元,具体用于:若所述指定位置中存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,获取编译及打包后的当前待部署的目标服务并进行部署;The first deployment unit is specifically used to: if the identification of the target service currently to be deployed in the map data structure is stored in the specified location, use the thread corresponding to the map data structure to obtain the compiled and packaged target service currently to be deployed. Deploy the target service and deploy it; 所述第二部署单元,具体用于若所述指定位置中未存储有该地图数据结构中当前待部署的目标服务的标识,利用该地图数据结构对应的线程,编译、打包及部署当前待部署的目标服务。The second deployment unit is specifically used to use the thread corresponding to the map data structure to compile, package and deploy the current target service to be deployed if the identification of the target service currently to be deployed in the map data structure is not stored in the specified location. target service. 4.根据权利要求3所述的装置,其特征在于,所述装置还包括:4. The device according to claim 3, characterized in that the device further comprises: 目标数据获取模块,用于获取所述关联关系中地图数据结构的数量,得到目标数量;The target data acquisition module is used to obtain the number of map data structures in the association relationship and obtain the target number; 线程组建立模块,用于按照所述目标数量,建立包括所述目标数量的线程的预设线程组。A thread group establishment module, configured to establish a preset thread group including the target number of threads according to the target number. 5.一种电子设备,其特征在于,包括处理器及存储器;5. An electronic device, characterized by including a processor and a memory; 所述存储器,用于存放计算机程序;The memory is used to store computer programs; 所述处理器,用于执行所述存储器上所存放的程序时,实现权利要求1-2任一所述的服务管理方法。The processor is configured to implement the service management method described in any one of claims 1-2 when executing a program stored on the memory. 6.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-2任一所述的服务管理方法。6. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the service management method of any one of claims 1-2 is implemented. .
CN201911054615.1A 2019-10-31 2019-10-31 Service management method, device, electronic equipment and storage medium Active CN110825391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911054615.1A CN110825391B (en) 2019-10-31 2019-10-31 Service management method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911054615.1A CN110825391B (en) 2019-10-31 2019-10-31 Service management method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110825391A CN110825391A (en) 2020-02-21
CN110825391B true CN110825391B (en) 2023-10-13

Family

ID=69552135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911054615.1A Active CN110825391B (en) 2019-10-31 2019-10-31 Service management method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110825391B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11467947B2 (en) * 2020-10-19 2022-10-11 EMC IP Holding Company LLC Automated mocking of computer system deployments
CN113098960A (en) * 2021-03-31 2021-07-09 北京三快在线科技有限公司 Service operation method, device, server and storage medium
CN113094052A (en) * 2021-06-09 2021-07-09 中电金信软件有限公司 Application construction method and device, computer equipment and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487881A (en) * 2015-08-20 2016-04-13 广州爱九游信息技术有限公司 Software installation package packaging method, device and system
CN106156198A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 Task executing method based on distributed data base and device
CN106547613A (en) * 2016-10-20 2017-03-29 西北工业大学 The scheduling of task handling process and fault recovery method
CN107368359A (en) * 2017-05-31 2017-11-21 杭州大搜车汽车服务有限公司 A kind of asynchronous task performs method and its storage medium, device
CN107784479A (en) * 2017-02-16 2018-03-09 平安科技(深圳)有限公司 A kind of business flow processing method and apparatus
CN107870845A (en) * 2017-10-19 2018-04-03 北京工业大数据创新中心有限公司 Towards the management method and system of micro services framework applications
CN108595180A (en) * 2018-03-14 2018-09-28 广东能龙教育股份有限公司 Micro-service automatic deployment method based on dependency chain
CN108762769A (en) * 2018-06-04 2018-11-06 万惠投资管理有限公司 Micro services application layout and dispositions method, device and terminal
CN109327490A (en) * 2017-07-31 2019-02-12 杭州华为数字技术有限公司 A kind of method and apparatus for disposing cloud service component
CN109491763A (en) * 2018-11-14 2019-03-19 北京奇艺世纪科技有限公司 A kind of system deployment method, apparatus and electronic equipment
CN109542462A (en) * 2018-10-17 2019-03-29 平安科技(深圳)有限公司 A kind of system environments dispositions method, storage medium and server
CN109558237A (en) * 2017-09-27 2019-04-02 北京国双科技有限公司 A kind of task status management method and device
CN109725785A (en) * 2018-05-08 2019-05-07 中国平安人寿保险股份有限公司 Task execution situation method for tracing, device, equipment and readable storage medium storing program for executing
CN109901926A (en) * 2019-01-25 2019-06-18 平安科技(深圳)有限公司 Method, server and storage medium based on big data behavior scheduling application task
CN110347398A (en) * 2018-04-08 2019-10-18 阿里巴巴集团控股有限公司 A kind of packaging method and device of application program
CN110391938A (en) * 2019-07-26 2019-10-29 北京百度网讯科技有限公司 Method and apparatus for deploying services

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294364A1 (en) * 2006-06-15 2007-12-20 International Business Machines Corporation Management of composite software services
US8806014B2 (en) * 2010-03-19 2014-08-12 Novell, Inc. Techniques for intelligent service deployment
US20150378701A1 (en) * 2014-06-26 2015-12-31 Microsoft Corporation Cross-environment orchestration of deployment activities
US9979779B2 (en) * 2015-08-19 2018-05-22 International Business Machines Corporation Scheduling software deployment
US10778810B2 (en) * 2016-09-25 2020-09-15 Salesforce.Com, Inc. Staging and deployment to multiple service clouds
CN110673936B (en) * 2019-09-18 2022-05-17 平安科技(深圳)有限公司 Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156198A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 Task executing method based on distributed data base and device
CN105487881A (en) * 2015-08-20 2016-04-13 广州爱九游信息技术有限公司 Software installation package packaging method, device and system
CN106547613A (en) * 2016-10-20 2017-03-29 西北工业大学 The scheduling of task handling process and fault recovery method
CN107784479A (en) * 2017-02-16 2018-03-09 平安科技(深圳)有限公司 A kind of business flow processing method and apparatus
CN107368359A (en) * 2017-05-31 2017-11-21 杭州大搜车汽车服务有限公司 A kind of asynchronous task performs method and its storage medium, device
CN109327490A (en) * 2017-07-31 2019-02-12 杭州华为数字技术有限公司 A kind of method and apparatus for disposing cloud service component
CN109558237A (en) * 2017-09-27 2019-04-02 北京国双科技有限公司 A kind of task status management method and device
CN107870845A (en) * 2017-10-19 2018-04-03 北京工业大数据创新中心有限公司 Towards the management method and system of micro services framework applications
CN108595180A (en) * 2018-03-14 2018-09-28 广东能龙教育股份有限公司 Micro-service automatic deployment method based on dependency chain
CN110347398A (en) * 2018-04-08 2019-10-18 阿里巴巴集团控股有限公司 A kind of packaging method and device of application program
CN109725785A (en) * 2018-05-08 2019-05-07 中国平安人寿保险股份有限公司 Task execution situation method for tracing, device, equipment and readable storage medium storing program for executing
CN108762769A (en) * 2018-06-04 2018-11-06 万惠投资管理有限公司 Micro services application layout and dispositions method, device and terminal
CN109542462A (en) * 2018-10-17 2019-03-29 平安科技(深圳)有限公司 A kind of system environments dispositions method, storage medium and server
CN109491763A (en) * 2018-11-14 2019-03-19 北京奇艺世纪科技有限公司 A kind of system deployment method, apparatus and electronic equipment
CN109901926A (en) * 2019-01-25 2019-06-18 平安科技(深圳)有限公司 Method, server and storage medium based on big data behavior scheduling application task
CN110391938A (en) * 2019-07-26 2019-10-29 北京百度网讯科技有限公司 Method and apparatus for deploying services

Also Published As

Publication number Publication date
CN110825391A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
CN109976761B (en) Software development kit generation method and device and terminal equipment
CN106559438B (en) A program upload method and device based on a target network platform
US8601129B2 (en) Hypervisor selection for hosting a virtual machine image
US11074154B2 (en) Identifying a source file for use in debugging compiled code
CN110825391B (en) Service management method, device, electronic equipment and storage medium
CN109408232B (en) A Componentized Bus Call Execution System Based on Transaction Process
Shahriar et al. Testing of memory leak in android applications
CN110908707B (en) Resource packaging method, device, server and storage medium
US20170123777A1 (en) Deploying applications on application platforms
US9652368B2 (en) Using linked data to determine package quality
CN106294113B (en) creation method and device based on programmable test service
CN111309402B (en) Data monitoring and application program processing method, device and equipment
CN116382874A (en) Task execution method and device based on multithreading, electronic equipment and storage medium
CN112379915B (en) Source code processing method and device
CN117762433A (en) Method for integrating OpenGauss on big data platform supporting multi-core multi-OS combined environment
CN114116509B (en) Program analysis method, device, electronic device and storage medium
US20220283789A1 (en) Methods and apparatuses for providing a function as a service platform
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
CN110134498A (en) A method and device for evaluating application compatibility
CN110297625B (en) Application processing method and device
CN110059485A (en) Privately owned API detection method, terminal and the storage medium of IOS application
US8359456B2 (en) Generating random addresses for verification of distributed computerized devices
CN114691496B (en) Unit testing method, device, computing equipment and medium
CN117348901A (en) A method and device for online updating of business programs
CN116578282A (en) Code generation method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant