WO2016045392A1 - Service deployment method, service management method and apparatus - Google Patents

Service deployment method, service management method and apparatus Download PDF

Info

Publication number
WO2016045392A1
WO2016045392A1 PCT/CN2015/078914 CN2015078914W WO2016045392A1 WO 2016045392 A1 WO2016045392 A1 WO 2016045392A1 CN 2015078914 W CN2015078914 W CN 2015078914W WO 2016045392 A1 WO2016045392 A1 WO 2016045392A1
Authority
WO
WIPO (PCT)
Prior art keywords
instance
service
node
plan
executed
Prior art date
Application number
PCT/CN2015/078914
Other languages
French (fr)
Chinese (zh)
Inventor
张毅
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016045392A1 publication Critical patent/WO2016045392A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a service deployment method, a service management method, and an apparatus.
  • Cloud computing is a service delivery and consumption model.
  • Cloud Service Provider (English: Cloud Service Provider, CSP for short) connects a large number of computing resources with the network and performs unified management, distribution and scheduling to form a huge resource pool to cloud service consumers (English: Cloud Service Consumer) , referred to as: CSC) provides services.
  • CSC Cloud Service Consumer
  • cloud resources can be expanded infinitely, with the characteristics of efficient and flexible on-demand, pay-per-use and so on.
  • the service deployment package contains at least one service deployment descriptor file.
  • the description file is suffixed with ste, and the deployment information of the application is described in Extensible Markup Language (English: Extensible Markup Language, XML for short).
  • the root element of the description file is the service template (ServiceTemplate). That is to say, the ServiceTemplate is used to completely describe the information of a service, and its sub-elements include TopologyTemplate, NodeType, NodeTemplate, RelationshipType, RelationshipTemplate, Plan (Plan). ), etc., the relationship between these elements is shown in Figure 1.
  • TopologyTemplate to depict an application topology.
  • Each node in the topology corresponds to a NodeTemplate whose type is defined by the NodeType (the type attribute of the NodeTemplate describes the NodeType corresponding to the NodeTemplate).
  • the NodeType defines the metadata of the NodeTemplate, such as properties (defined by Properties), the interface set of the node (defined by Interfaces), etc.
  • Each Interfaces can contain multiple Interfaces, and each Interface can contain multiple methods (Operation) Such as Install, Config, Stop, and Remove.
  • Each method corresponds to a method artifact (ie an executable file, such as a script file).
  • each node corresponds to a deployed artifact (can be a mirror, installable package, etc.).
  • the NodeType can be inherited, the inherited NodeType is called the parent node type, and the inherited NodeType is called the child node type.
  • the table The child node type of the NodeType contains all the attributes in its parent node type and the methods under the interface under the interface set.
  • Each NodeType is executed corresponding to one node type (English: Node Type Implementatio, referred to as NTI).
  • the type attribute of the NTI describes the NodeType corresponding to the NTI, and the NTI describes the information about the deployed product of the NodeType and the method product of all methods.
  • Each edge in the topology is a RelationshipTemplate.
  • the RelationshipTemplate is an instance of the RelationshipType that defines the starting point (defined by SourceElement) and the ending point (defined by TargetElement).
  • Each application deployment package also includes a plan, which is an executable workflow.
  • Each node in the workflow is a method defined in the NodeType, described in a standardized language, such as business process modeling and labeling. (English: Business Process Model and Notation, referred to as: BPMN) 2.0.
  • BPMN Business Process Model and Notation 2.0.
  • the prior art includes two standard plans, a deployment plan (BuildPlan) and a delete plan (TerminatePlan).
  • the ServiceTemplate can also contain custom Plan, such as configuration plan (ConfigPlan) and stop plan (StopPlan).
  • the server runs the method artifacts of each node one by one according to the definition of the plan.
  • ServiceTemplate can define rules that act on itself. First define the policy type (PolicyType) to describe the metadata of the rule, and then define its instance policy template (PolicyTemplate) in the ServiceTemplate.
  • PolicyType policy type
  • PolicyTemplate instance policy template
  • a CSC device has deployed Service A on a CSP server, which includes a web service a. Thereafter, the CSC device deploys service B on the same CSP server, and service B uses the web service a in service A in the service logic in the manner of service invocation.
  • the topology relationship between Service A and Service B is shown in Figure 2.
  • Service A is deleted or stopped, Service B's business logic will not function properly.
  • the existing method is: when the service B is deployed, the service A and the service B are merged into one large service C, as shown in FIG. 3. Because it is to be merged, in the service deployment package sent by the CSC device to the CSP server, the content in the deployment package of the service A is included, and the CSP server needs to deploy the service A once again, resulting in waste of resources.
  • the embodiment of the present application provides a service deployment method, a service management method, and a device, which are used to solve the present problem.
  • the first aspect of the present application provides a service deployment method, including:
  • the plan of the second instance ID and the first instance ID is recorded in the description file of the first service, and/or the After the correspondence between the methods of the nodes of the first instance ID, the method further includes:
  • performing the deleting the deleted plan includes:
  • the deletion plan to be executed is executed from the first method.
  • the plan of the second instance ID and the first instance ID is recorded in the description file of the first service and/or the After the correspondence between the methods of the nodes of the first instance ID, the method further includes:
  • a message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
  • a second aspect of the present application provides a service management method, including:
  • a message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
  • the third aspect of the present application provides a service management method, including:
  • performing the deleting plan after inserting the mark includes:
  • the deletion plan to be executed is executed from the first method.
  • a fourth aspect of the present application provides a service deployment apparatus, including:
  • a receiving unit configured to receive a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file of the second service;
  • a processing unit configured to: after performing the deployment plan according to the description file of the second service, acquire a second instance identifier ID of the second service that has been deployed; and determine that the description file of the second service includes The second service restricts information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID; acquiring a description file of the first service according to the first instance ID Recording the second in the description file of the first service according to the second service restriction information of executing the plan of the first instance ID of the first service and/or the method of the node of the first instance ID Correspondence relationship between the instance ID and the method of the first instance ID and/or the method of the node of the first instance ID.
  • the receiving unit is further configured to: when the processing unit records the second instance in a description file of the first service Receiving a deletion request for the second instance ID after the correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID, where the deletion request includes the second The instance ID and the deletion plan to be executed;
  • the processing unit is further configured to: obtain the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan; and determine that the second service includes the second service in a description file of the second service Method of restricting execution of a plan of the first instance ID and/or a node of the first instance ID Information; inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the first instance ID The execution limit of the method of the node; the deletion plan after inserting the tag.
  • the processing unit is specifically configured to: obtain the first information from a description file of the second service Instance ID; acquiring a description file of the first service according to the first instance ID; deleting a plan of the second instance ID and the first instance ID recorded in a description file of the first service and/or Corresponding relationship of the method of the node of the first instance ID; starting from the first method, executing the deletion plan to be executed.
  • the device further includes a sending unit
  • the receiving unit is further configured to: record, in the description file of the first service, a plan of the second instance ID and the first instance ID and/or the first instance ID in the description file of the first service After receiving the corresponding relationship of the method of the node, receiving a management request sent by the sending end for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
  • the processing unit is further configured to: acquire a description file of the first service according to the first instance ID;
  • the sending unit is configured to: send a message rejecting the method of executing the plan and/or the node to be executed to the sending end.
  • a fifth aspect of the present application provides a service management apparatus, including:
  • a receiving unit configured to receive a management request sent by the sending end for the first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
  • a processing unit configured to acquire, according to the first instance ID, a description file of the first service
  • a sending unit configured to send, to the sending end, a message rejecting a method of executing the plan and/or the node to be executed.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
  • the sixth aspect of the present application provides a service management apparatus, including:
  • a receiving unit configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
  • a processing unit configured to acquire, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes a description file of the deletion plan and a second service; and determining a description file of the second service Included in the information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID; a first method of the first node of the deletion plan Inserting a mark indicating a restriction of releasing the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; performing a delete plan after inserting the mark .
  • the processing unit is specifically configured to: acquire a description file of the first service according to the first instance ID; and delete the first service Corresponding relationship between the second instance ID recorded in the description file and the method of the first instance ID and/or the method of the node of the first instance ID; executing the execution from the first method Delete plan.
  • a seventh aspect of the present application provides a server, including:
  • a receiver configured to receive a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file of the second service;
  • a processor configured to acquire a second instance identifier ID of the second service that has been deployed after executing the deployment plan according to the description file of the second service; determining that the description file of the second service includes The second service restricts information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID; acquiring a description file of the first service according to the first instance ID Recording the second in the description file of the first service according to the second service restriction information of executing the plan of the first instance ID of the first service and/or the method of the node of the first instance ID Correspondence between the instance ID and the method of the first instance ID and/or the method of the node of the first instance ID relationship.
  • the receiver is further configured to: when the processor records the second instance in a description file of the first service Receiving a deletion request for the second instance ID after the correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID, where the deletion request includes the second The instance ID and the deletion plan to be executed;
  • the processor is further configured to: obtain the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan; and determine that the second service includes the second service in a description file of the second service Information limiting a method of executing the plan of the first instance ID and/or a node of the first instance ID; inserting a flag before the first method of the first node of the deletion plan, the flag indicating release Restriction of execution of the first instance ID by the second service and/or execution of the method of the node of the first instance ID; performing a deletion plan after inserting the tag.
  • the processor is specifically configured to: obtain the first information from a description file of the second service Instance ID; acquiring a description file of the first service according to the first instance ID; deleting a plan of the second instance ID and the first instance ID recorded in a description file of the first service and/or Corresponding relationship of the method of the node of the first instance ID; starting from the first method, executing the deletion plan to be executed.
  • the device further includes a transmitter
  • the receiver is further configured to: record, in the description file of the first service, the plan of the second instance ID and the first instance ID and/or the first instance ID in the description file of the first service After receiving the corresponding relationship of the method of the node, receiving a management request sent by the sending end for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
  • the processor is further configured to: acquire a description file of the first service according to the first instance ID;
  • the transmitter is configured to: send a message rejecting the method of executing the plan and/or the node to be executed to the sending end.
  • An eighth aspect of the present application provides a server, including:
  • a receiver configured to receive, by the sending end, a management request for a first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
  • a processor configured to acquire, according to the first instance ID, a description file of the first service
  • a transmitter configured to send a message to the sender that rejects the method of executing the plan and/or the node to be executed.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
  • a ninth aspect of the present application provides a server, including:
  • a receiver configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
  • a processor configured to acquire, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes a description file of the deletion plan and a second service; and determining a description file of the second service Included in the information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID; a first method of the first node of the deletion plan Inserting a mark indicating a restriction of releasing the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; performing a delete plan after inserting the mark .
  • the processor is specifically configured to: acquire a description file of the first service according to the first instance ID; and delete the first service Corresponding relationship between the second instance ID recorded in the description file and the method of the first instance ID and/or the method of the node of the first instance ID; executing the execution from the first method Delete plan.
  • the second service restriction execution is included in the second description file of the second service.
  • the second description file contains information that needs to restrict the execution of the plan and/or method without writing all the contents of the first service deployment package
  • the resources of the development service deployment package and the transmission resources are saved.
  • the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is written in the description file or the log file of the first service, without re-deployment
  • the content of the first service deployment package saves the server's deployment resources. Further, by limiting the method of executing the plan and/or node of the first instance ID, it can be avoided that the second service cannot be run due to execution of these plans and/or methods.
  • a tenth aspect of the present invention provides a service deployment method, including:
  • the service deployment request including information of a service deployment package of the second service
  • the service deployment package of the second service includes a deployment plan of the second service and a description file of the second service;
  • the restriction information includes information that the second service restricts execution of a plan of a first instance of the first service, and/or the second service restriction performs the Information about the method of the node of the first instance;
  • the second instance ID and the first instance are recorded in a record file of the first instance according to the restriction information Corresponding relationship of the plan ID, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically: according to the limitation Information, obtaining a first instance ID; obtaining a record file of the first instance according to the first instance ID; Recording, in the record file of the first instance, the correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, Corresponding relationship between the second instance ID and a method ID of a node of the first instance is recorded in a node record file of the first instance.
  • the method further includes: receiving an instance deletion request, the instance The deletion request includes the second instance ID and the deletion plan ID to be executed; and the service deployment package is obtained according to the second instance ID, where the service deployment package further includes the deletion corresponding to the deletion plan ID to be executed.
  • the method further includes: receiving an instance management request sent by the sender
  • the instance management request includes the first instance ID and a plan ID to be executed; acquiring a record file of the first instance according to the first instance ID; and recording according to the record file of the first instance
  • Corresponding relationship between the second instance ID and the plan ID of the first instance determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance, and sending a plan to refuse execution of the plan to be executed Message to the sender; and/or
  • the instance management request includes the first instance ID and a method ID of the node to be executed; acquiring the record file of the first instance according to the first instance ID; a record file of the first instance, acquiring a node record file of the first instance; according to the second instance ID recorded in the node record file and a method ID of the node of the first instance Corresponding relationship, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; sending a message rejecting the method of executing the node to be executed to the transmitting end; and/or
  • the instance management request includes a node ID to be executed and a method ID of the node to be executed; acquiring a node record file to be executed according to the node ID to be executed; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the method corresponding to the method ID of the node to be executed is performed by the second instance Restricting; sending a message rejecting the method of executing the node to be executed to the sender.
  • An eleventh aspect of the present invention provides an apparatus for service deployment, including: a receiving unit, configured to receive a service deployment request, where the service deployment request includes information of a service deployment package of a second service, and a processing unit configured to Obtaining, by the information of the service deployment package of the second service, a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; After the description file of the second service executes the deployment plan of the second service, acquiring a second instance identifier ID of the second service that has been deployed; determining that the description file of the second service includes restriction information, the limitation The information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or information that the second service restricts execution of a method of the node of the first instance; Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or a node record in the first instance Examples of the
  • the processing unit is configured to record the second instance in a record file of the first instance according to the restriction information Corresponding relationship between the ID and the plan ID of the first instance, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, Specifically, the first instance ID is obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID and the number are recorded in the record file of the first instance.
  • Corresponding relationship of the plan ID of an instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance The corresponding relationship of the method IDs of the nodes of the first instance.
  • the receiving The element is further configured to: record a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or record in a node record file of the first instance
  • receiving a receiving instance deletion request where the instance deletion request includes the second instance ID and a deletion plan ID to be executed
  • the processing unit is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining a description file of the second service Include the restriction information; obtain the first instance ID according to the restriction information; acquire a record file of the first instance according to the first instance ID; delete the record file of the first instance Determining a correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring a node record file of the first instance according to the record file
  • the device further includes a sending unit, where the receiving unit is further configured to: record the in the record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, and/or recording the second instance ID and the method ID of the node of the first instance in the node record file of the first instance
  • the instance management request sent by the sending end is received, where the instance management request includes the first instance identifier ID and a plan ID to be executed
  • the processing unit is further configured to: obtain, according to the first instance ID, a record file of the first instance; determining a plan ID to be executed according to a correspondence between a second instance ID of the second service recorded in the record file of the first instance and a plan ID of the first instance
  • the execution of the corresponding plan is restricted by the second instance
  • the sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
  • the receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed; the processing unit is further configured to: according to the first Obtaining, by an instance ID, a record file of the first instance; acquiring, according to the record file of the first instance, a node record file of the first instance; according to the second instance ID recorded in the node record file Corresponding relationship of the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending unit is configured to: send a rejection to execute the execution a message of the method of the node to the sender; and/or
  • the receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management is requested Determining a node ID to be executed and a method ID of a node to be executed; the processing unit is further configured to: acquire a node record file to be executed according to the node ID to be executed; according to the node record file to be executed Corresponding relationship between the recorded second instance ID and the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending The unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
  • a twelfth aspect of the present invention provides a service deployment method, including: receiving a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of a second service; and the restriction information includes the The second service restricts execution of the information of the plan of the first instance, and/or the second service limits information of the method of executing the node of the first instance; and obtains information according to the service deployment package of the second service a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; and performing the deployment of the second service according to the description file of the second service
  • the scheduling acquiring the second instance identifier ID of the second service that has been deployed and the record file of the second instance; and according to the restriction information, recording the association information in the record file of the second instance, the association
  • the information includes a first instance ID, and the second instance ID and the plan ID of the first instance are recorded in a log file of the first instance according to the restriction information Correspondence
  • the second instance ID and the first part are recorded in a record file of the first instance according to the restriction information Corresponding relationship between the plan ID of an instance, and/or a correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically: according to Determining information, obtaining a first instance ID; acquiring a record file of the first instance according to the first instance ID; recording the second instance ID and the plan ID of the first instance in the record file of the first instance Corresponding relationship, and/or obtaining a node record file of the first instance according to the record file of the first instance, and recording the second instance ID and the first instance in a node record file of the first instance Correspondence of the method ID of the node.
  • the method further includes: receiving an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed; according to the second instance ID Acquiring the record file of the second instance and the service deployment package, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; determining that the record file of the second instance includes the Correlating the information; acquiring the first instance ID according to the association information; acquiring the record file of the first instance according to the first instance ID; and deleting the record recorded in the record file of the first instance Obtaining a correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file
  • the method further includes: receiving an instance sent by the sender a management request, the instance management request includes the first instance ID and a plan ID to be executed; acquiring a record file of the first instance according to the first instance ID; recording according to a record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, determining that the execution of the plan corresponding to the plan ID to be executed is restricted by the second instance; sending the rejection to perform the execution a planned message to the sender; and/or
  • the instance management request includes the first instance ID and a method ID of the node to be executed; acquiring the record file of the first instance according to the first instance ID; a record file of the first instance, obtaining a node record file of the first instance; determining the desire according to a correspondence between the second instance ID recorded in the node record file and a method ID of a node of the first instance Execution of the method corresponding to the method ID of the executed node is restricted by the second instance; sending a message rejecting the method of executing the node to be executed to the sender; and/or
  • the instance management request includes a node ID to be executed and a method ID of the node to be executed; acquiring a node record file to be executed according to the node ID to be executed; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the method ID of the node to be executed corresponds to The execution of the method is limited by the second instance; a message is sent to the sender that rejects the method of executing the node to be executed.
  • the present invention provides a service deployment apparatus, including: a receiving unit, configured to receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of a second service;
  • the information includes information that the second service restricts execution of the plan of the first instance, and/or information that the second service restricts execution of a method of the node of the first instance;
  • a processing unit that is configured to Information about a service deployment package of the second service, where the service deployment package of the second service is obtained, where the service deployment package includes a deployment plan of the second service and a description file of the second service; After the description file executes the deployment plan of the second service, acquiring a second instance identifier ID of the second service that has been deployed and a log file of the second instance; according to the restriction information, in the second instance Recording associated information in the record file, the associated information including a first instance ID; recording the second in the record file of the first instance according to the restriction information Corresponding relationship between the instance ID and the
  • the processing unit is configured to: record, according to the restriction information, the second instance in a record file of the first instance Corresponding relationship between the ID and the plan ID of the first instance, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, Specifically, the first instance ID is obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID and the number are recorded in the record file of the first instance.
  • Corresponding relationship of the plan ID of an instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance The corresponding relationship of the method IDs of the nodes of the first instance.
  • the receiving unit is further configured to: record, in the recording file of the first instance, the second instance in the processing unit a correspondence between the ID and the plan ID of the first instance, and/or after the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance
  • the processing unit is further configured to: acquire the record of the second instance according to the second instance ID a file and the deployment package, the deployment package further including the deletion plan ID to be executed Corresponding deletion plan; determining that the record information of the second instance includes the association information; acquiring the first instance ID according to the association information; acquiring the first instance according to the first instance ID Recording a file; deleting a correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or acquiring the first according to the record file of the first instance a no
  • the apparatus further includes a transmitting unit, the receiving unit further configured to: record at the processing unit in the first instance Recording, in the file, a correspondence between the second instance ID and a plan ID of the first instance, and/or recording the second instance ID and the first instance in a node record file of the first instance
  • the processing unit is further configured to: according to the first The instance ID acquires the record file of the first instance; and determines the plan to be executed according to the correspondence between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance.
  • the execution of the plan corresponding to the ID is restricted by the second instance; the sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
  • the receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed; the processing unit is further configured to: according to the first Obtaining, by an instance ID, a record file of the first instance; acquiring, according to the record file of the first instance, a node record file of the first instance; according to the second instance ID recorded in the node record file Corresponding relationship of the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending unit is configured to: send a rejection to execute the execution a message of the method of the node to the sender; and/or
  • the receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed; the processing unit is further configured to: execute according to the Determining the node record file to be executed; determining the to-be-executed according to the correspondence between the second instance ID recorded in the node record file to be executed and the method ID of the node of the first instance The execution of the method corresponding to the method ID of the node is restricted by the second instance; the sending unit is configured to: send a message rejecting the method of executing the node to be executed to the Said sender.
  • the received service deployment request includes the restriction information, where the first service is the deployed service. Therefore, when the new service is deployed, that is, the second service, in addition to executing the deployment plan to deploy the second service, according to the restriction information, the record is recorded in the record file corresponding to the second instance of the deployed second service. Correlation information of an instance ID, and recording a correspondence relationship between the second instance and the plan of the first instance in the record file of the first instance, and/or recording the second instance and the first instance in the node record file of the first instance Correspondence of the methods of the nodes. Since only the restriction information needs to be included in the service deployment request without writing all the contents of the first service deployment package, resources for developing the service deployment package and transmission resources are saved.
  • the association information is recorded in the log file of the second instance
  • the correspondence between the plan of the second instance and the plan of the first instance and/or the method of the node of the second instance and the first instance are recorded in the log file of the first instance
  • the corresponding relationship without having to deploy the content of the deployment package of the first service again, thus saving the deployment resources of the server.
  • by limiting the method of executing the plan and/or node of the first instance it is possible to avoid the second service being inoperable due to execution of these plans and/or methods.
  • FIG. 2 is a schematic diagram of a topological relationship between service A and service B in the prior art
  • FIG. 3 is a schematic diagram of combining service A and service B into one service C in the prior art
  • FIG. 4 is a flowchart of a service deployment method in an embodiment of the present application.
  • FIG. 5 is a flowchart of a method for service management according to an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for service management in another embodiment of the present application.
  • FIG. 7 is a functional block diagram of a service deployment apparatus according to an embodiment of the present application.
  • FIG. 8 is a system block diagram of a server in an embodiment of the present application.
  • FIG. 9 is a functional block diagram of a service management apparatus according to an embodiment of the present application.
  • Figure 10 is a system block diagram of a server in another embodiment of the present application.
  • FIG. 11 is a functional block diagram of a service management apparatus in another embodiment of the present application.
  • FIG. 12 is a system block diagram of a server in still another embodiment of the present application.
  • FIG. 13 is a flowchart of a service deployment method according to an embodiment of the present application.
  • 15 is a flowchart of a method for service management in an embodiment of the present application.
  • 16 is a flowchart of a method for service deployment in an embodiment of the present application.
  • 17 is a flowchart of a method for service management in an embodiment of the present application.
  • FIG. 18 is a functional block diagram of a service deployment apparatus according to an embodiment of the present application.
  • FIG. 19 is a functional block diagram of a service deployment apparatus in still another embodiment of the present application.
  • 20 is a system block diagram of a server in an embodiment of the present application.
  • 21 is a system block diagram of a server in still another embodiment of the present application.
  • the embodiment of the present application provides a service deployment method, a service management method, and a device, which are used to solve the technical problem of merging resources caused by deployed services when deploying a new service in the prior art.
  • the second description file of the second service includes information that the second service restricts execution of the plan of the first instance ID of the first service and/or the method of the node of the first instance ID, where the first service is The deployed service.
  • the new service is deployed, that is, the second service, in addition to executing the deployment plan to deploy the second service, according to the information, the second instance is recorded in the first description file of the first service or the record file of the first instance.
  • the CSP server receives the service deployment request sent by the CSC device, and further includes, by the second service, restriction information of a method for executing the first instance of the first service and/or a method for the node of the first instance.
  • the association information is recorded in the record file of the second instance according to the restriction information, and the association information includes at least the first instance. ID; the correspondence between the plan of the second instance and the plan of the first instance and/or the method of the method of the second instance and the node of the first instance is recorded in the log file of the first instance.
  • the record file is a file that records configuration parameters, an operation status, an operation record, and the like of the instance, or a file created by the CSP server. The specific form of the record file is not limited in the present invention.
  • An embodiment of the present application provides a service deployment method.
  • FIG. 4 it is a flowchart of a service deployment method in this embodiment.
  • the method includes the following content:
  • Step 101 Receive a service deployment package of a second service, where the service deployment package includes a deployment plan and a second description file.
  • Step 102 After executing the deployment plan according to the second description file, acquiring a second instance identifier (ID) of the second service that has been deployed;
  • Step 103 Determine, in the second description file, information that includes, by the second service, a method of executing a plan of the first instance ID of the first service and/or a method of a node of the first instance ID;
  • Step 104 Acquire a first description file of the first service according to the first instance ID.
  • Step 105 Record, according to the second service, the information of the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID, and record the second instance ID and the first instance in the first description file. Correspondence between the plan of the ID and/or the method of the node of the first instance ID.
  • the method of restricting execution of the plan of the first instance ID and/or the node of the first instance ID means that the restricted plan and/or method is not allowed to be executed during the restriction execution.
  • the restriction execution period refers to a period in which the correspondence relationship between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID is recorded in the first profile.
  • the service deployment package of the first service and the second service both include two plans: a deployment plan (BuildPlan) and a delete plan (TerminatePlan).
  • a deployment plan (BuildPlan)
  • a delete plan (TerminatePlan).
  • Each node in the first service and the second service has four methods: start, configure, stop, and remove.
  • the service deployment package can also include other plans, such as a restart plan.
  • the method of each node can also be other methods, such as restarting. This application is not specifically limited.
  • the service instance ID of the first service (ServiceA) is ServiceA-1; the first description file, for example, the file name of the description file A is named ServiceA.ste.
  • the CSP server also records the mapping file A and the first instance ID, that is, the mapping relationship between ServiceA.ste and ServiceA-1. It should be noted that, when the first service is deployed on different servers, there will be different service instance IDs. In this embodiment, it is assumed that the service instance ID of the first service on the server is the first instance ID. The other service instance IDs of the first service are implemented in the same way.
  • the second service is ServiceB
  • the second description file of the second service is description file B
  • the file name of the description file B is ServiceB.ste.
  • the CSC device When the second service needs to be deployed, the CSC device sends the service deployment package of the second service to the CSP server. That is, the CSP server performs step 101 in the method of this embodiment, and receives a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file B.
  • the service deployment package may also include other plans, such as deleting the plan, restarting the plan, and the like.
  • the deployment plan After receiving the service deployment package of the second service, the deployment plan may be executed according to the second description file.
  • step 102 is performed to obtain a second instance ID of the deployed second service after the deployment is completed.
  • the execution deployment plan is well known to those skilled in the art, so it will not be described here.
  • the second instance ID is obtained, for example, the CSP server creates or allocates an instance ID to ServiceB-1 for ServiceB.
  • step 103 is performed to determine information in the second description file that includes the second service restriction method of executing the plan of the first instance ID and/or the node of the first instance ID.
  • a policy named "Limitation” may be defined in the second profile.
  • Type (PolicyType) defines a policy template (PolicyTemplate) of the policy type under the service template (ServiceTemplate) in the second description file.
  • PolicyTemplate a policy template of the policy type under the service template (ServiceTemplate) in the second description file.
  • Specific definitions of policy types and policy templates may be, but are not limited to, the following two types, which are called (I) type and (II) type, respectively.
  • the attributes "appliesToService” and "appliesFromService” in the (I) type are for the PolicyTemplate; while in the (II) type, both attributes are for the restricted plan and / Or the method of the node.
  • the type of strategy of type (I), "Limitation” can be defined by code (1).
  • the naming of the policy type can be arbitrarily set, which is not limited in this application.
  • the PolicyType name describes the name of the policy type.
  • the restriction is Limitation
  • the attribute definition element PropertiesDefinition element describes the restricted element, such as a method or plan.
  • the attribute describes the restricted method or plan, and passes
  • the Operation id gives the method name that is restricted
  • the NodeTemplateID describes the method to which the restricted method belongs. If you need to limit multiple methods, you can use the code (1) to write a multi-line Operation id and a NodeTemplateID corresponding to the Operation id.
  • the Plan id describes the plan that needs to be restricted.
  • the policy template of type (I) can be defined by code (2).
  • the PolicyTemplate id describes the id of the policy template, the name describes the name of the policy template, and the type describes the type of the policy description, for example, the type described by the code (1).
  • the attribute "appliesToService” is used to describe the requested service, and the attribute "appliesFromService” is used to describe the requested service.
  • code (1) and code (2) a general example is given, in which string represents a field. In actual use, the part of string needs to be replaced with the actual field. In the template of this embodiment, Differentiate the definition of different fields by string plus numbers.
  • the name of PolicyType is "Limitation", which means that it is a restriction on the plan of the service and / or the method of the node; it has two attributes, "LimitedOperations” and "LimitedPlans” Represents restricted methods and plans. Since each node may have the same name method, when describing the method, in addition to giving the id of the method, the ID of the corresponding NodeTemplate is also given, indicating which NodeTemplate the method belongs to. There is no plan with the same id in a service, so just give the id of the plan.
  • the embodiment of the present application uses the applicantToService to describe the ID of the requested service instance, that is, the first instance ID is the restricted service instance. At the same time, you need to add a new field to describe which service instance the PolicyTemplate comes from.
  • the present invention uses the applicantFromService to record the requested service instance ID, that is, to restrict the service instance from the second instance ID.
  • the deletion plan of ServiceA, the execution of the Stop and Remove methods of each node affect the normal operation of ServiceB, and the ServiceB deletes the plan of the ServiceA instance (TerminatePlan), and the Stop and Remove of each node.
  • the execution of the method is restricted, then the PolicyTemplate of type (I) in the description file B of ServiceB can be defined by code (3):
  • the policy template in code (3) indicates that Service B needs to restrict the execution of the first instance ID, the plan and method of ServiceA-1, and describes the id of the plan that restricts execution and the id of the method and the ID of the node template to which the method belongs.
  • the PolicyType name describes the name of the policy type.
  • the restriction is Limitation
  • the attribute definition element PropertiesDefinition element describes the restricted element, such as a square.
  • Method or plan in this example, the attribute describes the restricted method or plan, and the method name is given by the Operation id, and the NodeTemplateID describes the method to which the restricted method belongs. If you need to limit multiple methods, you can use the code (4) to write a multi-line Operation id and a NodeTemplateID corresponding to the Operation id.
  • the Plan id describes the plan that needs to be restricted. And, after each defined method and plan, describe the services to which these methods and plans belong by the attribute "appliesToService", and describe the services that limit these methods and plans through the attribute "appliesFromService”.
  • the PolicyTemplate of type (II) describing the plan of the service instance of ServiceA and the method limitation of the node in the description file B of ServiceB can be described by code (6).
  • the description file B also defines the policy type as shown in code (1) or code (4), and the restrictions on the plan and/or method of the instance whose instance ID is ServiceA-1, such as code (3) (corresponding to type I) ) and code (6) (corresponding to type II).
  • the CSP server can know, according to the second description file, that the second description file includes information that the ServiceB restricts execution of the first instance ID, the plan of the ServiceA-1 (delete plan), and the methods of all the nodes (Stop and Remove), and The first instance ID can be obtained.
  • the first instance ID is ServiceA-1.
  • step 104 is performed, that is, the first description file of the first service is obtained according to the first instance ID.
  • the CSP server queries the first description file corresponding to the first instance ID according to the mapping relationship between the recorded description file and the instance ID.
  • the description file A, ServiceA.ste is obtained.
  • step 105 is performed, according to which the second instance ID and the plan of the first instance ID and/or the node of the first instance ID are recorded in the first description file.
  • the corresponding relationship of the methods are described.
  • step 105 it may be checked whether a policy type named “Limitation” is already present in the first description file.
  • the policy template of type (I) is described by code (7).
  • the second service may be further described in the second description file to limit the execution of the plan of the first instance ID and/or the node method of the first instance ID.
  • the application does not limit this.
  • how to record the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is not limited in this application.
  • the second description file contains information on the method of the plan and/or the node that needs to be restricted, without saving all the contents in the first service deployment package, the development service is saved.
  • the first service is not deployed again.
  • the content of the deployment package saves the server's deployment resources.
  • management of the first service and the second service may be involved, and the management process for the first service will be described first.
  • FIG. 5 is a flowchart of a service management method in an embodiment of the present application, where the method includes the following content:
  • Step 201 Receive a management request sent by the sending end for the first instance ID of the first service, where the management request includes the first instance ID and a method of the plan and/or the node to be executed.
  • the CSC device wants to execute a plan or node method in the instance ServiceA-1 of ServiceA, such as a delete plan (TerminatePlan). Then, the client sends a management request to the CSP server, where the management request includes the ID of the ServiceA instance, ServiceA-1, and the node to which the plan and/or method and method to be executed belong.
  • a plan or node method in the instance ServiceA-1 of ServiceA such as a delete plan (TerminatePlan).
  • the client sends a management request to the CSP server, where the management request includes the ID of the ServiceA instance, ServiceA-1, and the node to which the plan and/or method and method to be executed belong.
  • Step 202 Acquire a first description file of the first service according to the first instance ID, where the second instance ID of the second service and the plan of the first instance ID and/or the first instance ID are recorded in the first description file. The correspondence of the methods of the nodes.
  • the corresponding relationship is specifically written in the manner described in the steps 101 to 105 in the embodiment of FIG. 4, and may be written in other manners, which is not limited in this application.
  • the process of obtaining the first description file of the first service according to the first instance ID is similar to the foregoing step 104, and therefore is not described herein again.
  • Step 203 Determine, according to the correspondence, that the execution of the plan to be executed and/or the method of the node is restricted by the second service.
  • the plan and/or method to be executed is located in the correspondence between the second instance ID and the plan and/or method in which the second instance limits the first instance ID, and if so, It can then be determined that the execution of the plan and/or the method of the node to be executed is limited by the second service. Otherwise no.
  • Step 204 If restricted, send a message rejecting the method of executing the plan and/or the node to be executed to the sender.
  • step 203 it is determined that the plan and/or method to be executed is subject to the second The restriction of the service, then a rejection message is sent to the sender.
  • the second instance ID of the second service may be included in the reject message.
  • the service instance ID ServiceB-1 of ServiceB is included to indicate that ServiceB-1 has restricted the instance ServiceA-1, thereby rejecting the request. This can ensure that the normal operation of the second service is not affected.
  • the second instance ID specifically the value of the attribute "appliesFromService” in the code (7) or the code (8), so reading the value of the attribute, the second instance ID of the second service, that is, ServiceB- 1.
  • the plan and/or method to be executed may be executed, such as deleting the plan.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method to be executed is at least one of a delete method, a restart method, and a stop method.
  • the execution of the plan and/or method to be executed is not limited by other services, if the execution of the plan and/or the method of the node is performed. If there are restrictions on other services, the request is rejected. In this way, when the first service is managed, it is guaranteed that the normal operation of the service that restricts the execution of the method of the plan and/or the node is not affected.
  • FIG. 6 a flowchart of the method for managing the second service in this embodiment is shown. The method includes the following:
  • Step 301 Receive a deletion request for a second instance ID of the second service, where the deletion request includes a second instance ID and a deletion plan to be executed.
  • the second instance ID included in the delete request is ServiceB-1.
  • the deletion plan to be executed included in the deletion request is TerminatePlan.
  • Step 302 Acquire a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan and a second description file.
  • the service deployment package is obtained through the instance ID ServiceB-1, and the deployment package includes a description file B and a TerminatePlan.
  • Step 303 Determine information that the second description file includes a method for restricting execution of the plan of the first instance ID and/or the method of the node of the first instance ID.
  • the second description file includes the code (3) and the code (6) as described above, so It is determined whether the second service has restrictions on the execution of the plans of other service instances and/or the methods of the nodes by checking whether the second description file contains such code segments. And, the restricted service instance ID can be known from the value of the attribute "appliesToService" in the code segment.
  • the first service generally refers to all services that are restricted by the second service, including, for example, ServiceA, and/or ServiceD.
  • the description file B has restrictions on the execution of the plan of the ServiceA-1 and/or the method of the node.
  • step 304 is performed: inserting a flag before the first method of the first node of the deletion plan, the flag indicating that the second service is released from the plan and/or the first instance ID A limitation of the execution of the method of a node of an instance ID.
  • a plan is a workflow consisting of methods, so insert a tag before deleting the first method of the first node of the plan.
  • AppB.Remove method of the node AppB Remove
  • AppBDb.Remove method of the node AppBDb Remove
  • the first method of the first node is AppB.Stop.
  • step 304 the deletion plan after inserting the mark is:
  • Step 305 Perform a deletion plan after inserting the mark.
  • the method when performing the deletion plan after inserting the mark, when performing the markup, specifically includes: acquiring a first instance ID from the second description file; acquiring the first service according to the first instance ID The first description file; the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and the method of the node of the first instance ID.
  • the correspondence in the first description file is deleted, thereby relieving the restriction of the second service on the planning of the first instance ID and/or the execution of the method of the node, so that the plan and/or method can be executed.
  • the first instance ID is obtained by using the second description file.
  • the instance ID of the restricted service can be obtained by using the value of the attribute “appliesToService” in the code segment in the second description file as described above.
  • the PolicyTemplate of the type "Limitation” in the description file B such as the value of the attribute "appliesToService” of the code (3)
  • the value ServiceA-1 is the service instance of ServiceA. ID.
  • the value of the attribute "appliesToService” of the Plan element and the Operation element in the PolicyTemplate (such as code 6) of the type "Limitation” in the description file B is obtained (in this embodiment, the serviceA-1) ), this value is the ID of the service instance of ServiceA.
  • the step of obtaining the first description file of the first service by using the first instance ID may also be implemented in the foregoing manner.
  • the CSP server stores the mapping relationship between the instance ID and the description file, so the mapping relationship may be obtained by querying the mapping relationship.
  • the first description file corresponding to the first instance ID may also be implemented in the foregoing manner.
  • the correspondence recorded in the first description file is deleted. Specifically, in the case of the (I) type, the PolicyTemplate of the type "Limitation” is deleted in the description file A, and the value of the attribute "appliesFromService” is ServiceB-1.
  • each method on each node in the deletion plan is executed one by one from the first method, which is a content well known to those skilled in the art, so it will not be described here. .
  • the second service can be separately managed to ensure the independence of the second service management. Increased flexibility in service management.
  • the embodiment of the present application further provides a service deployment apparatus.
  • the service deployment apparatus includes: a receiving unit 401, configured to receive a service deployment package of a second service, where the service deployment package
  • the processing unit 402 is configured to: after executing the deployment plan according to the second description file, acquire a second instance identifier ID of the second service that has been deployed; and determine that the second description file includes the second
  • the service restricts the information of the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID; acquiring the first description file of the first service according to the first instance ID; executing the first according to the second service restriction Information of a plan of the first instance ID of the service and/or a method of the node of the first instance ID, the node of the second instance ID and the plan of the first instance ID and/or the node of the first instance ID is recorded in the first profile
  • the receiving unit 401 is further configured to: after the processing unit 402 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, For the deletion request of the second instance ID, the deletion request includes the second instance ID and the deletion plan to be executed;
  • the processing unit 402 is further configured to: obtain a service deployment package according to the second instance ID, and the service deployment package further Included in the deletion plan; determining information in the second description file that includes a method for the second service to restrict execution of the plan of the first instance ID and/or the node of the first instance ID; before deleting the first method of the first node of the plan Insertion of a mark indicating a restriction to release the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; the deletion plan after the insertion of the mark is performed.
  • processing unit 402 is specifically configured to: obtain a first instance ID from the second description file; acquire the first description file according to the first instance ID; and delete the second instance ID and the first instance ID recorded in the first description file. Corresponding relationship between the method of the node of the plan and/or the first instance ID; starting from the first method, executing the deletion plan to be executed.
  • the device further includes a sending unit,
  • the receiving unit 401 is further configured to: after the processing unit 402 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, the receiving terminal sends the For the management request of the first instance ID, the management request includes a first instance ID and a method of the plan and/or node to be executed;
  • the processing unit 402 is further configured to: acquire the first description file according to the first instance ID;
  • the sending unit is configured to: send a message rejecting execution of the plan to be executed and/or the method of the node to the sending end.
  • the embodiment of the present application further includes a server.
  • FIG. 8 is a system block diagram of a server in the embodiment of the present application.
  • the server includes: a receiver 501, configured to receive a service deployment package of a second service, where the service deployment package includes a deployment plan and a second description file; and the processor 502 is configured to perform according to the second description.
  • the file executes the deployment plan, acquiring a second instance identifier ID of the second service that has been deployed; determining, in the second description file, a plan and/or a first instance ID of the second instance that restricts execution of the first instance ID of the first service Information of the method of the node; acquiring the first description file of the first service according to the first instance ID; executing the first service according to the second service restriction Recording information of the first instance ID and/or the method of the node of the first instance ID, in the first description file, recording the second instance ID with the plan of the first instance ID and/or the node of the first instance ID Corresponding relationship of the methods, and deploying the second service according to the service deployment package.
  • the receiver 501 is further configured to: after the processor 502 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, For the deletion request of the second instance ID, the deletion request includes the second instance ID and the deletion plan to be executed;
  • the processor 502 is further configured to: obtain a service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan; and determine that the second description file includes a second service restriction to execute the first instance ID and/or the first instance ID.
  • the information of the method of the node inserting a mark before deleting the first method of the first node of the plan, the mark indicating the execution of the method of releasing the plan of the first instance ID and the node of the first instance ID of the second service ID Restriction; the deletion plan after the insertion tag is executed.
  • the processor 502 is specifically configured to: obtain a first instance ID from the second description file; acquire the first description file according to the first instance ID; and delete the second instance ID and the first instance ID recorded in the first description file. Corresponding relationship between the method of the node of the plan and/or the first instance ID; starting from the first method, executing the deletion plan to be executed.
  • the device further includes a transmitter 503,
  • the receiver 501 is further configured to: after the processor 502 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, the receiving sender sends the For the management request of the first instance ID, the management request includes a first instance ID and a method of the plan and/or node to be executed;
  • the processor 502 is further configured to: acquire the first description file according to the first instance ID;
  • the sender 503 is configured to: send a message rejecting execution of the plan to be executed and/or the method of the node to the sender.
  • bus 500 can include any number of interconnected buses and bridges, and bus 500 will include one or more processors and memory 504 represented by processor 502. The various circuits of the memory are linked together. Bus 500 can also Various other circuits, such as peripherals, voltage regulators, and power management circuits, are linked together, which are well known in the art and, therefore, will not be further described herein.
  • Bus interface 505 provides an interface between bus 500 and processor 502, receiver 501, and transmitter 503. The receiver 501 and the transmitter 503 are used for data communication between the server and an external device.
  • the processor 502 is responsible for managing the bus 500 and the usual processing.
  • Memory 504 can be used to store data used by processor 502 in performing operations.
  • This server is for example a CSP server.
  • the embodiment of the present application further provides a service management apparatus.
  • the service deployment apparatus includes: a receiving unit 601, configured to receive a first instance identifier for a first service sent by a sending end. a management request of the ID, the management request includes a first instance ID and a method of the plan and/or the node to be executed; the processing unit 602 is configured to acquire the first description file of the first service according to the first instance ID; according to the first description file Corresponding relationship between the second instance ID of the second service recorded in the plan of the first instance ID and the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is performed by the second service
  • the sending unit 603 is configured to send a message to the sending end that rejects the method of executing the plan and/or the node to be executed.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method of the node to be executed is at least one of a delete method, a restart method, and a stop method.
  • the embodiment of the present application further includes a server.
  • the server includes: a receiver 701, configured to receive a management request sent by a sending end for a first instance identifier ID of the first service, where the management request includes a first instance ID and a plan to be executed and/or a method of the node; the processor 702, configured to acquire, according to the first instance ID, a first description file of the first service; according to the first record in the first description file Corresponding relationship between the second instance ID of the second service and the method of the first instance ID and/or the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is restricted by the second service; And 703, configured to send a message to the sender that rejects the method of executing the plan and/or the node to be executed.
  • the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method of the node to be executed is at least one of a delete method, a restart method, and a stop method.
  • bus 700 can include any number of interconnected buses and bridges, and bus 700 will include one or more processors and memory 704 represented by processor 702. The various circuits of the memory are linked together.
  • the bus 700 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art and, therefore, will not be further described herein.
  • Bus interface 705 provides an interface between bus 700 and processor 702, receiver 701, and transmitter 703. The receiver 701 and the transmitter 703 are used for data communication between the server and an external device.
  • the processor 702 is responsible for managing the bus 700 and the usual processing.
  • Memory 704 can be used to store data used by processor 702 in performing operations.
  • This server is for example a CSP server.
  • the embodiment of the present application further provides a service management apparatus.
  • the service deployment apparatus includes: a receiving unit 801, configured to receive a deletion request for a second instance identifier ID of the second service.
  • the deletion request includes a second instance ID and a deletion plan to be executed;
  • the processing unit 802 is configured to obtain a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan and a second description file;
  • the second description file includes information that the second service restricts execution of the plan of the first instance ID of the first service and/or the method of the node of the first instance ID; inserts the mark before deleting the first method of the first node of the plan
  • the flag indicates a restriction to release the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; the deletion plan after the insertion of the tag is performed.
  • the processing unit 802 is specifically configured to: acquire the first description file of the first service according to the first instance ID; delete the plan and/or the second instance ID and the first instance ID recorded in the first description file. Correspondence of the method of the node of the instance ID; starting from the first method, executing the deletion plan to be executed.
  • the embodiment of the present application further includes a server.
  • the server includes: a receiver 901, configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes a second instance ID and a deletion plan to be executed; the processor 902, a service deployment package for acquiring a second service according to the second instance ID, the service deployment package includes a deletion plan and a second description file; and determining, in the second description file, a plan that includes the second service restriction to execute the first instance ID of the first service And/or information of the method of the node of the first instance ID; inserting a flag before the first method of deleting the first node of the plan, the flag indicating that the second service is released from the plan and/or the first instance of the first instance ID The execution limit of the method of the node of the ID; the deletion plan after the insertion of the markup.
  • the processor 902 is specifically configured to: acquire the first description file of the first service according to the first instance ID; delete the plan and/or the first instance ID and the first instance ID recorded in the first description file. Correspondence of the method of the node of the instance ID; starting from the first method, executing the deletion plan to be executed.
  • bus 900 can include any number of interconnected buses and bridges, and bus 900 will include one or more processors and memory 904 represented by processor 902. The various circuits of the memory are linked together.
  • the bus 900 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art, and therefore, will not be further described herein.
  • Bus interface 905 provides an interface between bus 900 and processor 902, receiver 901, and transmitter 903. The receiver 901 and the transmitter 903 are used for data communication between the server and an external device.
  • Processor 902 is responsible for managing bus 900 and the usual processing.
  • Memory 904 can be used to store data used by processor 902 in performing operations.
  • This server is for example a CSP server.
  • the second description file of the second service includes information that the second service restricts the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID, where A service is a deployed service. Therefore, when the new service, that is, the second service, is deployed, in addition to executing the deployment plan to deploy the second service, the second instance ID and the first instance are recorded in the first description file of the first service according to the information. Correspondence between the plan of the ID and/or the method of the node of the first instance ID. Since the second description file contains information that needs to restrict the execution of the plan and/or method without writing all the contents of the first service deployment package, the resources of the development service deployment package and the transmission resources are saved.
  • the first service is not deployed again.
  • the content of the deployment package saves the server's deployment resources. Further, by limiting the method of executing the plan and/or node of the first instance ID, it can be avoided that the second service cannot be run due to execution of these plans and/or methods.
  • FIG. 13 is a flowchart of a method for service deployment according to another embodiment of the present invention.
  • the CSP server uses the second instance and the first instance.
  • the correspondence between the plan and/or the method of the second instance and the node of the first instance is recorded in the log file instead of the profile of the first service (i.e., the first profile in the embodiment described in FIG. 4). Since this correspondence is recorded in the log file instead of the profile of the first service, subsequent instances that are subsequently deployed for the first service will not be affected by the second instance of the second service.
  • the method provided in this embodiment includes the following steps:
  • Step 1301 Receive a service deployment request, where the service deployment request includes information about a service deployment package of the second service.
  • the information about the service deployment package of the second service may be a service deployment package identifier or a Uniform Resource Identifier (URI) of the service deployment package, and the specific form of the information of the service deployment package is not used by the present invention. limited.
  • URI Uniform Resource Identifier
  • Step 1302 Obtain a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a second service Description file
  • the service deployment package of the second service may be sent to the CSP server to be saved locally before the CSC device sends the service deployment request, or uploaded to the third-party device on the network side by the CSC device, or deployed with the service. Requests are sent to the CSP device together.
  • the description file of the second service herein is the second description file in the embodiment shown in FIG.
  • Steps 1301-1302 are mainly to send a service deployment request to the CSP server by the CSC device, and the CSP server obtains the service deployment package to be deployed according to the information of the service deployment package in the service deployment request.
  • the CSC device uploads the service deployment package, and how the CSP server obtains the service deployment package according to the information of the service deployment package, the present invention does not limit the service deployment package to be deployed.
  • Step 1303 After performing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier ID of the second service that has been deployed;
  • Step 1304 Determine that the description file of the second service includes restriction information, where the restriction information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction Information of a method of performing a node of the first instance;
  • Step 1303 and step 1304 are the same as the embodiment described in FIG. 4, and the related content refers to the method of the embodiment described in FIG. 4, and details are not described herein again.
  • Step 1305 Record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or a node in the first instance. Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the record file.
  • the first instance ID may be obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID is recorded in the record file of the first instance Corresponding relationship of the plan ID of the first instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance Correspondence with the method ID of the node of the first instance.
  • the step 1305 is different from the step 104-105 of the embodiment described in FIG. 4 in that the corresponding relationship between the second instance and the plan of the first instance and/or the second instance and the The correspondence of the methods of the nodes of the first instance is recorded in the log file, not in the profile of the first service.
  • the difference is described below with an example in the embodiment described in FIG. 4:
  • the service deployment package for the first service and the second service includes two plans: a deployment plan (BuildPlan) and a delete plan (TerminatePlan).
  • a deployment plan (BuildPlan)
  • a delete plan (TerminatePlan).
  • Each node in the first service and the second service has four methods: start, configure, stop, and remove.
  • the service deployment package can also include other plans, such as an update plan.
  • the method of each node may also be other methods, such as restarting and updating, which is not specifically limited in this application.
  • the service instance of the first service (ServiceA), that is, the first instance ID is ServiceA-1;
  • the record file of the first instance is, for example, a record file A.
  • the CSP server also records the mapping relationship between the record file A and the first instance. It should be noted that, when the first service is deployed on different servers, there will be different service instances. In this embodiment, it is assumed that the deployed instance of the first service on the server is the first instance, for the first Other service instances of the service are implemented in the same way.
  • the CSC device sends a service deployment request to the CSP server. That is, the CSP server performs the step 1301 in the method of the embodiment to receive the service deployment request, and the CSP server obtains the service deployment package of the second service according to the information of the service deployment package in the service deployment request.
  • the deployment plan and description file B are included in the service deployment package of the second service.
  • the service deployment package may also include other plans, such as deleting the plan, restarting the plan, and the like. This example does not limit the specific acquisition method of the service deployment package.
  • the deployment plan may be executed according to the description file B of the second service.
  • step 1303 is performed, and after the deployment is completed, the second instance ID of the deployed second service is obtained.
  • the execution deployment plan is well known to those skilled in the art, so it will not be described here.
  • the second instance ID is obtained, for example, the CSP server creates or allocates an instance ID to ServiceB-1 for ServiceB.
  • step 1304 it is determined that the restriction information is included in the description file of the second service.
  • Step 1304 is the same as the embodiment described in FIG. 4, and details are not described herein again.
  • step 1305 is performed, that is, the record file of the first instance is obtained according to the first instance ID.
  • the CSP server queries the record file corresponding to the first instance ID according to the mapping relationship between the recorded record file and the instance ID.
  • the log file A is obtained. According to Determining the correspondence between the second instance and the plan of the first instance in the record file A, and/or acquiring the node record file of the first instance according to the record file A, in the first Corresponding relationship between the method of the second instance and the node of the first instance is recorded in the node record file of the instance.
  • a service instance includes multiple nodes. At runtime, each instance corresponds to one record file, and each node also corresponds to one record file.
  • the restriction relationship to the plan needs to be written to the record file of the instance, and the restriction relationship of the node method needs to be written to the record file of the node.
  • the following information can be added to the LimitedPlans field of the log file A according to the code (7):
  • the record file A_1 of the node AppA is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_1 according to the code (8):
  • the record file A_2 of the node AppADb is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_2 according to the code (9):
  • the node Apache record file A_3 is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_3 according to the code (10):
  • the record file A_4 of the node MySql is obtained, and the following restriction information is added in the LimitedOperations field of the record file A_4 according to the code (11):
  • the method for describing the second service restriction execution of the first instance and/or the method for limiting the execution of the first instance may be described in the record file in other manners. This is not limited.
  • the correspondence between the second instance and the method of the first instance and/or the method of the node of the first instance ID is specifically recorded, which is not limited in this application.
  • the description file of the second service since the description file of the second service only contains the restriction information without writing all the contents in the first service deployment package, the resources for developing the service deployment package description file and the transmission resources are saved. . Moreover, as long as the corresponding relationship of the plan of the second instance and the first instance is written in the record file of the first instance of the first service, and/or the correspondence between the methods of the node of the second instance and the first instance is written It is possible to enter the node record file of the first instance of the first service without re-deploying the content in the deployment package of the first service, thereby saving the deployment resources of the server. Further, by limiting the method of executing the plan and/or node of the first instance, it is possible to avoid The execution of the method and/or the method of the node causes the second service to fail.
  • the management of the first service and the second service may be involved, and the management process for the first service will be described first.
  • FIG. 14 is a flowchart of a service management method in an embodiment of the present application, where the method includes the following content:
  • Step 1401 Receive an instance management request sent by the sending end, where the instance management request includes a first instance ID and a plan ID to be executed and/or a method ID of the node;
  • the CSC device wants to execute a plan or node method in the instance ServiceA-1 of ServiceA, such as a delete plan (TerminatePlan). Then, the instance management request is sent to the CSP server through the client, and the instance management request includes the ID of the ServiceA instance, ServiceA-1, and the plan ID, TerminatePlan, to be executed.
  • a plan or node method in the instance ServiceA-1 of ServiceA such as a delete plan (TerminatePlan).
  • the instance management request is sent to the CSP server through the client, and the instance management request includes the ID of the ServiceA instance, ServiceA-1, and the plan ID, TerminatePlan, to be executed.
  • Step 1402 Acquire a record file of the first instance according to the first instance ID, and/or obtain a node record file of the first instance according to the record file of the first instance;
  • the record of the first instance records the corresponding relationship between the second instance ID of the second service and the plan of the first instance ID, and the node record file of the first instance records the second instance ID and the first instance respectively.
  • the corresponding relationship is specifically written in the manner described in the steps 1301 to 1305 in the embodiment of FIG. 13 , and may be written in other manners, which is not limited in this application.
  • Step 1401 - Step 1402 is used to acquire a record file of the first instance and/or a node record file of the first instance.
  • step 1401 - step 1402 may also be: receiving an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method of the node to be executed. ID; acquiring a node record file to be executed according to the node ID to be executed.
  • Step 1403 Determine that execution of the plan to be executed and/or the method of the node is restricted by the second instance of the second service;
  • the node record file of the first instance determines whether the method ID of the node to be executed is located in the correspondence between the second instance ID and the method ID of the node of the first instance. If the record of the first instance records the corresponding relationship between the second instance of the second service and the plan of the first instance, determining that execution of the plan to be executed is restricted by the second instance; Or if the correspondence between the method of the second instance and the node of the first instance is recorded in the node record file of the first instance, the execution of the method for determining the node is restricted by the second instance.
  • check the record file A to determine the limit of the ServiceB instance ServiceB-1 to the TerminatePlan of the instance ServiceA-1. Specifically, it is to check the LimitedPlans field of the log file A. If "TerminatePlan” appears in “LimitedPlans”, the deletion plan is restricted to be executed, otherwise it is not.
  • checking the method of a node you first need to obtain the node record file according to the record file A, and then check the "LimitedOperations" field of each node record file separately. If the method of the node to be executed appears in "LimitedOperations", the method is restricted. It is.
  • Step 1404 Send a message rejecting the method of executing the plan and/or the node to be executed to the sender.
  • step 1403 it is determined that the plan and/or method to be executed is restricted by the second service, then a reject message is sent to the sender.
  • the second instance ID of the second service may be included in the reject message.
  • the service instance ID ServiceB-1 of ServiceB is included to indicate that ServiceB-1 has restricted the instance ServiceA-1, thereby rejecting the request. This can ensure that the normal operation of the second service is not affected.
  • the second instance ID of the second service that is, ServiceB-1
  • the plan and/or method to be executed may be executed, such as deleting the plan.
  • the plan to be executed is at least one of a delete plan, an update plan, a restart plan, and a stop plan;
  • the method to be executed is at least one of a delete method, an update method, a restart method, and a stop method.
  • the execution of the method and/or method is not limited by other services, and the request is rejected if the execution of the plan and/or the method of the node is restricted by other services. In this way, when the first service is managed, it is guaranteed that the normal operation of the service that restricts the execution of the method of the plan and/or the node is not affected.
  • the method includes the following:
  • Step 1501 Receive an instance deletion request, where the deletion request includes a second instance ID and a deletion plan ID to be executed.
  • the second instance ID included in the delete request is ServiceB-1.
  • the deletion plan to be executed included in the deletion request is TerminatePlan.
  • Step 1502 Obtain a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan corresponding to the deletion plan ID to be executed and a description file of the second service.
  • the service deployment package of the second service is obtained by using the instance ID ServiceB-1, and the service deployment package includes a description file B and a TerminatePlan.
  • Step 1503 Determine that the description file of the second service includes restriction information, where the restriction information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction execution Information about the method of the node of the first instance.
  • the description file B includes the code (3) and the code (6) as described above, so the description can be checked by Whether or not such a code segment is included in the file B is to determine whether the second service has restrictions on the execution of the plan of the other service instance and/or the method of the node.
  • the restricted service instance ID can be known from the value of the attribute "appliesToService" in the code segment.
  • the first instance of the first service generally refers to all instances that are subject to the second service restriction.
  • the description file B has restrictions on the execution of the plan of the ServiceA-1 and/or the method of the node.
  • step 1504 is performed:
  • Step 1504 Acquire the first instance ID according to the restriction information.
  • Step 1505 Obtain a record file of the first instance according to the first instance ID.
  • Step 1506 Delete the correspondence between the second instance ID in the record file of the first instance and the plan ID of the first instance, and/or obtain the first instance according to the record file of the first instance.
  • a node record file deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
  • Step 1507 Perform the deletion plan according to the description file of the second service.
  • the correspondence between the record file of the first instance and/or the record file of each node is deleted, thereby releasing the restriction of the execution of the plan of the first instance and/or the method of the node by the second instance, so that the plan And/or methods can be performed.
  • the first instance ID is obtained by using the description file of the second service.
  • the instance ID of the restricted service can be obtained by the value of the attribute “appliesToService” in the code segment in the description file as described above.
  • the step of obtaining the record file of the first instance of the first service by using the first instance ID and acquiring the record file of each node according to the record file of the first instance may also be implemented in the manner described above, and details are not described herein again.
  • Delete the correspondence recorded in the record file Specifically, it is to find whether the LimitedOlanations element of the Recorded File A of the first instance and/or the LimitedOperations element of the node record file (such as the record file A_1) contains the attribute "appliesFromService" value is ServiceB- Sub-elements of 1 and remove these sub-elements.
  • step 1506 After the content related to the deletion of the correspondence is performed in step 1506, the respective methods on the nodes in the deletion plan can be executed, which are well-known to those skilled in the art, and therefore will not be described herein.
  • the second service can be separately managed to ensure the independence of the second service management and improve The flexibility of service management.
  • FIG. 16 is a flowchart of a method for service deployment according to another embodiment of the present invention.
  • the difference between the embodiment and the embodiment shown in FIG. 4 and FIG. 13 is that, in this embodiment, the restriction information of the second service to the first instance of the first service is not recorded in the description file of the second service.
  • the CSC device carries the restriction information in the service deployment request sent to the CSP server.
  • the CSP server records the association information in the record file of the second instance, indicating that the second instance has a relationship with the first instance.
  • the restriction information recording a correspondence between the plan of the second instance and the first instance in a record file of the first instance and/or recording the record in a node record file of the first instance Correspondence between the second instance and the method of the node of the first instance.
  • the record file of the first instance and/or the node record file of the first instance are checked according to the association information. Since the restriction relationship is not recorded in the description file of the first service, when the second service is subsequently deployed, there may be other restriction relationships, such as a plan for restricting execution of the third instance of the third service to the first service. There is no limit to the plan for the first instance.
  • the method provided in this embodiment includes the following steps:
  • Step 1601 Receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of the second service, where the restriction information includes information that the second service restricts execution of the plan of the first instance, and / or the second service restricts information of a method of executing a node of the first instance;
  • Step 1602 Obtain a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service.
  • Step 1603 After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier ID of the second service that has been deployed and a record file of the second instance;
  • Step 1604 Record association information in the record file of the second instance according to the restriction information, where the association information includes a first instance ID;
  • Step 1605 Record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or a node in the first instance. Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the record file.
  • a limited policy template is included in a service template of the description file of the second service.
  • the restriction policy template combines the input variables to generate corresponding restriction policy information.
  • the present embodiment uses a YAML language to define a description file.
  • the description file B of the second service includes The following code (code 12):
  • the Limited_Policy_templates field defines a template for the restriction policy, and the rule describes the specific rules of the restriction policy, including the restriction plan (limit.plans) and the limit method (limit.operations).
  • the restriction plan function needs to specify the instance ID of the request and is
  • the restricted plan ID, limit method (limit.operations) function needs to specify the node ID and the restricted method ID.
  • the get_input description acquires the information by input, and of course, some or all of the information may be directly specified in the description file. If all the information is specified in the description file, the embodiment will be the same as the embodiment described in FIG.
  • the inputs field defines the information that needs to be obtained by input.
  • the information is included in the service deployment request, assuming that the requested service instance is ServiceA-1, the restricted plan is the termination plan (TerminatePlan), and the restricted node ID is AppA, AppADb, Apache and MySql, the restricted node method is stop, then the following restriction information can be included in the service deployment request:
  • Node_03_of_id_01 "Apache”
  • association information in the record file B of the second instance including at least the first instance ID:
  • ServiceInstance id ”ServiceA-1”>#The requested service instance ID is ServiceA-1
  • the record file B of the second example may also include information of the plan of the restricted first instance and the method of the node, and the present embodiment does not limit the content other than the first instance ID.
  • the CSP server can obtain the information that the ServiceB restricts the execution of the plan (delete plan) of the first instance ServiceA-1 of the first service and the methods (Stop and Remove) of all the nodes, and can obtain the information.
  • the first instance ID in this embodiment, the first instance ID is ServiceA-1.
  • the record file of the first instance is obtained.
  • the CSP server queries the record file corresponding to the first instance according to the mapping relationship between the recorded record file and the instance ID.
  • the log file A is obtained.
  • step 1605 the CSP server adds the following information to the LimitedPlans field of the record file A:
  • the second service restriction execution execution of the plan of the first instance and/or the node of the first instance may be described in other manners in the deployment request and description file of the second service.
  • the method is not limited in this application.
  • the correspondence between the second instance and the method of the first instance and/or the method of the node of the first instance ID is specifically recorded, which is not limited in this application.
  • the embodiment does not include the restriction information of the second service on the first instance of the first service in the description file of the second service, but sends it to the CSP server along with the service deployment request. Therefore, with respect to the service deployment method described in the embodiment described in FIG. 13, the present embodiment will have greater flexibility in deploying services.
  • the instance A of the deployed second service may be implemented, the deletion plan of the instance B of the first service is restricted; the instance C of the deployed second service only limits the deletion plan of the instance D of the first service, without limiting the first The deletion plan for instance B of the service.
  • FIG. 17 is a flowchart of the method for managing the second service in this embodiment. The method includes the following:
  • Step 1701 Receive an instance deletion request, where the instance deletion request includes a second instance identifier ID and a deletion plan ID to be executed;
  • Step 1702 Obtain a record file of the corresponding second instance and the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed.
  • Step 1703 Determine that the record file of the second instance includes association information, where the association information includes a first instance ID.
  • Step 1704 Acquire a record file of the first instance according to the first instance ID.
  • Step 1705 Delete the correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or obtain the first according to the record file of the first instance.
  • a node record file of the instance deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
  • Step 1706 Perform the deletion plan.
  • the second service can be separately managed to ensure the independence of the second service management and improve The flexibility of service management.
  • the embodiment of the present application further provides a service deployment apparatus.
  • the service deployment apparatus includes: a receiving unit 1801, configured to receive a service deployment request, where The service deployment request includes the information of the service deployment package of the second service; the processing unit 1802 is configured to acquire the service deployment package of the second service according to the information of the service deployment package of the second service, where the service deployment The package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring the second of the second service that has been deployed An instance identifier ID; determining that the description file of the second service includes restriction information, the restriction information including information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service Restricting information of a method of executing the node of the first instance; recording the second instance ID in a log file of the first instance according to the restriction information Program
  • the processing unit 1802 is configured to record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a log file of the first instance, and/or The corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, specifically: acquiring the first instance ID according to the restriction information; An instance ID, obtaining a record file of the first instance; recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or according to the first instance Recording file, obtaining a node record file of the first instance, and recording, in the node record file of the first instance, a correspondence between the second instance ID and a method ID of the node of the first instance system.
  • the receiving unit 1801 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the first instance After the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file, the receiving instance delete request is received, and the instance delete request includes the second instance ID and is to be executed.
  • Delete plan ID
  • the processing unit 1802 is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining the second service
  • the description file includes the restriction information; the first instance ID is obtained according to the restriction information; the record file of the first instance is acquired according to the first instance ID; and the record file of the first instance is deleted. Corresponding relationship between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, deleting the first instance Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance; the deletion plan is executed according to the description file of the second service.
  • the device further includes a sending unit 1803,
  • the receiving unit 1801 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or a node in the first instance After the record file records the correspondence between the second instance ID and the method ID of the node of the first instance, receiving an instance management request sent by the sending end, where the instance management request includes the first instance identifier ID and Plan ID of execution;
  • the processing unit 1802 is further configured to: acquire, according to the first instance ID, a record file of the first instance; according to the second instance ID of the second service recorded in the record file of the first instance, Corresponding relationship of the plan ID of the first instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance,
  • the sending unit 1803 is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
  • the receiving unit 1801 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
  • the processing unit 1802 is further configured to: acquire the record file of the first instance according to the first instance ID; acquire the node record file of the first instance according to the record file of the first instance; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the execution of the method corresponding to the ID of the method to be executed is performed by the second instance limit;
  • the sending unit 1803 is configured to: send a message rejecting the method of executing the node to be executed to the sending end; and/or
  • the receiving unit 1801 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
  • the processing unit 1802 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the first instance Corresponding relationship of the method ID of the node, determining that the method corresponding to the method ID of the node to be executed is restricted by the second instance;
  • the sending unit 1803 is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
  • the embodiment of the present application further provides a service deployment apparatus.
  • the service deployment apparatus includes: a receiving unit 1901, configured to receive a service deployment request, where The service deployment request includes information and restriction information of the service deployment package of the second service; the restriction information includes information that the second service restricts execution of the plan of the first instance, and/or the second service restriction execution The information about the method of the node of the first instance; the processing unit 1902, configured to acquire the service deployment package of the second service according to the information of the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed And a record file of the second instance; according to the restriction information, the association information is recorded in the record file of the second instance, the association information including the first instance I D: recording, according to
  • the processing unit 1902 is configured to record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a log file of the first instance, and/or The corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, specifically: acquiring the first instance ID according to the restriction information; An instance ID, obtaining a record file of the first instance; recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or according to the first instance a record file, the node record file of the first instance is obtained, and the corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance.
  • the receiving unit 1901 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the first instance After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file, an instance delete request is received, where the instance delete request includes the second instance ID and the Delete the plan ID;
  • the processing unit 1902 is further configured to acquire the record file of the second instance according to the second instance ID, determine that the record file of the second instance includes the association information, and acquire the location according to the association information. Deleting a first instance ID; acquiring a record file of the first instance according to the first instance ID; deleting the second instance ID of the record file of the first instance and a plan ID of the first instance Corresponding relationship, and/or acquiring the node record file of the first instance according to the record file of the first instance, deleting the second instance ID and the number recorded in the node record file of the first instance Corresponding relationship of the method ID of the node of the instance; executing the deletion plan corresponding to the deletion plan ID to be executed.
  • the device further includes a sending unit 1903,
  • the receiving unit 1901 is further configured to: record, in the recording file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the recording file After the corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, the instance management request sent by the sending end is received, where the instance management request includes the first The instance ID and the plan ID to be executed;
  • the processing unit 1902 is further configured to: acquire the record file of the first instance according to the first instance ID; and use the second instance ID and the first record recorded in the record file of the first instance Corresponding relationship of the plan ID of the instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance;
  • the sending unit 1903 is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
  • the receiving unit 1901 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
  • the processing unit 1902 is further configured to: acquire a record file of the first instance according to the first instance ID; acquire a node record file of the first instance according to the record file of the first instance; and record according to the node Corresponding relationship between the second instance ID recorded in the file and the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance;
  • the sending unit 1903 is configured to: send a message rejecting a method of executing the node to be executed to the sending end; and/or
  • the receiving unit 1901 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
  • the processing unit 1902 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the first instance Corresponding relationship of the method ID of the node, determining that the method corresponding to the method ID of the node to be executed is restricted by the second instance;
  • the sending unit 1903 is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
  • the embodiment of the present application further includes a server.
  • the server includes: a receiver 2001, configured to receive a service deployment request, the service deployment request includes information of a service deployment package of the second service, and a processor 2002, configured to be used according to the second service Information about the service deployment package, where the service deployment package of the second service is obtained, where the service deployment package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier of the second service that has been deployed Determining, in the description file of the second service, restriction information, the restriction information including information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction execution The information about the method of the node of the first instance; the correspondence between
  • the receiver 2001 is further configured to receive an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed.
  • the processor 2002 is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining a description file of the second service.
  • the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed.
  • the processor 2002 is further configured to acquire, according to the first instance ID, a record file of the first instance; according to the second instance ID recorded in the record file of the first instance and the plan of the first instance The correspondence of the IDs determines that the execution of the plan corresponding to the plan ID to be executed is limited by the second instance.
  • the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
  • the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed.
  • the processor 2002 is further configured to acquire the record file of the first instance according to the first instance ID, acquire a node record file of the first instance according to the record file of the first instance, and record the file according to the node record Corresponding relationship between the second instance ID and the method ID of the node of the first instance, determining that the execution is to be performed The execution of the method corresponding to the method ID of the node is limited by the second instance.
  • the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
  • the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed.
  • the processor 2002 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and a method of the node of the first instance For the correspondence of the IDs, the execution of the method corresponding to the method ID of the node to be executed is determined by the second instance.
  • the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
  • bus 2000 can include any number of interconnected buses and bridges, and bus 2000 will include one or more processors and memory 2004 represented by processor 2002.
  • the various circuits of the memory are linked together.
  • the bus 2000 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is well known in the art and, therefore, will not be further described herein.
  • the bus interface 2005 provides an interface between the bus 2000 and the processor 2002, the receiver 2001, and the transmitter 2003.
  • the receiver 2001 and the transmitter 2003 are used for data communication between the server and an external device.
  • the processor 2002 is responsible for managing the bus 2000 and the usual processing.
  • the memory 2004 can be used to store data used by the processor 2002 when performing operations.
  • This server is for example a CSP server.
  • the embodiment of the present application further includes a server.
  • FIG. 21 it is a system block diagram of a server in the embodiment of the present application.
  • the server includes: a receiver 2101, configured to receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of the second service; and the restriction information includes the second The service restricts execution of information of the plan of the first instance, and/or the second service limits information of a method of executing the node of the first instance.
  • a processor 2102 configured to be used according to the service part of the second service And obtaining, by the package information, a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; and executing the file according to the description file of the second service After the deployment plan of the second service is performed, acquiring a second instance identifier ID of the second service that has been deployed and a log file of the second instance; and recording in the log file of the second instance according to the restriction information Correlation information, the association information includes a first instance ID, and according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance is recorded in a record file of the first instance, and And mapping the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance.
  • the receiver 2101 is further configured to receive an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed.
  • the processor 2102 is further configured to acquire the record file of the second instance and the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; Determining, by the record file of the second instance, the association information; acquiring the first instance ID according to the association information; acquiring the record file of the first instance according to the first instance ID; Corresponding relationship between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance, and/or acquiring the node of the first instance according to the record file of the first instance Recording a file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance; performing the deleting according to the description file of the second service plan.
  • the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed.
  • the processor 2102 is further configured to acquire the record file of the first instance according to the first instance ID; the second instance ID recorded in the record file of the first instance and the plan ID of the first instance Corresponding relationship, determining that the execution of the plan corresponding to the plan ID to be executed is limited by the second instance.
  • the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
  • the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed.
  • the processor 2102 is further configured to acquire the record file of the first instance according to the first instance ID, acquire a node record file of the first instance according to the record file of the first instance, and record the file according to the node record Corresponding relationship between the second instance ID and the method ID of the node of the first instance, determining that the execution is to be performed The execution of the method corresponding to the method ID of the node is limited by the second instance.
  • the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
  • the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed.
  • the processor 2102 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and a method of the node of the first instance For the correspondence of the IDs, the execution of the method corresponding to the method ID of the node to be executed is determined by the second instance.
  • the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
  • bus 2100 can include any number of interconnected buses and bridges, and bus 2100 will include one or more processors and memory 2104 represented by processor 2102.
  • the various circuits of the memory are linked together.
  • the bus 2100 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art and, therefore, will not be further described herein.
  • the bus interface 2105 provides an interface between the bus 2100 and the processor 2102, the receiver 2101, and the transmitter 2103.
  • the receiver 2101 and the transmitter 2103 are used for data communication between the server and an external device.
  • the processor 2102 is responsible for managing the bus 2100 and the usual processing.
  • the memory 2104 can be used to store data used by the processor 2002 when performing operations.
  • This server is for example a CSP server.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the present application is made with reference to a method, a device (system), and a computer program according to an embodiment of the present application.
  • the flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

A service deployment method, a service management method and an apparatus. The service deployment method comprises: receiving a service deployment package of a second service, the service deployment package comprising a deployment plan and a second description file (101); acquiring a second instance ID of the deployed second service after the deployment plan is executed according to the second description file (102); determining that the second description file includes information indicating that the second service restricts the execution of a plan for a first instance ID of a first service and/or a method for a node of the first instance ID (103); acquiring a first description file of the first service according to the first instance ID (104); and recording a correspondence between the second instance ID and the plan for the first instance ID and/or the method for the node of the first instance ID in the first description file according to the information indicating that the second service restricts the execution of the plan for the first instance ID of the first service and/or the method for the node of the first instance ID (105).

Description

一种服务部署方法、服务管理方法及装置Service deployment method, service management method and device 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种服务部署方法、服务管理方法及装置。The present application relates to the field of computer technologies, and in particular, to a service deployment method, a service management method, and an apparatus.
背景技术Background technique
云计算是一种服务的交付和消费模式。云服务供应商(英文:Cloud Service Provider,简称:CSP)将大量计算资源用网络连接起来并进行统一的管理、分配和调度,构成一个巨大的资源池向云服务消费者(英文:Cloud Service Consumer,简称:CSC)提供服务。对CSC而言,云资源可无限扩展,具有按需索取、按使用付费等高效灵活的特点。Cloud computing is a service delivery and consumption model. Cloud Service Provider (English: Cloud Service Provider, CSP for short) connects a large number of computing resources with the network and performs unified management, distribution and scheduling to form a huge resource pool to cloud service consumers (English: Cloud Service Consumer) , referred to as: CSC) provides services. For CSC, cloud resources can be expanded infinitely, with the characteristics of efficient and flexible on-demand, pay-per-use and so on.
现有技术中,部署一个服务所需的全部信息都在一个名为云服务档案(英文:Cloud Service Archive,简称:CSAR)的服务部署包中描述。服务部署包至少包含一个服务部署描述文件。该描述文件的后缀为ste,以可扩展标记语言(英文:Extensible Markup Language,简称:XML)描述应用的部署信息。该描述文件的根元素为服务模板(ServiceTemplate)。也就是说使用ServiceTemplate来完整描述一个服务的信息,其子元素包括拓扑模板(TopologyTemplate)、节点类型(NodeType)、节点模板(NodeTemplate)、关系类型(RelationshipType)、关系模板(RelationshipTemplate)、计划(Plan)等,这些元素之间的关系如图1所示。In the prior art, all the information required to deploy a service is described in a service deployment package called Cloud Service Archive (CSAR). The service deployment package contains at least one service deployment descriptor file. The description file is suffixed with ste, and the deployment information of the application is described in Extensible Markup Language (English: Extensible Markup Language, XML for short). The root element of the description file is the service template (ServiceTemplate). That is to say, the ServiceTemplate is used to completely describe the information of a service, and its sub-elements include TopologyTemplate, NodeType, NodeTemplate, RelationshipType, RelationshipTemplate, Plan (Plan). ), etc., the relationship between these elements is shown in Figure 1.
如图1所示,现有技术使用TopologyTemplate来描绘一个应用拓扑。拓扑中每个节点都对应一个NodeTemplate,其类型由NodeType定义(NodeTemplate的type属性描述了该NodeTemplate对应的NodeType)。NodeType定义了NodeTemplate的元数据,如属性(用Properties定义)、该节点的接口集(用Interfaces定义)等,每个Interfaces可包含多个Interface,而每个Interface中可包含多个方法(Operation),比如安装(Install)、配置(Config)、停止(Stop)和移除(Remove)等。每个方法对应一个方法制品(即一个可执行文件,如脚本文件)。同时,每个节点都对应一个部署制品(可以是一个镜像、可安装的软件包等)。NodeType可以被继承,被继承的NodeType称为父节点类型,而继承的NodeType则被称为子节点类型。一旦一个NodeType被继承,则表 明该NodeType的子节点类型包含其父节点类型中所有的属性和接口集下的接口下的方法。As shown in Figure 1, the prior art uses TopologyTemplate to depict an application topology. Each node in the topology corresponds to a NodeTemplate whose type is defined by the NodeType (the type attribute of the NodeTemplate describes the NodeType corresponding to the NodeTemplate). The NodeType defines the metadata of the NodeTemplate, such as properties (defined by Properties), the interface set of the node (defined by Interfaces), etc. Each Interfaces can contain multiple Interfaces, and each Interface can contain multiple methods (Operation) Such as Install, Config, Stop, and Remove. Each method corresponds to a method artifact (ie an executable file, such as a script file). At the same time, each node corresponds to a deployed artifact (can be a mirror, installable package, etc.). The NodeType can be inherited, the inherited NodeType is called the parent node type, and the inherited NodeType is called the child node type. Once a NodeType is inherited, the table The child node type of the NodeType contains all the attributes in its parent node type and the methods under the interface under the interface set.
每个NodeType对应一个节点类型执行(英文:Node Type Implementatio,简称:NTI)。NTI的type属性描述了该NTI对应的NodeType,NTI描述了该NodeType的部署制品和所有方法的方法制品的信息。Each NodeType is executed corresponding to one node type (English: Node Type Implementatio, referred to as NTI). The type attribute of the NTI describes the NodeType corresponding to the NTI, and the NTI describes the information about the deployed product of the NodeType and the method product of all methods.
拓扑中的每条边都是一个RelationshipTemplate。RelationshipTemplate是RelationshipType的一个实例,定义了该边的起点(用SourceElement定义)和终点(用TargetElement定义)。Each edge in the topology is a RelationshipTemplate. The RelationshipTemplate is an instance of the RelationshipType that defines the starting point (defined by SourceElement) and the ending point (defined by TargetElement).
每个应用部署包还包括计划(Plan),计划是可执行的工作流,工作流中的每个节点都是NodeType中定义的方法,用标准化语言描述,标准化语言例如是业务流程建模与标注(英文:Business Process Model and Notation,简称:BPMN)2.0。目前,现有技术中包含两个标准Plan,部署计划(BuildPlan)和删除计划(TerminatePlan)。同时,ServiceTemplate还能包含自定义的Plan,比如配置计划(ConfigPlan)和停止计划(StopPlan)等。执行计划时,服务器根据计划的定义按序逐个运行各节点的方法制品。Each application deployment package also includes a plan, which is an executable workflow. Each node in the workflow is a method defined in the NodeType, described in a standardized language, such as business process modeling and labeling. (English: Business Process Model and Notation, referred to as: BPMN) 2.0. Currently, the prior art includes two standard plans, a deployment plan (BuildPlan) and a delete plan (TerminatePlan). At the same time, the ServiceTemplate can also contain custom Plan, such as configuration plan (ConfigPlan) and stop plan (StopPlan). When the plan is executed, the server runs the method artifacts of each node one by one according to the definition of the plan.
另外,ServiceTemplate能够定义作用于自身的规则。首先定义策略类型(PolicyType)以描述规则的元数据,然后在ServiceTemplate中定义其实例策略模板(PolicyTemplate)。In addition, the ServiceTemplate can define rules that act on itself. First define the policy type (PolicyType) to describe the metadata of the rule, and then define its instance policy template (PolicyTemplate) in the ServiceTemplate.
在现有技术中,假设某CSC设备在某CSP服务器上已经部署了服务A,其中包含一个网页服务a。之后,该CSC设备在同一个CSP服务器上部署服务B,服务B在业务逻辑上以服务调用的方式使用了服务A中的网页服务a。服务A和服务B的拓扑关系如图2所示。In the prior art, it is assumed that a CSC device has deployed Service A on a CSP server, which includes a web service a. Thereafter, the CSC device deploys service B on the same CSP server, and service B uses the web service a in service A in the service logic in the manner of service invocation. The topology relationship between Service A and Service B is shown in Figure 2.
显然,若服务A被删除或者被停止,那么服务B的业务逻辑将无法正常运行。为了解决该技术问题,现有方式为:在部署服务B时,将服务A和服务B合并成一个大的服务C,如图3所示。因为要合并,所以在CSC设备向CSP服务器发送的服务部署包中,就要包含服务A的部署包中的内容,而CSP服务器也要再部署一次服务A,造成了资源浪费。Obviously, if Service A is deleted or stopped, Service B's business logic will not function properly. In order to solve the technical problem, the existing method is: when the service B is deployed, the service A and the service B are merged into one large service C, as shown in FIG. 3. Because it is to be merged, in the service deployment package sent by the CSC device to the CSP server, the content in the deployment package of the service A is included, and the CSP server needs to deploy the service A once again, resulting in waste of resources.
发明内容Summary of the invention
本申请实施例提供一种服务部署方法、服务管理方法及装置,用以解决现 有技术中部署新服务时合并已部署的服务导致的资源浪费的技术问题。The embodiment of the present application provides a service deployment method, a service management method, and a device, which are used to solve the present problem. There is a technical problem of merging resource waste caused by deployed services when deploying new services in the technology.
本申请第一方面提供了一种服务部署方法,包括:The first aspect of the present application provides a service deployment method, including:
接收第二服务的服务部署包,其中,所述服务部署包包括部署计划和第二服务的描述文件;Receiving a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file of the second service;
在根据所述第二服务的描述文件执行所述部署计划后,获取已被部署的所述第二服务的第二实例标识ID;After executing the deployment plan according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed;
确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the description file of the second service, information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID;
根据所述第一实例ID,获取所述第一服务的描述文件;Obtaining, according to the first instance ID, a description file of the first service;
根据所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息,在所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系。Recording, according to the second service, information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID, recording the second instance in a description file of the first service A correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID.
结合第一方面,在第一方面的第一种可能的实现方式中,在所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,所述方法还包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the plan of the second instance ID and the first instance ID is recorded in the description file of the first service, and/or the After the correspondence between the methods of the nodes of the first instance ID, the method further includes:
接收针对所述第二实例ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;Receiving a deletion request for the second instance ID, where the deletion request includes the second instance ID and a deletion plan to be executed;
根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述删除计划;Obtaining the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan;
确定所述第二服务的描述文件中包括所述第二服务限制执行所述第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the description file of the second service, information that the second service restricts execution of a plan of the first instance ID and/or a method of a node of the first instance ID;
在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;Inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the node of the first instance ID Restrictions on the execution of the method;
执行插入所述标记后的删除计划。Perform the delete plan after inserting the tag.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,执行插入所述标记后的删除计划,包括:In conjunction with the first possible implementation of the first aspect, in a second possible implementation of the first aspect, performing the deleting the deleted plan includes:
从所述第二服务的描述文件中获取所述第一实例ID;Obtaining the first instance ID from a description file of the second service;
根据所述第一实例ID获取所述第一服务的描述文件; Obtaining, according to the first instance ID, a description file of the first service;
删除所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;Deleting a correspondence between the second instance ID recorded in the description file of the first service and a method of the first instance ID and a method of a node of the first instance ID;
从所述第一方法开始执行所述欲执行的删除计划。The deletion plan to be executed is executed from the first method.
结合第一方面,在第一方面的第三种可能的实现方式中,在所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,所述方法还包括:In conjunction with the first aspect, in a third possible implementation of the first aspect, the plan of the second instance ID and the first instance ID is recorded in the description file of the first service and/or the After the correspondence between the methods of the nodes of the first instance ID, the method further includes:
接收发送端发送的针对所述第一实例ID的管理请求,所述管理请求包括所述第一实例ID和欲执行的计划和/或节点的方法;Receiving, by the sending end, a management request for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
根据所述第一实例ID获取所述第一服务的描述文件;Obtaining, according to the first instance ID, a description file of the first service;
根据所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining, according to the correspondence between the second instance ID recorded in the description file of the first service and the method of the first instance ID and the method of the node of the first instance ID, The execution of the method of the plan and/or the node is limited by the second service;
发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。A message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
本申请第二方面提供一种服务管理方法,包括:A second aspect of the present application provides a service management method, including:
接收发送端发送的针对第一服务的第一实例标识ID的管理请求,所述管理请求包括所述第一实例ID以及欲执行的计划和/或节点的方法;Receiving, by the sending end, a management request for a first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
根据所述第一实例ID获取所述第一服务的描述文件;Obtaining, according to the first instance ID, a description file of the first service;
根据所述第一服务的描述文件中记录的第二服务的第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the desire according to a correspondence between a second instance ID of the second service recorded in the description file of the first service and a method of the first instance ID and a method of the node of the first instance ID Execution of the executed plan and/or method of the node is restricted by the second service;
发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。A message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
结合第二方面,在第二方面的第一种可能的实现方式中,所述欲执行的计划为删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。With reference to the second aspect, in a first possible implementation manner of the second aspect, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
本申请第三方面提供一种服务管理方法,包括:The third aspect of the present application provides a service management method, including:
接收针对第二服务的第二实例标识ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;Receiving a deletion request for a second instance identification ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
根据所述第二实例ID获取所述第二服务的服务部署包,所述服务部署包包括所述删除计划和第二服务的描述文件;Obtaining, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes a description file of the deletion plan and a second service;
确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的 第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the description file of the second service, that the second service restricts execution of the first service Information of a plan of the first instance ID and/or a method of a node of the first instance ID;
在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;Inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the node of the first instance ID Restrictions on the execution of the method;
执行插入所述标记后的删除计划。Perform the delete plan after inserting the tag.
结合第三方面,在第三方面的第一种可能的实现方式中,执行插入所述标记后的删除计划,包括:With reference to the third aspect, in a first possible implementation manner of the third aspect, performing the deleting plan after inserting the mark includes:
根据所述第一实例ID获取所述第一服务的描述文件;Obtaining, according to the first instance ID, a description file of the first service;
删除所述第一服务的描述文件中记录的所述第二实例ID和所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;Deleting a correspondence between the second instance ID recorded in the description file of the first service and a method of the first instance ID and/or a method of a node of the first instance ID;
从所述第一方法开始执行所述欲执行的删除计划。The deletion plan to be executed is executed from the first method.
本申请第四方面提供一种服务部署装置,包括:A fourth aspect of the present application provides a service deployment apparatus, including:
接收单元,用于接收第二服务的服务部署包,其中,所述服务部署包包括部署计划和第二服务的描述文件;a receiving unit, configured to receive a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file of the second service;
处理单元,用于在根据所述第二服务的描述文件执行所述部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;根据所述第一实例ID,获取所述第一服务的描述文件;根据所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息,在所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系。a processing unit, configured to: after performing the deployment plan according to the description file of the second service, acquire a second instance identifier ID of the second service that has been deployed; and determine that the description file of the second service includes The second service restricts information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID; acquiring a description file of the first service according to the first instance ID Recording the second in the description file of the first service according to the second service restriction information of executing the plan of the first instance ID of the first service and/or the method of the node of the first instance ID Correspondence relationship between the instance ID and the method of the first instance ID and/or the method of the node of the first instance ID.
结合第四方面,在第四方面的第一种可能的实现方式中,所述接收单元还用于:在所述处理单元在所述所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收针对所述第二实例ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the receiving unit is further configured to: when the processing unit records the second instance in a description file of the first service Receiving a deletion request for the second instance ID after the correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID, where the deletion request includes the second The instance ID and the deletion plan to be executed;
所述处理单元还用于:根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述删除计划;确定所述第二服务的描述文件中包括所述第二服务限制执行所述第一实例ID的计划和/或所述第一实例ID的节点的方法 的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。The processing unit is further configured to: obtain the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan; and determine that the second service includes the second service in a description file of the second service Method of restricting execution of a plan of the first instance ID and/or a node of the first instance ID Information; inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the first instance ID The execution limit of the method of the node; the deletion plan after inserting the tag.
结合第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述处理单元具体用于:从所述第二服务的描述文件中获取所述第一实例ID;根据所述第一实例ID获取所述第一服务的描述文件;删除所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the processing unit is specifically configured to: obtain the first information from a description file of the second service Instance ID; acquiring a description file of the first service according to the first instance ID; deleting a plan of the second instance ID and the first instance ID recorded in a description file of the first service and/or Corresponding relationship of the method of the node of the first instance ID; starting from the first method, executing the deletion plan to be executed.
结合第四方面,在第四方面的第三种可能的实现方式中,所述装置还包括发送单元,With reference to the fourth aspect, in a third possible implementation manner of the fourth aspect, the device further includes a sending unit,
所述接收单元还用于:在所述处理单元在所述所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收发送端发送的针对所述第一实例ID的管理请求,所述管理请求包括所述第一实例ID和欲执行的计划和/或节点的方法;The receiving unit is further configured to: record, in the description file of the first service, a plan of the second instance ID and the first instance ID and/or the first instance ID in the description file of the first service After receiving the corresponding relationship of the method of the node, receiving a management request sent by the sending end for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
所述处理单元还用于:根据所述第一实例ID获取所述第一服务的描述文件;The processing unit is further configured to: acquire a description file of the first service according to the first instance ID;
根据所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining, according to the correspondence between the second instance ID recorded in the description file of the first service and the method of the first instance ID and the method of the node of the first instance ID, The execution of the method of the plan and/or the node is limited by the second service;
所述发送单元用于:发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。The sending unit is configured to: send a message rejecting the method of executing the plan and/or the node to be executed to the sending end.
本申请第五方面提供一种服务管理装置,包括:A fifth aspect of the present application provides a service management apparatus, including:
接收单元,用于接收发送端发送的针对第一服务的第一实例标识ID的管理请求,所述管理请求包括所述第一实例ID以及欲执行的计划和/或节点的方法;a receiving unit, configured to receive a management request sent by the sending end for the first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
处理单元,用于根据所述第一实例ID获取所述第一服务的描述文件;a processing unit, configured to acquire, according to the first instance ID, a description file of the first service;
根据所述第一服务的描述文件中记录的第二服务的第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制; Determining the desire according to a correspondence between a second instance ID of the second service recorded in the description file of the first service and a method of the first instance ID and a method of the node of the first instance ID Execution of the executed plan and/or method of the node is restricted by the second service;
发送单元,用于发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。And a sending unit, configured to send, to the sending end, a message rejecting a method of executing the plan and/or the node to be executed.
结合第五方面,在第五方面的第一种可能的实现方式中,所述欲执行的计划为删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
本申请第六方面提供一种服务管理装置,包括:The sixth aspect of the present application provides a service management apparatus, including:
接收单元,用于接收针对第二服务的第二实例标识ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;a receiving unit, configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
处理单元,用于根据所述第二实例ID获取所述第二服务的服务部署包,所述服务部署包包括所述删除计划和第二服务的描述文件;确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。a processing unit, configured to acquire, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes a description file of the deletion plan and a second service; and determining a description file of the second service Included in the information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID; a first method of the first node of the deletion plan Inserting a mark indicating a restriction of releasing the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; performing a delete plan after inserting the mark .
结合第六方面,在第六方面的第一种可能的实现方式中,所述处理单元具体用于:根据所述第一实例ID获取所述第一服务的描述文件;删除所述第一服务的描述文件中记录的所述第二实例ID和所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。With reference to the sixth aspect, in a first possible implementation manner of the sixth aspect, the processing unit is specifically configured to: acquire a description file of the first service according to the first instance ID; and delete the first service Corresponding relationship between the second instance ID recorded in the description file and the method of the first instance ID and/or the method of the node of the first instance ID; executing the execution from the first method Delete plan.
本申请第七方面提供一种服务器,包括:A seventh aspect of the present application provides a server, including:
接收器,用于接收第二服务的服务部署包,其中,所述服务部署包包括部署计划和第二服务的描述文件;a receiver, configured to receive a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file of the second service;
处理器,用于在根据所述第二服务的描述文件执行所述部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;根据所述第一实例ID,获取所述第一服务的描述文件;根据所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息,在所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应 关系。a processor, configured to acquire a second instance identifier ID of the second service that has been deployed after executing the deployment plan according to the description file of the second service; determining that the description file of the second service includes The second service restricts information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID; acquiring a description file of the first service according to the first instance ID Recording the second in the description file of the first service according to the second service restriction information of executing the plan of the first instance ID of the first service and/or the method of the node of the first instance ID Correspondence between the instance ID and the method of the first instance ID and/or the method of the node of the first instance ID relationship.
结合第七方面,在第七方面的第一种可能的实现方式中,所述接收器还用于:在所述处理器在所述所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收针对所述第二实例ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;With reference to the seventh aspect, in a first possible implementation manner of the seventh aspect, the receiver is further configured to: when the processor records the second instance in a description file of the first service Receiving a deletion request for the second instance ID after the correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID, where the deletion request includes the second The instance ID and the deletion plan to be executed;
所述处理器还用于:根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述删除计划;确定所述第二服务的描述文件中包括所述第二服务限制执行所述第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。The processor is further configured to: obtain the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan; and determine that the second service includes the second service in a description file of the second service Information limiting a method of executing the plan of the first instance ID and/or a node of the first instance ID; inserting a flag before the first method of the first node of the deletion plan, the flag indicating release Restriction of execution of the first instance ID by the second service and/or execution of the method of the node of the first instance ID; performing a deletion plan after inserting the tag.
结合第七方面的第一种可能的实现方式,在第七方面的第二种可能的实现方式中,所述处理器具体用于:从所述第二服务的描述文件中获取所述第一实例ID;根据所述第一实例ID获取所述第一服务的描述文件;删除所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。With reference to the first possible implementation manner of the seventh aspect, in a second possible implementation manner of the seventh aspect, the processor is specifically configured to: obtain the first information from a description file of the second service Instance ID; acquiring a description file of the first service according to the first instance ID; deleting a plan of the second instance ID and the first instance ID recorded in a description file of the first service and/or Corresponding relationship of the method of the node of the first instance ID; starting from the first method, executing the deletion plan to be executed.
结合第七方面,在第七方面的第三种可能的实现方式中,所述装置还包括发送器,With reference to the seventh aspect, in a third possible implementation manner of the seventh aspect, the device further includes a transmitter,
所述接收器还用于:在所述处理器在所述所述第一服务的描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收发送端发送的针对所述第一实例ID的管理请求,所述管理请求包括所述第一实例ID和欲执行的计划和/或节点的方法;The receiver is further configured to: record, in the description file of the first service, the plan of the second instance ID and the first instance ID and/or the first instance ID in the description file of the first service After receiving the corresponding relationship of the method of the node, receiving a management request sent by the sending end for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
所述处理器还用于:根据所述第一实例ID获取所述第一服务的描述文件;The processor is further configured to: acquire a description file of the first service according to the first instance ID;
根据所述第一服务的描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining, according to the correspondence between the second instance ID recorded in the description file of the first service and the method of the first instance ID and the method of the node of the first instance ID, The execution of the method of the plan and/or the node is limited by the second service;
所述发送器用于:发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。 The transmitter is configured to: send a message rejecting the method of executing the plan and/or the node to be executed to the sending end.
本申请第八方面提供一种服务器,包括:An eighth aspect of the present application provides a server, including:
接收器,用于接收发送端发送的针对第一服务的第一实例标识ID的管理请求,所述管理请求包括所述第一实例ID以及欲执行的计划和/或节点的方法;a receiver, configured to receive, by the sending end, a management request for a first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
处理器,用于根据所述第一实例ID获取所述第一服务的描述文件;a processor, configured to acquire, according to the first instance ID, a description file of the first service;
根据所述第一服务的描述文件中记录的第二服务的第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the desire according to a correspondence between a second instance ID of the second service recorded in the description file of the first service and a method of the first instance ID and a method of the node of the first instance ID Execution of the executed plan and/or method of the node is restricted by the second service;
发送器,用于发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。And a transmitter, configured to send a message to the sender that rejects the method of executing the plan and/or the node to be executed.
结合第八方面,在第八方面的第一种可能的实现方式中,所述欲执行的计划为删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。With reference to the eighth aspect, in a first possible implementation manner of the eighth aspect, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a deletion method. At least one of a restart method and a stop method.
本申请第九方面提供一种服务器,包括:A ninth aspect of the present application provides a server, including:
接收器,用于接收针对第二服务的第二实例标识ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;a receiver, configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
处理器,用于根据所述第二实例ID获取所述第二服务的服务部署包,所述服务部署包包括所述删除计划和第二服务的描述文件;确定所述第二服务的描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。a processor, configured to acquire, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes a description file of the deletion plan and a second service; and determining a description file of the second service Included in the information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID; a first method of the first node of the deletion plan Inserting a mark indicating a restriction of releasing the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; performing a delete plan after inserting the mark .
结合第九方面,在第九方面的第一种可能的实现方式中,所述处理器具体用于:根据所述第一实例ID获取所述第一服务的描述文件;删除所述第一服务的描述文件中记录的所述第二实例ID和所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。With reference to the ninth aspect, in a first possible implementation manner of the ninth aspect, the processor is specifically configured to: acquire a description file of the first service according to the first instance ID; and delete the first service Corresponding relationship between the second instance ID recorded in the description file and the method of the first instance ID and/or the method of the node of the first instance ID; executing the execution from the first method Delete plan.
本申请实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
本申请实施例中,在第二服务的第二描述文件中包括有第二服务限制执行 第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,其中,第一服务为已部署的服务。因此,当部署新的服务,即第二服务时,除了执行部署计划部署第二服务之外,还根据所述信息,在第一服务的第一描述文件或在第一服务的第一实例的记录文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。因为第二描述文件中只要包含需要限制执行的计划和/或方法的信息,而不用将第一服务部署包中的所有内容都写入,所以节约了开发服务部署包的资源以及传输资源。而且,只要将第二实例ID和所述第一实例ID的计划和/或第一实例ID的节点的方法的对应关系写入第一服务的描述文件或记录文件中即可,而不用再次部署第一服务的部署包中的内容,所以节约了服务器的部署资源。进一步,通过限制执行第一实例ID的计划和/或节点的方法,可以避免因为对这些计划和/或方法的执行而导致第二服务无法运行。In the embodiment of the present application, the second service restriction execution is included in the second description file of the second service. Information of a method of a first instance ID of a first service and/or a method of a node of a first instance ID, wherein the first service is a deployed service. Therefore, when deploying a new service, ie, a second service, in addition to executing the deployment plan to deploy the second service, according to the information, the first description file of the first service or the first instance of the first service A correspondence relationship between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is recorded in the log file. Since the second description file contains information that needs to restrict the execution of the plan and/or method without writing all the contents of the first service deployment package, the resources of the development service deployment package and the transmission resources are saved. Moreover, as long as the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is written in the description file or the log file of the first service, without re-deployment The content of the first service deployment package saves the server's deployment resources. Further, by limiting the method of executing the plan and/or node of the first instance ID, it can be avoided that the second service cannot be run due to execution of these plans and/or methods.
本发明第十方面,提供了一种服务部署的方法,包括:A tenth aspect of the present invention provides a service deployment method, including:
接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;Receiving a service deployment request, the service deployment request including information of a service deployment package of the second service;
根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;Obtaining, according to the information about the service deployment package of the second service, the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service;
在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed;
确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;Determining that the description file of the second service includes restriction information, the restriction information includes information that the second service restricts execution of a plan of a first instance of the first service, and/or the second service restriction performs the Information about the method of the node of the first instance;
根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or in a node record file of the first instance Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded.
结合第十方面,在第十方面的第一种可能的实现方式中,所述根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所 述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。With reference to the tenth aspect, in a first possible implementation manner of the tenth aspect, the second instance ID and the first instance are recorded in a record file of the first instance according to the restriction information Corresponding relationship of the plan ID, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically: according to the limitation Information, obtaining a first instance ID; obtaining a record file of the first instance according to the first instance ID; Recording, in the record file of the first instance, the correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, Corresponding relationship between the second instance ID and a method ID of a node of the first instance is recorded in a node record file of the first instance.
结合第十方面,在第十方面的第二种可能的实现方式中,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二服务的描述文件中包括所述限制信息;根据所述限制信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。With reference to the tenth aspect, in a second possible implementation manner of the tenth aspect, the corresponding relationship between the second instance ID and the plan ID of the first instance is recorded in the record file of the first instance, and After the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, the method further includes: receiving an instance deletion request, the instance The deletion request includes the second instance ID and the deletion plan ID to be executed; and the service deployment package is obtained according to the second instance ID, where the service deployment package further includes the deletion corresponding to the deletion plan ID to be executed. Determining, in the description file of the second service, the restriction information; acquiring the first instance ID according to the restriction information; acquiring the record file of the first instance according to the first instance ID; Deleting a correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or acquiring a section of the first instance according to the record file of the first instance Recording a file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance; performing the deleting according to the description file of the second service plan.
结合第十方面,在第十方面的第三种可能的实现方式中,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID以及欲执行的计划ID;根据所述第一实例ID,获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制,发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或With reference to the tenth aspect, in a third possible implementation manner of the tenth aspect, the corresponding relationship between the second instance ID and the plan ID of the first instance is recorded in the record file of the first instance, and After the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, the method further includes: receiving an instance management request sent by the sender The instance management request includes the first instance ID and a plan ID to be executed; acquiring a record file of the first instance according to the first instance ID; and recording according to the record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance, and sending a plan to refuse execution of the plan to be executed Message to the sender; and/or
接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID 的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed; acquiring the record file of the first instance according to the first instance ID; a record file of the first instance, acquiring a node record file of the first instance; according to the second instance ID recorded in the node record file and a method ID of the node of the first instance Corresponding relationship, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; sending a message rejecting the method of executing the node to be executed to the transmitting end; and/or
接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Receiving an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed; acquiring a node record file to be executed according to the node ID to be executed; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the method corresponding to the method ID of the node to be executed is performed by the second instance Restricting; sending a message rejecting the method of executing the node to be executed to the sender.
本发明第十一方面,提供了一种服务部署的装置,包括:接收单元,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;处理单元,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点ID的方法的对应关系。An eleventh aspect of the present invention provides an apparatus for service deployment, including: a receiving unit, configured to receive a service deployment request, where the service deployment request includes information of a service deployment package of a second service, and a processing unit configured to Obtaining, by the information of the service deployment package of the second service, a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; After the description file of the second service executes the deployment plan of the second service, acquiring a second instance identifier ID of the second service that has been deployed; determining that the description file of the second service includes restriction information, the limitation The information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or information that the second service restricts execution of a method of the node of the first instance; Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or a node record in the first instance Examples of the second member in the recording process corresponding relationship ID in the node and the first instance.
结合第十一方面,在第十一方面的第一种可能的实现方式中,所述处理单元,用于根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。With reference to the eleventh aspect, in a first possible implementation manner of the eleventh aspect, the processing unit is configured to record the second instance in a record file of the first instance according to the restriction information Corresponding relationship between the ID and the plan ID of the first instance, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, Specifically, the first instance ID is obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID and the number are recorded in the record file of the first instance. Corresponding relationship of the plan ID of an instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance The corresponding relationship of the method IDs of the nodes of the first instance.
结合第十一方面,在第十一方面的第二种可能的实现方式中,所述接收单 元还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点ID的方法的对应关系之后,接收接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;所述处理单元,还用于根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二服务的描述文件中包括所述限制信息;根据所述限制信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。In conjunction with the eleventh aspect, in a second possible implementation manner of the eleventh aspect, the receiving The element is further configured to: record a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or record in a node record file of the first instance After receiving the correspondence between the second instance ID and the method of the node ID of the first instance, receiving a receiving instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed; The processing unit is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining a description file of the second service Include the restriction information; obtain the first instance ID according to the restriction information; acquire a record file of the first instance according to the first instance ID; delete the record file of the first instance Determining a correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, deleting the section of the first instance Corresponding relationship between the ID recording method of recording a file of a second example of the node ID of the first example; the second service description file according to the execution of the program deleted.
结合第十一方面,在第十一方面的第三种可能的实现方式中,所述装置还包括发送单元,所述接收单元还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例标识ID以及欲执行的计划ID;所述处理单元还用于:根据所述第一实例ID,获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的第二服务的第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制,所述发送单元用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或In conjunction with the eleventh aspect, in a third possible implementation manner of the eleventh aspect, the device further includes a sending unit, where the receiving unit is further configured to: record the in the record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, and/or recording the second instance ID and the method ID of the node of the first instance in the node record file of the first instance After the corresponding relationship, the instance management request sent by the sending end is received, where the instance management request includes the first instance identifier ID and a plan ID to be executed; the processing unit is further configured to: obtain, according to the first instance ID, a record file of the first instance; determining a plan ID to be executed according to a correspondence between a second instance ID of the second service recorded in the record file of the first instance and a plan ID of the first instance The execution of the corresponding plan is restricted by the second instance, and the sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed; the processing unit is further configured to: according to the first Obtaining, by an instance ID, a record file of the first instance; acquiring, according to the record file of the first instance, a node record file of the first instance; according to the second instance ID recorded in the node record file Corresponding relationship of the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending unit is configured to: send a rejection to execute the execution a message of the method of the node to the sender; and/or
所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请 求包括欲执行的节点ID和欲执行的节点的方法ID;所述处理单元还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management is requested Determining a node ID to be executed and a method ID of a node to be executed; the processing unit is further configured to: acquire a node record file to be executed according to the node ID to be executed; according to the node record file to be executed Corresponding relationship between the recorded second instance ID and the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending The unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
本发明第十二方面,提供了一种服务部署的方法,包括:接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。A twelfth aspect of the present invention provides a service deployment method, including: receiving a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of a second service; and the restriction information includes the The second service restricts execution of the information of the plan of the first instance, and/or the second service limits information of the method of executing the node of the first instance; and obtains information according to the service deployment package of the second service a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; and performing the deployment of the second service according to the description file of the second service After the scheduling, acquiring the second instance identifier ID of the second service that has been deployed and the record file of the second instance; and according to the restriction information, recording the association information in the record file of the second instance, the association The information includes a first instance ID, and the second instance ID and the plan ID of the first instance are recorded in a log file of the first instance according to the restriction information Correspondence between the correspondence relationship, and / or recorded in a log file of the node in the first instance to the second instance node ID of the first example of the method ID.
结合第十二方面,在第十二方面的第一种可能的实现方式中,所述根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。With reference to the twelfth aspect, in a first possible implementation manner of the twelfth aspect, the second instance ID and the first part are recorded in a record file of the first instance according to the restriction information Corresponding relationship between the plan ID of an instance, and/or a correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically: according to Determining information, obtaining a first instance ID; acquiring a record file of the first instance according to the first instance ID; recording the second instance ID and the plan ID of the first instance in the record file of the first instance Corresponding relationship, and/or obtaining a node record file of the first instance according to the record file of the first instance, and recording the second instance ID and the first instance in a node record file of the first instance Correspondence of the method ID of the node.
结合第十二方面,在第十二方面的第二种可能的实现方式中,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一 实例的节点的方法ID的对应关系之后,所述方法还包括:接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;根据所述第二实例ID获取所述第二实例的记录文件和所述服务部署包,所述服务部署包中还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二实例的记录文件中包括所述关联信息;根据所述关联信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。With reference to the twelfth aspect, in a second possible implementation manner of the twelfth aspect, the correspondence between the second instance ID and the plan ID of the first instance is recorded in the record file of the first instance And/or recording the second instance ID and the first in the node record file of the first instance After the corresponding relationship of the method IDs of the nodes of the instance, the method further includes: receiving an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed; according to the second instance ID Acquiring the record file of the second instance and the service deployment package, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; determining that the record file of the second instance includes the Correlating the information; acquiring the first instance ID according to the association information; acquiring the record file of the first instance according to the first instance ID; and deleting the record recorded in the record file of the first instance Obtaining a correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, and deleting the node record file of the first instance Corresponding relationship between the second instance ID recorded in the node and the method ID of the node of the first instance; performing the deletion plan according to the description file of the second service.
结合第十二方面,在第十二方面的第三种可能的实现方式中,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID;根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制;发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或With reference to the twelfth aspect, in a third possible implementation of the twelfth aspect, the correspondence between the second instance ID and the plan ID of the first instance is recorded in the log file of the first instance And after the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, the method further includes: receiving an instance sent by the sender a management request, the instance management request includes the first instance ID and a plan ID to be executed; acquiring a record file of the first instance according to the first instance ID; recording according to a record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, determining that the execution of the plan corresponding to the plan ID to be executed is restricted by the second instance; sending the rejection to perform the execution a planned message to the sender; and/or
接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed; acquiring the record file of the first instance according to the first instance ID; a record file of the first instance, obtaining a node record file of the first instance; determining the desire according to a correspondence between the second instance ID recorded in the node record file and a method ID of a node of the first instance Execution of the method corresponding to the method ID of the executed node is restricted by the second instance; sending a message rejecting the method of executing the node to be executed to the sender; and/or
接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应 的方法的执行受到所述第二实例的限制;发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Receiving an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed; acquiring a node record file to be executed according to the node ID to be executed; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the method ID of the node to be executed corresponds to The execution of the method is limited by the second instance; a message is sent to the sender that rejects the method of executing the node to be executed.
本发明第十二方面,提供了一种服务部署的装置,包括:接收单元,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;处理单元,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。According to a twelfth aspect, the present invention provides a service deployment apparatus, including: a receiving unit, configured to receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of a second service; The information includes information that the second service restricts execution of the plan of the first instance, and/or information that the second service restricts execution of a method of the node of the first instance; a processing unit that is configured to Information about a service deployment package of the second service, where the service deployment package of the second service is obtained, where the service deployment package includes a deployment plan of the second service and a description file of the second service; After the description file executes the deployment plan of the second service, acquiring a second instance identifier ID of the second service that has been deployed and a log file of the second instance; according to the restriction information, in the second instance Recording associated information in the record file, the associated information including a first instance ID; recording the second in the record file of the first instance according to the restriction information Corresponding relationship between the instance ID and the plan ID of the first instance, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance .
结合第十二方面,在第十二方面的第一种可能的实现方式中,所述处理单元用于,根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。With reference to the twelfth aspect, in a first possible implementation manner of the twelfth aspect, the processing unit is configured to: record, according to the restriction information, the second instance in a record file of the first instance Corresponding relationship between the ID and the plan ID of the first instance, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, Specifically, the first instance ID is obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID and the number are recorded in the record file of the first instance. Corresponding relationship of the plan ID of an instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance The corresponding relationship of the method IDs of the nodes of the first instance.
结合第十二方面,在第十二方面的第二种可能的实现方式中,所述接收单元还用于:在所述处理单元在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;所述处理单元还用于:根据所述第二实例ID获取所述第二实例的记录文件和所述部署包,所述部署包中还包括所述欲执行的删除计划ID 对应的删除计划;确定所述第二实例的记录文件中包括所述关联信息;根据所述关联信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。In a second possible implementation manner of the twelfth aspect, the receiving unit is further configured to: record, in the recording file of the first instance, the second instance in the processing unit a correspondence between the ID and the plan ID of the first instance, and/or after the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance Receiving an instance deletion request, the instance deletion request includes the second instance ID and a deletion plan ID to be executed; the processing unit is further configured to: acquire the record of the second instance according to the second instance ID a file and the deployment package, the deployment package further including the deletion plan ID to be executed Corresponding deletion plan; determining that the record information of the second instance includes the association information; acquiring the first instance ID according to the association information; acquiring the first instance according to the first instance ID Recording a file; deleting a correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or acquiring the first according to the record file of the first instance a node record file of the instance, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of the node of the first instance; performing according to the description file of the second service The deletion plan.
结合第十二方面,在第十二方面的第三种可能的实现方式中,所述装置还包括发送单元,所述接收单元还用于:在所述处理单元在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID;所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制;所述发送单元用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或In conjunction with the twelfth aspect, in a third possible implementation of the twelfth aspect, the apparatus further includes a transmitting unit, the receiving unit further configured to: record at the processing unit in the first instance Recording, in the file, a correspondence between the second instance ID and a plan ID of the first instance, and/or recording the second instance ID and the first instance in a node record file of the first instance After receiving the corresponding relationship of the method ID of the node, receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed; the processing unit is further configured to: according to the first The instance ID acquires the record file of the first instance; and determines the plan to be executed according to the correspondence between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance. The execution of the plan corresponding to the ID is restricted by the second instance; the sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed; the processing unit is further configured to: according to the first Obtaining, by an instance ID, a record file of the first instance; acquiring, according to the record file of the first instance, a node record file of the first instance; according to the second instance ID recorded in the node record file Corresponding relationship of the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance; the sending unit is configured to: send a rejection to execute the execution a message of the method of the node to the sender; and/or
所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;所述处理单元还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所 述发送端。The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed; the processing unit is further configured to: execute according to the Determining the node record file to be executed; determining the to-be-executed according to the correspondence between the second instance ID recorded in the node record file to be executed and the method ID of the node of the first instance The execution of the method corresponding to the method ID of the node is restricted by the second instance; the sending unit is configured to: send a message rejecting the method of executing the node to be executed to the Said sender.
本申请实施例中,接收的服务部署请求中包括有限制信息,其中,第一服务为已部署的服务。因此,当部署新的服务,即第二服务时,除了执行部署计划部署第二服务之外,还根据所述限制信息,在部署的第二服务的第二实例对应的记录文件中记录包括第一实例ID的关联信息,并且在第一实例的记录文件中记录第二实例与第一实例的计划的对应关系,和/或在第一实例的节点记录文件中记录第二实例与第一实例的节点的方法的对应关系。因为只需要在服务部署请求中包含所述限制信息,而不用将第一服务部署包中的所有内容都写入,所以节约了开发服务部署包的资源以及传输资源。而且,只要在第二实例的记录文件中记录关联信息,在第一实例的记录文件中记录第二实例与第一实例的计划的对应关系和/或第二实例与第一实例的节点的方法的对应关系,而不用再次部署第一服务的部署包中的内容,所以节约了服务器的部署资源。进一步,通过限制执行第一实例的计划和/或节点的方法,可以避免因为对这些计划和/或方法的执行而导致第二服务无法运行。In the embodiment of the present application, the received service deployment request includes the restriction information, where the first service is the deployed service. Therefore, when the new service is deployed, that is, the second service, in addition to executing the deployment plan to deploy the second service, according to the restriction information, the record is recorded in the record file corresponding to the second instance of the deployed second service. Correlation information of an instance ID, and recording a correspondence relationship between the second instance and the plan of the first instance in the record file of the first instance, and/or recording the second instance and the first instance in the node record file of the first instance Correspondence of the methods of the nodes. Since only the restriction information needs to be included in the service deployment request without writing all the contents of the first service deployment package, resources for developing the service deployment package and transmission resources are saved. Moreover, as long as the association information is recorded in the log file of the second instance, the correspondence between the plan of the second instance and the plan of the first instance and/or the method of the node of the second instance and the first instance are recorded in the log file of the first instance The corresponding relationship, without having to deploy the content of the deployment package of the first service again, thus saving the deployment resources of the server. Further, by limiting the method of executing the plan and/or node of the first instance, it is possible to avoid the second service being inoperable due to execution of these plans and/or methods.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description of the embodiments will be briefly described. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1为现有技术中描述文件中各元素之间的关系图;1 is a diagram showing the relationship between elements in a file in the prior art;
图2为现有技术中服务A和服务B的拓扑关系示意图;2 is a schematic diagram of a topological relationship between service A and service B in the prior art;
图3为现有技术中将服务A和服务B合并为一个服务C的示意图;3 is a schematic diagram of combining service A and service B into one service C in the prior art;
图4为本申请一实施例中的服务部署方法的流程图;4 is a flowchart of a service deployment method in an embodiment of the present application;
图5为本申请一实施例中的服务管理的方法流程图;FIG. 5 is a flowchart of a method for service management according to an embodiment of the present application;
图6为本申请另一实施例中的服务管理的方法流程图;6 is a flowchart of a method for service management in another embodiment of the present application;
图7为为本申请一实施例中的服务部署装置的功能框图;FIG. 7 is a functional block diagram of a service deployment apparatus according to an embodiment of the present application;
图8为本申请一实施例中的服务器的系统框图;8 is a system block diagram of a server in an embodiment of the present application;
图9为为本申请一实施例中的服务管理装置的功能框图;FIG. 9 is a functional block diagram of a service management apparatus according to an embodiment of the present application; FIG.
图10本申请另一实施例中的服务器的系统框图; Figure 10 is a system block diagram of a server in another embodiment of the present application;
图11为为本申请另一实施例中的服务管理装置的功能框图;11 is a functional block diagram of a service management apparatus in another embodiment of the present application;
图12为本申请再一实施例中的服务器的系统框图;12 is a system block diagram of a server in still another embodiment of the present application;
图13为本申请一实施例中的服务部署方法的流程图;FIG. 13 is a flowchart of a service deployment method according to an embodiment of the present application;
图14为本申请一实施例中的服务管理的方法流程图;14 is a flowchart of a method for service management in an embodiment of the present application;
图15为本申请一实施例中的服务管理的方法流程图;15 is a flowchart of a method for service management in an embodiment of the present application;
图16为本申请一实施例中的服务部署的方法流程图;16 is a flowchart of a method for service deployment in an embodiment of the present application;
图17为本申请一实施例中的服务管理的方法流程图;17 is a flowchart of a method for service management in an embodiment of the present application;
图18为为本申请一实施例中的服务部署装置的功能框图;FIG. 18 is a functional block diagram of a service deployment apparatus according to an embodiment of the present application;
图19为为本申请又一实施例中的服务部署装置的功能框图;19 is a functional block diagram of a service deployment apparatus in still another embodiment of the present application;
图20为本申请一实施例中的服务器的系统框图;20 is a system block diagram of a server in an embodiment of the present application;
图21为本申请又一实施例中的服务器的系统框图。21 is a system block diagram of a server in still another embodiment of the present application.
具体实施方式detailed description
本申请实施例提供一种服务部署方法、服务管理方法及装置,用以解决现有技术中部署新服务时合并已部署的服务导致的资源浪费的技术问题。The embodiment of the present application provides a service deployment method, a service management method, and a device, which are used to solve the technical problem of merging resources caused by deployed services when deploying a new service in the prior art.
本申请实施例中的技术方案为解决上述的技术问题,总体思路如下:The technical solution in the embodiment of the present application is to solve the above technical problem, and the general idea is as follows:
1、在第二服务的第二描述文件中包括有第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,其中,第一服务为已部署的服务。当部署新的服务,即第二服务时,除了执行部署计划部署第二服务之外,还根据所述信息,在第一服务的第一描述文件或者第一实例的记录文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。1. The second description file of the second service includes information that the second service restricts execution of the plan of the first instance ID of the first service and/or the method of the node of the first instance ID, where the first service is The deployed service. When the new service is deployed, that is, the second service, in addition to executing the deployment plan to deploy the second service, according to the information, the second instance is recorded in the first description file of the first service or the record file of the first instance. The correspondence between the ID and the method of the first instance ID and/or the method of the node of the first instance ID.
2、CSP服务器接收CSC设备发送的服务部署请求中还包括第二服务限制执行第一服务的第一实例的计划和/或第一实例的节点的方法的限制信息。当部署新的服务,即第二服务时,除了执行部署计划部署第二服务之外,还需要根据该限制信息,在第二实例的记录文件中记录关联信息,该关联信息至少包括第一实例ID;在第一实例的记录文件中记录第二实例与第一实例的计划的对应关系和/或第二实例与第一实例的节点的方法的对应关系。其中,所述记录文件为记载实例的配置参数、运行状态、操作记录等信息的文件或是CSP服务器新建的文件,本发明对记录文件的具体形式不做限定。 2. The CSP server receives the service deployment request sent by the CSC device, and further includes, by the second service, restriction information of a method for executing the first instance of the first service and/or a method for the node of the first instance. When the new service is deployed, that is, the second service, in addition to executing the deployment plan to deploy the second service, the association information is recorded in the record file of the second instance according to the restriction information, and the association information includes at least the first instance. ID; the correspondence between the plan of the second instance and the plan of the first instance and/or the method of the method of the second instance and the node of the first instance is recorded in the log file of the first instance. The record file is a file that records configuration parameters, an operation status, an operation record, and the like of the instance, or a file created by the CSP server. The specific form of the record file is not limited in the present invention.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly described in the following with reference to the accompanying drawings in the embodiments of the present application. It is obvious that the described embodiments are Some embodiments are applied, not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。The term "and/or" in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
本申请一实施例提供一种服务部署方法,请参考图4所示,为本实施例中服务部署方法的流程图,该方法包括以下内容:An embodiment of the present application provides a service deployment method. Referring to FIG. 4, it is a flowchart of a service deployment method in this embodiment. The method includes the following content:
步骤101:接收第二服务的服务部署包,其中,服务部署包包括部署计划和第二描述文件;Step 101: Receive a service deployment package of a second service, where the service deployment package includes a deployment plan and a second description file.
步骤102:在根据第二描述文件执行所述部署计划后,获取已被部署的第二服务的第二实例标识(ID);Step 102: After executing the deployment plan according to the second description file, acquiring a second instance identifier (ID) of the second service that has been deployed;
步骤103:确定第二描述文件中包括第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息;Step 103: Determine, in the second description file, information that includes, by the second service, a method of executing a plan of the first instance ID of the first service and/or a method of a node of the first instance ID;
步骤104:根据第一实例ID,获取第一服务的第一描述文件;Step 104: Acquire a first description file of the first service according to the first instance ID.
步骤105:根据所述第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。Step 105: Record, according to the second service, the information of the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID, and record the second instance ID and the first instance in the first description file. Correspondence between the plan of the ID and/or the method of the node of the first instance ID.
其中,限制执行第一实例ID的计划和/或第一实例ID的节点的方法,是指在限制执行期间,不允许执行被限制的计划和/或方法。其中,限制执行期间指在第一描述文件中记录有第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系的期间。Wherein, the method of restricting execution of the plan of the first instance ID and/or the node of the first instance ID means that the restricted plan and/or method is not allowed to be executed during the restriction execution. Here, the restriction execution period refers to a period in which the correspondence relationship between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID is recorded in the first profile.
在本实施例中,假设第一服务和第二服务的服务部署包均包括两个计划:部署计划(BuildPlan)和删除计划(TerminatePlan)。第一服务和第二服务中的每个节点都有4个方法,分别为:开始、配置、停止和移除。在实际运用中,服务部署包还可以包括其他计划,例如重启计划。每个节点的方法也可以是其他方法,例如重启。本申请不作具体限定。 In this embodiment, it is assumed that the service deployment package of the first service and the second service both include two plans: a deployment plan (BuildPlan) and a delete plan (TerminatePlan). Each node in the first service and the second service has four methods: start, configure, stop, and remove. In practice, the service deployment package can also include other plans, such as a restart plan. The method of each node can also be other methods, such as restarting. This application is not specifically limited.
此时,假设第一服务(ServiceA)已经部署完成,即在云平台上运行。第一服务(ServiceA)的服务实例ID,即第一实例ID为ServiceA-1;第一描述文件,例如称为描述文件A的文件名为ServiceA.ste。进一步,CSP服务器还记录了描述文件A与第一实例ID,即ServiceA.ste与ServiceA-1的映射关系。需要说明的是,第一服务在不同的服务器上进行部署,就会有不同的服务实例ID,在本实施例中,假设第一服务在该服务器上的服务实例ID为第一实例ID,对于第一服务的其他服务实例ID,实施的方法相同。At this point, assume that the first service (ServiceA) has been deployed, that is, running on the cloud platform. The service instance ID of the first service (ServiceA), that is, the first instance ID is ServiceA-1; the first description file, for example, the file name of the description file A is named ServiceA.ste. Further, the CSP server also records the mapping file A and the first instance ID, that is, the mapping relationship between ServiceA.ste and ServiceA-1. It should be noted that, when the first service is deployed on different servers, there will be different service instance IDs. In this embodiment, it is assumed that the service instance ID of the first service on the server is the first instance ID. The other service instance IDs of the first service are implemented in the same way.
假设第二服务为ServiceB,第二服务的第二描述文件为描述文件B,其中描述文件B的文件名为ServiceB.ste。Assume that the second service is ServiceB, and the second description file of the second service is description file B, wherein the file name of the description file B is ServiceB.ste.
当需要部署第二服务时,CSC设备将第二服务的服务部署包发送给CSP服务器。即CSP服务器执行本实施例方法中的步骤101,接收第二服务的服务部署包,该服务部署包中包括部署计划和描述文件B。在其他实施例中,该服务部署包中还可以包括其他计划,例如删除计划,重启计划等。When the second service needs to be deployed, the CSC device sends the service deployment package of the second service to the CSP server. That is, the CSP server performs step 101 in the method of this embodiment, and receives a service deployment package of the second service, where the service deployment package includes a deployment plan and a description file B. In other embodiments, the service deployment package may also include other plans, such as deleting the plan, restarting the plan, and the like.
在接收到第二服务的服务部署包后,可以根据第二描述文件执行部署计划。After receiving the service deployment package of the second service, the deployment plan may be executed according to the second description file.
然后执行步骤102,在部署完成后,获取已部署的第二服务的第二实例ID。Then, step 102 is performed to obtain a second instance ID of the deployed second service after the deployment is completed.
其中,执行部署计划为本领域技术人员所熟知的内容,所以在此不再赘述。获取第二实例ID,具体例如是CSP服务器为ServiceB创建或分配一个实例ID为ServiceB-1。The execution deployment plan is well known to those skilled in the art, so it will not be described here. The second instance ID is obtained, for example, the CSP server creates or allocates an instance ID to ServiceB-1 for ServiceB.
接下来执行步骤103,确定第二描述文件中包括第二服务限制执行第一实例ID的计划和/或第一实例ID的节点的方法的信息。Next, step 103 is performed to determine information in the second description file that includes the second service restriction method of executing the plan of the first instance ID and/or the node of the first instance ID.
具体来说,为了能够描述第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的限制,可以在第二描述文件中定义一个名为“限制(Limitation)”的策略类型(PolicyType),在第二描述文件中的服务模板(ServiceTemplate)下定义该策略类型的策略模板(PolicyTemplate)。策略类型和策略模板的具体定义可以有但不限于以下两种,分别称为(I)型和(II)型。(I)型中的属性“被请求的服务(appliesToService)”和“请求的服务(appliesFromService)”都是针对PolicyTemplate;而(II)型中,这两个属性都是针对受限制的计划和/或节点的方法。Specifically, in order to be able to describe the limitation of the second service to the plan of the first instance ID and/or the method of the node of the first instance ID, a policy named "Limitation" may be defined in the second profile. Type (PolicyType) defines a policy template (PolicyTemplate) of the policy type under the service template (ServiceTemplate) in the second description file. Specific definitions of policy types and policy templates may be, but are not limited to, the following two types, which are called (I) type and (II) type, respectively. The attributes "appliesToService" and "appliesFromService" in the (I) type are for the PolicyTemplate; while in the (II) type, both attributes are for the restricted plan and / Or the method of the node.
其中,(I)型的策略类型,“Limitation”可以通过代码(1)来定义。在其 它实施例中,策略类型的命名可以任意设置,本申请不作限定。Among them, the type of strategy of type (I), "Limitation" can be defined by code (1). In its In the embodiment, the naming of the policy type can be arbitrarily set, which is not limited in this application.
Figure PCTCN2015078914-appb-000001
Figure PCTCN2015078914-appb-000001
其中,PolicyType name描述策略类型的名称,本实例中为限制,即Limitation;属性定义元素PropertiesDefinition element描述被限制的元素,如方法或计划,本实例中该属性描述被限制的方法或计划,并通过Operation id给出被限制的方法名称,以及NodeTemplateID描述被限制的方法属于哪个节点的方法。如果需要限制多个方法,采用代码(1),可以写入多行Operation id,以及与Operation id对应的NodeTemplateID。而Plan id描述需要限制的计划。The PolicyType name describes the name of the policy type. In this example, the restriction is Limitation; the attribute definition element PropertiesDefinition element describes the restricted element, such as a method or plan. In this example, the attribute describes the restricted method or plan, and passes The Operation id gives the method name that is restricted, and the NodeTemplateID describes the method to which the restricted method belongs. If you need to limit multiple methods, you can use the code (1) to write a multi-line Operation id and a NodeTemplateID corresponding to the Operation id. The Plan id describes the plan that needs to be restricted.
(I)型的策略模板可以通过代码(2)来定义。The policy template of type (I) can be defined by code (2).
代码(2):<PolicyTemplate id=“string4”name=“string5”type=“Limitation”appliesToService=“string6”appliesFromService=“string7”>//策略模板的id为string4,名称为string5,类型为Limitation,被请求的服务为string6,请求的服务为string7。Code (2): <PolicyTemplate id=“string4” name=“string5” type=“Limitation” applicantToService=“string6”appliesFromService=“string7”>//The id of the policy template is string4, the name is string5, and the type is Limitation. The requested service is string6 and the requested service is string7.
其中,PolicyTemplate id描述策略模板的id,name描述策略模板的名称,type描述策略描述的类型,例如类型为代码(1)所描述的类型。属性“appliesToService”用来描述被请求的服务,而属性“appliesFromService”用来描述请求的服务。The PolicyTemplate id describes the id of the policy template, the name describes the name of the policy template, and the type describes the type of the policy description, for example, the type described by the code (1). The attribute "appliesToService" is used to describe the requested service, and the attribute "appliesFromService" is used to describe the requested service.
在代码(1)和代码(2)中,给出了一个通用的示例,其中,string表示字段,在实际运用中,string的部分需要用实际的字段来替换,在本实施例的模板中,通过string加数字进行区分不同的字段的定义。 In code (1) and code (2), a general example is given, in which string represents a field. In actual use, the part of string needs to be replaced with the actual field. In the template of this embodiment, Differentiate the definition of different fields by string plus numbers.
在代码(1)和代码(2)中,PolicyType的名字为“Limitation”,表示是对服务的计划和/或节点的方法的限制;其有两个属性,分别为“LimitedOperations”和“LimitedPlans”表示受限制的方法和计划。由于每个节点可能存在相同名字的方法,所以在描述方法的时候,除了给出方法的id之外,还需给出其对应的NodeTemplate的ID,表示该方法属于哪个NodeTemplate。在一个服务中不会存在id相同的计划,故只需给出计划的id即可。In code (1) and code (2), the name of PolicyType is "Limitation", which means that it is a restriction on the plan of the service and / or the method of the node; it has two attributes, "LimitedOperations" and "LimitedPlans" Represents restricted methods and plans. Since each node may have the same name method, when describing the method, in addition to giving the id of the method, the ID of the corresponding NodeTemplate is also given, indicating which NodeTemplate the method belongs to. There is no plan with the same id in a service, so just give the id of the plan.
描述PolicyTemplate时,其type为“Limitation”,表示该PolicyTemplate是名为“Limitation”的PolicyType的一种示例。本申请实施例使用appliesToService描述被请求的服务实例的ID,即第一实例ID为被限制的服务实例。同时,也需要增加新的字段以描述PolicyTemplate来自于哪个服务实例。本发明使用appliesFromService记录请求的服务实例ID,即限制来自的服务实例,也即第二实例ID。When the PolicyTemplate is described, its type is "Limitation", indicating that the PolicyTemplate is an example of a PolicyType named "Limitation". The embodiment of the present application uses the applicantToService to describe the ID of the requested service instance, that is, the first instance ID is the restricted service instance. At the same time, you need to add a new field to describe which service instance the PolicyTemplate comes from. The present invention uses the applicantFromService to record the requested service instance ID, that is, to restrict the service instance from the second instance ID.
例如,本实施例中,假设ServiceA的删除计划、每个节点的Stop和Remove方法的执行会影响到ServiceB的正常运行,那么ServiceB对ServiceA实例的删除计划(TerminatePlan)、每个节点的Stop和Remove方法的执行进行限制,那么在ServiceB的描述文件B中(I)型的PolicyTemplate可通过代码(3)来定义:For example, in this embodiment, it is assumed that the deletion plan of ServiceA, the execution of the Stop and Remove methods of each node affect the normal operation of ServiceB, and the ServiceB deletes the plan of the ServiceA instance (TerminatePlan), and the Stop and Remove of each node. The execution of the method is restricted, then the PolicyTemplate of type (I) in the description file B of ServiceB can be defined by code (3):
Figure PCTCN2015078914-appb-000002
Figure PCTCN2015078914-appb-000002
Figure PCTCN2015078914-appb-000003
Figure PCTCN2015078914-appb-000003
代码(3)中的策略模板表示Service B需要限制执行第一实例ID,ServiceA-1的计划和方法,并且描述了限制执行的计划的id和方法的id以及方法所属节点模板的ID。The policy template in code (3) indicates that Service B needs to restrict the execution of the first instance ID, the plan and method of ServiceA-1, and describes the id of the plan that restricts execution and the id of the method and the ID of the node template to which the method belongs.
在实际运用中,除了采用代码(1)的方式定义策略类型,还可以采用其他方式来定义策略类型,例如(II)型的策略类型,具体如代码(4)所示。In practice, in addition to defining the policy type by means of code (1), other ways can be used to define the policy type, such as the type of policy of type (II), as shown in code (4).
Figure PCTCN2015078914-appb-000004
Figure PCTCN2015078914-appb-000004
其中,PolicyType name描述策略类型的名称,本实例中为限制,即Limitation;属性定义元素PropertiesDefinition element描述被限制的元素,如方 法或计划,本实例中该属性描述被限制的方法或计划,并通过Operation id给出被限制的方法名称,以及NodeTemplateID描述被限制的方法属于哪个节点的方法。如果需要限制多个方法,采用代码(4),可以写入多行Operation id,以及与Operation id对应的NodeTemplateID。而Plan id描述需要限制的计划。并且,在每个限定的方法和计划后面,通过属性“appliesToService”来描述这些方法和计划所属的服务,通过属性“appliesFromService”来描述限制这些方法和计划的服务。The PolicyType name describes the name of the policy type. In this example, the restriction is Limitation; the attribute definition element PropertiesDefinition element describes the restricted element, such as a square. Method or plan, in this example, the attribute describes the restricted method or plan, and the method name is given by the Operation id, and the NodeTemplateID describes the method to which the restricted method belongs. If you need to limit multiple methods, you can use the code (4) to write a multi-line Operation id and a NodeTemplateID corresponding to the Operation id. The Plan id describes the plan that needs to be restricted. And, after each defined method and plan, describe the services to which these methods and plans belong by the attribute "appliesToService", and describe the services that limit these methods and plans through the attribute "appliesFromService".
对应代码(4),(II)型的策略模板可以通过代码(5)来定义。Corresponding code (4), (II) type policy template can be defined by code (5).
代码(5):<PolicyTemplate id=“string15”name=“string16”type=“Limitation”/>//策略模板的id为string15,名称为string16,类型为“Limitation”。Code (5): <PolicyTemplate id=“string15” name=“string16” type=“Limitation”/>//The id of the policy template is string15, the name is string16, and the type is “Limitation”.
其中,在代码(5)和代码(6)中,string的含义与前述描述相同,为通用模板中的代替符号,在实际运用中,需要用真实的字段来代替。Among them, in the code (5) and the code (6), the meaning of the string is the same as the foregoing description, and is a substitute symbol in the general template. In actual use, it is necessary to replace the real field.
继续沿用(I)型的例子,ServiceB的描述文件B中描述对ServiceA的服务实例的计划和/或节点的方法限制的(II)型的PolicyTemplate可通过代码(6)来描述。Continuing with the example of type (I), the PolicyTemplate of type (II) describing the plan of the service instance of ServiceA and the method limitation of the node in the description file B of ServiceB can be described by code (6).
Figure PCTCN2015078914-appb-000005
Figure PCTCN2015078914-appb-000005
Figure PCTCN2015078914-appb-000006
Figure PCTCN2015078914-appb-000006
由此可以看出,在(II)型的代码中,策略模板中的被请求的服务实例直接写在被限制执行的计划和节点的方法之后。而在(I)型的代码(3)中,被请求的服务实例是写在策略模板之后的。It can be seen from this that in the code of type (II), the requested service instance in the policy template is directly written after the method of the plan and the node that is restricted from being executed. In the code (3) of type (I), the requested service instance is written after the policy template.
接下来继续描述步骤103。因此,不管是通过(I)型还是(II)型的描述方式,只要描述文件B中对策略模板的定义中,属性appliesToService=“ServiceA-1”,就可以说明第二服务引用了ServiceA的一个实例,其中被引用的ServiceA的实例的ID为ServiceA-1。描述文件B中还定义了如代码(1)或代码(4)所示的策略类型,以及对实例ID为ServiceA-1的实例的计划和/或方法的限制如代码(3)(对应I型)和代码(6)(对应II型)。因此,CSP服务器根据第二描述文件,即可获知第二描述文件中包括ServiceB限制执行第一实例ID,ServiceA-1的计划(删除计划)和所有节点的方法(Stop和Remove)的信息,并且能够获取到第一实例ID,在本实施例中,第一实例ID为ServiceA-1。Next, step 103 will be described. Therefore, whether through the description of the (I) type or the (II) type, as long as the definition of the policy template in the file B, the attribute appliesToService=“ServiceA-1”, it can be stated that the second service refers to one of the ServiceA. An instance where the ID of the referenced ServiceA instance is ServiceA-1. The description file B also defines the policy type as shown in code (1) or code (4), and the restrictions on the plan and/or method of the instance whose instance ID is ServiceA-1, such as code (3) (corresponding to type I) ) and code (6) (corresponding to type II). Therefore, the CSP server can know, according to the second description file, that the second description file includes information that the ServiceB restricts execution of the first instance ID, the plan of the ServiceA-1 (delete plan), and the methods of all the nodes (Stop and Remove), and The first instance ID can be obtained. In this embodiment, the first instance ID is ServiceA-1.
接下来执行步骤104,即根据第一实例ID,获取第一服务的第一描述文件。具体来说,例如是CSP服务器根据记录的描述文件和实例ID对应的映射关系,查询到与第一实例ID对应的第一描述文件。在本实施例中,例如获得了描述文件A,ServiceA.ste。Next, step 104 is performed, that is, the first description file of the first service is obtained according to the first instance ID. Specifically, for example, the CSP server queries the first description file corresponding to the first instance ID according to the mapping relationship between the recorded description file and the instance ID. In the present embodiment, for example, the description file A, ServiceA.ste is obtained.
当获取到第一描述文件时,接下来执行步骤105,根据所述信息,在第一描述文件中记录第二实例ID和第一实例ID的计划和/或第一实例ID的节点的 方法的对应关系。When the first description file is obtained, step 105 is performed, according to which the second instance ID and the plan of the first instance ID and/or the node of the first instance ID are recorded in the first description file. The corresponding relationship of the methods.
可选的,在执行步骤105之前,可以先检查第一描述文件中是否已经有名为“Limitation”的策略类型。Optionally, before performing step 105, it may be checked whether a policy type named “Limitation” is already present in the first description file.
针对(I)型的情况,如果没有的话,则根据所述信息将第二描述文件中的策略类型拷贝至第一描述文件中,然后将代码(3)中描述的策略模板拷贝至第一描述文件中服务模板下,其中,不拷贝“appliesToService=“ServiceA-1””。通过属性“appliesFromService”记录该限制来自于第二服务的第二实例ID,例如为ServiceB的服务实例ServiceB-1。For the case of (I) type, if not, copy the policy type in the second description file to the first description file according to the information, and then copy the policy template described in the code (3) to the first description. Under the service template in the file, where "appliesToService="ServiceA-1" is not copied. The restriction is recorded by the attribute "appliesFromService" from the second instance ID of the second service, such as the service instance ServiceB-1 of ServiceB.
如果有的话,就将代码(3)中描述的策略模板拷贝至第一描述文件中服务模板下,其中,不拷贝“appliesToService=“ServiceA-1””。通过属性“appliesFromService”记录该限制来自于第二服务的第二实例ID,例如为ServiceB的服务实例ServiceB-1。If yes, copy the policy template described in code (3) to the service template in the first description file, where "appliesToService="ServiceA-1" is not copied. The restriction is recorded by the attribute "appliesFromService" from the second instance ID of the second service, such as the service instance ServiceB-1 of ServiceB.
继续沿用前述实例,那么在第一描述文件,例如描述文件A中,(I)型的策略模板通过代码(7)来描述。Continuing with the foregoing example, then in the first description file, such as description file A, the policy template of type (I) is described by code (7).
Figure PCTCN2015078914-appb-000007
Figure PCTCN2015078914-appb-000007
Figure PCTCN2015078914-appb-000008
Figure PCTCN2015078914-appb-000008
针对(II)型的情况,如果没有的话,将第二描述文件中的策略类型拷贝至第一描述文件中,例如将描述文件B中的策略类型拷贝至描述文件A中。然后将例如代码(6)中描述的策略模板拷贝至描述文件A中服务模板下,不拷贝“appliesToService=“ServiceA-1””。并且,通过属性“appliesFromService”记录该限制来自于第二服务的第二服务实例ID,例如ServiceB的服务实例ServiceB-1。For the case of type (II), if not, copy the policy type in the second description file to the first description file, for example, copy the policy type in the description file B into the description file A. Then copy the policy template described in the code (6) to the service template in the description file A, and do not copy "appliesToService = "ServiceA-1"". And, the restriction is recorded by the attribute "appliesFromService" from the second service instance ID of the second service, such as the service instance ServiceB-1 of ServiceB.
如果有的话,将代码(6)中限制计划(LimitedPlans)的所有子元素拷贝至描述文件A中类型为“Limitation”的策略模板的子元素限制计划(LimitedPlans),不拷贝“appliesToService=“ServiceA-1””。并且,通过属性“appliesFromService”记录该限制来自于第二服务的第二服务实例ID,例如ServiceB的服务实例ServiceB-1。以同样的方式处理代码(6)中的限制方法(LimitedOperations)。If any, copy all child elements of the restricted plan (LimitedPlans) in code (6) to the child element restriction plan (LimitedPlans) of the policy template of type "Limitation" in profile A, without copying "appliesToService="ServiceA -1"". And, the restriction is recorded by the attribute "appliesFromService" from the second service instance ID of the second service, such as the service instance ServiceB-1 of ServiceB. The restricted method (LimitedOperations) in code (6) is handled in the same way.
处理完成后完整的(II)型的策略模板在描述文件A中的描述如代码(8)所示。The complete (II) type of policy template after processing is described in the description file A as shown in code (8).
Figure PCTCN2015078914-appb-000009
Figure PCTCN2015078914-appb-000009
Figure PCTCN2015078914-appb-000010
Figure PCTCN2015078914-appb-000010
在实际运用中,除前述实施例中所描述的方式,还可以采用其他方式在第二描述文件中描述第二服务限制执行第一实例ID的计划和/或第一实例ID的节点方法,本申请对此不作限定。另外,具体如何记录第二实例ID和第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,本申请对此也不作限定。In an actual application, in addition to the manner described in the foregoing embodiments, the second service may be further described in the second description file to limit the execution of the plan of the first instance ID and/or the node method of the first instance ID. The application does not limit this. In addition, how to record the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is not limited in this application.
由以上描述可以看出,因为第二描述文件中只要包含需要限制执行的计划和/或节点的方法的信息,而不用将第一服务部署包中的所有内容都写入,所以节约了开发服务部署包的资源以及传输资源。而且,只要将第二实例ID和所述第一实例ID的计划和/或第一实例ID的节点的方法的对应关系写入第一服务的描述文件中即可,而不用再次部署第一服务的部署包中的内容,所以节约了服务器的部署资源。进一步,通过限制执行第一实例ID的计划和/或节点的方法,可以避免因为对这些计划和/或节点的方法的执行而导致第二服务无法运行。As can be seen from the above description, since the second description file contains information on the method of the plan and/or the node that needs to be restricted, without saving all the contents in the first service deployment package, the development service is saved. The resources of the deployment package and the transmission resources. Moreover, as long as the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is written in the description file of the first service, the first service is not deployed again. The content of the deployment package saves the server's deployment resources. Further, by restricting the method of executing the plan and/or node of the first instance ID, it is possible to avoid the second service from being inoperable due to execution of the methods of these plans and/or nodes.
当通过前述的服务部署方法部署第二服务之后,会涉及到对第一服务和第二服务的管理,接下来将先描述对第一服务的管理过程。 After the second service is deployed by the foregoing service deployment method, management of the first service and the second service may be involved, and the management process for the first service will be described first.
请参考图5所示,为本申请实施例中服务管理方法的流程图,该方法包括以下内容:Please refer to FIG. 5, which is a flowchart of a service management method in an embodiment of the present application, where the method includes the following content:
步骤201:接收发送端发送的针对第一服务的第一实例ID的管理请求,管理请求包括第一实例ID以及欲执行的计划和/或节点的方法。Step 201: Receive a management request sent by the sending end for the first instance ID of the first service, where the management request includes the first instance ID and a method of the plan and/or the node to be executed.
举例来说,例如,CSC设备想要执行ServiceA的实例ServiceA-1中的某个计划或节点的方法,例如删除计划(TerminatePlan)。于是通过客户端向CSP服务器发送管理请求,该管理请求中包含ServiceA实例的ID ServiceA-1和欲执行的计划和/或方法及方法所属的节点。For example, for example, the CSC device wants to execute a plan or node method in the instance ServiceA-1 of ServiceA, such as a delete plan (TerminatePlan). Then, the client sends a management request to the CSP server, where the management request includes the ID of the ServiceA instance, ServiceA-1, and the node to which the plan and/or method and method to be executed belong.
步骤202:根据第一实例ID获取第一服务的第一描述文件;其中,第一描述文件中记录了第二服务的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。Step 202: Acquire a first description file of the first service according to the first instance ID, where the second instance ID of the second service and the plan of the first instance ID and/or the first instance ID are recorded in the first description file. The correspondence of the methods of the nodes.
举例来说,所述对应关系具体是通过图4所述实施例中步骤101至步骤105所描述的方式写入的,也可以是通过其他方式写入的,本申请不作限定。For example, the corresponding relationship is specifically written in the manner described in the steps 101 to 105 in the embodiment of FIG. 4, and may be written in other manners, which is not limited in this application.
根据第一实例ID获取第一服务的第一描述文件的过程类似于前述步骤104,所以在此不再赘述。The process of obtaining the first description file of the first service according to the first instance ID is similar to the foregoing step 104, and therefore is not described herein again.
步骤203:根据该对应关系,确定欲执行的计划和/或节点的方法的执行受到第二服务的限制。Step 203: Determine, according to the correspondence, that the execution of the plan to be executed and/or the method of the node is restricted by the second service.
具体来说,通过检测第一描述文件,确定欲执行的计划和/或方法是否位于第二实例ID与第二服务所限制第一实例ID的计划和/或方法的对应关系中,如果是,则可以确定欲执行的计划和/或节点的方法的执行受到了第二服务的限制。反之则没有。Specifically, by detecting the first description file, determining whether the plan and/or method to be executed is located in the correspondence between the second instance ID and the plan and/or method in which the second instance limits the first instance ID, and if so, It can then be determined that the execution of the plan and/or the method of the node to be executed is limited by the second service. Otherwise no.
举例来说,检查描述文件A,确定ServiceB的实例ServiceB-1对实例ServiceA-1的TerminatePlan的限制。针对(I)型的情况,查看代码(7)中id为“LimitedTemplate”的策略模板,如果“TerminatePlan”出现在“LimitedPlans”中,说明删除计划被限制执行了。针对(II)型的情况,查看代码(8)中是否包含计划id为“TerminatePlan”的计划,如果有,则表示删除计划被限制执行,反之则没有。For example, check the description file A to determine the limit of the ServiceB instance ServiceB-1 to the TerminatePlan of the instance ServiceA-1. For the case of type (I), look at the policy template with the id "LimitedTemplate" in the code (7). If "TerminatePlan" appears in "LimitedPlans", the deletion plan is restricted. For the case of type (II), check whether the plan with the plan id "TerminatePlan" is included in the code (8). If there is, it means that the delete plan is restricted to execute, otherwise it is not.
步骤204:若受到限制,则发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。Step 204: If restricted, send a message rejecting the method of executing the plan and/or the node to be executed to the sender.
例如通过步骤203的确定过程,确定出欲执行的计划和/或方法受到第二 服务的限制,那么就发送拒绝消息给所述发送端。For example, by the determining process of step 203, it is determined that the plan and/or method to be executed is subject to the second The restriction of the service, then a rejection message is sent to the sender.
可选的,拒绝消息中可以包含第二服务的第二实例ID。例如包含ServiceB的服务实例ID ServiceB-1,以说明是ServiceB-1对实例ServiceA-1做了限制,从而拒绝了该请求。如此可以保证不影响第二服务的正常运行。Optionally, the second instance ID of the second service may be included in the reject message. For example, the service instance ID ServiceB-1 of ServiceB is included to indicate that ServiceB-1 has restricted the instance ServiceA-1, thereby rejecting the request. This can ensure that the normal operation of the second service is not affected.
关于第二实例ID,具体即为代码(7)或代码(8)中的属性“appliesFromService”的值,所以读取该属性的值,即可获得第二服务的第二实例ID,即ServiceB-1。Regarding the second instance ID, specifically the value of the attribute "appliesFromService" in the code (7) or the code (8), so reading the value of the attribute, the second instance ID of the second service, that is, ServiceB- 1.
可选的,当确定欲执行的计划和/或方法的执行没有受到第二服务的限制时,就可以执行欲执行的计划和/或方法,例如删除计划。Alternatively, when it is determined that the execution of the plan and/or method to be executed is not restricted by the second service, the plan and/or method to be executed may be executed, such as deleting the plan.
可选的,欲执行的计划为删除计划、重启计划和停止计划中的至少一个;欲执行的方法为删除方法、重启方法和停止方法中的至少一个。Optionally, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method to be executed is at least one of a delete method, a restart method, and a stop method.
当然,在实际运用中,还可以是其他计划和/或节点的方法,本申请不作限定。Of course, in actual use, it may also be a method of other plans and/or nodes, which is not limited in this application.
由以上描述可以看出,在对第一服务进行管理时,先要确定欲执行的计划和/或方法的执行没有受到其它服务的限制,如果欲执行的计划和/或节点的方法的执行受到其它服务的限制的话,就拒绝请求。这样一来,在对第一服务进行管理时,就可以保证不影响限制了该计划和/或节点的方法的执行的服务的正常运行。As can be seen from the above description, when managing the first service, it is first determined that the execution of the plan and/or method to be executed is not limited by other services, if the execution of the plan and/or the method of the node is performed. If there are restrictions on other services, the request is rejected. In this way, when the first service is managed, it is guaranteed that the normal operation of the service that restricts the execution of the method of the plan and/or the node is not affected.
接下来再描述对第二服务的管理过程,请参考图6所示,为本实施例中对第二服务的管理方法的流程图。该方法包括以下内容:Next, the management process of the second service is described. Referring to FIG. 6, a flowchart of the method for managing the second service in this embodiment is shown. The method includes the following:
步骤301:接收针对第二服务的第二实例ID的删除请求,删除请求中包含第二实例ID和欲执行的删除计划。Step 301: Receive a deletion request for a second instance ID of the second service, where the deletion request includes a second instance ID and a deletion plan to be executed.
举例来说,删除请求中包含的第二实例ID为ServiceB-1。删除请求中包括的欲执行的删除计划的为TerminatePlan。For example, the second instance ID included in the delete request is ServiceB-1. The deletion plan to be executed included in the deletion request is TerminatePlan.
步骤302:根据第二实例ID获取第二服务的服务部署包,该服务部署包包括删除计划和第二描述文件。Step 302: Acquire a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan and a second description file.
举例来说,通过实例ID ServiceB-1获取服务部署包,该部署包包括描述文件B和TerminatePlan。For example, the service deployment package is obtained through the instance ID ServiceB-1, and the deployment package includes a description file B and a TerminatePlan.
步骤303:确定第二描述文件中包括第二服务限制执行第一实例ID的计划和/或第一实例ID的节点的方法的信息。 Step 303: Determine information that the second description file includes a method for restricting execution of the plan of the first instance ID and/or the method of the node of the first instance ID.
具体来说,如果第二描述文件中有对第一实例ID的计划和/或节点的方法的限制,那么第二描述文件中就会包括如前述代码(3)和代码(6),所以可以通过检查第二描述文件中是否包含这样的代码段来判断第二服务是否有对其他服务实例的计划和/或节点的方法的执行的限制。并且,可以从该代码段中的属性“appliesToService”的值获知受限制的服务实例ID。Specifically, if there is a restriction on the plan of the first instance ID and/or the method of the node in the second description file, the second description file includes the code (3) and the code (6) as described above, so It is determined whether the second service has restrictions on the execution of the plans of other service instances and/or the methods of the nodes by checking whether the second description file contains such code segments. And, the restricted service instance ID can be known from the value of the attribute "appliesToService" in the code segment.
在本实施例中,第一服务泛指所有受到第二服务限制的服务,例如包括ServiceA,和/或ServiceD。In this embodiment, the first service generally refers to all services that are restricted by the second service, including, for example, ServiceA, and/or ServiceD.
假设第二服务为ServiceB,第一服务为ServiceA,那么通过前述的实施例描述可知,描述文件B中有对ServiceA-1的计划和/或节点的方法的执行的限制。Assuming that the second service is ServiceB and the first service is ServiceA, it can be seen from the description of the foregoing embodiment that the description file B has restrictions on the execution of the plan of the ServiceA-1 and/or the method of the node.
当结果为没有时,那么就直接执行删除计划即可。When the result is not, then the deletion plan can be executed directly.
当结果为有时,那么接下来执行步骤304:在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的执行的限制。When the result is sometimes, then step 304 is performed: inserting a flag before the first method of the first node of the deletion plan, the flag indicating that the second service is released from the plan and/or the first instance ID A limitation of the execution of the method of a node of an instance ID.
计划是由方法组成的工作流,所以就在删除计划的第一个节点的第一方法前插入标记。A plan is a workflow consisting of methods, so insert a tag before deleting the first method of the first node of the plan.
假设初始的TerminatePlan为:Assume that the initial TerminatePlan is:
TerminatePlan:TerminatePlan:
AppB.Stop;节点AppB的方法Stop;AppB.Stop; method Stop of node AppB;
AppBDb.Stop;节点AppBDb的方法Stop;AppBDb.Stop; method Stop of node AppBDb;
Apache.Stop;节点Apache的方法Stop;Apache.Stop; node Apache method Stop;
MySql.Stop;节点MySql的方法Stop;MySql.Stop; node MySql method Stop;
AppB.Remove;节点AppB的方法Remove;AppB.Remove; method of the node AppB Remove;
AppBDb.Remove;节点AppBDb的方法Remove;AppBDb.Remove; method of the node AppBDb Remove;
Apache.Remove;节点Apache的方法Remove;Apache.Remove; node Apache method Remove;
MySql.Remove;节点Apache的方法Remove。MySql.Remove; node Apache's method Remove.
那么在本实施例中,第一个节点的第一个方法即为AppB.Stop。Then in this embodiment, the first method of the first node is AppB.Stop.
经过步骤304的修改,插入标记后的删除计划为:After the modification of step 304, the deletion plan after inserting the mark is:
TerminatePlan:TerminatePlan:
DELETE_LIMITATION;//解除对其他服务实例的限制的标记 DELETE_LIMITATION; / / remove the restrictions on other service instances
AppB.Stop;AppB.Stop;
AppBDb.Stop;AppBDb.Stop;
Apache.Stop;Apache.Stop;
MySql.Stop;MySql.Stop;
AppB.Remove;AppB.Remove;
AppBDb.Remove;AppBDb.Remove;
Apache.Remove;Apache.Remove;
MySql.Remove。MySql.Remove.
步骤305:执行插入所述标记后的删除计划。Step 305: Perform a deletion plan after inserting the mark.
具体来说,在执行插入所述标记后的删除计划时,当执行到所述标记时,具体包括以下内容:从第二描述文件中获取第一实例ID;根据第一实例ID获取第一服务的第一描述文件;删除第一描述文件中记录的第二实例ID和第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。Specifically, when performing the deletion plan after inserting the mark, when performing the markup, the method specifically includes: acquiring a first instance ID from the second description file; acquiring the first service according to the first instance ID The first description file; the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and the method of the node of the first instance ID.
将第一描述文件中的对应关系删除,以此来解除第二服务对第一实例ID的计划和/或节点的方法的执行的限制,使得该计划和/或方法能够被执行。The correspondence in the first description file is deleted, thereby relieving the restriction of the second service on the planning of the first instance ID and/or the execution of the method of the node, so that the plan and/or method can be executed.
其中,通过第二描述文件获取第一实例ID,可以如前所述,通过第二描述文件中的代码段中的属性“appliesToService”的值获知受限制的服务的实例ID。The first instance ID is obtained by using the second description file. The instance ID of the restricted service can be obtained by using the value of the attribute “appliesToService” in the code segment in the second description file as described above.
举例来说,对于(I)型的情况,获取描述文件B中的类型为“Limitation”的PolicyTemplate,如代码(3)的属性“appliesToService”的值,该值ServiceA-1即为ServiceA的服务实例的ID。对于(II)型的情况,获取描述文件B中的类型为“Limitation”的PolicyTemplate(如代码6)中Plan元素和Operation元素的属性“appliesToService”的值(在本实施例中都为ServiceA-1),该值即为ServiceA的服务实例的ID。For example, for the case of type (I), obtain the PolicyTemplate of the type "Limitation" in the description file B, such as the value of the attribute "appliesToService" of the code (3), and the value ServiceA-1 is the service instance of ServiceA. ID. For the case of the type (II), the value of the attribute "appliesToService" of the Plan element and the Operation element in the PolicyTemplate (such as code 6) of the type "Limitation" in the description file B is obtained (in this embodiment, the serviceA-1) ), this value is the ID of the service instance of ServiceA.
通过第一实例ID获取第一服务的第一描述文件的步骤也可以按照前述所描述的方式来实施,例如CSP服务器存储有实例ID和描述文件的映射关系,所以查询该映射关系,就可以获取到第一实例ID对应的第一描述文件。The step of obtaining the first description file of the first service by using the first instance ID may also be implemented in the foregoing manner. For example, the CSP server stores the mapping relationship between the instance ID and the description file, so the mapping relationship may be obtained by querying the mapping relationship. The first description file corresponding to the first instance ID.
删除第一描述文件中记录的对应关系,具体来说,对于(I)型的情况,在描述文件A中删除类型为“Limitation”的PolicyTemplate,其属性“appliesFromService”的值为ServiceB-1。 The correspondence recorded in the first description file is deleted. Specifically, in the case of the (I) type, the PolicyTemplate of the type "Limitation" is deleted in the description file A, and the value of the attribute "appliesFromService" is ServiceB-1.
可选的,检查描述文件A中是否还包含类型为“Limitation”的PolicyTemplate,若无,删除ID为“Limitation”的PolicyType。Optionally, check whether the description file A also includes a PolicyTemplate of the type "Limitation", and if not, delete the PolicyType whose ID is "Limitation".
对于(II)型的情况,在描述文件A中找到类型为“Limitation”的PolicyTemplate,删除属性“appliesFromService”值为ServiceB-1的所有Plan元素和Operation元素。For the case of type (II), find the PolicyTemplate of type "Limitation" in the description file A, and delete all the Plane elements and Operation elements of the service "appliesFromService" value of ServiceB-1.
可选的,检查该PolicyTemplate中LimitedPlans元素和/或LimitedOperations元素是否包含子元素,若无,则删除LimitedPlans元素和/或LimitedOperations元素;若该PolicyTemplate中没有任何子元素,则删除该PolicyTemplate和ID为“Limitation”的PolicyType。Optionally, checking whether the LimitedPlans element and/or the LimitedOperations element in the PolicyTemplate include a child element, if not, deleting the LimitedPlans element and/or the LimitedOperations element; if there is no child element in the PolicyTemplate, deleting the PolicyTemplate and the ID is “ PolicyType of Limitation.
当在步骤305中执行完与标记相关的内容之后,然后从第一方法开始逐个执行删除计划中各个节点上的各个方法,该部分为本领域技术人员所熟知的内容,所以在此不再赘述。After the content related to the mark is executed in step 305, each method on each node in the deletion plan is executed one by one from the first method, which is a content well known to those skilled in the art, so it will not be described here. .
由以上描述可以看出,即使第二服务对第一服务的实例的计划和/或节点的方法的执行有限制,但是也可以单独管理第二服务,保证了第二服务管理的独立性。提高了服务管理的灵活性。As can be seen from the above description, even if the second service has restrictions on the execution of the plan of the instance of the first service and/or the method of the node, the second service can be separately managed to ensure the independence of the second service management. Increased flexibility in service management.
基于同一发明构思,本申请实施例还提供一种服务部署装置,请参考图7所示,该服务部署装置包括:接收单元401,用于接收第二服务的服务部署包,其中,服务部署包包括部署计划和第二描述文件;处理单元402,用于在根据第二描述文件执行部署计划后,获取已被部署的第二服务的第二实例标识ID;确定第二描述文件中包括第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息;根据第一实例ID,获取第一服务的第一描述文件;根据第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,以及根据服务部署包部署第二服务。Based on the same inventive concept, the embodiment of the present application further provides a service deployment apparatus. Referring to FIG. 7, the service deployment apparatus includes: a receiving unit 401, configured to receive a service deployment package of a second service, where the service deployment package The processing unit 402 is configured to: after executing the deployment plan according to the second description file, acquire a second instance identifier ID of the second service that has been deployed; and determine that the second description file includes the second The service restricts the information of the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID; acquiring the first description file of the first service according to the first instance ID; executing the first according to the second service restriction Information of a plan of the first instance ID of the service and/or a method of the node of the first instance ID, the node of the second instance ID and the plan of the first instance ID and/or the node of the first instance ID is recorded in the first profile The corresponding relationship of the methods, as well as deploying the second service according to the service deployment package.
可选的,接收单元401还用于:在处理单元402在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系之后,接收针对第二实例ID的删除请求,删除请求中包含第二实例ID和欲执行的删除计划;Optionally, the receiving unit 401 is further configured to: after the processing unit 402 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, For the deletion request of the second instance ID, the deletion request includes the second instance ID and the deletion plan to be executed;
处理单元402还用于:根据第二实例ID获取服务部署包,服务部署包还 包括删除计划;确定第二描述文件中包括第二服务限制执行第一实例ID的计划和/或第一实例ID的节点的方法的信息;在删除计划的第一个节点的第一个方法前插入标记,标记表示解除第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的执行的限制;执行插入标记后的删除计划。The processing unit 402 is further configured to: obtain a service deployment package according to the second instance ID, and the service deployment package further Included in the deletion plan; determining information in the second description file that includes a method for the second service to restrict execution of the plan of the first instance ID and/or the node of the first instance ID; before deleting the first method of the first node of the plan Insertion of a mark indicating a restriction to release the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; the deletion plan after the insertion of the mark is performed.
进一步,处理单元402具体用于:从第二描述文件中获取第一实例ID;根据第一实例ID获取第一描述文件;删除第一描述文件中记录的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系;从第一方法开始执行欲执行的删除计划。Further, the processing unit 402 is specifically configured to: obtain a first instance ID from the second description file; acquire the first description file according to the first instance ID; and delete the second instance ID and the first instance ID recorded in the first description file. Corresponding relationship between the method of the node of the plan and/or the first instance ID; starting from the first method, executing the deletion plan to be executed.
可选的,装置还包括发送单元,Optionally, the device further includes a sending unit,
接收单元401还用于:在处理单元402在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系之后,接收发送端发送的针对第一实例ID的管理请求,管理请求包括第一实例ID和欲执行的计划和/或节点的方法;The receiving unit 401 is further configured to: after the processing unit 402 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, the receiving terminal sends the For the management request of the first instance ID, the management request includes a first instance ID and a method of the plan and/or node to be executed;
处理单元402还用于:根据第一实例ID获取第一描述文件;The processing unit 402 is further configured to: acquire the first description file according to the first instance ID;
根据第一描述文件中记录的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,确定欲执行的计划和/或节点的方法的执行受到第二服务的限制;Determining, according to the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and/or the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is performed by the second Service restrictions;
发送单元用于:发送拒绝执行欲执行的计划和/或节点的方法的消息给发送端。The sending unit is configured to: send a message rejecting execution of the plan to be executed and/or the method of the node to the sending end.
前述图4实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务部署装置,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务部署装置的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of FIG. 4 are also applicable to the service deployment device of the embodiment. The foregoing description of the service deployment method can be clearly known to those skilled in the art. In the example, the implementation method of the service deployment device is not detailed here for the sake of brevity of the description.
基于同一发明构思,本申请实施例还包括一种服务器,请参考图8所示,为本申请实施例中的服务器的系统框图。如图8所示,该服务器包括:接收器501,用于接收第二服务的服务部署包,其中,服务部署包包括部署计划和第二描述文件;处理器502,用于在根据第二描述文件执行部署计划后,获取已被部署的第二服务的第二实例标识ID;确定第二描述文件中包括第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息;根据第一实例ID,获取第一服务的第一描述文件;根据第二服务限制执行第一服 务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,以及根据所述服务部署包部署所述第二服务。Based on the same inventive concept, the embodiment of the present application further includes a server. Please refer to FIG. 8 , which is a system block diagram of a server in the embodiment of the present application. As shown in FIG. 8, the server includes: a receiver 501, configured to receive a service deployment package of a second service, where the service deployment package includes a deployment plan and a second description file; and the processor 502 is configured to perform according to the second description. After the file executes the deployment plan, acquiring a second instance identifier ID of the second service that has been deployed; determining, in the second description file, a plan and/or a first instance ID of the second instance that restricts execution of the first instance ID of the first service Information of the method of the node; acquiring the first description file of the first service according to the first instance ID; executing the first service according to the second service restriction Recording information of the first instance ID and/or the method of the node of the first instance ID, in the first description file, recording the second instance ID with the plan of the first instance ID and/or the node of the first instance ID Corresponding relationship of the methods, and deploying the second service according to the service deployment package.
可选的,接收器501还用于:在处理器502在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系之后,接收针对第二实例ID的删除请求,删除请求中包含第二实例ID和欲执行的删除计划;Optionally, the receiver 501 is further configured to: after the processor 502 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, For the deletion request of the second instance ID, the deletion request includes the second instance ID and the deletion plan to be executed;
处理器502还用于:根据第二实例ID获取服务部署包,服务部署包还包括删除计划;确定第二描述文件中包括第二服务限制执行第一实例ID的计划和/或第一实例ID的节点的方法的信息;在删除计划的第一个节点的第一个方法前插入标记,标记表示解除第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的执行的限制;执行插入标记后的删除计划。The processor 502 is further configured to: obtain a service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan; and determine that the second description file includes a second service restriction to execute the first instance ID and/or the first instance ID. The information of the method of the node; inserting a mark before deleting the first method of the first node of the plan, the mark indicating the execution of the method of releasing the plan of the first instance ID and the node of the first instance ID of the second service ID Restriction; the deletion plan after the insertion tag is executed.
进一步,处理器502具体用于:从第二描述文件中获取第一实例ID;根据第一实例ID获取第一描述文件;删除第一描述文件中记录的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系;从第一方法开始执行欲执行的删除计划。Further, the processor 502 is specifically configured to: obtain a first instance ID from the second description file; acquire the first description file according to the first instance ID; and delete the second instance ID and the first instance ID recorded in the first description file. Corresponding relationship between the method of the node of the plan and/or the first instance ID; starting from the first method, executing the deletion plan to be executed.
可选的,装置还包括发送器503,Optionally, the device further includes a transmitter 503,
接收器501还用于:在处理器502在第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系之后,接收发送端发送的针对第一实例ID的管理请求,管理请求包括第一实例ID和欲执行的计划和/或节点的方法;The receiver 501 is further configured to: after the processor 502 records the correspondence between the second instance ID and the method of the first instance ID and the method of the node of the first instance ID in the first description file, the receiving sender sends the For the management request of the first instance ID, the management request includes a first instance ID and a method of the plan and/or node to be executed;
处理器502还用于:根据第一实例ID获取第一描述文件;The processor 502 is further configured to: acquire the first description file according to the first instance ID;
根据第一描述文件中记录的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,确定欲执行的计划和/或节点的方法的执行受到第二服务的限制;Determining, according to the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and/or the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is performed by the second Service restrictions;
发送器503用于:发送拒绝执行欲执行的计划和/或节点的方法的消息给发送端。The sender 503 is configured to: send a message rejecting execution of the plan to be executed and/or the method of the node to the sender.
进一步,在图8中,总线架构(用总线500来代表),总线500可以包括任意数量的互联的总线和桥,总线500将包括由处理器502代表的一个或多个处理器和存储器504代表的存储器的各种电路链接在一起。总线500还可以将 诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口505在总线500和处理器502、接收器501、发送器503之间提供接口。接收器501和发送器503用于服务器与外部设备进行数据通信。Further, in FIG. 8, a bus architecture (represented by bus 500), bus 500 can include any number of interconnected buses and bridges, and bus 500 will include one or more processors and memory 504 represented by processor 502. The various circuits of the memory are linked together. Bus 500 can also Various other circuits, such as peripherals, voltage regulators, and power management circuits, are linked together, which are well known in the art and, therefore, will not be further described herein. Bus interface 505 provides an interface between bus 500 and processor 502, receiver 501, and transmitter 503. The receiver 501 and the transmitter 503 are used for data communication between the server and an external device.
处理器502负责管理总线500和通常的处理。存储器504可以被用于存储处理器502在执行操作时所使用的数据。The processor 502 is responsible for managing the bus 500 and the usual processing. Memory 504 can be used to store data used by processor 502 in performing operations.
该服务器例如为CSP服务器。This server is for example a CSP server.
前述图4实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of FIG. 4 are also applicable to the server in this embodiment. The foregoing detailed description of the service deployment method can be clearly known to those skilled in the art. The implementation method of the server, so for the sake of brevity of the description, it will not be described in detail here.
基于同一发明构思,本申请实施例还提供一种服务管理装置,请参考图9所示,该服务部署装置包括:接收单元601,用于接收发送端发送的针对第一服务的第一实例标识ID的管理请求,管理请求包括第一实例ID以及欲执行的计划和/或节点的方法;处理单元602,用于根据第一实例ID获取第一服务的第一描述文件;根据第一描述文件中记录的第二服务的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,确定欲执行的计划和/或节点的方法的执行受到第二服务的限制;发送单元603,用于发送拒绝执行欲执行的计划和/或节点的方法的消息给发送端。Based on the same inventive concept, the embodiment of the present application further provides a service management apparatus. Referring to FIG. 9, the service deployment apparatus includes: a receiving unit 601, configured to receive a first instance identifier for a first service sent by a sending end. a management request of the ID, the management request includes a first instance ID and a method of the plan and/or the node to be executed; the processing unit 602 is configured to acquire the first description file of the first service according to the first instance ID; according to the first description file Corresponding relationship between the second instance ID of the second service recorded in the plan of the first instance ID and the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is performed by the second service The sending unit 603 is configured to send a message to the sending end that rejects the method of executing the plan and/or the node to be executed.
可选的,欲执行的计划为删除计划、重启计划和停止计划中的至少一个;欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。Optionally, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method of the node to be executed is at least one of a delete method, a restart method, and a stop method.
前述图5实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务管理装置,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务管理装置的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of FIG. 5 are also applicable to the service management apparatus of this embodiment. Through the foregoing detailed description of the service deployment method, those skilled in the art can clearly understand the implementation. In the example, the method of implementing the service management device is not described in detail for the sake of brevity of the description.
基于同一发明构思,本申请实施例还包括一种服务器,请参考图10所示,为本申请实施例中的服务器的系统框图。如图10所示,该服务器包括:接收器701,用于接收发送端发送的针对第一服务的第一实例标识ID的管理请求,管理请求包括第一实例ID以及欲执行的计划和/或节点的方法;处理器702,用于根据第一实例ID获取第一服务的第一描述文件;根据第一描述文件中记录的第 二服务的第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系,确定欲执行的计划和/或节点的方法的执行受到第二服务的限制;发送器703,用于发送拒绝执行欲执行的计划和/或节点的方法的消息给发送端。Based on the same inventive concept, the embodiment of the present application further includes a server. Referring to FIG. 10, it is a system block diagram of a server in the embodiment of the present application. As shown in FIG. 10, the server includes: a receiver 701, configured to receive a management request sent by a sending end for a first instance identifier ID of the first service, where the management request includes a first instance ID and a plan to be executed and/or a method of the node; the processor 702, configured to acquire, according to the first instance ID, a first description file of the first service; according to the first record in the first description file Corresponding relationship between the second instance ID of the second service and the method of the first instance ID and/or the method of the node of the first instance ID, determining that the execution of the plan and/or the method of the node is restricted by the second service; And 703, configured to send a message to the sender that rejects the method of executing the plan and/or the node to be executed.
可选的,欲执行的计划为删除计划、重启计划和停止计划中的至少一个;欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。Optionally, the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; the method of the node to be executed is at least one of a delete method, a restart method, and a stop method.
进一步,在图10中,总线架构(用总线700来代表),总线700可以包括任意数量的互联的总线和桥,总线700将包括由处理器702代表的一个或多个处理器和存储器704代表的存储器的各种电路链接在一起。总线700还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口705在总线700和处理器702、接收器701、发送器703之间提供接口。接收器701和发送器703用于服务器与外部设备进行数据通信。Further, in FIG. 10, a bus architecture (represented by bus 700), bus 700 can include any number of interconnected buses and bridges, and bus 700 will include one or more processors and memory 704 represented by processor 702. The various circuits of the memory are linked together. The bus 700 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art and, therefore, will not be further described herein. Bus interface 705 provides an interface between bus 700 and processor 702, receiver 701, and transmitter 703. The receiver 701 and the transmitter 703 are used for data communication between the server and an external device.
处理器702负责管理总线700和通常的处理。存储器704可以被用于存储处理器702在执行操作时所使用的数据。The processor 702 is responsible for managing the bus 700 and the usual processing. Memory 704 can be used to store data used by processor 702 in performing operations.
该服务器例如为CSP服务器。This server is for example a CSP server.
前述图5实施例中的服务管理方法中的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对服务管理方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service management method in the foregoing embodiment of FIG. 5 are also applicable to the server in this embodiment. The foregoing detailed description of the service management method can be clearly known to those skilled in the art. The implementation method of the server, so for the sake of brevity of the description, it will not be described in detail here.
基于同一发明构思,本申请实施例还提供一种服务管理装置,请参考图11所示,该服务部署装置包括:接收单元801,用于接收针对第二服务的第二实例标识ID的删除请求,删除请求中包含第二实例ID和欲执行的删除计划;处理单元802,用于根据第二实例ID获取第二服务的服务部署包,服务部署包包括删除计划和第二描述文件;确定第二描述文件中包括第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息;在删除计划的第一个节点的第一个方法前插入标记,标记表示解除第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的执行的限制;执行插入标记后的删除计划。Based on the same inventive concept, the embodiment of the present application further provides a service management apparatus. Referring to FIG. 11, the service deployment apparatus includes: a receiving unit 801, configured to receive a deletion request for a second instance identifier ID of the second service. The deletion request includes a second instance ID and a deletion plan to be executed; the processing unit 802 is configured to obtain a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan and a second description file; The second description file includes information that the second service restricts execution of the plan of the first instance ID of the first service and/or the method of the node of the first instance ID; inserts the mark before deleting the first method of the first node of the plan The flag indicates a restriction to release the second service from the plan of the first instance ID and/or the method of the node of the first instance ID; the deletion plan after the insertion of the tag is performed.
可选的,处理单元802具体用于:根据第一实例ID获取第一服务的第一描述文件;删除第一描述文件中记录的第二实例ID和第一实例ID的计划和/或第 一实例ID的节点的方法的对应关系;从第一方法开始执行欲执行的删除计划。Optionally, the processing unit 802 is specifically configured to: acquire the first description file of the first service according to the first instance ID; delete the plan and/or the second instance ID and the first instance ID recorded in the first description file. Correspondence of the method of the node of the instance ID; starting from the first method, executing the deletion plan to be executed.
前述图6实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务管理装置,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务管理装置的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of FIG. 6 are also applicable to the service management apparatus in this embodiment. The foregoing description of the service deployment method can be clearly known to those skilled in the art. In the example, the method of implementing the service management device is not described in detail for the sake of brevity of the description.
基于同一发明构思,本申请实施例还包括一种服务器,请参考图12所示,为本申请实施例中的服务器的系统框图。如图10所示,该服务器包括:接收器901,用于接收针对第二服务的第二实例标识ID的删除请求,删除请求中包含第二实例ID和欲执行的删除计划;处理器902,用于根据第二实例ID获取第二服务的服务部署包,服务部署包包括删除计划和第二描述文件;确定第二描述文件中包括第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息;在删除计划的第一个节点的第一个方法前插入标记,标记表示解除第二服务对第一实例ID的计划和/或第一实例ID的节点的方法的执行的限制;执行插入标记后的删除计划。Based on the same inventive concept, the embodiment of the present application further includes a server. Referring to FIG. 12, it is a system block diagram of a server in the embodiment of the present application. As shown in FIG. 10, the server includes: a receiver 901, configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes a second instance ID and a deletion plan to be executed; the processor 902, a service deployment package for acquiring a second service according to the second instance ID, the service deployment package includes a deletion plan and a second description file; and determining, in the second description file, a plan that includes the second service restriction to execute the first instance ID of the first service And/or information of the method of the node of the first instance ID; inserting a flag before the first method of deleting the first node of the plan, the flag indicating that the second service is released from the plan and/or the first instance of the first instance ID The execution limit of the method of the node of the ID; the deletion plan after the insertion of the markup.
可选的,处理器902具体用于:根据第一实例ID获取第一服务的第一描述文件;删除第一描述文件中记录的第二实例ID和第一实例ID的计划和/或第一实例ID的节点的方法的对应关系;从第一方法开始执行欲执行的删除计划。Optionally, the processor 902 is specifically configured to: acquire the first description file of the first service according to the first instance ID; delete the plan and/or the first instance ID and the first instance ID recorded in the first description file. Correspondence of the method of the node of the instance ID; starting from the first method, executing the deletion plan to be executed.
进一步,在图12中,总线架构(用总线900来代表),总线900可以包括任意数量的互联的总线和桥,总线900将包括由处理器902代表的一个或多个处理器和存储器904代表的存储器的各种电路链接在一起。总线900还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口905在总线900和处理器902、接收器901、发送器903之间提供接口。接收器901和发送器903用于服务器与外部设备进行数据通信。Further, in FIG. 12, a bus architecture (represented by bus 900), bus 900 can include any number of interconnected buses and bridges, and bus 900 will include one or more processors and memory 904 represented by processor 902. The various circuits of the memory are linked together. The bus 900 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art, and therefore, will not be further described herein. Bus interface 905 provides an interface between bus 900 and processor 902, receiver 901, and transmitter 903. The receiver 901 and the transmitter 903 are used for data communication between the server and an external device.
处理器902负责管理总线900和通常的处理。存储器904可以被用于存储处理器902在执行操作时所使用的数据。 Processor 902 is responsible for managing bus 900 and the usual processing. Memory 904 can be used to store data used by processor 902 in performing operations.
该服务器例如为CSP服务器。This server is for example a CSP server.
前述图6实施例中的服务管理方法中的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对服务管理方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在 此不再详述。The various changes and specific examples in the service management method in the foregoing embodiment of FIG. 6 are also applicable to the server in this embodiment. The foregoing detailed description of the service management method can be clearly known to those skilled in the art. The implementation method of the server, so for the simplicity of the manual, This is not detailed.
申请实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the application embodiments have at least the following technical effects or advantages:
本申请实施例中,在第二服务的第二描述文件中包括有第二服务限制执行第一服务的第一实例ID的计划和/或第一实例ID的节点的方法的信息,其中,第一服务为已部署的服务。因此,当部署新的服务,即第二服务时,除了执行部署计划部署第二服务之外,还根据所述信息,在第一服务的第一描述文件中记录第二实例ID与第一实例ID的计划和/或第一实例ID的节点的方法的对应关系。因为第二描述文件中只要包含需要限制执行的计划和/或方法的信息,而不用将第一服务部署包中的所有内容都写入,所以节约了开发服务部署包的资源以及传输资源。而且,只要将第二实例ID和所述第一实例ID的计划和/或第一实例ID的节点的方法的对应关系写入第一服务的描述文件中即可,而不用再次部署第一服务的部署包中的内容,所以节约了服务器的部署资源。进一步,通过限制执行第一实例ID的计划和/或节点的方法,可以避免因为对这些计划和/或方法的执行而导致第二服务无法运行。In the embodiment of the present application, the second description file of the second service includes information that the second service restricts the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID, where A service is a deployed service. Therefore, when the new service, that is, the second service, is deployed, in addition to executing the deployment plan to deploy the second service, the second instance ID and the first instance are recorded in the first description file of the first service according to the information. Correspondence between the plan of the ID and/or the method of the node of the first instance ID. Since the second description file contains information that needs to restrict the execution of the plan and/or method without writing all the contents of the first service deployment package, the resources of the development service deployment package and the transmission resources are saved. Moreover, as long as the correspondence between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID is written in the description file of the first service, the first service is not deployed again. The content of the deployment package saves the server's deployment resources. Further, by limiting the method of executing the plan and/or node of the first instance ID, it can be avoided that the second service cannot be run due to execution of these plans and/or methods.
图13为本发明又一实施例提供的一种服务部署的方法的流程图,本实施例与图4所述实施例的区别在于,本实施例中,CSP服务器将第二实例与第一实例的计划和/或第二实例与第一实例的节点的方法的对应关系记录在记录文件中,而不是第一服务的描述文件(即图4所述实施例中的第一描述文件)中。由于这种对应关系记录在记录文件中,而不是第一服务的描述文件中,所以后续针对第一服务继续部署的其他实例,将不受到第二服务的第二实例的影响。如图13所示,本实施例提供的方法包括以下步骤:FIG. 13 is a flowchart of a method for service deployment according to another embodiment of the present invention. The difference between this embodiment and the embodiment shown in FIG. 4 is that, in this embodiment, the CSP server uses the second instance and the first instance. The correspondence between the plan and/or the method of the second instance and the node of the first instance is recorded in the log file instead of the profile of the first service (i.e., the first profile in the embodiment described in FIG. 4). Since this correspondence is recorded in the log file instead of the profile of the first service, subsequent instances that are subsequently deployed for the first service will not be affected by the second instance of the second service. As shown in FIG. 13, the method provided in this embodiment includes the following steps:
步骤1301:接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;Step 1301: Receive a service deployment request, where the service deployment request includes information about a service deployment package of the second service.
具体的,第二服务的服务部署包的信息可以是服务部署包标识或者是保存服务部署包的统一资源标识符(Uniform Resource Identifier,URI),本发明对服务部署包的信息的具体形式不做限定。Specifically, the information about the service deployment package of the second service may be a service deployment package identifier or a Uniform Resource Identifier (URI) of the service deployment package, and the specific form of the information of the service deployment package is not used by the present invention. limited.
步骤1302:根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的 描述文件;Step 1302: Obtain a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a second service Description file
具体的,第二服务的服务部署包可以在CSC设备发送服务部署请求之前,发送给CSP服务器保存在本地,或者是由CSC设备上传到网络侧的第三方设备上,亦或者是随着服务部署请求一起发送给CSP设备。需说明的是,这里的第二服务的描述文件即是图4所述实施例中的第二描述文件。Specifically, the service deployment package of the second service may be sent to the CSP server to be saved locally before the CSC device sends the service deployment request, or uploaded to the third-party device on the network side by the CSC device, or deployed with the service. Requests are sent to the CSP device together. It should be noted that the description file of the second service herein is the second description file in the embodiment shown in FIG.
步骤1301-1302主要是由CSC设备向CSP服务器发送服务部署请求,CSP服务器根据服务部署请求中的服务部署包的信息,获取待部署的服务部部署包。本发明对CSC设备什么时候以什么样的方式上传服务部署包,以及CSP服务器如何根据服务部署包的信息,获取待部署的服务部署包不做限定。Steps 1301-1302 are mainly to send a service deployment request to the CSP server by the CSC device, and the CSP server obtains the service deployment package to be deployed according to the information of the service deployment package in the service deployment request. When the CSC device uploads the service deployment package, and how the CSP server obtains the service deployment package according to the information of the service deployment package, the present invention does not limit the service deployment package to be deployed.
步骤1303:在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;Step 1303: After performing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier ID of the second service that has been deployed;
步骤1304:确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;Step 1304: Determine that the description file of the second service includes restriction information, where the restriction information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction Information of a method of performing a node of the first instance;
步骤1303和步骤1304与图4所述的实施例相同,相关内容参阅图4所述的实施例的方法,这里不再赘述。 Step 1303 and step 1304 are the same as the embodiment described in FIG. 4, and the related content refers to the method of the embodiment described in FIG. 4, and details are not described herein again.
步骤1305:根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Step 1305: Record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or a node in the first instance. Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the record file.
具体的,可以根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Specifically, the first instance ID may be obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the second instance ID is recorded in the record file of the first instance Corresponding relationship of the plan ID of the first instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, and recording the second instance ID in the node record file of the first instance Correspondence with the method ID of the node of the first instance.
步骤1305与图4所述的实施例步骤104-步骤105的区别在于,本实施例中所述第二实例与所述第一实例的计划的对应关系和/或所述第二实例与所述第一实例的节点的方法的对应关系是记录在记录文件中,而不是第一服务的描述文件中的。为了突出区别点,下面以图4所述的实施例中的一个例子来描述其中的区别: The step 1305 is different from the step 104-105 of the embodiment described in FIG. 4 in that the corresponding relationship between the second instance and the plan of the first instance and/or the second instance and the The correspondence of the methods of the nodes of the first instance is recorded in the log file, not in the profile of the first service. In order to highlight the difference, the difference is described below with an example in the embodiment described in FIG. 4:
假设第一服务和第二服务的服务部署包均包括两个计划:部署计划(BuildPlan)和删除计划(TerminatePlan)。第一服务和第二服务中的每个节点都有4个方法,分别为:开始、配置、停止和移除。在实际运用中,服务部署包还可以包括其他计划,例如更新计划。每个节点的方法也可以是其他方法,例如重启、更新,本申请不作具体限定。Assume that the service deployment package for the first service and the second service includes two plans: a deployment plan (BuildPlan) and a delete plan (TerminatePlan). Each node in the first service and the second service has four methods: start, configure, stop, and remove. In practice, the service deployment package can also include other plans, such as an update plan. The method of each node may also be other methods, such as restarting and updating, which is not specifically limited in this application.
此时,假设第一服务(ServiceA)已经部署完成,即在云平台上运行。第一服务(ServiceA)的服务实例,即第一实例ID为ServiceA-1;第一实例的记录文件,例如称为记录文件A。进一步,CSP服务器还记录了记录文件A与第一实例的映射关系。需要说明的是,第一服务在不同的服务器上进行部署,就会有不同的服务实例,在本实施例中,假设第一服务在该服务器上的部署的实例为第一实例,对于第一服务的其他服务实例,实施的方法相同。At this point, assume that the first service (ServiceA) has been deployed, that is, running on the cloud platform. The service instance of the first service (ServiceA), that is, the first instance ID is ServiceA-1; the record file of the first instance is, for example, a record file A. Further, the CSP server also records the mapping relationship between the record file A and the first instance. It should be noted that, when the first service is deployed on different servers, there will be different service instances. In this embodiment, it is assumed that the deployed instance of the first service on the server is the first instance, for the first Other service instances of the service are implemented in the same way.
假设第二服务为ServiceB,第二服务的描述文件为描述文件B,其中描述文件B的文件名为ServiceB.ste。Assume that the second service is ServiceB, and the description file of the second service is description file B, wherein the file name of the description file B is ServiceB.ste.
当需要部署第二服务时,CSC设备将服务部署请求发送给CSP服务器。即CSP服务器执行本实施例方法中的步骤1301,接收服务部署请求,CSP服务器根据服务部署请求中的服务部署包的信息,获取第二服务的服务部署包。该第二服务的服务部署包中包括部署计划和描述文件B。在其他实施例中,该服务部署包中还可以包括其他计划,例如删除计划,重启计划等。本实例并不限定服务部署包的具体获取方式。When the second service needs to be deployed, the CSC device sends a service deployment request to the CSP server. That is, the CSP server performs the step 1301 in the method of the embodiment to receive the service deployment request, and the CSP server obtains the service deployment package of the second service according to the information of the service deployment package in the service deployment request. The deployment plan and description file B are included in the service deployment package of the second service. In other embodiments, the service deployment package may also include other plans, such as deleting the plan, restarting the plan, and the like. This example does not limit the specific acquisition method of the service deployment package.
在获取到第二服务的服务部署包后,可以根据第二服务的描述文件B执行部署计划。After obtaining the service deployment package of the second service, the deployment plan may be executed according to the description file B of the second service.
然后执行步骤1303,在部署完成后,获取已部署的第二服务的第二实例ID。其中,执行部署计划为本领域技术人员所熟知的内容,所以在此不再赘述。获取第二实例ID,具体例如是CSP服务器为ServiceB创建或分配一个实例ID为ServiceB-1。Then, step 1303 is performed, and after the deployment is completed, the second instance ID of the deployed second service is obtained. The execution deployment plan is well known to those skilled in the art, so it will not be described here. The second instance ID is obtained, for example, the CSP server creates or allocates an instance ID to ServiceB-1 for ServiceB.
接下来执行步骤1304,确定所述第二服务的描述文件中包括限制信息。步骤1304与图4所述的实施例相同,这里不再赘述。Next, in step 1304, it is determined that the restriction information is included in the description file of the second service. Step 1304 is the same as the embodiment described in FIG. 4, and details are not described herein again.
接下来执行步骤1305,即根据第一实例ID,获取第一实例的记录文件。例如,CSP服务器根据记录的记录文件和实例ID对应的映射关系,查询到与第一实例ID对应的记录文件。在本实施例中,例如获得了记录文件A。根据 所述限制信息,在记录文件A中记录所述第二实例与所述第一实例的计划的对应关系,和/或根据记录文件A,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例与所述第一实例的节点的方法的对应关系。Next, step 1305 is performed, that is, the record file of the first instance is obtained according to the first instance ID. For example, the CSP server queries the record file corresponding to the first instance ID according to the mapping relationship between the recorded record file and the instance ID. In the present embodiment, for example, the log file A is obtained. According to Determining the correspondence between the second instance and the plan of the first instance in the record file A, and/or acquiring the node record file of the first instance according to the record file A, in the first Corresponding relationship between the method of the second instance and the node of the first instance is recorded in the node record file of the instance.
具体的,一个服务实例包含多个节点,在运行时,每个实例对应一个记录文件,每个节点也各自对应一个记录文件。对计划的限制关系需写入实例的记录文件,对节点方法的限制关系需写入节点的记录文件。可以按照代码(7)在记录文件A的LimitedPlans字段中增加以下信息:Specifically, a service instance includes multiple nodes. At runtime, each instance corresponds to one record file, and each node also corresponds to one record file. The restriction relationship to the plan needs to be written to the record file of the instance, and the restriction relationship of the node method needs to be written to the record file of the node. The following information can be added to the LimitedPlans field of the log file A according to the code (7):
Figure PCTCN2015078914-appb-000011
Figure PCTCN2015078914-appb-000011
根据记录文件A获取节点AppA的记录文件A_1,按照代码(8)在记录文件A_1的LimitedOperations字段中增加以下限制信息:According to the record file A, the record file A_1 of the node AppA is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_1 according to the code (8):
Figure PCTCN2015078914-appb-000012
Figure PCTCN2015078914-appb-000012
根据记录文件A获取节点AppADb的记录文件A_2,按照代码(9)在记录文件A_2的LimitedOperations字段中增加以下限制信息:According to the record file A, the record file A_2 of the node AppADb is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_2 according to the code (9):
Figure PCTCN2015078914-appb-000013
Figure PCTCN2015078914-appb-000013
Figure PCTCN2015078914-appb-000014
Figure PCTCN2015078914-appb-000014
根据记录文件A获取节点Apache的记录文件A_3,按照代码(10)在记录文件A_3的LimitedOperations字段中增加以下限制信息:According to the record file A, the node Apache record file A_3 is obtained, and the following restriction information is added to the LimitedOperations field of the record file A_3 according to the code (10):
Figure PCTCN2015078914-appb-000015
Figure PCTCN2015078914-appb-000015
根据记录文件A获取节点MySql的记录文件A_4,按照代码(11)在记录文件A_4的LimitedOperations字段中增加以下限制信息:According to the record file A, the record file A_4 of the node MySql is obtained, and the following restriction information is added in the LimitedOperations field of the record file A_4 according to the code (11):
Figure PCTCN2015078914-appb-000016
Figure PCTCN2015078914-appb-000016
在实际运用中,除前述实施例中所描述的方式,还可以采用其他方式在记录文件中描述第二服务限制执行第一实例的计划和/或限制执行第一实例的节点方法,本申请对此不作限定。另外,具体如何记录第二实例和第一实例的计划和/或第一实例ID的节点的方法的对应关系,本申请对此也不作限定。In an actual application, in addition to the manner described in the foregoing embodiments, the method for describing the second service restriction execution of the first instance and/or the method for limiting the execution of the first instance may be described in the record file in other manners. This is not limited. In addition, the correspondence between the second instance and the method of the first instance and/or the method of the node of the first instance ID is specifically recorded, which is not limited in this application.
由以上描述可以看出,因为第二服务的描述文件中只要包含限制信息,而不用将第一服务部署包中的所有内容都写入,所以节约了开发服务部署包描述文件的资源以及传输资源。而且,只要将第二实例和所述第一实例的计划的对应关系写入第一服务的第一实例的记录文件中,和/或第二实例和第一实例的节点的方法的对应关系写入第一服务的第一实例的节点记录文件中即可,而不用再次部署第一服务的部署包中的内容,所以节约了服务器的部署资源。进一步,通过限制执行第一实例的计划和/或节点的方法,可以避免因为对这些计 划和/或节点的方法的执行而导致第二服务无法运行。As can be seen from the above description, since the description file of the second service only contains the restriction information without writing all the contents in the first service deployment package, the resources for developing the service deployment package description file and the transmission resources are saved. . Moreover, as long as the corresponding relationship of the plan of the second instance and the first instance is written in the record file of the first instance of the first service, and/or the correspondence between the methods of the node of the second instance and the first instance is written It is possible to enter the node record file of the first instance of the first service without re-deploying the content in the deployment package of the first service, thereby saving the deployment resources of the server. Further, by limiting the method of executing the plan and/or node of the first instance, it is possible to avoid The execution of the method and/or the method of the node causes the second service to fail.
当通过图13所述实施例所述的服务部署方法部署第二服务之后,会涉及到对第一服务和第二服务的管理,接下来将先描述对第一服务的管理过程。After the second service is deployed by the service deployment method described in the embodiment of FIG. 13, the management of the first service and the second service may be involved, and the management process for the first service will be described first.
请参考图14所示,为本申请实施例中服务管理方法的流程图,该方法包括以下内容:Please refer to FIG. 14 , which is a flowchart of a service management method in an embodiment of the present application, where the method includes the following content:
步骤1401:接收发送端发送的实例管理请求,所述实例管理请求包括第一实例ID以及欲执行的计划ID和/或节点的方法ID;Step 1401: Receive an instance management request sent by the sending end, where the instance management request includes a first instance ID and a plan ID to be executed and/or a method ID of the node;
举例来说,例如,CSC设备想要执行ServiceA的实例ServiceA-1中的某个计划或节点的方法,例如删除计划(TerminatePlan)。于是通过客户端向CSP服务器发送实例管理请求,该实例管理请求中包含ServiceA实例的ID ServiceA-1和欲执行的计划ID TerminatePlan。For example, for example, the CSC device wants to execute a plan or node method in the instance ServiceA-1 of ServiceA, such as a delete plan (TerminatePlan). Then, the instance management request is sent to the CSP server through the client, and the instance management request includes the ID of the ServiceA instance, ServiceA-1, and the plan ID, TerminatePlan, to be executed.
步骤1402:根据所述第一实例ID,获取所述第一实例的记录文件,和/或根据所述第一实例的记录文件获取第一实例的节点记录文件;Step 1402: Acquire a record file of the first instance according to the first instance ID, and/or obtain a node record file of the first instance according to the record file of the first instance;
其中,第一实例的记录文件中记录了第二服务的第二实例ID与第一实例ID的计划的对应关系,第一实例的节点记录文件分别记录了第二实例ID与第一实例各个的节点的方法ID的对应关系。The record of the first instance records the corresponding relationship between the second instance ID of the second service and the plan of the first instance ID, and the node record file of the first instance records the second instance ID and the first instance respectively. The correspondence between the method IDs of the nodes.
举例来说,所述对应关系具体是通过图13所述实施例中步骤1301至步骤1305所描述的方式写入的,也可以是通过其他方式写入的,本申请不作限定。For example, the corresponding relationship is specifically written in the manner described in the steps 1301 to 1305 in the embodiment of FIG. 13 , and may be written in other manners, which is not limited in this application.
根据第一实例ID获取第一服务的第一实例的记录文件,以及根据第一实例的记录文件获取第一实例的节点的记录文件的过程参阅图13所述实施例的相关描述,此处不再赘述。The process of acquiring the record file of the first instance of the first service according to the first instance ID, and acquiring the record file of the node of the first instance according to the record file of the first instance, refer to the related description of the embodiment described in FIG. Let me repeat.
步骤1401-步骤1402用于获取第一实例的记录文件和/或第一实例的节点记录文件。当需要执行的是节点的方法时,可选的,步骤1401-步骤1402也可以为:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;根据所述欲执行的节点ID获取欲执行的节点记录文件。Step 1401 - Step 1402 is used to acquire a record file of the first instance and/or a node record file of the first instance. When the method of the node needs to be performed, optionally, step 1401 - step 1402 may also be: receiving an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method of the node to be executed. ID; acquiring a node record file to be executed according to the node ID to be executed.
步骤1403:确定欲执行的计划和/或节点的方法的执行受到第二服务的第二实例的限制;Step 1403: Determine that execution of the plan to be executed and/or the method of the node is restricted by the second instance of the second service;
具体来说,通过检测第一实例的记录文件,确定欲执行的计划ID是否位于所述第二实例ID与所述第一实例的计划ID的对应关系中,和/或通过检测 第一实例的节点记录文件,确定欲执行的节点的方法ID是否位于所述第二实例ID与所述第一实例的节点的方法ID的对应关系中。如果所述第一实例的记录文件中记录了第二服务的第二实例与所述第一实例的计划的对应关系,则确定所述欲执行的计划的执行受到所述第二实例的限制;或者如果第一实例的节点记录文件中记录了所述第二实例与所述第一实例的节点的方法的对应关系,确定所述节点的方法的执行受到所述第二实例的限制。Specifically, by detecting the record file of the first instance, determining whether the plan ID to be executed is located in the correspondence between the second instance ID and the plan ID of the first instance, and/or by detecting The node record file of the first instance determines whether the method ID of the node to be executed is located in the correspondence between the second instance ID and the method ID of the node of the first instance. If the record of the first instance records the corresponding relationship between the second instance of the second service and the plan of the first instance, determining that execution of the plan to be executed is restricted by the second instance; Or if the correspondence between the method of the second instance and the node of the first instance is recorded in the node record file of the first instance, the execution of the method for determining the node is restricted by the second instance.
举例来说,检查记录文件A,确定ServiceB的实例ServiceB-1对实例ServiceA-1的TerminatePlan的限制。具体来说就是检查记录文件A的LimitedPlans字段,如果“TerminatePlan”出现在“LimitedPlans”中,说明删除计划被限制执行了,反之则没有。检查节点的方法时,首先需要根据记录文件A获取节点记录文件,然后分别检查各个节点记录文件的“LimitedOperations”字段,如果欲执行的节点的方法出现在“LimitedOperations”中,说明该方法被限制执行了。For example, check the record file A to determine the limit of the ServiceB instance ServiceB-1 to the TerminatePlan of the instance ServiceA-1. Specifically, it is to check the LimitedPlans field of the log file A. If "TerminatePlan" appears in "LimitedPlans", the deletion plan is restricted to be executed, otherwise it is not. When checking the method of a node, you first need to obtain the node record file according to the record file A, and then check the "LimitedOperations" field of each node record file separately. If the method of the node to be executed appears in "LimitedOperations", the method is restricted. It is.
步骤1404:发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。Step 1404: Send a message rejecting the method of executing the plan and/or the node to be executed to the sender.
例如通过步骤1403的确定过程,确定出欲执行的计划和/或方法受到第二服务的限制,那么就发送拒绝消息给所述发送端。For example, by the determining process of step 1403, it is determined that the plan and/or method to be executed is restricted by the second service, then a reject message is sent to the sender.
可选的,拒绝消息中可以包含第二服务的第二实例ID。例如包含ServiceB的服务实例ID ServiceB-1,以说明是ServiceB-1对实例ServiceA-1做了限制,从而拒绝了该请求。如此可以保证不影响第二服务的正常运行。Optionally, the second instance ID of the second service may be included in the reject message. For example, the service instance ID ServiceB-1 of ServiceB is included to indicate that ServiceB-1 has restricted the instance ServiceA-1, thereby rejecting the request. This can ensure that the normal operation of the second service is not affected.
关于第二实例ID,具体即为代码(7至11)中的属性“appliesFromService”的值,所以读取该属性的值,即可获得第二服务的第二实例ID,即ServiceB-1。Regarding the second instance ID, specifically, the value of the attribute "appliesFromService" in the code (7 to 11), so reading the value of the attribute, the second instance ID of the second service, that is, ServiceB-1, can be obtained.
可选的,当确定欲执行的计划和/或方法的执行没有受到第二服务的限制时,就可以执行欲执行的计划和/或方法,例如删除计划。Alternatively, when it is determined that the execution of the plan and/or method to be executed is not restricted by the second service, the plan and/or method to be executed may be executed, such as deleting the plan.
可选的,欲执行的计划为删除计划、更新计划、重启计划和停止计划中的至少一个;欲执行的方法为删除方法、更新方法、重启方法和停止方法中的至少一个。Optionally, the plan to be executed is at least one of a delete plan, an update plan, a restart plan, and a stop plan; the method to be executed is at least one of a delete method, an update method, a restart method, and a stop method.
当然,在实际运用中,还可以是其他计划和/或节点的方法,本申请不作限定。Of course, in actual use, it may also be a method of other plans and/or nodes, which is not limited in this application.
由以上描述可以看出,在对第一服务进行管理时,先要确定欲执行的计划 和/或方法的执行没有受到其它服务的限制,如果欲执行的计划和/或节点的方法的执行受到其它服务的限制的话,就拒绝请求。这样一来,在对第一服务进行管理时,就可以保证不影响限制了该计划和/或节点的方法的执行的服务的正常运行。As can be seen from the above description, when managing the first service, it is necessary to first determine the plan to be executed. The execution of the method and/or method is not limited by other services, and the request is rejected if the execution of the plan and/or the method of the node is restricted by other services. In this way, when the first service is managed, it is guaranteed that the normal operation of the service that restricts the execution of the method of the plan and/or the node is not affected.
接下来再描述对第二服务的管理过程,请参考图15所示,为本实施例中对第二服务的管理方法的流程图。该方法包括以下内容:Next, the management process of the second service is described. Referring to FIG. 15, a flowchart of the method for managing the second service in this embodiment is shown. The method includes the following:
步骤1501:接收实例删除请求,删除请求中包含第二实例ID和欲执行的删除计划ID。Step 1501: Receive an instance deletion request, where the deletion request includes a second instance ID and a deletion plan ID to be executed.
举例来说,删除请求中包含的第二实例ID为ServiceB-1。删除请求中包括的欲执行的删除计划的为TerminatePlan。For example, the second instance ID included in the delete request is ServiceB-1. The deletion plan to be executed included in the deletion request is TerminatePlan.
步骤1502:根据第二实例ID获取第二服务的服务部署包,所述服务部署包包括所述欲执行的删除计划ID对应的删除计划和第二服务的描述文件;Step 1502: Obtain a service deployment package of the second service according to the second instance ID, where the service deployment package includes a deletion plan corresponding to the deletion plan ID to be executed and a description file of the second service.
举例来说,通过实例ID ServiceB-1获取第二服务的服务部署包,该服务部署包包括描述文件B和TerminatePlan。For example, the service deployment package of the second service is obtained by using the instance ID ServiceB-1, and the service deployment package includes a description file B and a TerminatePlan.
步骤1503:确定第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息。Step 1503: Determine that the description file of the second service includes restriction information, where the restriction information includes information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction execution Information about the method of the node of the first instance.
具体来说,如果描述文件B中有对第一实例的计划和/或节点的方法的限制,那么描述文件B中就会包括如前述代码(3)和代码(6),所以可以通过检查描述文件B中是否包含这样的代码段来判断第二服务是否有对其他服务实例的计划和/或节点的方法的执行的限制。并且,可以从该代码段中的属性“appliesToService”的值获知受限制的服务实例ID。Specifically, if there is a limitation in the description file B on the plan of the first instance and/or the method of the node, the description file B includes the code (3) and the code (6) as described above, so the description can be checked by Whether or not such a code segment is included in the file B is to determine whether the second service has restrictions on the execution of the plan of the other service instance and/or the method of the node. And, the restricted service instance ID can be known from the value of the attribute "appliesToService" in the code segment.
在本实施例中,第一服务的第一实例泛指所有受到第二服务限制的实例。In this embodiment, the first instance of the first service generally refers to all instances that are subject to the second service restriction.
假设第二服务为ServiceB,第一服务为ServiceA,那么通过前述的实施例描述可知,描述文件B中有对ServiceA-1的计划和/或节点的方法的执行的限制。Assuming that the second service is ServiceB and the first service is ServiceA, it can be seen from the description of the foregoing embodiment that the description file B has restrictions on the execution of the plan of the ServiceA-1 and/or the method of the node.
当结果为没有时,那么就直接执行删除计划即可。When the result is not, then the deletion plan can be executed directly.
当结果为有时,那么接下来执行步骤1504:When the result is sometimes, then step 1504 is performed:
步骤1504:根据所述限制信息,获取所述第一实例ID;Step 1504: Acquire the first instance ID according to the restriction information.
步骤1505:根据所述第一实例ID,获取所述第一实例的记录文件; Step 1505: Obtain a record file of the first instance according to the first instance ID.
步骤1506:删除所述第一实例的记录文件中第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;Step 1506: Delete the correspondence between the second instance ID in the record file of the first instance and the plan ID of the first instance, and/or obtain the first instance according to the record file of the first instance. a node record file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
步骤1507:根据所述第二服务的描述文件执行所述删除计划。Step 1507: Perform the deletion plan according to the description file of the second service.
具体的,将第一实例的记录文件和/或各节点记录文件中的对应关系删除,以此来解除第二实例对第一实例的计划和/或节点的方法的执行的限制,使得该计划和/或方法能够被执行。Specifically, the correspondence between the record file of the first instance and/or the record file of each node is deleted, thereby releasing the restriction of the execution of the plan of the first instance and/or the method of the node by the second instance, so that the plan And/or methods can be performed.
其中,通过第二服务的描述文件获取第一实例ID,可以如前所述,通过该描述文件中的代码段中的属性“appliesToService”的值获知受限制的服务的实例ID。具体请参看图4所述实施例的相关描述,这里不再赘述。通过第一实例ID获取第一服务的第一实例的记录文件以及根据第一实例的记录文件获取各节点的记录文件的步骤也可以按照前述所描述的方式来实施,这里不再赘述。The first instance ID is obtained by using the description file of the second service. The instance ID of the restricted service can be obtained by the value of the attribute “appliesToService” in the code segment in the description file as described above. For details, please refer to the related description of the embodiment shown in FIG. 4, and details are not described herein again. The step of obtaining the record file of the first instance of the first service by using the first instance ID and acquiring the record file of each node according to the record file of the first instance may also be implemented in the manner described above, and details are not described herein again.
删除记录文件中记录的对应关系,具体来说,就是查找第一实例的记录文件A的LimitedPlans元素和/或节点记录文件(如记录文件A_1)的LimitedOperations元素是否包含属性”appliesFromService”值为ServiceB-1的子元素,并删除这些子元素。Delete the correspondence recorded in the record file. Specifically, it is to find whether the LimitedOlanations element of the Recorded File A of the first instance and/or the LimitedOperations element of the node record file (such as the record file A_1) contains the attribute "appliesFromService" value is ServiceB- Sub-elements of 1 and remove these sub-elements.
当在步骤1506中执行完删除对应关系相关的内容之后,即可以执行删除计划中各个节点上的各个方法,该部分为本领域技术人员所熟知的内容,所以在此不再赘述。After the content related to the deletion of the correspondence is performed in step 1506, the respective methods on the nodes in the deletion plan can be executed, which are well-known to those skilled in the art, and therefore will not be described herein.
由以上描述可以看出,即使第二服务对第一服务的实例的计划和/或节点的方法的执行有限制,但是也可以单独管理第二服务,保证了第二服务管理的独立性,提高了服务管理的灵活性。It can be seen from the above description that even if the second service has restrictions on the planning of the instance of the first service and/or the execution of the method of the node, the second service can be separately managed to ensure the independence of the second service management and improve The flexibility of service management.
为了进一步提高服务部署的灵活性,图16为本发明又一实施例提供的一种服务部署的方法的流程图。本实施例与图4、图13所述实施例的区别在于,本实施例中,第二服务的描述文件中不记录第二服务对第一服务的第一实例的限制信息。当需要部署第二服务,且要求引用第一服务的第一实例时,CSC设备通过在发送给CSP服务器的服务部署请求中携带所述限制信息。CSP服务器在第二实例的记录文件中记录关联信息,指示第二实例与第一实例存在关 联关系;并且根据所述限制信息,在第一实例的记录文件中记录所述第二实例与所述第一实例的计划的对应关系和/或在第一实例的节点记录文件中记录所述第二实例与所述第一实例的节点的方法的对应关系。当CSP服务器管理第二实例时,就会根据该关联信息去检查第一实例的记录文件和/或第一实例的节点记录文件。由于这种限制关系不是记录在第一服务的描述文件中,所以后续部署第二服务时,可以有其他的限制关系,如可以实现限制执行第三服务的第三实例的计划而对第一服务的第一实例的计划没有限制。如图16所示,本实施例提供的方法包括以下步骤:To further improve the flexibility of service deployment, FIG. 16 is a flowchart of a method for service deployment according to another embodiment of the present invention. The difference between the embodiment and the embodiment shown in FIG. 4 and FIG. 13 is that, in this embodiment, the restriction information of the second service to the first instance of the first service is not recorded in the description file of the second service. When the second service needs to be deployed and the first instance of the first service is required to be referenced, the CSC device carries the restriction information in the service deployment request sent to the CSP server. The CSP server records the association information in the record file of the second instance, indicating that the second instance has a relationship with the first instance. And according to the restriction information, recording a correspondence between the plan of the second instance and the first instance in a record file of the first instance and/or recording the record in a node record file of the first instance Correspondence between the second instance and the method of the node of the first instance. When the CSP server manages the second instance, the record file of the first instance and/or the node record file of the first instance are checked according to the association information. Since the restriction relationship is not recorded in the description file of the first service, when the second service is subsequently deployed, there may be other restriction relationships, such as a plan for restricting execution of the third instance of the third service to the first service. There is no limit to the plan for the first instance. As shown in FIG. 16, the method provided in this embodiment includes the following steps:
步骤1601:接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;Step 1601: Receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of the second service, where the restriction information includes information that the second service restricts execution of the plan of the first instance, and / or the second service restricts information of a method of executing a node of the first instance;
步骤1602:根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;Step 1602: Obtain a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service.
步骤1603:在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;Step 1603: After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier ID of the second service that has been deployed and a record file of the second instance;
步骤1604:根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;Step 1604: Record association information in the record file of the second instance according to the restriction information, where the association information includes a first instance ID;
步骤1605:根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Step 1605: Record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or a node in the first instance. Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the record file.
本实例与图13所述实施例相同的步骤或方法,请参阅图13实施例的相关内容,这里不再赘述。下面依据本实施例的方法,介绍一种可选实现方式。For the same steps or methods as the embodiment shown in FIG. 13 , please refer to the related content of the embodiment of FIG. 13 , and details are not described herein again. An alternative implementation is described below in accordance with the method of the present embodiment.
可选的,在第二服务的描述文件的服务模板(ServiceTemplate)中包括限制策略模板(Limited Policy templates)。所述限制策略模板结合输入的变量,即可生成相应的限制策略信息。具体的,为了支持对输入变量的定义和获取,本实施例采用YAML语言定义描述文件。其中,第二服务的描述文件B包含 以下代码(代码12):Optionally, a limited policy template is included in a service template of the description file of the second service. The restriction policy template combines the input variables to generate corresponding restriction policy information. Specifically, in order to support the definition and acquisition of input variables, the present embodiment uses a YAML language to define a description file. Wherein, the description file B of the second service includes The following code (code 12):
Figure PCTCN2015078914-appb-000017
Figure PCTCN2015078914-appb-000017
其中,Limited_Policy_templates字段定义限制策略的模板,rule描述该限制策略的具体规则,包含限制计划(limit.plans)和限制方法(limit.operations)两种功能,限制计划功能需要指定请求的实例ID和被限制的计划ID,限制方法(limit.operations)功能需要指定节点ID和被限制的方法ID。get_input说明通过输入获取这些信息,当然也可以在描述文件中直接指定其中的部分或全部信息,若在描述文件中指定全部信息,那么本实施例将与图13所述实施例相同。inputs字段定义需要通过输入获取的信息来确定。在本实施例中这些信息包含在服务部署请求中,假设这里被请求的服务实例为ServiceA-1,受限制的计划为删除计划(TerminatePlan),受限制的节点ID为AppA,AppADb, Apache和MySql,受限制的节点方法为stop,那么在服务部署请求中可以包含以下限制信息:The Limited_Policy_templates field defines a template for the restriction policy, and the rule describes the specific rules of the restriction policy, including the restriction plan (limit.plans) and the limit method (limit.operations). The restriction plan function needs to specify the instance ID of the request and is The restricted plan ID, limit method (limit.operations) function needs to specify the node ID and the restricted method ID. The get_input description acquires the information by input, and of course, some or all of the information may be directly specified in the description file. If all the information is specified in the description file, the embodiment will be the same as the embodiment described in FIG. The inputs field defines the information that needs to be obtained by input. In this embodiment, the information is included in the service deployment request, assuming that the requested service instance is ServiceA-1, the restricted plan is the termination plan (TerminatePlan), and the restricted node ID is AppA, AppADb, Apache and MySql, the restricted node method is stop, then the following restriction information can be included in the service deployment request:
代码(13)Code (13)
reference_instance_id_01:“ServiceA-1”Reference_instance_id_01: "ServiceA-1"
limited_plans_of_id_01:“TermiatePlan”Limited_plans_of_id_01: "TermiatePlan"
node_01_of_id_01:“AppA”Node_01_of_id_01: "AppA"
limited_operations_of_node_01_of_id_01:“stop”,”remove”Limited_operations_of_node_01_of_id_01: "stop", "remove"
node_02_of_id_01:“AppADb”Node_02_of_id_01: "AppADb"
limited_operations_of_node_02_of_id_01:“stop”,”remove”Limited_operations_of_node_02_of_id_01: "stop", "remove"
node_03_of_id_01:”Apache”Node_03_of_id_01: "Apache"
limited_operations_of_node_03_of_id_01:“stop”,”remove”Limited_operations_of_node_03_of_id_01: "stop", "remove"
node_04_of_id_01:”MySql”Node_04_of_id_01: "MySql"
limited_operations_of_node_04_of_id_01:“stop”,”remove”Limited_operations_of_node_04_of_id_01: "stop", "remove"
接下来需要在第二实例的记录文件B中添加关联信息,所述关联信息至少包括第一实例ID:Next, it is necessary to add association information in the record file B of the second instance, the association information including at least the first instance ID:
代码(14)Code (14)
<AppliesToServices>#被请求的服务实例<AppliesToServices>#Requested Service Instance
<ServiceInstance id=”ServiceA-1”>#被请求的服务实例ID为ServiceA-1<ServiceInstance id=”ServiceA-1”>#The requested service instance ID is ServiceA-1
<\AppliesToServices>#结束被请求的服务实例字段<\AppliesToServices>#End the requested service instance field
第二实例的记录文件B也可以包括被限制的第一实例的计划和节点的方法的信息,本实施例并不限定除第一实例ID之外的内容。The record file B of the second example may also include information of the plan of the restricted first instance and the method of the node, and the present embodiment does not limit the content other than the first instance ID.
CSP服务器根据服务部署请求中的限制信息,即可获取ServiceB限制执行第一服务的第一实例ServiceA-1的计划(删除计划)和所有节点的方法(Stop和Remove)的信息,并且能够获取到第一实例ID,在本实施例中,第一实例ID为ServiceA-1。According to the restriction information in the service deployment request, the CSP server can obtain the information that the ServiceB restricts the execution of the plan (delete plan) of the first instance ServiceA-1 of the first service and the methods (Stop and Remove) of all the nodes, and can obtain the information. The first instance ID, in this embodiment, the first instance ID is ServiceA-1.
根据第一实例ID,获取第一实例的记录文件。具体来说,例如是CSP服务器根据记录的记录文件和实例ID对应的映射关系,查询到与第一实例对应的记录文件。在本实施例中,例如获得了记录文件A。According to the first instance ID, the record file of the first instance is obtained. Specifically, for example, the CSP server queries the record file corresponding to the first instance according to the mapping relationship between the recorded record file and the instance ID. In the present embodiment, for example, the log file A is obtained.
执行步骤1605,CSP服务器在记录文件A的LimitedPlans字段中增加以下信息: In step 1605, the CSP server adds the following information to the LimitedPlans field of the record file A:
Figure PCTCN2015078914-appb-000018
Figure PCTCN2015078914-appb-000018
Figure PCTCN2015078914-appb-000019
Figure PCTCN2015078914-appb-000019
在实际运用中,除前述实施例中所描述的方式,还可以采用其他方式在第二服务的部署请求和描述文件中描述第二服务限制执行第一实例的计划和/或第一实例的节点方法,本申请对此不作限定。另外,具体如何记录第二实例和第一实例的计划和/或第一实例ID的节点的方法的对应关系,本申请对此也不作限定。In an actual application, in addition to the manner described in the foregoing embodiments, the second service restriction execution execution of the plan of the first instance and/or the node of the first instance may be described in other manners in the deployment request and description file of the second service. The method is not limited in this application. In addition, the correspondence between the second instance and the method of the first instance and/or the method of the node of the first instance ID is specifically recorded, which is not limited in this application.
有上述描述可以看出,本实施例没有将第二服务对第一服务的第一实例的限制信息包含在第二服务的描述文件中,而是随着服务部署请求一起发送给CSP服务器的。因此,相对于图13所述的实施例描述的服务部署方法,本实施例在部署服务的时候,将具有更大的灵活性。例如,可以实现部署的第二服务的实例A,限制第一服务的实例B的删除计划;部署的第二服务的实例C,仅限制第一服务的实例D的删除计划,而不限制第一服务的实例B的删除计划。As can be seen from the above description, the embodiment does not include the restriction information of the second service on the first instance of the first service in the description file of the second service, but sends it to the CSP server along with the service deployment request. Therefore, with respect to the service deployment method described in the embodiment described in FIG. 13, the present embodiment will have greater flexibility in deploying services. For example, the instance A of the deployed second service may be implemented, the deletion plan of the instance B of the first service is restricted; the instance C of the deployed second service only limits the deletion plan of the instance D of the first service, without limiting the first The deletion plan for instance B of the service.
当通过图16所述的服务部署方法部署第二服务之后,会涉及到对第一服务和第二服务的管理。其中,对第一服务的管理过程与图14所述的实施例描述的方法相同,这里不再赘述。对第二服务的管理过程,请参考图17所示,为本实施例中对第二服务的管理方法的流程图。该方法包括以下内容:After the second service is deployed by the service deployment method described in FIG. 16, management of the first service and the second service may be involved. The management process of the first service is the same as the method described in the embodiment of FIG. 14, and details are not described herein again. For the management process of the second service, please refer to FIG. 17, which is a flowchart of the method for managing the second service in this embodiment. The method includes the following:
步骤1701:接收实例删除请求,所述实例删除请求中包含第二实例标识ID和欲执行的删除计划ID;Step 1701: Receive an instance deletion request, where the instance deletion request includes a second instance identifier ID and a deletion plan ID to be executed;
步骤1702:根据所述第二实例ID,获取对应的第二实例的记录文件和所述服务部署包,所述服务部署包中还包括所述欲执行的删除计划ID对应的删除计划;Step 1702: Obtain a record file of the corresponding second instance and the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed.
步骤1703:确定所述第二实例的记录文件中包括关联信息,所述关联信息包括第一实例ID;Step 1703: Determine that the record file of the second instance includes association information, where the association information includes a first instance ID.
步骤1704:根据所述第一实例ID,获取所述第一实例的记录文件; Step 1704: Acquire a record file of the first instance according to the first instance ID.
步骤1705:删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;Step 1705: Delete the correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or obtain the first according to the record file of the first instance. a node record file of the instance, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
步骤1706:执行所述删除计划。Step 1706: Perform the deletion plan.
本实例与图15所述实施例相同的步骤或方法,请参阅图15实施例的相关内容,这里不再赘述。For the same steps or methods as the embodiment of FIG. 15 , refer to the related content of the embodiment of FIG. 15 , and details are not described herein again.
由以上描述可以看出,即使第二服务对第一服务的实例的计划和/或节点的方法的执行有限制,但是也可以单独管理第二服务,保证了第二服务管理的独立性,提高了服务管理的灵活性。It can be seen from the above description that even if the second service has restrictions on the planning of the instance of the first service and/or the execution of the method of the node, the second service can be separately managed to ensure the independence of the second service management and improve The flexibility of service management.
基于与图13所述实施例同一发明构思,本申请实施例还提供一种服务部署装置,请参考图18所示,该服务部署装置包括:接收单元1801,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;处理单元1802,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Based on the same inventive concept as the embodiment in FIG. 13 , the embodiment of the present application further provides a service deployment apparatus. Referring to FIG. 18 , the service deployment apparatus includes: a receiving unit 1801, configured to receive a service deployment request, where The service deployment request includes the information of the service deployment package of the second service; the processing unit 1802 is configured to acquire the service deployment package of the second service according to the information of the service deployment package of the second service, where the service deployment The package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring the second of the second service that has been deployed An instance identifier ID; determining that the description file of the second service includes restriction information, the restriction information including information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service Restricting information of a method of executing the node of the first instance; recording the second instance ID in a log file of the first instance according to the restriction information Program ID corresponding relation to said first example, and / or recorded in a log file of the node in the first instance to the second instance node ID of the first example of the method ID.
其中,所述处理单元1802,用于根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关 系。The processing unit 1802 is configured to record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a log file of the first instance, and/or The corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, specifically: acquiring the first instance ID according to the restriction information; An instance ID, obtaining a record file of the first instance; recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or according to the first instance Recording file, obtaining a node record file of the first instance, and recording, in the node record file of the first instance, a correspondence between the second instance ID and a method ID of the node of the first instance system.
可选的,接收单元1801还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;Optionally, the receiving unit 1801 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the first instance After the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file, the receiving instance delete request is received, and the instance delete request includes the second instance ID and is to be executed. Delete plan ID;
所述处理单元1802,还用于根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二服务的描述文件中包括所述限制信息;根据所述限制信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。The processing unit 1802 is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining the second service The description file includes the restriction information; the first instance ID is obtained according to the restriction information; the record file of the first instance is acquired according to the first instance ID; and the record file of the first instance is deleted. Corresponding relationship between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, deleting the first instance Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance; the deletion plan is executed according to the description file of the second service.
可选的,装置还包括发送单元1803,Optionally, the device further includes a sending unit 1803,
所述接收单元1801还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例标识ID以及欲执行的计划ID;The receiving unit 1801 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or a node in the first instance After the record file records the correspondence between the second instance ID and the method ID of the node of the first instance, receiving an instance management request sent by the sending end, where the instance management request includes the first instance identifier ID and Plan ID of execution;
所述处理单元1802还用于:根据所述第一实例ID,获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的第二服务的第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制,The processing unit 1802 is further configured to: acquire, according to the first instance ID, a record file of the first instance; according to the second instance ID of the second service recorded in the record file of the first instance, Corresponding relationship of the plan ID of the first instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance,
所述发送单元1803用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或The sending unit 1803 is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
所述接收单元1801还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;The receiving unit 1801 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
所述处理单元1802还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据 所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的方法的ID对应的方法的执行受到所述第二实例的限制;The processing unit 1802 is further configured to: acquire the record file of the first instance according to the first instance ID; acquire the node record file of the first instance according to the record file of the first instance; Corresponding relationship between the second instance ID recorded in the node record file and the method ID of the node of the first instance, determining that the execution of the method corresponding to the ID of the method to be executed is performed by the second instance limit;
所述发送单元1803用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The sending unit 1803 is configured to: send a message rejecting the method of executing the node to be executed to the sending end; and/or
所述接收单元1801还用于:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;The receiving unit 1801 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
所述处理单元1802还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit 1802 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the first instance Corresponding relationship of the method ID of the node, determining that the method corresponding to the method ID of the node to be executed is restricted by the second instance;
所述发送单元1803用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。The sending unit 1803 is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
前述图13实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务部署装置,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务部署装置的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of the present invention are also applicable to the service deployment device of the embodiment. The foregoing description of the service deployment method can be clearly known to those skilled in the art. In the example, the implementation method of the service deployment device is not detailed here for the sake of brevity of the description.
基于与图16所述实施例同一发明构思,本申请实施例还提供一种服务部署装置,请参考图19所示,该服务部署装置包括:接收单元1901,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;处理单元1902,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。 Based on the same inventive concept as the embodiment in FIG. 16 , the embodiment of the present application further provides a service deployment apparatus. Referring to FIG. 19 , the service deployment apparatus includes: a receiving unit 1901, configured to receive a service deployment request, where The service deployment request includes information and restriction information of the service deployment package of the second service; the restriction information includes information that the second service restricts execution of the plan of the first instance, and/or the second service restriction execution The information about the method of the node of the first instance; the processing unit 1902, configured to acquire the service deployment package of the second service according to the information of the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed And a record file of the second instance; according to the restriction information, the association information is recorded in the record file of the second instance, the association information including the first instance I D: recording, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or a node record in the first instance Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the file.
其中,所述处理单元1902,用于根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:根据所述限制信息,获取第一实例ID;根据第一实例ID,获取第一实例的记录文件;在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。The processing unit 1902 is configured to record, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a log file of the first instance, and/or The corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, specifically: acquiring the first instance ID according to the restriction information; An instance ID, obtaining a record file of the first instance; recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or according to the first instance a record file, the node record file of the first instance is obtained, and the corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance.
可选的,接收单元1901还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;Optionally, the receiving unit 1901 is further configured to: record, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the first instance After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file, an instance delete request is received, where the instance delete request includes the second instance ID and the Delete the plan ID;
所述处理单元1902,还用于根据所述第二实例ID获取所述第二实例的记录文件;确定所述第二实例的记录文件中包括所述关联信息;根据所述关联信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;执行所述欲执行的删除计划ID对应的删除计划。The processing unit 1902 is further configured to acquire the record file of the second instance according to the second instance ID, determine that the record file of the second instance includes the association information, and acquire the location according to the association information. Deleting a first instance ID; acquiring a record file of the first instance according to the first instance ID; deleting the second instance ID of the record file of the first instance and a plan ID of the first instance Corresponding relationship, and/or acquiring the node record file of the first instance according to the record file of the first instance, deleting the second instance ID and the number recorded in the node record file of the first instance Corresponding relationship of the method ID of the node of the instance; executing the deletion plan corresponding to the deletion plan ID to be executed.
可选的,装置还包括发送单元1903,Optionally, the device further includes a sending unit 1903,
所述接收单元1901还用于:在所述处理单元在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID;The receiving unit 1901 is further configured to: record, in the recording file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the recording file After the corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, the instance management request sent by the sending end is received, where the instance management request includes the first The instance ID and the plan ID to be executed;
所述处理单元1902还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一 实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制;The processing unit 1902 is further configured to: acquire the record file of the first instance according to the first instance ID; and use the second instance ID and the first record recorded in the record file of the first instance Corresponding relationship of the plan ID of the instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance;
所述发送单元1903用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或The sending unit 1903 is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
所述接收单元1901还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;The receiving unit 1901 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
所述处理单元1902还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit 1902 is further configured to: acquire a record file of the first instance according to the first instance ID; acquire a node record file of the first instance according to the record file of the first instance; and record according to the node Corresponding relationship between the second instance ID recorded in the file and the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance;
所述发送单元1903用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The sending unit 1903 is configured to: send a message rejecting a method of executing the node to be executed to the sending end; and/or
所述接收单元1901还用于:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;The receiving unit 1901 is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
所述处理单元1902还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit 1902 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the first instance Corresponding relationship of the method ID of the node, determining that the method corresponding to the method ID of the node to be executed is restricted by the second instance;
所述发送单元1903用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。The sending unit 1903 is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
前述图16实施例中的服务部署方法中的各种变化方式和具体实例同样适用于本实施例的服务部署装置,通过前述对服务部署方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务部署装置的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service deployment method in the foregoing embodiment of the present invention are also applicable to the service deployment device in this embodiment. The foregoing description of the service deployment method can be clearly known to those skilled in the art. In the example, the implementation method of the service deployment device is not detailed here for the sake of brevity of the description.
基于与图13所述实施例同一发明构思,本申请实施例还包括一种服务器,请参考图20所示,为本申请实施例中的服务器的系统框图。如图20所示,该服务器包括:接收器2001,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;处理器2002,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括 第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Based on the same inventive concept as that of the embodiment shown in FIG. 13, the embodiment of the present application further includes a server. Referring to FIG. 20, it is a system block diagram of a server in the embodiment of the present application. As shown in FIG. 20, the server includes: a receiver 2001, configured to receive a service deployment request, the service deployment request includes information of a service deployment package of the second service, and a processor 2002, configured to be used according to the second service Information about the service deployment package, where the service deployment package of the second service is obtained, where the service deployment package includes a deployment plan of the second service and a description file of the second service; after executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier of the second service that has been deployed Determining, in the description file of the second service, restriction information, the restriction information including information that the second service restricts execution of a plan of the first instance of the first service, and/or the second service restriction execution The information about the method of the node of the first instance; the correspondence between the second instance ID and the plan ID of the first instance is recorded in the record file of the first instance according to the restriction information, and/ Or recording a correspondence between the second instance ID and a method ID of a node of the first instance in a node record file of the first instance.
可选的,接收器2001还用于接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID。处理器2002还用于根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二服务的描述文件中包括所述限制信息;根据所述限制信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。Optionally, the receiver 2001 is further configured to receive an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed. The processor 2002 is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining a description file of the second service. Include the restriction information; acquire the first instance ID according to the restriction information; acquire a record file of the first instance according to the first instance ID; delete the record file of the first instance Corresponding relationship between the second instance ID and the plan ID of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance, deleting the node record of the first instance Corresponding relationship between the second instance ID recorded in the file and the method ID of the node of the first instance; performing the deletion plan according to the description file of the second service.
可选的,接收器2001还用于接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID以及欲执行的计划ID。处理器2002还用于根据所述第一实例ID,获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2003用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed. The processor 2002 is further configured to acquire, according to the first instance ID, a record file of the first instance; according to the second instance ID recorded in the record file of the first instance and the plan of the first instance The correspondence of the IDs determines that the execution of the plan corresponding to the plan ID to be executed is limited by the second instance. Optionally, the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
可选的,接收器2001还用于接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID。处理器2002还用于根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行 的节点的方法ID对应的方法的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2003用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed. The processor 2002 is further configured to acquire the record file of the first instance according to the first instance ID, acquire a node record file of the first instance according to the record file of the first instance, and record the file according to the node record Corresponding relationship between the second instance ID and the method ID of the node of the first instance, determining that the execution is to be performed The execution of the method corresponding to the method ID of the node is limited by the second instance. Optionally, the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
可选的,接收器2001还用于接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID。处理器2002还用于根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2003用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2001 is further configured to receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed. The processor 2002 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and a method of the node of the first instance For the correspondence of the IDs, the execution of the method corresponding to the method ID of the node to be executed is determined by the second instance. Optionally, the server further includes a message sent by the sender 2003 to the sender to send a method of rejecting the node to be executed.
进一步,在图20中,总线架构(用总线2000来代表),总线2000可以包括任意数量的互联的总线和桥,总线2000将包括由处理器2002代表的一个或多个处理器和存储器2004代表的存储器的各种电路链接在一起。总线2000还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口2005在总线2000和处理器2002、接收器2001、发送器2003之间提供接口。接收器2001和发送器2003用于服务器与外部设备进行数据通信。Further, in FIG. 20, a bus architecture (represented by bus 2000), bus 2000 can include any number of interconnected buses and bridges, and bus 2000 will include one or more processors and memory 2004 represented by processor 2002. The various circuits of the memory are linked together. The bus 2000 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is well known in the art and, therefore, will not be further described herein. The bus interface 2005 provides an interface between the bus 2000 and the processor 2002, the receiver 2001, and the transmitter 2003. The receiver 2001 and the transmitter 2003 are used for data communication between the server and an external device.
处理器2002负责管理总线2000和通常的处理。存储器2004可以被用于存储处理器2002在执行操作时所使用的数据。The processor 2002 is responsible for managing the bus 2000 and the usual processing. The memory 2004 can be used to store data used by the processor 2002 when performing operations.
该服务器例如为CSP服务器。This server is for example a CSP server.
前述图13实施例中的服务管理方法中的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对服务管理方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the foregoing service management method in the foregoing embodiment of FIG. 13 are also applicable to the server in this embodiment. The foregoing detailed description of the service management method can be clearly known to those skilled in the art. The implementation method of the server, so for the sake of brevity of the description, it will not be described in detail here.
基于与图16所述实施例同一发明构思,本申请实施例还包括一种服务器,请参考图21所示,为本申请实施例中的服务器的系统框图。如图21所示,该服务器包括:接收器2101,用于接收接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息。处理器2102,用于根据所述第二服务的服务部 署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Based on the same inventive concept as the embodiment in FIG. 16 , the embodiment of the present application further includes a server. Referring to FIG. 21 , it is a system block diagram of a server in the embodiment of the present application. As shown in FIG. 21, the server includes: a receiver 2101, configured to receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of the second service; and the restriction information includes the second The service restricts execution of information of the plan of the first instance, and/or the second service limits information of a method of executing the node of the first instance. a processor 2102, configured to be used according to the service part of the second service And obtaining, by the package information, a service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service; and executing the file according to the description file of the second service After the deployment plan of the second service is performed, acquiring a second instance identifier ID of the second service that has been deployed and a log file of the second instance; and recording in the log file of the second instance according to the restriction information Correlation information, the association information includes a first instance ID, and according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance is recorded in a record file of the first instance, and And mapping the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance.
可选的,接收器2101还用于接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID。处理器2102还用于根据所述第二实例ID获取所述第二实例的记录文件和所述服务部署包,所述服务部署包中还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二实例的记录文件中包括所述关联信息;根据所述关联信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。Optionally, the receiver 2101 is further configured to receive an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed. The processor 2102 is further configured to acquire the record file of the second instance and the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; Determining, by the record file of the second instance, the association information; acquiring the first instance ID according to the association information; acquiring the record file of the first instance according to the first instance ID; Corresponding relationship between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance, and/or acquiring the node of the first instance according to the record file of the first instance Recording a file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance; performing the deleting according to the description file of the second service plan.
可选的,接收器2101还用于接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID。处理器2102还用于根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2103用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed. The processor 2102 is further configured to acquire the record file of the first instance according to the first instance ID; the second instance ID recorded in the record file of the first instance and the plan ID of the first instance Corresponding relationship, determining that the execution of the plan corresponding to the plan ID to be executed is limited by the second instance. Optionally, the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
可选的,接收器2101还用于接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID。处理器2102还用于根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行 的节点的方法ID对应的方法的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2103用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed. The processor 2102 is further configured to acquire the record file of the first instance according to the first instance ID, acquire a node record file of the first instance according to the record file of the first instance, and record the file according to the node record Corresponding relationship between the second instance ID and the method ID of the node of the first instance, determining that the execution is to be performed The execution of the method corresponding to the method ID of the node is limited by the second instance. Optionally, the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
可选的,接收器2101还用于接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID。处理器2102还用于根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制。可选的,所述服务器还包括发送器2103用于发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Optionally, the receiver 2101 is further configured to receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed. The processor 2102 is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and a method of the node of the first instance For the correspondence of the IDs, the execution of the method corresponding to the method ID of the node to be executed is determined by the second instance. Optionally, the server further includes a message that the transmitter 2103 is configured to send a method of rejecting the node to be executed to the sending end.
进一步,在图21中,总线架构(用总线2100来代表),总线2100可以包括任意数量的互联的总线和桥,总线2100将包括由处理器2102代表的一个或多个处理器和存储器2104代表的存储器的各种电路链接在一起。总线2100还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口2105在总线2100和处理器2102、接收器2101、发送器2103之间提供接口。接收器2101和发送器2103用于服务器与外部设备进行数据通信。Further, in FIG. 21, a bus architecture (represented by bus 2100), bus 2100 can include any number of interconnected buses and bridges, and bus 2100 will include one or more processors and memory 2104 represented by processor 2102. The various circuits of the memory are linked together. The bus 2100 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art and, therefore, will not be further described herein. The bus interface 2105 provides an interface between the bus 2100 and the processor 2102, the receiver 2101, and the transmitter 2103. The receiver 2101 and the transmitter 2103 are used for data communication between the server and an external device.
处理器2102负责管理总线2100和通常的处理。存储器2104可以被用于存储处理器2002在执行操作时所使用的数据。The processor 2102 is responsible for managing the bus 2100 and the usual processing. The memory 2104 can be used to store data used by the processor 2002 when performing operations.
该服务器例如为CSP服务器。This server is for example a CSP server.
前述图16实施例中的服务管理方法中的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对服务管理方法的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在此不再详述。The various changes and specific examples in the service management method in the foregoing embodiment of the present invention are also applicable to the server in this embodiment. The foregoing detailed description of the service management method can be clearly known to those skilled in the art. The implementation method of the server, so for the sake of brevity of the description, it will not be described in detail here.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产 品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is made with reference to a method, a device (system), and a computer program according to an embodiment of the present application. The flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.

Claims (36)

  1. 一种服务部署方法,其特征在于,包括:A service deployment method, comprising:
    接收第二服务的服务部署包,其中,所述服务部署包包括部署计划和第二描述文件;Receiving a service deployment package of the second service, where the service deployment package includes a deployment plan and a second description file;
    在根据所述第二描述文件执行所述部署计划后,获取已被部署的所述第二服务的第二实例标识ID;After executing the deployment plan according to the second description file, acquiring a second instance identification ID of the second service that has been deployed;
    确定所述第二描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the second description file, information that the second service restricts execution of a plan of a first instance ID of the first service and/or a method of a node of the first instance ID;
    根据所述第一实例ID,获取所述第一服务的第一描述文件;Obtaining, according to the first instance ID, a first description file of the first service;
    根据所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息,在所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系。Recording, in the first description file, the second instance ID and the information of the method of executing the first instance ID of the first service and/or the method of the node of the first instance ID according to the second service restriction Correspondence relationship between the plan of the first instance ID and/or the method of the node of the first instance ID.
  2. 如权利要求1所述的方法,其特征在于,在所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,所述方法还包括:The method of claim 1, wherein the method of recording the second instance ID and the plan of the first instance ID and/or the node of the first instance ID in the first description file After the correspondence, the method further includes:
    接收针对所述第二实例ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;Receiving a deletion request for the second instance ID, where the deletion request includes the second instance ID and a deletion plan to be executed;
    根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述删除计划;Obtaining the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan;
    确定所述第二描述文件中包括所述第二服务限制执行所述第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the second description file, information that the second service restricts execution of a plan of the first instance ID and/or a method of a node of the first instance ID;
    在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;Inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the node of the first instance ID Restrictions on the execution of the method;
    执行插入所述标记后的删除计划。Perform the delete plan after inserting the tag.
  3. 如权利要求2所述的方法,其特征在于,执行插入所述标记后的删除计划,包括:The method of claim 2, wherein the deleting the deleted plan after the tag is performed comprises:
    从所述第二描述文件中获取所述第一实例ID;Obtaining the first instance ID from the second description file;
    根据所述第一实例ID获取所述第一描述文件; Obtaining the first description file according to the first instance ID;
    删除所述第一描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;Deleting a correspondence between the second instance ID recorded in the first description file and a method of the first instance ID and a method of a node of the first instance ID;
    从所述第一方法开始执行所述欲执行的删除计划。The deletion plan to be executed is executed from the first method.
  4. 如权利要求1所述的方法,其特征在于,在所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,所述方法还包括:The method of claim 1, wherein the method of recording the second instance ID and the plan of the first instance ID and/or the node of the first instance ID in the first description file After the correspondence, the method further includes:
    接收发送端发送的针对所述第一实例ID的管理请求,所述管理请求包括所述第一实例ID和欲执行的计划和/或节点的方法;Receiving, by the sending end, a management request for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
    根据所述第一实例ID获取所述第一描述文件;Obtaining the first description file according to the first instance ID;
    根据所述第一描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the plan to be executed according to the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and/or the method of the node of the first instance ID / or the execution of the method of the node is limited by the second service;
    发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。A message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
  5. 一种服务管理方法,其特征在于,包括:A service management method, comprising:
    接收发送端发送的针对第一服务的第一实例标识ID的管理请求,所述管理请求包括所述第一实例ID以及欲执行的计划和/或节点的方法;Receiving, by the sending end, a management request for a first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
    根据所述第一实例ID获取所述第一服务的第一描述文件;Acquiring the first description file of the first service according to the first instance ID;
    根据所述第一描述文件中记录的第二服务的第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the to-be-executed according to a correspondence between a second instance ID of the second service recorded in the first description file and a method of the first instance ID and a method of the node of the first instance ID The execution of the method of the plan and/or the node is limited by the second service;
    发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。A message is sent to the sender that refuses to execute the plan of the program to be executed and/or the method of the node.
  6. 如权利要求5所述的方法,其特征在于,所述欲执行的计划为删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为删除方法、重启方法和停止方法中的至少一个。The method according to claim 5, wherein the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a delete method, a restart method, and a stop method. At least one of them.
  7. 一种服务管理方法,其特征在于,包括:A service management method, comprising:
    接收针对第二服务的第二实例标识ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;Receiving a deletion request for a second instance identification ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
    根据所述第二实例ID获取所述第二服务的服务部署包,所述服务部署包包括所述删除计划和第二描述文件;Obtaining, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes the deletion plan and a second description file;
    确定所述第二描述文件中包括所述第二服务限制执行第一服务的第一实 例ID的计划和/或所述第一实例ID的节点的方法的信息;Determining, in the second description file, that the second service restricts execution of the first service Information of the plan of the example ID and/or the method of the node of the first instance ID;
    在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;Inserting a mark before the first method of the first node of the deletion plan, the mark indicating that the second service is released from the plan of the first instance ID and/or the node of the first instance ID Restrictions on the execution of the method;
    执行插入所述标记后的删除计划。Perform the delete plan after inserting the tag.
  8. 如权利要求7所述的方法,其特征在于,执行插入所述标记后的删除计划,包括:The method of claim 7, wherein the deleting the deleted plan after the tag is performed comprises:
    根据所述第一实例ID获取所述第一服务的第一描述文件;Acquiring the first description file of the first service according to the first instance ID;
    删除所述第一描述文件中记录的所述第二实例ID和所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;Deleting a correspondence between the second instance ID recorded in the first description file and a method of the first instance ID and/or a method of a node of the first instance ID;
    从所述第一方法开始执行所述欲执行的删除计划。The deletion plan to be executed is executed from the first method.
  9. 一种服务部署装置,其特征在于,包括:A service deployment device, comprising:
    接收单元,用于接收第二服务的服务部署包,其中,所述服务部署包包括部署计划和第二描述文件;a receiving unit, configured to receive a service deployment package of the second service, where the service deployment package includes a deployment plan and a second description file;
    处理单元,用于在根据所述第二描述文件执行所述部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;根据所述第一实例ID,获取所述第一服务的第一描述文件;根据所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息,在所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系。a processing unit, configured to acquire a second instance identifier ID of the second service that has been deployed after performing the deployment plan according to the second description file, and determine that the second description file includes the second The service restricts execution of a plan of the first instance ID of the first service and/or a method of a method of the node of the first instance ID; acquiring, according to the first instance ID, a first description file of the first service; The second service restricts execution of a plan of a first instance ID of the first service and/or a method of a method of a node of the first instance ID, and records the second instance ID and the location in the first description file Corresponding relationship between the plan of the first instance ID and/or the method of the node of the first instance ID.
  10. 如权利要求9所述的装置,其特征在于,所述接收单元还用于:在所述处理单元在所述所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收针对所述第二实例ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;The apparatus according to claim 9, wherein the receiving unit is further configured to: record, in the first description file, the second instance ID and the first instance ID in the processing unit Receiving a deletion request for the second instance ID after the plan and/or the correspondence of the method of the node of the first instance ID, the deletion request including the second instance ID and a deletion plan to be executed ;
    所述处理单元还用于:根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述删除计划;确定所述第二描述文件中包括所述第二服务限制执行所述第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所 述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。The processing unit is further configured to: acquire the service deployment package according to the second instance ID, where the service deployment package further includes the deletion plan; and determine that the second description file includes the second service restriction execution Information of a plan of the first instance ID and/or a method of a node of the first instance ID; inserting a mark before the first method of the first node of the delete plan, the mark indicating a release Restricting the execution of the plan of the first instance ID and/or the method of the node of the first instance ID by the second service; performing a delete plan after inserting the tag.
  11. 如权利要求10所述的装置,其特征在于,所述处理单元具体用于:从所述第二描述文件中获取所述第一实例ID;根据所述第一实例ID获取所述第一描述文件;删除所述第一描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。The apparatus according to claim 10, wherein the processing unit is configured to: obtain the first instance ID from the second description file; and acquire the first description according to the first instance ID a file; deleting a correspondence between the second instance ID recorded in the first description file and a method of the first instance ID and/or a method of a node of the first instance ID; from the first method Start execution of the deletion plan to be executed.
  12. 如权利要求9所述的装置,其特征在于,所述装置还包括发送单元,The device according to claim 9, wherein said device further comprises a transmitting unit,
    所述接收单元还用于:在所述处理单元在所述所述第一描述文件中记录所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系之后,接收发送端发送的针对所述第一实例ID的管理请求,所述管理请求包括所述第一实例ID和欲执行的计划和/或节点的方法;The receiving unit is further configured to: in the processing unit, record, in the first description file, a node of the second instance ID and the first instance ID and/or a node of the first instance ID After receiving the corresponding relationship of the method, receiving a management request sent by the sending end for the first instance ID, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
    所述处理单元还用于:根据所述第一实例ID获取所述第一描述文件;The processing unit is further configured to: acquire the first description file according to the first instance ID;
    根据所述第一描述文件中记录的所述第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the plan to be executed according to the correspondence between the second instance ID recorded in the first description file and the method of the first instance ID and/or the method of the node of the first instance ID / or the execution of the method of the node is limited by the second service;
    所述发送单元用于:发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。The sending unit is configured to: send a message rejecting the method of executing the plan and/or the node to be executed to the sending end.
  13. 一种服务管理装置,其特征在于,包括:A service management device, comprising:
    接收单元,用于接收发送端发送的针对第一服务的第一实例标识ID的管理请求,所述管理请求包括所述第一实例ID以及欲执行的计划和/或节点的方法;a receiving unit, configured to receive a management request sent by the sending end for the first instance identifier ID of the first service, where the management request includes the first instance ID and a method of a plan and/or a node to be executed;
    处理单元,用于根据所述第一实例ID获取所述第一服务的第一描述文件;a processing unit, configured to acquire, according to the first instance ID, a first description file of the first service;
    根据所述第一描述文件中记录的第二服务的第二实例ID与所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系,确定所述欲执行的计划和/或节点的方法的执行受到所述第二服务的限制;Determining the to-be-executed according to a correspondence between a second instance ID of the second service recorded in the first description file and a method of the first instance ID and a method of the node of the first instance ID The execution of the method of the plan and/or the node is limited by the second service;
    发送单元,用于发送拒绝执行所述欲执行的计划和/或节点的方法的消息给所述发送端。And a sending unit, configured to send, to the sending end, a message rejecting a method of executing the plan and/or the node to be executed.
  14. 如权利要求13所述的装置,其特征在于,所述欲执行的计划为删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为删除方 法、重启方法和停止方法中的至少一个。The apparatus according to claim 13, wherein the plan to be executed is at least one of a deletion plan, a restart plan, and a stop plan; and the method of the node to be executed is a delete side At least one of a method, a restart method, and a stop method.
  15. 一种服务管理装置,其特征在于,包括:A service management device, comprising:
    接收单元,用于接收针对第二服务的第二实例标识ID的删除请求,所述删除请求中包含所述第二实例ID和欲执行的删除计划;a receiving unit, configured to receive a deletion request for a second instance identifier ID of the second service, where the deletion request includes the second instance ID and a deletion plan to be executed;
    处理单元,用于根据所述第二实例ID获取所述第二服务的服务部署包,所述服务部署包包括所述删除计划和第二描述文件;确定所述第二描述文件中包括所述第二服务限制执行第一服务的第一实例ID的计划和/或所述第一实例ID的节点的方法的信息;在所述删除计划的第一个节点的第一个方法前插入标记,所述标记表示解除所述第二服务对所述第一实例ID的计划和/或所述第一实例ID的节点的方法的执行的限制;执行插入所述标记后的删除计划。a processing unit, configured to acquire, according to the second instance ID, a service deployment package of the second service, where the service deployment package includes the deletion plan and a second description file; determining that the second description file includes the The second service restricts information of a method of executing a first instance ID of the first service and/or a method of a node of the first instance ID; inserting a flag before the first method of the first node of the deletion plan, The flag indicates a restriction to release the execution of the method of the first instance ID and/or the method of the node of the first instance ID by the second service; performing a deletion plan after inserting the tag.
  16. 如权利要求15所述的装置,其特征在于,所述处理单元具体用于:根据所述第一实例ID获取所述第一服务的第一描述文件;删除所述第一描述文件中记录的所述第二实例ID和所述第一实例ID的计划和/或所述第一实例ID的节点的方法的对应关系;从所述第一方法开始执行所述欲执行的删除计划。The device according to claim 15, wherein the processing unit is configured to: acquire a first description file of the first service according to the first instance ID; and delete a record in the first description file Corresponding relationship between the second instance ID and the method of the first instance ID and/or the method of the node of the first instance ID; starting from the first method, executing the deletion plan to be executed.
  17. 一种服务部署方法,其特征在于,包括:A service deployment method, comprising:
    接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;Receiving a service deployment request, the service deployment request including information of a service deployment package of the second service;
    根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;Obtaining, according to the information about the service deployment package of the second service, the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service;
    在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed;
    确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;Determining that the description file of the second service includes restriction information, the restriction information includes information that the second service restricts execution of a plan of a first instance of the first service, and/or the second service restriction performs the Information about the method of the node of the first instance;
    根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or in a node record file of the first instance Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded.
  18. 如权利要求17所述的方法,其特征在于,所述根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与 所述第一实例的节点的方法ID的对应关系,具体为:The method according to claim 17, wherein the mapping of the correspondence between the second instance ID and the plan ID of the first instance is recorded in the log file of the first instance according to the restriction information And/or recording the second instance ID and the node record file of the first instance Corresponding relationship between the method IDs of the nodes of the first instance is specifically:
    根据所述限制信息,获取第一实例ID;Obtaining a first instance ID according to the restriction information;
    根据第一实例ID,获取第一实例的记录文件;Obtaining a record file of the first instance according to the first instance ID;
    在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or acquiring a node record of the first instance according to the record file of the first instance And a file, in the node record file of the first instance, records a correspondence between the second instance ID and a method ID of a node of the first instance.
  19. 如权利要求17所述的方法,其特征在于,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:The method according to claim 17, wherein a correspondence relationship between the second instance ID and a plan ID of the first instance is recorded in a log file of the first instance, and/or in the After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of an instance, the method further includes:
    接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;Receiving an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed;
    根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;Obtaining the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed;
    确定所述第二服务的描述文件中包括所述限制信息;Determining, in the description file of the second service, the restriction information;
    根据所述限制信息,获取所述第一实例ID;Obtaining the first instance ID according to the restriction information;
    根据所述第一实例ID,获取所述第一实例的记录文件;Acquiring the record file of the first instance according to the first instance ID;
    删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;Deleting a correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or acquiring a node of the first instance according to the record file of the first instance Logging a file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
    根据所述第二服务的描述文件执行所述删除计划。The deletion plan is executed according to the description file of the second service.
  20. 如权利要求17所述的方法,其特征在于,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:The method according to claim 17, wherein a correspondence relationship between the second instance ID and a plan ID of the first instance is recorded in a log file of the first instance, and/or in the After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of an instance, the method further includes:
    接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID以及欲执行的计划ID;Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed;
    根据所述第一实例ID,获取所述第一实例的记录文件; Acquiring the record file of the first instance according to the first instance ID;
    根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制,Determining, according to the correspondence between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance, that execution of the plan corresponding to the plan ID to be executed is subjected to the second instance limits,
    发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或Sending a message rejecting execution of the plan to be executed to the sender; and/or
    接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
    根据所述第一实例ID获取所述第一实例的记录文件;Acquiring the record file of the first instance according to the first instance ID;
    根据所述第一实例的记录文件,获取第一实例的节点记录文件;Obtaining, according to the record file of the first instance, a node record file of the first instance;
    根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;Determining, according to the correspondence between the second instance ID recorded in the node record file and the method ID of the node of the first instance, performing the method corresponding to the method ID of the node to be executed by the second Limitation of the instance;
    发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或Sending a message rejecting the method of executing the node to be executed to the sender; and/or
    接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;Receiving an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
    根据所述欲执行的节点ID获取欲执行的节点记录文件;Obtaining a node record file to be executed according to the node ID to be executed;
    根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;Determining, according to the correspondence between the second instance ID recorded in the node record file to be executed and the method ID of the node of the first instance, performing execution of a method corresponding to the method ID of the node to be executed The limitations of the second example;
    发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Sending a message rejecting the method of executing the node to be executed to the sender.
  21. 如权利要求20所述的方法,其特征在于,所述欲执行的计划为更新计划、删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法为更新方法、删除方法、重启方法和停止方法中的至少一个。The method according to claim 20, wherein the plan to be executed is at least one of an update plan, a delete plan, a restart plan, and a stop plan; and the method of the node to be executed is an update method, a delete method At least one of a restart method and a stop method.
  22. 一种服务部署装置,其特征在于,包括:A service deployment device, comprising:
    接收单元,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息;a receiving unit, configured to receive a service deployment request, where the service deployment request includes information about a service deployment package of the second service;
    处理单元,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID;确定所述第二服务的描述文件中包括限制信息,所述限制信息包括所述第二服务限制执行第一服务 的第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点ID的方法的对应关系。a processing unit, configured to acquire a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed; determining that the description file of the second service includes Restricting information, the restriction information including the second service restriction executing the first service Information of the plan of the first instance, and/or information of the method of the second service limiting execution of the node of the first instance; recording the record in the log file of the first instance according to the restriction information a correspondence between the second instance ID and the plan ID of the first instance, and/or a method of recording the second instance ID and the node ID of the first instance in the node record file of the first instance Correspondence relationship.
  23. 如权利要求22所述的装置,其特征在于,所述处理单元,用于根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:The device according to claim 22, wherein the processing unit is configured to record the second instance ID and the first instance in a record file of the first instance according to the restriction information Corresponding relationship between the plan ID, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically:
    根据所述限制信息,获取第一实例ID;Obtaining a first instance ID according to the restriction information;
    根据第一实例ID,获取第一实例的记录文件;Obtaining a record file of the first instance according to the first instance ID;
    在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or acquiring a node record of the first instance according to the record file of the first instance And a file, in the node record file of the first instance, records a correspondence between the second instance ID and a method ID of a node of the first instance.
  24. 如权利要求22所述的装置,其特征在于,所述接收单元还用于:在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点ID的方法的对应关系之后,接收接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;The apparatus according to claim 22, wherein the receiving unit is further configured to: record a correspondence between the second instance ID and a plan ID of the first instance in a log file of the first instance And/or receiving a receiving instance deletion request in the instance deletion request after recording the correspondence between the second instance ID and the method of the node ID of the first instance in the node record file of the first instance Include the second instance ID and a deletion plan ID to be executed;
    所述处理单元,还用于根据所述第二实例ID获取所述服务部署包,所述服务部署包还包括所述欲执行的删除计划ID对应的删除计划;确定所述第二服务的描述文件中包括所述限制信息;根据所述限制信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。The processing unit is further configured to acquire the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed; and determining a description of the second service The file includes the restriction information; the first instance ID is obtained according to the restriction information; the record file of the first instance is obtained according to the first instance ID; and the record file of the first instance is deleted. Obtaining a correspondence between the second instance ID and the plan ID of the first instance, and/or acquiring a node record file of the first instance according to the record file of the first instance, deleting the first instance a correspondence between the second instance ID recorded in the node record file and a method ID of the node of the first instance; and the deletion plan is executed according to the description file of the second service.
  25. 如权利要求22所述的装置,其特征在于,所述装置还包括发送单元,The device according to claim 22, wherein said device further comprises a transmitting unit,
    所述接收单元还用于:在所述第一实例的记录文件中记录所述第二实例 ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例标识ID以及欲执行的计划ID;The receiving unit is further configured to: record the second instance in a record file of the first instance a correspondence between the ID and the plan ID of the first instance, and/or after the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance Receiving an instance management request sent by the sending end, where the instance management request includes the first instance identifier ID and a plan ID to be executed;
    所述处理单元还用于:根据所述第一实例ID,获取所述第一实例的记录文件;根据所述第一实例的记录文件中记录的第二服务的第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制,The processing unit is further configured to: acquire, according to the first instance ID, a record file of the first instance; according to the second instance ID of the second service recorded in the record file of the first instance, Corresponding relationship of the plan ID of an instance, determining that execution of the plan corresponding to the plan ID to be executed is restricted by the second instance,
    所述发送单元用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或The sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
    所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed;
    所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit is further configured to: acquire a record file of the first instance according to the first instance ID; acquire a node record file of the first instance according to the record file of the first instance; and record a file according to the node Corresponding relationship between the second instance ID recorded in the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance;
    所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The sending unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end; and/or
    所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
    所述处理单元还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the node of the first instance Corresponding relationship of the method ID, determining that the execution of the method corresponding to the method ID of the node to be executed is limited by the second instance;
    所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。The sending unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
  26. 如权利要求25所述的装置,其特征在于,所述欲执行的计划ID对应的计划为更新计划、删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法ID对应的方法为更新方法、删除方法、重启方法和停止方法 中的至少一个。The device according to claim 25, wherein the plan corresponding to the plan ID to be executed is at least one of an update plan, a delete plan, a restart plan, and a stop plan; and the method ID of the node to be executed corresponds to The methods are update method, delete method, restart method, and stop method. At least one of them.
  27. 一种服务部署方法,其特征在于,包括:A service deployment method, comprising:
    接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;Receiving a service deployment request, the service deployment request including information and restriction information of a service deployment package of the second service; the restriction information including information that the second service restricts execution of the plan of the first instance, and/or Determining, by the second service, information of a method of executing a node of the first instance;
    根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;Obtaining, according to the information about the service deployment package of the second service, the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service;
    在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identifier ID of the second service that has been deployed and a record file of the second instance;
    根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;Correlating the association information in the record file of the second instance according to the restriction information, where the association information includes a first instance ID;
    根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, according to the restriction information, a correspondence between the second instance ID and a plan ID of the first instance in a record file of the first instance, and/or in a node record file of the first instance Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded.
  28. 如权利要求27所述的方法,其特征在于,所述根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:The method according to claim 27, wherein the mapping of the correspondence between the second instance ID and the plan ID of the first instance is recorded in the log file of the first instance according to the restriction information Corresponding relationship between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, specifically:
    根据所述限制信息,获取第一实例ID;Obtaining a first instance ID according to the restriction information;
    根据第一实例ID,获取第一实例的记录文件;Obtaining a record file of the first instance according to the first instance ID;
    在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or acquiring a node record of the first instance according to the record file of the first instance And a file, in the node record file of the first instance, records a correspondence between the second instance ID and a method ID of a node of the first instance.
  29. 如权利要求27所述的方法,其特征在于,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:The method according to claim 27, wherein a correspondence relationship between the second instance ID and a plan ID of the first instance is recorded in a log file of the first instance, and/or in the After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of an instance, the method further includes:
    接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID; Receiving an instance deletion request, where the instance deletion request includes the second instance ID and a deletion plan ID to be executed;
    根据所述第二实例ID获取所述第二实例的记录文件和所述服务部署包,所述服务部署包中还包括所述欲执行的删除计划ID对应的删除计划;Acquiring the record file of the second instance and the service deployment package according to the second instance ID, where the service deployment package further includes a deletion plan corresponding to the deletion plan ID to be executed;
    确定所述第二实例的记录文件中包括所述关联信息;Determining that the related information is included in a record file of the second instance;
    根据所述关联信息,获取所述第一实例ID;Obtaining the first instance ID according to the association information;
    根据所述第一实例ID,获取所述第一实例的记录文件;Acquiring the record file of the first instance according to the first instance ID;
    删除所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;Deleting a correspondence between the second instance ID recorded in the record file of the first instance and a plan ID of the first instance, and/or acquiring the first instance according to the record file of the first instance a node record file, deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of a node of the first instance;
    根据所述第二服务的描述文件执行所述删除计划。The deletion plan is executed according to the description file of the second service.
  30. 如权利要求27所述的方法,其特征在于,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,所述方法还包括:The method according to claim 27, wherein a correspondence relationship between the second instance ID and a plan ID of the first instance is recorded in a log file of the first instance, and/or in the After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of an instance, the method further includes:
    接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID;Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a plan ID to be executed;
    根据所述第一实例ID获取所述第一实例的记录文件;Acquiring the record file of the first instance according to the first instance ID;
    根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制;Determining, according to the correspondence between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance, that execution of the plan corresponding to the plan ID to be executed is subjected to the second instance limits;
    发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或Sending a message rejecting execution of the plan to be executed to the sender; and/or
    接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;Receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of a node to be executed;
    根据所述第一实例ID获取所述第一实例的记录文件;Acquiring the record file of the first instance according to the first instance ID;
    根据所述第一实例的记录文件,获取第一实例的节点记录文件;Obtaining, according to the record file of the first instance, a node record file of the first instance;
    根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;Determining, according to the correspondence between the second instance ID recorded in the node record file and the method ID of the node of the first instance, performing the method corresponding to the method ID of the node to be executed by the second Limitation of the instance;
    发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或Sending a message rejecting the method of executing the node to be executed to the sender; and/or
    接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点 ID和欲执行的节点的方法ID;Receiving an instance management request sent by the sending end, where the instance management request includes a node to be executed ID and method ID of the node to be executed;
    根据所述欲执行的节点ID获取欲执行的节点记录文件;Obtaining a node record file to be executed according to the node ID to be executed;
    根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;Determining, according to the correspondence between the second instance ID recorded in the node record file to be executed and the method ID of the node of the first instance, performing execution of a method corresponding to the method ID of the node to be executed The limitations of the second example;
    发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。Sending a message rejecting the method of executing the node to be executed to the sender.
  31. 如权利要求30所述的方法,其特征在于,所述欲执行的计划ID对应的计划为更新计划、删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法ID对应的方法为更新方法、删除方法、重启方法和停止方法中的至少一个。The method according to claim 30, wherein the plan corresponding to the plan ID to be executed is at least one of an update plan, a delete plan, a restart plan, and a stop plan; and the method ID of the node to be executed corresponds to The method is at least one of an update method, a delete method, a restart method, and a stop method.
  32. 一种服务部署装置,其特征在于,包括:A service deployment device, comprising:
    接收单元,用于接收服务部署请求,所述服务部署请求包含第二服务的服务部署包的信息和限制信息;所述限制信息包括所述第二服务限制执行所述第一实例的计划的信息,和/或所述第二服务限制执行所述第一实例的节点的方法的信息;a receiving unit, configured to receive a service deployment request, where the service deployment request includes information and restriction information of a service deployment package of the second service; and the restriction information includes information that the second service restricts execution of the plan of the first instance And/or the second service limits information of a method of performing a node of the first instance;
    处理单元,用于根据所述第二服务的服务部署包的信息,获取所述第二服务的服务部署包,其中,所述服务部署包包括第二服务的部署计划和第二服务的描述文件;在根据所述第二服务的描述文件执行所述第二服务的部署计划后,获取已被部署的所述第二服务的第二实例标识ID和第二实例的记录文件;根据所述限制信息,在所述第二实例的记录文件中记录关联信息,所述关联信息包括第一实例ID;根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。a processing unit, configured to acquire a service deployment package of the second service according to the information about the service deployment package of the second service, where the service deployment package includes a deployment plan of the second service and a description file of the second service After executing the deployment plan of the second service according to the description file of the second service, acquiring a second instance identification ID of the second service that has been deployed and a record file of the second instance; according to the limitation Information, in the record file of the second instance, the association information is recorded, the association information includes a first instance ID; and the second instance ID is recorded in the record file of the first instance according to the restriction information Corresponding relationship between the plan ID of the first instance, and/or a correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance.
  33. 如权利要求32所述的方法,其特征在于,所述处理单元用于,根据所述限制信息,在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系,具体为:The method according to claim 32, wherein the processing unit is configured to record the second instance ID and the first instance in a log file of the first instance according to the restriction information Corresponding relationship between the plan ID, and/or the correspondence between the second instance ID and the method ID of the node of the first instance in the node record file of the first instance, specifically:
    根据所述限制信息,获取第一实例ID;Obtaining a first instance ID according to the restriction information;
    根据第一实例ID,获取第一实例的记录文件; Obtaining a record file of the first instance according to the first instance ID;
    在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取第一实例的节点记录文件,在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系。Recording, in the record file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or acquiring a node record of the first instance according to the record file of the first instance And a file, in the node record file of the first instance, records a correspondence between the second instance ID and a method ID of a node of the first instance.
  34. 如权利要求32所述的装置,其特征在于,所述接收单元还用于:在所述处理单元在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收实例删除请求,所述实例删除请求中包含所述第二实例ID和欲执行的删除计划ID;The apparatus according to claim 32, wherein the receiving unit is further configured to: record, in the recording file of the first instance, the second instance ID and the first instance in the processing unit Receiving an instance deletion request after the correspondence between the plan ID and/or the correspondence between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of the first instance, The instance deletion request includes the second instance ID and a deletion plan ID to be executed;
    所述处理单元还用于:根据所述第二实例ID获取所述第二实例的记录文件和所述服务部署包,所述服务部署包中还包括所述欲执行的删除计划ID对应的删除计划;The processing unit is further configured to: obtain the record file of the second instance and the service deployment package according to the second instance ID, where the service deployment package further includes deleting corresponding to the deletion plan ID to be executed. plan;
    确定所述第二实例的记录文件中包括所述关联信息;根据所述关联信息,获取所述第一实例ID;根据所述第一实例ID,获取所述第一实例的记录文件;删除所述第一实例的记录文件中所述第二实例ID与所述第一实例的计划ID的对应关系,和/或根据所述第一实例的记录文件,获取所述第一实例的节点记录文件,删除所述第一实例的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系;根据所述第二服务的描述文件执行所述删除计划。Determining, by the record file of the second instance, the association information; acquiring the first instance ID according to the association information; acquiring the record file of the first instance according to the first instance ID; Obtaining a correspondence between the second instance ID and the plan ID of the first instance in the record file of the first instance, and/or acquiring the node record file of the first instance according to the record file of the first instance And deleting a correspondence between the second instance ID recorded in the node record file of the first instance and a method ID of the node of the first instance; and executing the deletion plan according to the description file of the second service.
  35. 如权利要求32所述的装置,其特征在于,所述装置还包括发送单元,The device according to claim 32, wherein said device further comprises a transmitting unit,
    所述接收单元还用于:在所述处理单元在所述第一实例的记录文件中记录所述第二实例ID与所述第一实例的计划ID的对应关系,和/或在所述第一实例的节点记录文件中记录所述第二实例ID与所述第一实例的节点的方法ID的对应关系之后,接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的计划ID;The receiving unit is further configured to: record, in the recording file of the first instance, a correspondence between the second instance ID and a plan ID of the first instance, and/or in the first After the mapping between the second instance ID and the method ID of the node of the first instance is recorded in the node record file of an instance, receiving an instance management request sent by the sending end, where the instance management request includes the first instance ID and plan ID to be executed;
    所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;The processing unit is further configured to: acquire the record file of the first instance according to the first instance ID;
    根据所述第一实例的记录文件中记录的所述第二实例ID与所述第一实例的计划ID的对应关系,确定所述欲执行的计划ID对应的计划的执行受到所述第二实例的限制; Determining, according to the correspondence between the second instance ID recorded in the record file of the first instance and the plan ID of the first instance, that execution of the plan corresponding to the plan ID to be executed is subjected to the second instance limits;
    所述发送单元用于:发送拒绝执行所述欲执行的计划的消息给所述发送端;和/或The sending unit is configured to: send a message rejecting execution of the plan to be executed to the sending end; and/or
    所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括所述第一实例ID和欲执行的节点的方法ID;The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes the first instance ID and a method ID of the node to be executed;
    所述处理单元还用于:根据所述第一实例ID获取所述第一实例的记录文件;根据所述第一实例的记录文件,获取第一实例的节点记录文件;根据所述节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit is further configured to: acquire a record file of the first instance according to the first instance ID; acquire a node record file of the first instance according to the record file of the first instance; and record a file according to the node Corresponding relationship between the second instance ID recorded in the method ID of the node of the first instance, determining that the execution of the method corresponding to the method ID of the node to be executed is restricted by the second instance;
    所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端;和/或The sending unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end; and/or
    所述接收单元还用于:接收发送端发送的实例管理请求,所述实例管理请求包括欲执行的节点ID和欲执行的节点的方法ID;The receiving unit is further configured to: receive an instance management request sent by the sending end, where the instance management request includes a node ID to be executed and a method ID of the node to be executed;
    所述处理单元还用于:根据所述欲执行的节点ID获取欲执行的节点记录文件;根据所述欲执行的节点记录文件中记录的所述第二实例ID与所述第一实例的节点的方法ID的对应关系,确定所述欲执行的节点的方法ID对应的方法的执行受到所述第二实例的限制;The processing unit is further configured to: acquire, according to the node ID to be executed, a node record file to be executed; according to the second instance ID recorded in the node record file to be executed, and the node of the first instance Corresponding relationship of the method ID, determining that the execution of the method corresponding to the method ID of the node to be executed is limited by the second instance;
    所述发送单元用于:发送拒绝执行所述欲执行的节点的方法的消息给所述发送端。The sending unit is configured to: send a message rejecting a method of executing the node to be executed to the sending end.
  36. 如权利要求35所述的装置,其特征在于,所述欲执行的计划ID对应的计划为更新计划、删除计划、重启计划和停止计划中的至少一个;所述欲执行的节点的方法ID对应的方法为更新方法、删除方法、重启方法和停止方法中的至少一个。 The apparatus according to claim 35, wherein the plan corresponding to the plan ID to be executed is at least one of an update plan, a delete plan, a restart plan, and a stop plan; and the method ID of the node to be executed corresponds to The method is at least one of an update method, a delete method, a restart method, and a stop method.
PCT/CN2015/078914 2014-09-26 2015-05-14 Service deployment method, service management method and apparatus WO2016045392A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201410505406.5 2014-09-26
CN201410505406 2014-09-26
CN201510085240.0 2015-02-16
CN201510085240.0A CN105592130B (en) 2014-09-26 2015-02-16 A kind of service arrangement method, service management and device

Publications (1)

Publication Number Publication Date
WO2016045392A1 true WO2016045392A1 (en) 2016-03-31

Family

ID=55580247

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/078914 WO2016045392A1 (en) 2014-09-26 2015-05-14 Service deployment method, service management method and apparatus

Country Status (2)

Country Link
CN (1) CN105592130B (en)
WO (1) WO2016045392A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766042A (en) * 2016-08-23 2018-03-06 南京中兴软件有限责任公司 A kind of visual data manager and device of the model file based on CSAR
CN110674103B (en) * 2018-06-15 2022-04-29 华为技术有限公司 Data management method and device
CN111431743B (en) * 2020-03-18 2021-03-02 中南大学 Data analysis-based method and system for constructing edge resource pool in large-scale WiFi system
CN116719647B (en) * 2023-08-09 2023-11-03 苏州浪潮智能科技有限公司 Super-computing cluster management method and device, arrangement management equipment and super-computing cluster

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267341A (en) * 2008-03-28 2008-09-17 华为技术有限公司 A distributed network management system, network management server and method
CN101454766A (en) * 2006-06-15 2009-06-10 国际商业机器公司 Management of composite software services
CN102404381A (en) * 2011-09-02 2012-04-04 西安交通大学 Software deployment system and deployment method based on workflow in cloud computing environment
CN103577235A (en) * 2013-11-14 2014-02-12 中安消技术有限公司 Software deploying method, deploying server, computer to be deployed and system
CN103716372A (en) * 2013-11-22 2014-04-09 浙江大学 Digital library-as-a-service cloud computing platform construction method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905508B (en) * 2012-12-28 2017-07-28 华为技术有限公司 Cloud platform application dispositions method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101454766A (en) * 2006-06-15 2009-06-10 国际商业机器公司 Management of composite software services
CN101267341A (en) * 2008-03-28 2008-09-17 华为技术有限公司 A distributed network management system, network management server and method
CN102404381A (en) * 2011-09-02 2012-04-04 西安交通大学 Software deployment system and deployment method based on workflow in cloud computing environment
CN103577235A (en) * 2013-11-14 2014-02-12 中安消技术有限公司 Software deploying method, deploying server, computer to be deployed and system
CN103716372A (en) * 2013-11-22 2014-04-09 浙江大学 Digital library-as-a-service cloud computing platform construction method

Also Published As

Publication number Publication date
CN105592130B (en) 2019-04-05
CN105592130A (en) 2016-05-18

Similar Documents

Publication Publication Date Title
CN111465930B (en) Method, system and computer readable medium for violation resolution in client synchronization
US10764109B2 (en) Instantiating resources of an IT-service
US10521284B2 (en) System and method for management of deployed services and applications
US10540159B2 (en) Model-based virtual system provisioning
US8615768B2 (en) Dependency-ordered resource synchronization across multiple environments using change list created based on dependency-ordered graphs of the multiple environments
US9444760B2 (en) Allocating instantiated resources to an IT-service
US9256413B2 (en) Automatic identification of services
US20140007051A1 (en) Configuring Integration Capabilities for System Integration
EP2959387B1 (en) Method and system for providing high availability for state-aware applications
US8677376B2 (en) Expressing equivalency relationships with identity graphs across multiple environments to create change list to be traversed to conform the environments
WO2016045392A1 (en) Service deployment method, service management method and apparatus
JP2017091531A (en) Exporting hierarchical data from source code management (scm) system to product lifecycle management (plm) system
US20130304717A1 (en) Control system asset management
US9235437B2 (en) Method and integration component for integrating OSGi environments into a Service-oriented Architecture
US20170288967A1 (en) Environment manager for continuous deployment
WO2021189895A1 (en) Configuration data management method, apparatus and device, and storage medium
CN106990978B (en) Exporting hierarchical data from a Product Lifecycle Management (PLM) system to a Source Code Management (SCM) system
WO2016083912A1 (en) Partial validation of configurations at runtime
US20230289237A1 (en) Automated nesting of existing stacks in a root stack within an aws environment
US10223328B1 (en) Unified system for connecting a content repository to a file sharing service
JP6930141B2 (en) Monitoring definition generator, monitoring definition generation method, and monitoring definition generation program
CN111930718A (en) Node adjustment method and device for configuration management database
JP2009140443A (en) Software development support system, exclusive control method, and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15843489

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15843489

Country of ref document: EP

Kind code of ref document: A1