WO2022062661A1 - 操作通知方法和装置、存储介质和电子装置 - Google Patents

操作通知方法和装置、存储介质和电子装置 Download PDF

Info

Publication number
WO2022062661A1
WO2022062661A1 PCT/CN2021/110032 CN2021110032W WO2022062661A1 WO 2022062661 A1 WO2022062661 A1 WO 2022062661A1 CN 2021110032 W CN2021110032 W CN 2021110032W WO 2022062661 A1 WO2022062661 A1 WO 2022062661A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
node
message
cloud service
notification
Prior art date
Application number
PCT/CN2021/110032
Other languages
English (en)
French (fr)
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 WO2022062661A1 publication Critical patent/WO2022062661A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present disclosure relates to the field of the Internet, and to an operation notification method and device, a storage medium, and an electronic device.
  • the cloud service can be a VPC.
  • the present disclosure provides an operation notification method, including: receiving a target configuration instruction sent by a client, wherein the target configuration instruction is configured to instruct a notification to perform a target configuration operation on a target cloud service;
  • the target database writes a target configuration message, wherein the target configuration message is configured to trigger a notification to a target node associated with the target cloud service to perform the target configuration operation on the target cloud service;
  • the method further includes: monitoring a target event occurring in the target database, wherein the target event is writing the target database an event triggered by a target configuration message; and sending a target notification message to the target node, wherein the target notification message is configured to notify the target cloud service to perform the target configuration operation.
  • writing the target configuration message to the target database includes, if the target configuration operation is a configuration operation performed on the target cloud service on the first node, to the target cloud service
  • the target database writes a first configuration message, wherein the first configuration message is configured to trigger a notification to the first node to perform the target configuration operation on the target cloud service on the first node;
  • the target database writes a second configuration message, wherein the second configuration message is configured to trigger a notification to a second node that the target cloud service is to perform the target configuration operation on the first node, and the second node is Nodes with the target cloud service are deployed.
  • the method further includes: monitoring a first event occurring in the target database, wherein the first event is writing entering an event triggered by the first configuration message, where the first configuration message is a message with the target node identifier of the first node as a key; and sending a first notification message to the first node, wherein, The first notification message is configured to notify that the target configuration operation is performed on the target cloud service on the first node, where the first node is a node that subscribes to a first monitoring task, and the first monitoring task It is configured to monitor messages in the target database with the target node identifier as a key.
  • the method further includes: monitoring a second event occurring in the target database, wherein the second event is writing enter the event triggered by the second configuration message, where the second configuration message is a message with the target cloud service identifier of the target cloud service as a key; and send a second notification message to the second node, wherein , the second notification message is configured to notify the target cloud service that the target configuration operation is performed on the first node, the second node is a node that subscribes to the second monitoring task, and the second monitoring The task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • the method further comprises: configuring, on the target, an operation to create the target cloud service on the first node the first virtual machine, and when the first virtual machine is the first virtual machine of the target cloud service on the first node, subscribe the third monitoring task for the first node, wherein the The third monitoring task is configured to listen to messages in the target database with the target cloud service identifier as a key; and the target configuration operation is to delete a second virtual message of the target cloud service on the first node. and the second virtual machine is the last virtual machine of the target cloud service on the first node, cancel the fourth monitoring task for the first node, wherein the fourth monitoring The task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • the method before receiving the target configuration instruction sent by the client, the method further includes: creating a first communication connection between the proxy server and the target database, wherein the first communication connection configured to send a third notification message to the proxy server, the third notification message configured to notify the target cloud service to perform the target configuration operation; and between the proxy server and each of the target nodes create a second communication connection between the The message is configured to notify that the target configuration operation is performed on the target cloud service.
  • the method before receiving the target configuration instruction sent by the client, the method further includes: receiving a target monitoring request sent by a third node, wherein the target monitoring request is configured to request monitoring a target The event change with the target cloud service identifier of the target cloud service as a keyword after the version, and an event change with the target cloud service identifier as a keyword corresponds to a version; and in response to the target monitoring request, start the fifth The monitoring task, wherein the fifth monitoring task is configured to monitor the event changes with the target cloud service identifier as a key after the target version.
  • the present disclosure provides an operation notification device, comprising: a first receiving unit configured to receive a target configuration instruction sent by a client, wherein the target configuration instruction is configured to instruct the notification to perform a target configuration operation on a target cloud service a writing unit, configured to respond to the target configuration instruction and write a target configuration message to the target database, wherein the target configuration message is configured to trigger a notification to the target node associated with the target cloud service to the target cloud service. performing the target configuration operation; and a first sending unit configured to send a target response message corresponding to the target configuration instruction to the client, wherein the target response message is configured as a notification indicating the target configuration operation result.
  • the apparatus further includes: a first monitoring unit, configured to listen to a target event occurring in the target database after writing the target configuration message to the target database, wherein the The target event is an event triggered by writing the target configuration message; and a second sending unit configured to send a target notification message to the target node, wherein the target notification message is configured to notify the execution of the target cloud service The target configuration operation.
  • a first monitoring unit configured to listen to a target event occurring in the target database after writing the target configuration message to the target database, wherein the The target event is an event triggered by writing the target configuration message
  • a second sending unit configured to send a target notification message to the target node, wherein the target notification message is configured to notify the execution of the target cloud service The target configuration operation.
  • the writing unit includes: a first writing unit configured to, if the target configuration operation is a configuration operation performed on the target cloud service on the first node, to the target cloud service
  • the target database writes a first configuration message, wherein the first configuration message is configured to trigger a notification to the first node to perform the target configuration operation on the target cloud service on the first node; and the second a writing unit, configured to write a second configuration message to the target database, wherein the second configuration message is configured to trigger a notification to a second node that the target cloud service is executed on the first node
  • the second node is a node on which the target cloud service is deployed.
  • the apparatus further includes: a second monitoring unit, configured to listen to a first event that occurs in the target database after writing the first configuration message to the target database, wherein, The first event is an event triggered by writing the first configuration message, and the first configuration message is a message with the target node identifier of the first node as a key; and a third sending unit, configured as sending a first notification message to the first node, wherein the first notification message is configured to notify that the target configuration operation is performed on the target cloud service on the first node, the first node is a subscription
  • the first monitoring task is configured to monitor a message in the target database with the target node identifier as a key.
  • the apparatus further includes: a third monitoring unit, configured to listen to a second event occurring in the target database after writing the second configuration message to the target database, wherein, The second event is an event triggered by writing the second configuration message, and the second configuration message is a message with the target cloud service identifier of the target cloud service as a key; and a fourth sending unit configured to configure for sending a second notification message to the second node, wherein the second notification message is configured to notify the target cloud service that the target configuration operation is performed on the first node, the second node is A node that has subscribed to a second monitoring task, where the second monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • a third monitoring unit configured to listen to a second event occurring in the target database after writing the second configuration message to the target database, wherein, The second event is an event triggered by writing the second configuration message, and the second configuration message is a message with the target cloud service identifier of the target cloud service as a key
  • the apparatus further includes a subscribing unit configured to, after sending the first notification message to the first node, operate on the target configuration to create a subscription on the first node the first virtual machine of the target cloud service, and the first virtual machine is the first virtual machine of the target cloud service on the first node, subscribe the third monitoring task for the first node , wherein the third monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key; and a cancellation unit configured to operate on the first node in the target configuration If the second virtual machine of the target cloud service is deleted, and the second virtual machine is the last virtual machine of the target cloud service on the first node, cancel the fourth virtual machine for the first node.
  • the monitoring task wherein the fourth monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • the apparatus further includes: a first creation unit configured to create a first communication connection between the proxy server and the target database before receiving the target configuration instruction sent by the client, wherein , the first communication connection is configured to send a third notification message to the proxy server, where the third notification message is configured to notify the target cloud service to perform the target configuration operation; and a second creation unit, configured as A second communication connection is created between the proxy server and each of the target nodes, wherein the first communication connection has an associated relationship with the second communication connection, and the second communication connection is configured to Each node sends a fourth notification message, where the fourth notification message is configured to notify that the target configuration operation is performed on the target cloud service.
  • the apparatus further includes: a second receiving unit, configured to receive a target monitoring request sent by a third node before receiving the target configuration instruction sent by the client, wherein the target The monitoring request is configured to request to monitor the event change of the target cloud service with the target cloud service identifier of the target cloud service as a keyword, and an event change with the target cloud service identifier as a keyword corresponds to one version; and a startup unit, is configured to start a fifth monitoring task in response to the target monitoring request, wherein the fifth monitoring task is configured to monitor event changes with the target cloud service identifier as a key after the target version.
  • a second receiving unit configured to receive a target monitoring request sent by a third node before receiving the target configuration instruction sent by the client, wherein the target The monitoring request is configured to request to monitor the event change of the target cloud service with the target cloud service identifier of the target cloud service as a keyword, and an event change with the target cloud service identifier as a keyword corresponds to one version
  • a startup unit is configured to start
  • the present disclosure provides a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to execute the operation notification method of the present disclosure when run.
  • the present disclosure provides an electronic device comprising a memory and a processor, with a computer program stored in the memory, the processor being configured to execute the computer program to perform the operation notification method of the present disclosure.
  • the database is used for auxiliary notification, and the target configuration instruction sent by the client is received by receiving the target configuration instruction, wherein the target configuration instruction is configured to instruct the notification to perform the target configuration operation on the target cloud service;
  • the database writes a target configuration message, wherein the target configuration message is configured to trigger a notification to a target node associated with the target cloud service to perform a target configuration operation on the target cloud service; and send a target response message corresponding to the target configuration instruction to the client, wherein, The target response message is configured to indicate the notification result of the target configuration operation.
  • the server After receiving the configuration instruction from the client, the server only needs to write the message to the target database, and the relevant computing nodes can receive the change, while the server is writing the message.
  • the client notification result After reaching the target database, the client notification result can be returned.
  • the notification time is constant and will not increase with the increase of the cloud service scale.
  • the purpose of shortening the notification time of the configuration operation is achieved, and the operation notification efficiency and user awareness are improved.
  • the technical effect of the timeliness of the operation notification result further solves the problem of the operation notification method in the related art that the user cannot know the operation notification result in time due to the increase of the notification time with the increase of the cloud service scale.
  • FIG. 1 is a schematic diagram of a hardware environment of an operation notification method according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of an operation notification method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a transaction processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a structural block diagram of an operation notification device according to an embodiment of the present disclosure.
  • FIG. 6 is a structural block diagram of an electronic device according to an embodiment of the present disclosure.
  • ETCD a highly available distributed key-value database
  • RabbitMQ An open source message middleware that implements the AMQP message queue protocol
  • SDN Software Defined Network, software defined network
  • VPC Virtual Private Cloud, virtual private cloud
  • Zookeeper A distributed, open source coordination service for distributed applications.
  • the present disclosure provides an operation notification method.
  • the above operation notification method can be applied to the hardware environment composed of the terminal 102 and the server 104 as shown in FIG. 1 .
  • the server 104 is connected to the terminal 102 through the network, and can be configured to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal, and a database can be set on the server or independently of the server. , is configured to provide data storage services for the server 104, and can also be configured to process cloud services.
  • the above-mentioned networks include but are not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 102 is not limited to PCs, mobile phones, tablet computers, etc.
  • the operation notification method in the embodiment of the present disclosure may be executed by the server 104 , may also be executed by the terminal 102 , or may be executed jointly by the server 104 and the terminal 102 .
  • the terminal 102 may execute the operation notification method of the embodiment of the present disclosure by a client installed on the terminal 102 .
  • FIG. 2 is a flowchart of the operation notification method according to the embodiment of the present disclosure. As shown in FIG. 2 , the flow of the method may include the following steps :
  • Step S202 receiving a target configuration instruction sent by the client, wherein the target configuration instruction is configured to instruct a notification to perform a target configuration operation on the target cloud service;
  • Step S204 in response to the target configuration instruction, write a target configuration message to the target database, wherein the target configuration message is configured to trigger a notification that the target node associated with the target cloud service performs the target configuration operation on the target cloud service;
  • Step S206 sending a target response message corresponding to the target configuration instruction to the client, wherein the target response message is configured to indicate a notification result of the target configuration operation.
  • a target configuration instruction sent by the client is received, wherein the target configuration instruction is configured to instruct a notification to perform a target configuration operation on the target cloud service; in response to the target configuration instruction, a target configuration message is written to the target database, wherein , the target configuration message is configured to trigger a notification to the target node associated with the target cloud service to perform the target configuration operation on the target cloud service; send a target response message corresponding to the target configuration instruction to the client, wherein the target response message is configured to indicate the target configuration operation
  • step S202 a target configuration instruction sent by the client is received, wherein the target configuration instruction is configured to instruct a notification to perform a target configuration operation on the target cloud service.
  • the operation notification method in this embodiment may be applied to a scenario where cloud services (eg, cloud computing services) are deployed across multiple computing nodes, and cloud services may include but are not limited to: VPC.
  • cloud services eg, cloud computing services
  • cloud services may include but are not limited to: VPC.
  • a VPC is used as an example for description.
  • the operation notification method in this example is also applicable.
  • VPC User
  • the server of the VPC can be connected to multiple computing nodes spanned by the VPC.
  • a VPC can span multiple computing nodes, and multiple VPCs can be distributed on a computing node.
  • a certain VPC target VPC is used as an example to describe the operation notification method of the VPC. Except for the description, the operation notification method of multiple VPCs is the same as or similar to the operation notification method of the target VPC.
  • the user can control the target configuration operation to be performed on the target VPC (an example of the target cloud service).
  • the target configuration operation can be a configuration operation performed on the configuration information of the target VPC.
  • the configuration operation is an operation of adding a network card; the target configuration operation may also be a configuration operation performed on the virtual machine of the target VPC, for example, creating a virtual machine of the target VPC, deleting the virtual machine of the target VPC, etc.
  • Configuration operations are not limited.
  • the target configuration operation for the target VPC can be sent to the server through the target configuration instruction.
  • the server may receive a target configuration instruction sent by the client, where the target configuration instruction may be configured to instruct the notification to perform a target configuration operation on the target VPC.
  • a target configuration message is written to the target database in response to the target configuration instruction, wherein the target configuration message is configured to trigger a notification to a target node associated with the target cloud service to perform a target configuration operation on the target cloud service.
  • the server can be a server in a distributed system such as zookeeper and ETCD, and the server can be used as an SDN controller (VPC is an implementation of SDN).
  • VPC is an implementation of SDN.
  • a target database can be deployed in the server, or connected to the target database through a network.
  • the server can write a target configuration message to the target database.
  • the target configuration message can be used to trigger and notify the target node associated with the target VPC to perform the target configuration operation on the target VPC.
  • the target node may be a computing node where the target VPC is distributed, that is, the computing node spanned by the target VPC, and the number of computing nodes spanned by the target VPC may be one or more.
  • the server can use a watch (listening) mechanism, and the computing node can watch the VPC concerned.
  • the server only needs to write the message to the target database (for example, the database in zookeeper, etc.), and then it can trigger the notification of each relevant computing node, and the relevant computing node can receive the change.
  • a target response message corresponding to the target configuration instruction is sent to the client, wherein the target response message is configured to indicate the notification result of the target configuration operation.
  • the target configuration operation performed on the target VPC can notify each relevant computing node. Therefore, after writing the target configuration message into the target database, the server can send a target response message corresponding to the target configuration instruction to the client, the target response message can be used to indicate the notification result of the target configuration operation, and the notification result can be Yes: Notification complete.
  • the client terminal may display the notification result of the target configuration operation to the user through the display interface of the client terminal, and may also prompt the user whether to perform subsequent operations, etc., which is not limited in this embodiment.
  • each computing node can synchronize the configuration information through the target database, and the latest version ensures the normal operation of the target VPC.
  • each computing node spanned by the target VPC needs to be notified one by one in a polling manner, and only after all the computing nodes have completed the notification.
  • the client will be notified that the notification has been completed, and the notification time and configuration effective time will increase as the scale increases.
  • the VPC is distributed among 1,000 computing nodes. If a network card is added to the VPC, the operation of adding a network card needs to be notified to the 1,000 nodes.
  • the RabbitMQ polling notification method it is necessary to notify the 1000 nodes one by one in a polling manner, and the time required for the notification and configuration to take effect will be very long.
  • the server writes the message into the target database (zookeeper, ETCD), and the relevant computing node can receive the change.
  • the server does not need to notify each relevant computing node one by one, and the time required for notification and configuration to take effect will be greatly shortened, which can improve the efficiency of configuration notification and configuration taking effect.
  • the server can use the watch (listening) mechanism to calculate the VPC concerned by the node watch.
  • the server only needs to write the message to the target database (for example, zookeeper, ETCD) to trigger the notification of each relevant computing node, and the relevant computing node can receive the change.
  • the client After the message is written to the target database, the client can be notified that the notification has been completed, and the notification time is constant and will not increase with the increase in scale.
  • the operation notification method in this embodiment is explained below with reference to examples.
  • the computing node watches the VPC concerned by itself, and the server only needs to write the message to zookeeper, and the relevant computing node can receive the change.
  • the above method further includes:
  • S12 Send a target notification message to the target node, where the target notification message is configured to notify to perform a target configuration operation on the target cloud service.
  • the computing node can watch the VPC that it is concerned about, and the watch can correspond to a monitoring task on the server side.
  • the monitoring task is configured to listen to a specific event in the target database.
  • the above-mentioned specific event can be triggered by writing a specific message in the target database.
  • the server can monitor that a target event occurs in the target database, that is, an event triggered by writing the target configuration message. In response to the target event, the server can generate a target notification message to notify that the target configuration operation has been performed on the target VPC.
  • the target notification message may be generated according to the target configuration message, and the target notification message may be generated by adding relevant information (for example, node identification, node address, etc., which can be configured as information for communication transmission) on the basis of the target configuration message, or it may be
  • relevant information for example, node identification, node address, etc., which can be configured as information for communication transmission
  • the specific fields are extracted from the target configuration message and generated according to the extracted specific fields and the preset message format, and different fields may correspond to different positions in the preset message format. This is not limited in this embodiment.
  • the generation of a notification message is triggered by monitoring the event change, so as to notify the associated computing node of the event change, which can improve the timeliness of the configuration notification and the efficiency of the configuration notification.
  • writing the target configuration message to the target database includes:
  • the target configuration operation is a configuration operation performed on the target cloud service on the first node
  • S22 Write a second configuration message to the target database, where the second configuration message is configured to trigger a notification to the second node that the target cloud service is to perform the target configuration operation on the first node, and the second node is the node on which the target cloud service is deployed .
  • the target configuration operation is a configuration operation performed on the target VPC on a certain node, for example, a virtual machine of the target VPC is created, a virtual machine of the target VPC is deleted, etc., you can write two data into the target database. configuration messages, a first configuration message and a second configuration message.
  • the first node Before writing the target configuration message, the first node may be the compute node spanned by the target VPC (the virtual machine with the target VPC on the compute node), or the newly configured compute node (the compute node without the target VPC before)
  • performing a target configuration operation on the target VPC on the first node can trigger a change in the relevant configuration on the first node.
  • the list of VPCs distributed on this node (VPC list) will change, and each The number of virtual machines in a VPC and the identity of the virtual machines may also change.
  • the server can write the first configuration message to the target database to trigger and notify the first node to perform the target configuration operation on the target VPC on the first node, so as to ensure accurate notification to the first node and ensure that the related configuration on the first node is correct. accuracy.
  • the target VPC can be distributed on multiple computing nodes.
  • it can also include one or more second nodes. That is, the second node is the computing node spanned by the target VPC, and the target node can include the first node. and the second node.
  • the server can write a second configuration message to the target database to trigger notification to the second node that the target VPC has performed the target configuration operation on the first node, so as to ensure the notification of configuration information. accuracy and comprehensiveness.
  • the above method further includes:
  • S32 Send a first notification message to the first node, where the first notification message is configured to notify the first node to perform a target configuration operation on the target cloud service, the first node is a node that subscribes to the first monitoring task, the first The listening task is configured to listen for messages in the target database with the target node ID as the key.
  • the target database may be a database that stores data in a key-value manner.
  • the target database may be a database that stores data in a key-value manner.
  • node identifier for example, hostname, host name
  • the first node may subscribe to the first monitoring task, and the first monitoring task is to monitor the messages in the target database with the target node identifier as the key.
  • the first configuration message may be a message with a node identifier (eg, hostname, host name) of the first node as a key, and is used to trigger a notification that the first node performs a target configuration operation on the target VPC on the first node.
  • a node identifier eg, hostname, host name
  • the server can monitor the first event triggered by writing the first configuration message. After monitoring the first event, the server may send a first notification message to the first node to notify that the target configuration operation is performed on the target VPC on the first node.
  • the server if the computing node hostname 1 creates a virtual machine of vpc-id-1, the server writes the message of creating the virtual machine into the ETCD with the key of hostname1, so as to trigger the notification of hostname1.
  • the server if the computing node hostname1 deletes a virtual machine of vpc-id-1, the server writes the message of deleting the virtual machine into the ETCD with the key of hostname1, so as to trigger the notification of hostname1.
  • the above method further includes:
  • S42 Send a second notification message to the second node, where the second notification message is configured to notify the target cloud service that the target configuration operation is performed on the first node, the second node is a node that subscribes to the second monitoring task, the second The listening task is configured to listen for messages in the target database with the target cloud service ID as the key.
  • the target database can be a database that stores data in a key-value manner.
  • the computing node After the computing node is started, it can obtain the VPC list distributed on the computing node from the server, and monitor the event changes of these VPC ids, that is, monitor the event changes with these VPC ids as the key.
  • the node For the second node, the node may subscribe to a second monitoring task, and the second monitoring task is to monitor messages in the target database with the VPC identifier of the target VPC as a key.
  • the second configuration message may be a message with a VPC identifier (eg, vpc-id-1) of the target VPC as a key, and is used to trigger a notification to the second node that the target VPC has performed a target configuration operation on the first node.
  • a VPC identifier eg, vpc-id-1
  • the server can monitor the second event triggered by the writing of the second configuration message. After monitoring the second event, the server may send a second notification message to the second node, so as to notify that the target VPC on the second node has performed a target configuration operation on the first node.
  • the server can write the message of creating a virtual machine into ETCD with the key of vpc-id-1, so as to trigger the notification of the virtual machine.
  • Other compute nodes (second nodes) across which the VPC spans.
  • the computing node hostname 1 deletes a virtual machine of vpc-id-1, and the server writes the message of deleting the virtual machine to ETCD with the key of vpc-id-1, so as to trigger the notification to the VPC across other compute nodes.
  • the above method further includes:
  • the target configuration operation is to create a first virtual machine of the target cloud service on the first node, and the first virtual machine is the first virtual machine of the target cloud service on the first node, subscribe the first node a third monitoring task, wherein the third monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key;
  • the target configuration operation is to delete the second virtual machine of the target cloud service on the first node, and the second virtual machine is the last virtual machine of the target cloud service on the first node, cancel the first node
  • the fourth monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • Compute nodes can use the publish-subscribe function of the distributed system (eg, ETCD) to listen for event changes in the distributed system.
  • the monitored event changes can be notified through a communication connection (channel) between the computing node and the server.
  • the computing node can only monitor the event changes of the VPC distributed on this node.
  • the target configuration operation is to create a virtual machine of the target VPC on the first node (the first virtual machine), and the created virtual machine is the first virtual machine of the target VPC on the first node, then, on the first node and Event changes with the target VPC ID as the key in the target database are not subscribed.
  • the first node may be subscribed to a third monitoring task, where the third monitoring task is configured to monitor messages in the target database with the target VPC identifier as a key.
  • the way of subscribing the third monitoring task for the first node may be: the first node sends a monitoring request to the server to request to monitor the event change with the target VPC identifier as the keyword (write the message with the target VPC identifier as the keyword). Triggered event); in response to the monitoring request, the server can create a third monitoring task.
  • vpc-id-1 For a scenario where a virtual machine of vpc-id-1 is created on the computing node hostname1, if the virtual machine is the first virtual machine of vpc-id-1 on this computing node (hostname1), Then the computing node can monitor the event change of vpc-id-1.
  • the target configuration operation is to delete the virtual machine (second virtual machine) of the target VPC on the first node, and the deleted virtual machine is the last virtual machine of the target VPC on the first node, then after deleting the second virtual machine Before the host, the first node has subscribed to the event change in the target database with the target VPC identifier as the key.
  • a fourth monitoring task may be canceled for the first node, and the fourth monitoring task is configured to monitor messages in the target database with the target VPC identifier as a key.
  • the method of canceling the fourth monitoring task for the first node may be: the first node sends a cancel monitoring request to the server to request to cancel monitoring the event change with the target VPC identifier as the keyword (write the target VPC identifier as the keyword). The event triggered by the message); in response to the cancel monitoring request, the server can delete the fourth monitoring task.
  • vpc-id-1 For a scenario where a virtual machine of vpc-id-1 is created on the computing node hostname1, if the virtual machine is the last virtual machine of vpc-id-1 on this computing node (hostname1), Then the computing node cancels monitoring the event change of vpc-id-1.
  • the timeliness of event monitoring can be ensured, and the rationality of communication resource utilization can be ensured at the same time.
  • the above method before receiving the target configuration instruction sent by the client, the above method further includes:
  • S62 Create a second communication connection between the proxy server and each node of the target node, wherein the first communication connection has an associated relationship with the second communication connection, the second communication connection is configured to send a fourth notification message to each node, and the first communication connection is configured to send a fourth notification message to each node.
  • Four notification messages are configured to notify the target cloud service to perform the target configuration operation.
  • the changes of the monitored events can be aggregated through the proxy server, for example, the monitoring tasks of the same keywords of different computing nodes can be aggregated.
  • the communication connection (channel) established between the proxy server and the computing node can be used to transmit messages between the proxy server and the computing node.
  • each node in the target node may send a monitoring request to the server through the proxy server, and establish a first communication connection (channel) between the server and the proxy server and each node communicates with the server.
  • a second communication connection (channel) between proxy servers, and the first communication connection has an associated relationship with the second communication connection.
  • the first communication connection may be configured to send a third notification message to the proxy server, the third notification message may be configured to notify that a target configuration operation is performed on the target VPC, the second communication connection may be used to send a fourth notification message to each node, and the third notification message may be configured to notify the target VPC that the target configuration operation is performed.
  • Four notification messages can be configured to notify that a target configuration operation has been performed on the target VPC.
  • different computing nodes can establish a channel with the proxy server respectively, and the proxy server and the server can establish a channel. If the event of the key changes, the server can send a notification message to the proxy server to notify the event change.
  • the proxy server can determine the computing node that watches the key, and forward the notification message to each computing node through the channel between the proxy server and each computing node.
  • Different computing nodes can start monitoring messages in the target database with the VPC identifier of the target VPC as a key at different timings.
  • the proxy server can aggregate the monitoring requests of different computing nodes, and aggregate the same key that different computing nodes watch.
  • the proxy server may receive a monitoring request from the computing node to request to monitor event changes of one or more keywords in the target database, and the one or more keywords may include the VPC identifier of the target VPC.
  • the proxy server may not re-establish the proxy server and service Instead, the first communication connection is associated with the communication connection (second communication connection) between the computing node and the proxy server.
  • the following describes the manner in which the proxy server aggregates the same keywords monitored by different computing nodes with reference to an example.
  • the server is the server of ETCD
  • ETCD-proxy (a kind of proxy server) is a proxy service of ETCD, which can be extended. Prevents a large number of connections from being directly connected to ETCD, which is suitable for VPC scenarios.
  • the computing nodes include: vgw1, vgw2, vgw3, and vgw4.
  • vgw1 is distributed with d1 (VPC domain 1) and d2,
  • vgw2 is distributed with d1,
  • vgw3 is distributed with d2 and d3,
  • vgw4 is distributed with d1 and d2.
  • vgw1 can watch events whose keys are d1 and d2
  • vgw2 can watch events whose keys are d1
  • vgw3 can watch events whose keys are d2 and d3
  • vgw1 can watch events whose keys are d1 and d2.
  • ETCD-proxy can aggregate watch keys to reduce ETCD cluster load. For example, ETCD-proxy can aggregate d1 watched by vgw1, vgw2 and vgw4, and aggregate d2 watched by vgw1, vgw3 and vgw4.
  • the proxy server aggregates keywords monitored by different computing nodes, so that the load of the database cluster can be reduced and the utilization rate of communication resources can be improved.
  • the above method before receiving the target configuration instruction sent by the client, the above method further includes:
  • S71 Receive the target monitoring request sent by the third node, wherein the target monitoring request is configured to request monitoring of the target version after the event change with the target cloud service identifier of the target cloud service as the keyword, and once the target cloud service identifier is used as the keyword.
  • the event change corresponds to a version
  • a historical version can be specified to start listening to make up for lost events.
  • the third node may determine the version of the event change (ie, the target version) saved on the node and using the VPC identifier of the target VPC as a key, and one event change may correspond to one version.
  • the third node may send a target monitoring request to the server, and the target monitoring request may carry version information of the target version.
  • the target monitoring request may be configured as an event change with the VPC identifier of the target VPC as a key after requesting to monitor the target version. .
  • the server After receiving the target monitoring request sent by the third node, the server can start the fifth monitoring task, and the fifth monitoring task is configured to monitor the target database, and the target version uses the VPC identifier of the target VPC as a key for event changes.
  • the lost events can be recovered, and the integrity of the configuration information saved on the computing node is improved.
  • the MQ polling notification can be replaced by the watch method, and the notification time can be made constant.
  • the zookeeper watch mechanism can be used to calculate the VPC that the node is concerned about.
  • the server only needs to write the message to the zookeeper, and the relevant computing nodes can receive the change.
  • the notification time is constant and does not increase with scale.
  • the channel notified by Zookeeper cannot be reused, the channel needs to be re-established after each message is received; if the event comes too fast, the zookeeper client has no time to re-watch after processing an event, and the events during the period will be lost; and, zookeeper cannot Get historical version information.
  • the publish and subscribe function of ETCD can also be used to calculate the VPC concerned by the computing node, and the server only needs to write the message to ETCD, and the relevant computing node can receive the change.
  • the notification time is constant and does not increase with scale.
  • ETCD can reuse channels, you can specify a certain version of history to start monitoring to make up for lost events, and ETCD-proxy can aggregate watch keys, greatly reducing the load of ETCD clusters, thus solving the problems of using the zookeeper watch mechanism .
  • the process of the operation notification method in this example may include the following steps:
  • Step S402 the front end instructs the server to create a virtual machine of a VPC
  • Step S404 the server writes the message of creating the virtual machine to the ETCD, and notifies the relevant computing nodes.
  • VM with id-1 If a virtual machine with vpc-id-1 needs to be created on the computing node hostname 1, the relevant personnel can send configuration instructions to the server through its terminal device (front-end device) to indicate that a vpc-id-1 has been created on the computing node hostname 1.
  • VM with id-1 If a virtual machine with vpc-id-1 needs to be created on the computing node hostname 1, the relevant personnel can send configuration instructions to the server through its terminal device (front-end device) to indicate that a vpc-id-1 has been created on the computing node hostname 1.
  • VM with id-1 If a virtual machine with vpc-id-1 needs to be created on the computing node hostname 1, the relevant personnel can send configuration instructions to the server through its terminal device (front-end device) to indicate that a vpc-id-1 has been created on the computing node hostname 1.
  • VM with id-1 If a virtual machine with vpc
  • the server can write the message of creating a virtual machine into ETCD with the key of hostname 1, and notify hostname 1 (the first node).
  • the server writes the message of creating a virtual machine to ETCD with the key as vpc-id-1, and notifies other computing nodes (second nodes) spanned by the VPC.
  • the computing node monitors the event changes of vpc-id-1.
  • a virtual machine of a VPC is deleted on a computing node, the relevant computing nodes can be notified in a similar manner. If the virtual machine is the last virtual machine of vpc-id-1 on the computing node (hostname 1), the computing node cancels monitoring the event changes of vpc-id-1.
  • the watch mode is used to replace the MQ polling notification, and the notification time is changed to a constant, which can improve the efficiency of configuration notification and configuration validation.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
  • the technical solutions of the present disclosure can be embodied in the form of software products in essence or the parts that make contributions to related technologies.
  • the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) ), including several instructions to cause a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present disclosure.
  • FIG. 5 is a structural block diagram of an operation notification apparatus according to an embodiment of the present disclosure. As shown in FIG. 5 , the apparatus may include:
  • the first receiving unit 502 is configured to receive a target configuration instruction sent by the client, wherein the target configuration instruction is configured to instruct a notification to perform a target configuration operation on the target cloud service;
  • the writing unit 504 is connected to the first receiving unit 502, and is configured to respond to the target configuration instruction and write a target configuration message to the target database, wherein the target configuration message is configured to trigger a notification that the target node associated with the target cloud service is to the target cloud service. perform target configuration operations;
  • the first sending unit 506, connected to the writing unit 504, is configured to send a target response message corresponding to the target configuration instruction to the client, wherein the target response message is configured to indicate the notification result of the target configuration operation.
  • the first receiving unit 502 in this embodiment may be configured to execute the above step S202
  • the writing unit 504 in this embodiment may be configured to execute the above step S204
  • the first sending unit 506 in this embodiment It can be configured to perform the above step S206.
  • the target configuration instruction sent by the client is received, wherein the target configuration instruction is configured to instruct the notification to perform the target configuration operation on the target cloud service; in response to the target configuration instruction, the target configuration message is written to the target database, wherein the target configuration message is configured to trigger a notification to a target node associated with the target cloud service to perform a target configuration operation on the target cloud service; send a target response message corresponding to the target configuration instruction to the client, wherein the target response message is configured to indicate a notification result of the target configuration operation, It solves the problem in the operation notification method in the related art that the user cannot know the result of the operation notification in time due to the increase of the notification time with the increase of the scale of the cloud service, improves the efficiency of the operation notification, and improves the timeliness for the user to know the result of the operation notification. .
  • the above-mentioned apparatus further comprises:
  • a first monitoring unit configured to monitor a target event that occurs in the target database after writing the target configuration message to the target database, where the target event is an event triggered by writing the target configuration message;
  • the second sending unit is configured to send a target notification message to the target node, wherein the target notification message is configured to notify to perform a target configuration operation on the target cloud service.
  • writing unit 504 includes:
  • a first writing unit configured to write a first configuration message to the target database when the target configuration operation is a configuration operation performed on the target cloud service on the first node, where the first configuration message is configured to trigger a notification the first node performs a target configuration operation on the target cloud service on the first node;
  • the second writing unit is configured to write a second configuration message to the target database, where the second configuration message is configured to trigger a notification to the second node that the target cloud service is to perform a target configuration operation on the first node, and the second node is the deployment A node with the target cloud service.
  • the above-mentioned apparatus further comprises:
  • the second monitoring unit is configured to monitor the first event that occurs in the target database after writing the first configuration message to the target database, where the first event is an event triggered by writing the first configuration message, and the first configuration message is a message keyed by the target node identification of the first node;
  • the third sending unit is configured to send a first notification message to the first node, where the first notification message is configured to notify the first node to perform a target configuration operation on the target cloud service, and the first node subscribes to the first monitoring task
  • the first monitoring task is configured to monitor messages in the target database with the target node identifier as a key.
  • the above-mentioned apparatus further comprises:
  • the third monitoring unit is configured to, after writing the second configuration message to the target database, monitor a second event that occurs in the target database, where the second event is an event triggered by writing the second configuration message, and the second configuration message is a message keyed by the target cloud service identifier of the target cloud service;
  • the fourth sending unit is configured to send a second notification message to the second node, where the second notification message is configured to notify the target cloud service that the target configuration operation is performed on the first node, and the second node is subscribed to the second monitoring task
  • the node, and the second monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • the above-mentioned apparatus further comprises:
  • a subscription unit configured to create a first virtual machine of the target cloud service on the first node in the target configuration operation after sending the first notification message to the first node, and the first virtual machine is the target cloud service on the first node
  • the first node is subscribed to a third monitoring task, wherein the third monitoring task is configured to listen to messages in the target database with the target cloud service identifier as a key;
  • the cancellation unit is configured to delete the second virtual machine of the target cloud service on the first node when the target configuration operation is performed, and the second virtual machine is the last virtual machine of the target cloud service on the first node.
  • a node cancels the fourth monitoring task, where the fourth monitoring task is configured to monitor messages in the target database with the target cloud service identifier as a key.
  • the above-mentioned apparatus further comprises:
  • the first creation unit is configured to create a first communication connection between the proxy server and the target database before receiving the target configuration instruction sent by the client, wherein the first communication connection is configured to send a third notification message to the proxy server, and the first communication connection is configured to send a third notification message to the proxy server.
  • Three notification messages configured to notify the target configuration operation to be performed on the target cloud service;
  • the second creation unit is configured to create a second communication connection between the proxy server and each node of the target node, wherein the first communication connection has an associated relationship with the second communication connection, and the second communication connection is configured to send the first communication connection to each node.
  • Four notification messages where the fourth notification message is configured to notify to perform a target configuration operation on the target cloud service.
  • the above-mentioned apparatus further comprises:
  • the second receiving unit is configured to receive the target monitoring request sent by the third node before receiving the target configuration instruction sent by the client, wherein the target monitoring request is configured to use the target cloud service identifier of the target cloud service as the target version after requesting to monitor the target version.
  • the event change of the keyword, an event change with the target cloud service identifier as the keyword corresponds to one version;
  • the initiating unit is configured to initiate a fifth monitoring task in response to the target monitoring request, wherein the fifth monitoring task is configured to monitor event changes with the target cloud service identifier as a keyword after the target version.
  • the above modules may run in the hardware environment as shown in FIG. 1 , and may be implemented by software or hardware, wherein the hardware environment includes a network environment.
  • the present disclosure also provides an electronic device configured to implement the above operation notification method, where the electronic device may be a terminal device, a server, or a combination thereof.
  • FIG. 6 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 6 , the electronic device includes a memory 602 and a processor 604, where a computer program is stored in the memory 602, and the processor 604 is configured to The steps in any one of the above method embodiments are performed by a computer program.
  • the electronic device described above may be located at at least one network device among a plurality of network devices of a computer network.
  • the above-described processor may be configured to perform the following steps by a computer program:
  • S3 Send a target response message corresponding to the target configuration instruction to the client, where the target response message is configured to indicate a notification result of the target configuration operation.
  • the memory 602 may be configured to store software programs and modules, such as program instructions/modules corresponding to the operation notification method and apparatus in the embodiments of the present disclosure.
  • the processor 604 executes the software programs stored in the memory 602 by running the software programs. and modules to perform various functional applications and data processing, that is, to implement the above-mentioned operation notification method.
  • Memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • memory 602 may further include memory located remotely from processor 604, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the memory 602 may be, but is not limited to, configured to store inference models, resource data, and the like.
  • the above-mentioned memory 602 may include, but is not limited to, the first receiving unit 502 , the writing unit 504 , and the first sending unit 506 in the above-mentioned operation notification apparatus. In addition, it may also include, but is not limited to, other module units in the above-mentioned operation notification apparatus, which will not be repeated in this example.
  • the above-described transmission device 606 is configured to receive or transmit data via a network.
  • the above-mentioned network-related embodiments may include wired networks and wireless networks.
  • the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network.
  • the transmission device 606 is a radio frequency (RF) module configured to communicate with the Internet wirelessly.
  • RF radio frequency
  • the above-mentioned electronic device further includes: a connection bus 608 configured to connect various module components in the above-mentioned electronic device.
  • the examples in this embodiment may refer to the examples described in the foregoing embodiments, and details are not described herein again in this embodiment.
  • the device implementing the above operation notification method may be a terminal device, and the terminal device may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a Handheld computers and terminal equipment such as Mobile Internet Devices (MID) and PAD.
  • FIG. 6 does not limit the structure of the above electronic device.
  • the terminal device may also include more or less components than those shown in FIG. 6 (eg, a network interface, a display device, etc.), or have a different configuration than that shown in FIG. 6 .
  • the present disclosure also provides a storage medium.
  • the above-described storage medium may be configured to execute program code of the operation notification method.
  • the above-mentioned storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above-mentioned embodiments.
  • the storage medium is configured to store program code configured to perform the following steps:
  • S3 Send a target response message corresponding to the target configuration instruction to the client, where the target response message is configured to indicate a notification result of the target configuration operation.
  • the examples in this embodiment may refer to the examples described in the foregoing embodiments, which are not repeated in this embodiment.
  • the above-mentioned storage media may include, but are not limited to, various media that can store program codes, such as U disk, ROM, RAM, removable hard disk, magnetic disk, or optical disk.
  • the integrated units in the above-mentioned embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in the above-mentioned computer-readable storage medium.
  • the technical solutions of the present disclosure can be embodied in the form of software products that are essentially or contribute to related technologies, or all or part of the technical solutions.
  • the computer software products are stored in a storage medium, including Several instructions are used to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the disclosed client may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the database is used for auxiliary notification
  • the target configuration instruction sent by the client is received by receiving the target configuration instruction, wherein the target configuration instruction is configured to instruct the notification to perform the target configuration operation on the target cloud service; in response to the target configuration instruction, write to the target database.
  • Entering a target configuration message wherein the target configuration message is configured to trigger a notification to a target node associated with the target cloud service to perform a target configuration operation on the target cloud service; and send a target response message corresponding to the target configuration instruction to the client, wherein the target response The message is configured to indicate the notification result of the target configuration operation.
  • the server After receiving the configuration instruction from the client, the server only needs to write the message to the target database, and the relevant computing nodes can receive the change, while the server is writing the message to the target.
  • the client notification result After the database, the client notification result can be returned.
  • the notification time is constant and will not increase with the increase of the cloud service scale. This achieves the purpose of shortening the notification time of configuration operations, improves the efficiency of operation notification, and improves the user’s notification of operation notifications.
  • the technical effect of the timeliness of the results further solves the problem in the operation notification method in the related art that the user cannot know the operation notification result in time because the notification time increases with the increase of the cloud service scale.

Abstract

本申请公开了一种操作通知方法和装置、存储介质和电子装置。该方法包括:接收客户端发送的目标配置指令,其中,所述目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应所述目标配置指令,向目标数据库写入目标配置消息,其中,所述目标配置消息配置为触发通知与所述目标云服务关联的目标节点对所述目标云服务执行所述目标配置操作;向所述客户端发送与所述目标配置指令对应的目标响应消息,其中,所述目标响应消息配置为指示所述目标配置操作的通知结果。

Description

操作通知方法和装置、存储介质和电子装置
相关申请的引用
本公开要求于2020年9月25日向中华人民共和国国家知识产权局提交的申请号为202011027454.X、发明名称为“操作通知方法和装置、存储介质和电子装置”的发明专利申请的全部权益,并通过引用的方式将其全部内容并入本公开。
领域
本公开涉及互联网领域,以及涉及操作通知方法和装置、存储介质和电子装置。
背景
随着云服务规模的增加,单个的云服务所跨的计算节点的数量也会跟着增加。对于云服务的操作需要通知各个节点。云服务可以是VPC。
以VPC中新增一张网卡为例,如果该VPC分布在1000个计算节点上,那么,这个新增网卡的操作需要通知到这个1000个节点中;按照目前通过RabbitMQ轮询通知方式,通知时间以及配置生效时间会随着规模的增加而增加。
因此,相关技术中的操作通知方式,存在由于通知时间随着云服务规模的增加而增加导致的用户无法及时获知操作通知结果的问题。
概述
一方面,本公开提供了操作通知方法,包括:接收客户端发送的目标配置指令,其中,所述目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应所述目标配置指令,向目标数据库写入目标配置消息,其中,所述目标配置消息配置为触发通知与所述目标云服务关联的目标节点对所述目标云服务执行所述目标配置操作;以及向所述客户端发送与所述目标配置指令对应的目标响应消息,其中,所述目标响应消息配置为指示所述目标配置操作的通知结果。
在某些实施方案中,在向所述目标数据库写入所述目标配置消息之后,所述方法还包括:监听到所述目标数据库发生的目标事件,其中,所述目标事件为写入所述目标配置消息所触发的事件;以及向所述目标节点发送目标通知消息,其中,所述目标通知消息配置为通知对所述目标云服务执行所述目标配置操作。
在某些实施方案中,向所述目标数据库写入所述目标配置消息包括:在所述目标配置操作为在第一节点上对所述目标云服务执行的配置操作的情况下,向所述目标数据库写入第一配置消息,其中,所述第一配置消息配置为触发通知所述第一节点在所述第一节点上对所述目标云服务执行所述目标配置操作;以及向所述目标数据库写入第二配置消息,其中,所述第二配置消息配置为触发通知第二节点所述目 标云服务在所述第一节点上被执行所述目标配置操作,所述第二节点为布设有所述目标云服务的节点。
在某些实施方案中,在向所述目标数据库写入所述第一配置消息之后,所述方法还包括:监听到所述目标数据库发生的第一事件,其中,所述第一事件为写入所述第一配置消息所触发的事件,所述第一配置消息为以所述第一节点的目标节点标识作为关键字的消息;以及向所述第一节点发送第一通知消息,其中,所述第一通知消息配置为通知在所述第一节点上对所述目标云服务执行所述目标配置操作,所述第一节点是订阅了第一监听任务的节点,所述第一监听任务配置为监听所述目标数据库中以所述目标节点标识作为关键字的消息。
在某些实施方案中,在向所述目标数据库写入所述第二配置消息之后,所述方法还包括:监听到所述目标数据库发生的第二事件,其中,所述第二事件为写入所述第二配置消息所触发的事件,所述第二配置消息为以所述目标云服务的目标云服务标识作为关键字的消息;以及向所述第二节点发送第二通知消息,其中,所述第二通知消息配置为通知所述目标云服务在所述第一节点上被执行所述目标配置操作,所述第二节点是订阅了第二监听任务的节点,所述第二监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
在某些实施方案中,在向所述第一节点发送所述第一通知消息之后,所述方法还包括:在所述目标配置操作为在所述第一节点上创建所述目标云服务的第一虚拟机,且所述第一虚拟机为所述第一节点上所述目标云服务的第一台虚拟机的情况下,为所述第一节点订阅第三监听任务,其中,所述第三监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息;以及在所述目标配置操作为在所述第一节点上删除所述目标云服务的第二虚拟机,且所述第二虚拟机为所述第一节点上所述目标云服务的最后一台虚拟机的情况下,为所述第一节点取消第四监听任务,其中,所述第四监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
在某些实施方案中,在接收所述客户端发送的所述目标配置指令之前,所述方法还包括:在代理服务器与目标数据库之间创建第一通信连接,其中,所述第一通信连接配置为向所述代理服务器发送第三通知消息,所述第三通知消息配置为通知对所述目标云服务执行所述目标配置操作;以及在所述代理服务器与所述目标节点的各个节点之间创建第二通信连接,其中,所述第一通信连接与所述第二通信连接具有关联关系,所述第二通信连接配置为向所述各个节点发送第四通知消息,所述第四通知消息配置为通知对所述目标云服务执行所述目标配置操作。
在某些实施方案中,在接收所述客户端发送的所述目标配置指令之前,所述方法还包括:接收第三节点发送的目标监听请求,其中,所述目标监听请求配置为请求监听目标版本之后以所述目标云服务的 目标云服务标识作为关键字的事件变动,一次以所述目标云服务标识作为关键字的事件变动对应于一个版本;以及响应所述目标监听请求,启动第五监听任务,其中,所述第五监听任务配置为监听所述目标版本之后以所述目标云服务标识作为关键字的事件变动。
第二方面,本公开提供了操作通知装置,其包括:第一接收单元,配置为接收客户端发送的目标配置指令,其中,所述目标配置指令配置为指示通知对目标云服务执行目标配置操作;写入单元,配置为响应所述目标配置指令,向目标数据库写入目标配置消息,其中,所述目标配置消息配置为触发通知与所述目标云服务关联的目标节点对所述目标云服务执行所述目标配置操作;以及第一发送单元,配置为向所述客户端发送与所述目标配置指令对应的目标响应消息,其中,所述目标响应消息配置为指示所述目标配置操作的通知结果。
在某些实施方案中,所述装置还包括:第一监听单元,配置为在向所述目标数据库写入所述目标配置消息之后,监听到所述目标数据库发生的目标事件,其中,所述目标事件为写入所述目标配置消息所触发的事件;以及第二发送单元,配置为向所述目标节点发送目标通知消息,其中,所述目标通知消息配置为通知对所述目标云服务执行所述目标配置操作。
在某些实施方案中,所述写入单元包括:第一写入单元,配置为在所述目标配置操作为在第一节点上对所述目标云服务执行的配置操作的情况下,向所述目标数据库写入第一配置消息,其中,所述第一配置消息配置为触发通知所述第一节点在所述第一节点上对所述目标云服务执行所述目标配置操作;以及第二写入单元,配置为向所述目标数据库写入第二配置消息,其中,所述第二配置消息配置为触发通知第二节点所述目标云服务在所述第一节点上被执行所述目标配置操作,所述第二节点为布设有所述目标云服务的节点。
在某些实施方案中,所述装置还包括:第二监听单元,配置为在向所述目标数据库写入所述第一配置消息之后,监听到所述目标数据库发生的第一事件,其中,所述第一事件为写入所述第一配置消息所触发的事件,所述第一配置消息为以所述第一节点的目标节点标识作为关键字的消息;以及第三发送单元,配置为向所述第一节点发送第一通知消息,其中,所述第一通知消息配置为通知在所述第一节点上对所述目标云服务执行所述目标配置操作,所述第一节点是订阅了第一监听任务的节点,所述第一监听任务配置为监听所述目标数据库中以所述目标节点标识作为关键字的消息。
在某些实施方案中,所述装置还包括:第三监听单元,配置为在向所述目标数据库写入所述第二配置消息之后,监听到所述目标数据库发生的第二事件,其中,所述第二事件为写入所述第二配置消息所触发的事件,所述第二配置消息为以所述目标云服务的目标云服务标识作为关键字的消息;以及第四发送单元,配置为向所述第二节点发送第二通知消息,其中,所述第二通知消息配置为通知所述目标云服 务在所述第一节点上被执行所述目标配置操作,所述第二节点是订阅了第二监听任务的节点,所述第二监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
在某些实施方案中,所述装置还包括:订阅单元,配置为在向所述第一节点发送所述第一通知消息之后,在所述目标配置操作为在所述第一节点上创建所述目标云服务的第一虚拟机,且所述第一虚拟机为所述第一节点上所述目标云服务的第一台虚拟机的情况下,为所述第一节点订阅第三监听任务,其中,所述第三监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息;以及取消单元,配置为在所述目标配置操作为在所述第一节点上删除所述目标云服务的第二虚拟机,且所述第二虚拟机为所述第一节点上所述目标云服务的最后一台虚拟机的情况下,为所述第一节点取消第四监听任务,其中,所述第四监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
在某些实施方案中,所述装置还包括:第一创建单元,配置为在接收所述客户端发送的所述目标配置指令之前,在代理服务器与目标数据库之间创建第一通信连接,其中,所述第一通信连接配置为向所述代理服务器发送第三通知消息,所述第三通知消息配置为通知对所述目标云服务执行所述目标配置操作;以及第二创建单元,配置为在所述代理服务器与所述目标节点的各个节点之间创建第二通信连接,其中,所述第一通信连接与所述第二通信连接具有关联关系,所述第二通信连接配置为向所述各个节点发送第四通知消息,所述第四通知消息配置为通知对所述目标云服务执行所述目标配置操作。
在某些实施方案中,所述装置还包括:第二接收单元,配置为在接收所述客户端发送的所述目标配置指令之前,接收第三节点发送的目标监听请求,其中,所述目标监听请求配置为请求监听目标版本之后以所述目标云服务的目标云服务标识作为关键字的事件变动,一次以所述目标云服务标识作为关键字的事件变动对应于一个版本;以及启动单元,配置为响应所述目标监听请求,启动第五监听任务,其中,所述第五监听任务配置为监听所述目标版本之后以所述目标云服务标识作为关键字的事件变动。
第三方面,本公开提供了计算机可读的存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行本公开的操作通知方法。
第四方面,本公开提供了电子装置,其包括存储器和处理器,存储器中存储有计算机程序,处理器被设置为运行计算机程序以执行本公开的操作通知方法。
在本公开实施例中,采用数据库进行辅助通知的方式,通过接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务 关联的目标节点对目标云服务执行目标配置操作;以及向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果,由于接收到客户端的配置指令后,服务端只需要将消息写到目标数据库,相关计算节点就能收到该变动,而服务端在将消息写到目标数据库之后即可返回客户端通知结果,通知时间为常量,不会随着云服务规模的增加而增加,实现了缩短配置操作的通知时间的目的,达到了提高操作通知效率、提升用户获知操作通知结果的及时性的技术效果,进而解决了相关技术中的操作通知方式存在由于通知时间随着云服务规模的增加而增加导致的用户无法及时获知操作通知结果的问题。
附图简要说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是根据本公开一实施例的一种操作通知方法的硬件环境的示意图;
图2是根据本公开一实施例的一种操作通知方法的流程图;
图3是根据本公开一实施例的一种事务处理方法的示意图;
图4是根据本公开一实施例的另一种操作通知方法的流程图;
图5是根据本公开一实施例的一种操作通知装置的结构框图;以及
图6是根据本公开一实施例的一种电子装置的结构框图。
详述
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤 或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本公开实施方案进行描述的过程中出现的部分名词或者术语适用于如下解释:
ETCD:一个高可用的分布式键值(key-value)数据库;
RabbitMQ:实现了AMQP消息队列协议的开源消息中间件;
SDN:Software Defined Network,软件定义网络;
VPC:Virtual Private Cloud,虚拟私有云;
Zookeeper:一个分布式的,开放源码的分布式应用程序协调服务。
第一方面,本公开提供了操作通知方法。在某些实施方案中,上述操作通知方法可以应用于如图1所示的由终端102和服务器104所构成的硬件环境中。如图1所示,服务器104通过网络与终端102进行连接,可配置为为终端或终端上安装的客户端提供服务(如游戏服务、应用服务等),可在服务器上或独立于服务器设置数据库,配置为为服务器104提供数据存储服务,还可以配置为处理云服务,上述网络包括但不限于:广域网、城域网或局域网,终端102并不限定于PC、手机、平板电脑等。本公开实施例的操作通知方法可以由服务器104来执行,也可以由终端102来执行,还可以是由服务器104和终端102共同执行。其中,终端102执行本公开实施例的操作通知方法也可以是由安装在其上的客户端来执行。
以由云服务的服务端来执行本实施例中的操作通知方法为例,图2是根据本公开实施例的操作通知方法的流程图,如图2所示,该方法的流程可以包括以下步骤:
步骤S202,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;
步骤S204,响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;以及
步骤S206,向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果。
通过上述步骤S202至步骤S206,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果,解决了相关技术中的操作通知方式存在由于通知时间随着云服务规模的增加而增加导致的用户无法及时获知操作通知结果的问题,提高了操作通知效率、提升了用户获知操作通知结果的及时性。
在步骤S202提供的技术方案中,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作。
本实施例中的操作通知方法可以应用于云服务(例如,云计算服务)跨越多个计算节点进行布设的场景,云服务可以包括但不限于:VPC。本实施例中以VPC为例进行说明,对于其他通知云服务所跨的多个计算节点与云服务相关操作的场景,本示例中的操作通知方法同样适用。
用户(目标对象,也可以是相关人员)可以通过客户端与VPC的服务端进行通信,该服务端可以配置为进行VPC的调控。VPC的服务端可以与VPC所跨的多个计算节点相连,某一VPC可以跨越多个计算节点,某一个计算节点上可以分布多个VPC。本实施例中以某一VPC(目标VPC)为例说明对该VPC的操作通知方式,除了进行说明的,多个VPC的操作通知方式与目标VPC的操作通知方式相同或者类似。
用户可以控制对目标VPC(目标云服务的一种示例)执行目标配置操作,该目标配置操作可以是对目标VPC的配置信息执行的配置操作,例如,目标VPC中新增一张网卡,该目标配置操作为新增网卡的操作;该目标配置操作也可以是对目标VPC的虚拟机执行的配置操作,例如,创建目标VPC的虚拟机,删除目标VPC的虚拟机等,本实施例中对于目标配置操作不作限定。
对目标VPC执行目标配置操作可以通过目标配置指令的方式发送到服务端。服务端可以接收客户端发送的目标配置指令,该目标配置指令可以配置为指示通知对目标VPC执行目标配置操作。
在步骤S204提供的技术方案中,响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作。
服务端可以是zookeeper、ETCD等分布式系统中的服务端,该服务端可以作为SDN控制器(VPC为SDN的一种实现方式)。服务端中可以布设有目标数据库,或者,通过网络与目标数据库相连。
响应目标配置指令,服务端可以向目标数据库写入目标配置消息。该目标配置消息可以用来触发通知与目标VPC关联的目标节点对目标VPC执行目标配置操作。目标节点可以是目标VPC所分布在的计算节点,即,目标VPC所跨的计算节点,目标VPC所跨的计算节点的数量可以是一个或者多个。
在某些实施方案中,服务端可以采用watch(监听)机制,计算节点可以watch所关注的VPC。服务端只需要将消息写到目标数据库(例如,zookeeper、ETCD中的数据库),即可触发通知各相关计算节点,相关计算节点就能收到该变动。
在步骤S206提供的技术方案中,向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果。
在将目标配置消息写入到目标数据库中之后,除非目标数据库崩溃,对目标VPC执行的目标配置操作可以通知到各个相关计算节点。因此,在将目标配置消息写入到目标数据库中之后,服务端可以向客户端发送与目标配置指令对应的目标响应消息,该目标响应消息可以 用来指示目标配置操作的通知结果,通知结果可以是:通知完成。
在接收到目标响应消息之后,客户端可以通过客户端的显示界面向用户显示目标配置操作的通知结果,还可以提示用户是否需要执行后续的操作等等,本实施例中对此不作限定。
在本实施例中,在将目标配置消息写入到目标数据库中之后,可以判定目标配置操作已经生成,允许按照新的配置执行后续的操作。由于由目标数据库统一保存各个配置操作的消息,各个计算节点可以通过目标数据库实现配置信息同步,且为最新版本,保证目标VPC的正常运行。
相关技术中,对于目标VPC执行的目标配置操作,通过RabbitMQ轮询通知方式,需要以轮询的方式一台一台通知目标VPC所跨的各个计算节点,在所有计算节点均完成通知之后,才会告知客户端已通知完成,通知时间以及配置生效时间会随着规模增加而增加。
在某些实施方案中,VPC分布在1000个计算节点,如果VPC中新增一张网卡,这个新增网卡的操作需要通知到这个1000个节点中。通过RabbitMQ轮询通知方式,需要以轮询的方式一台一台通知这1000个节点,通知和配置生效所需的时间会非常长。
在本实施例中,服务端将消息写入到目标数据库中(zookeeper,ETCD),相关计算节点就能收到该变动。服务端无需一台一台的通知各个相关计算节点,通知和配置生效所需的时间会大大缩短,可以提高配置通知以及配置生效的效率。
例如,服务端可以采用watch(监听)机制,计算节点watch所关注的VPC。服务端只需要将消息写到目标数据库(例如,zookeeper,ETCD),即可触发通知各相关计算节点,相关计算节点就能收到该变动。在将消息写到目标数据库之后即可告知客户端已通知完成,通知时间为常量,不会随着规模增加而增加。
下面结合示例对本实施例中的操作通知方法进行解释说明。采用zookeeper watch机制,计算节点watch自己关注的VPC,服务端只需要将消息写到zookeeper,相关计算节点就能收到该变动。
在某些实施方案中,在向目标数据库写入目标配置消息之后,上述方法还包括:
S11,监听到目标数据库发生的目标事件,其中,目标事件为写入目标配置消息所触发的事件;以及
S12,向目标节点发送目标通知消息,其中,目标通知消息配置为通知对目标云服务执行目标配置操作。
计算节点可以watch自己关注的VPC,watch可以对应于服务端的一个监听任务,该监听任务配置为监听目标数据库中特定的事件,上述特定的事件可以是在目标数据库写入特定的消息触发的。
在将目标配置消息写入到目标数据库中之后,服务端可以监听到目标数据库发生了目标事件,即,写入目标配置消息所触发的事件。响应该目标事件,服务端可以生成目标通知消息,以通知对目标VPC 执行了目标配置操作。
目标通知消息可以是根据目标配置消息生成的,该目标通知消息可以是在目标配置消息的基础上添加相关信息(例如,节点标识、节点地址等可以配置为通信传输的信息)生成,也可以是从目标配置消息提取出特定字段、并按照提取的特定字段和预置消息格式生成的,不同的字段可以对应于预置消息格式中的不同位置。本实施例中对此不作限定。
通过本实施例,通过监听事件变动来触发生成通知消息,以通知关联的计算节点该事件变动,可以提高配置通知的及时性,提升配置通知的效率。
在某些实施方案中,向目标数据库写入目标配置消息包括:
S21,在目标配置操作为在第一节点上对目标云服务执行的配置操作的情况下,向目标数据库写入第一配置消息,其中,第一配置消息配置为触发通知第一节点在第一节点上对目标云服务执行目标配置操作;以及
S22,向目标数据库写入第二配置消息,其中,第二配置消息配置为触发通知第二节点目标云服务在第一节点上被执行目标配置操作,第二节点为布设有目标云服务的节点。
如果目标配置操作是在某一个节点上对目标VPC执行的配置操作,例如,创建了一台目标VPC的虚拟机,删除了一台目标VPC的虚拟机等,则可以向目标数据库中写入两个配置消息,第一配置消息和第二配置消息。
在写入目标配置消息之前,第一节点可能是目标VPC所跨的计算节点(计算节点上之前有目标VPC的虚拟机),也可能是新配置的计算节点(计算节点上之前没有目标VPC的虚拟机),此外,在第一节点上对目标VPC执行目标配置操作可以触发第一节点上的相关配置的改变,例如,本节点上分布的VPC的列表(VPC列表)会发生变化,每个VPC的虚拟机的数量和虚拟机的标识也可能会发生变化。
服务端可以向目标数据库写入第一配置消息,以触发通知第一节点在第一节点上对目标VPC执行目标配置操作,来保证准确通知到第一节点,并保证第一节点上相关配置的准确性。
目标VPC可以分布在多个计算节点上,除了第一节点之外,还可以包含一个或多个第二节点,即,第二节点为目标VPC所跨的计算节点,目标节点可以包含第一节点和第二节点。
为了方便通知目标VPC所跨的其他计算节点,服务端可以向目标数据库写入第二配置消息,以触发通知第二节点目标VPC在第一节点上被执行了目标配置操作,以保证配置信息通知的准确性和全面性。
通过本实施例,通过写入两个配置消息来触发通知各个计算节点,可以保证配置操作通知到各个计算节点,提高配置操作通知的准确性和全面性。
在某些实施方案中,在向目标数据库写入第一配置消息之后,上 述方法还包括:
S31,监听到目标数据库发生的第一事件,其中,第一事件为写入第一配置消息所触发的事件,第一配置消息为以第一节点的目标节点标识作为关键字的消息;以及
S32,向第一节点发送第一通知消息,其中,第一通知消息配置为通知在第一节点上对目标云服务执行目标配置操作,第一节点是订阅了第一监听任务的节点,第一监听任务配置为监听目标数据库中以目标节点标识作为关键字的消息。
目标数据库可以是通过key-value(键-值)的方式进行数据存储的数据库。所有计算节点在启动时,可以监听(watch)自己的节点标识(例如,hostname,主机名称)为key的事件变动。对于第一节点,该第一节点可以订阅第一监听任务,第一监听任务是监听目标数据库中以目标节点标识作为关键字的消息。
第一配置消息可以是以第一节点的节点标识(例如,hostname,主机名称)作为关键字的消息,用来触发通知第一节点在第一节点上对目标VPC执行了目标配置操作。在目标数据库中写入第一配置消息之后,服务端可以监听到写入第一配置消息所触发的第一事件。在监听到第一事件之后,服务端可以向第一节点发送第一通知消息,以通知在第一节点上对目标VPC执行了目标配置操作。
在某些实施方案中,若计算节点hostname 1创建了一台vpc-id-1的虚拟机,服务端将创建虚拟机的消息以key为hostname1写入ETCD,以触发通知hostname1。
在某些实施方案中,若计算节点hostname 1删除了一台vpc-id-1的虚拟机,服务端将删除虚拟机的消息以key为hostname1写入ETCD,以触发通知hostname1。
通过本实施例,通过监听自己的节点标识为key的事件变动,可以保证本节点配置信息通知的及时性。
在某些实施方案中,在向目标数据库写入第二配置消息之后,上述方法还包括:
S41,监听到目标数据库发生的第二事件,其中,第二事件为写入第二配置消息所触发的事件,第二配置消息为以目标云服务的目标云服务标识作为关键字的消息;以及
S42,向第二节点发送第二通知消息,其中,第二通知消息配置为通知目标云服务在第一节点上被执行目标配置操作,第二节点是订阅了第二监听任务的节点,第二监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息。
目标数据库可以是通过key-value方式进行数据存储的数据库。计算节点在启动之后,可以从服务端获取该计算节点上分布的VPC列表,并监听这些VPC id的事件变动,即,监听以这些VPC id为key的事件变动。对于第二节点,该节点可以订阅第二监听任务,第二监听任务是监听目标数据库中以目标VPC的VPC标识作为关键字的消息。
第二配置消息可以是以目标VPC的VPC标识(例如,vpc-id-1)作为关键字的消息,用来触发通知第二节点目标VPC在第一节点上被执行了目标配置操作。在目标数据库中写入第二配置消息之后,服务端可以监听到写入第二配置消息所触发的第二事件。在监听到第二事件之后,服务端可以向第二节点发送第二通知消息,以通知在第二节点目标VPC在第一节点上被执行了目标配置操作。
在某些实施方案中,若计算节点hostname 1创建了一台vpc-id-1的虚拟机,服务端可以将创建虚拟机的消息以key为vpc-id-1写入ETCD,以触发通知该VPC所跨的其他计算节点(第二节点)。
在某些实施方案中,计算节点hostname 1删除了一台vpc-id-1的虚拟机,服务端将删除虚拟机的消息以key为vpc-id-1写入ETCD,以触发通知该VPC所跨的其他计算节点。
通过本实施例,通过监听以本节点上分布的VPC的标识为key的事件变动,可以保证配置信息通知的准确性和及时性。
在某些实施方案中,在向第一节点发送第一通知消息之后,上述方法还包括:
S51,在目标配置操作为在第一节点上创建目标云服务的第一虚拟机,且第一虚拟机为第一节点上目标云服务的第一台虚拟机的情况下,为第一节点订阅第三监听任务,其中,第三监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息;以及
S52,在目标配置操作为在第一节点上删除目标云服务的第二虚拟机,且第二虚拟机为第一节点上目标云服务的最后一台虚拟机的情况下,为第一节点取消第四监听任务,其中,第四监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息。
计算节点可以利用分布式系统(例如,ETCD)的发布订阅功能来监听分布式系统中的事件变动。监听到的事件变动可以是通过计算节点与服务端之间的通信连接(channel)进行通知。为了保证通信资源的合理使用,计算节点可以仅监听本节点上所分布的VPC的事件变动。
如果目标配置操作是在第一节点上创建目标VPC的虚拟机(第一虚拟机),而创建的虚拟机是第一节点上该目标VPC的第一台虚拟机,那么,在第一节点并未订阅目标数据库中以目标VPC标识作为关键字的事件变动。可以为第一节点订阅第三监听任务,该第三监听任务配置为监听目标数据库中以目标VPC标识作为关键字的消息。
为第一节点订阅第三监听任务的方式可以是:第一节点向服务端发送监听请求,以请求监听以目标VPC标识作为关键字的事件变动(写入以目标VPC标识作为关键字的消息所触发的事件);响应该监听请求,服务端可以创建第三监听任务。
在某些实施方案中,对于在计算节点hostname1创建一台vpc-id-1的虚拟机的场景,若该虚拟机为此计算节点(hostname1)上vpc-id-1的第一台虚拟机,则该计算节点可以监听vpc-id-1的事件变动。
如果目标配置操作是在第一节点上删除目标VPC的虚拟机(第二虚 拟机),而删除的虚拟机是第一节点上该目标VPC的最后一台虚拟机,那么,在删除第二虚拟机之前,第一节点已经订阅了目标数据库中以目标VPC标识作为关键字的事件变动。
在删除第二虚拟机之后,第一节点上已经没有了该目标VPC的虚拟机。为了提高通信资源的利用率,可以为第一节点取消第四监听任务,该第四监听任务配置为监听目标数据库中以目标VPC标识作为关键字的消息。
为第一节点取消第四监听任务的方式可以是:第一节点向服务端发送取消监听请求,以请求取消监听以目标VPC标识作为关键字的事件变动(写入以目标VPC标识作为关键字的消息所触发的事件);响应该取消监听请求,服务端可以删除该第四监听任务。
在某些实施方案中,对于在计算节点hostname1创建一台vpc-id-1的虚拟机的场景,若该虚拟机为此计算节点(hostname1)上vpc-id-1的最后一台虚拟机,则该计算节点取消监听vpc-id-1的事件变动。
通过本实施例,通过及时订阅或取消监听以目标云服务标识作为关键字的事件变动,可以保证事件监听的及时性,同时保证通信资源利用的合理性。
在某些实施方案中,在接收客户端发送的目标配置指令之前,上述方法还包括:
S61,在代理服务器与目标数据库之间创建第一通信连接,其中,第一通信连接配置为向代理服务器发送第三通知消息,第三通知消息配置为通知对目标云服务执行目标配置操作;以及
S62,在代理服务器与目标节点的各个节点之间创建第二通信连接,其中,第一通信连接与第二通信连接具有关联关系,第二通信连接配置为向各个节点发送第四通知消息,第四通知消息配置为通知对目标云服务执行目标配置操作。
为了降低数据库集群的负载压力,可以通过代理服务器聚合监听的事件变动,例如,聚合不同计算节点相同关键字的监听任务。代理服务器和计算节点之间建立的通信连接(channel)可以用来传输代理服务器和计算节点之间的消息。
在某些实施方案中,对于目标节点,目标节点中的各个节点可以分别通过代理服务器向服务端发送监听请求,并建立服务端与代理服务器之间的第一通信连接(channel)和各个节点与代理服务器之间的第二通信连接(channel),第一通信连接与第二通信连接具有关联关系。
第一通信连接可以配置为向代理服务器发送第三通知消息,第三通知消息可以配置为通知对目标VPC执行了目标配置操作,第二通信连接可以用来向各个节点发送第四通知消息,第四通知消息可以配置为通知对目标VPC执行了目标配置操作。
对于同一key,不同计算节点可以分别与代理服务器建立channel,而代理服务器与服务端可以建立一个channel,如果发生该key的事件变动,服务端可以向代理服务器发送通知消息,以通知该事件变动, 代理服务器可以确定watch该key的计算节点,并通过代理服务器与各个计算节点之间的channel将通知消息转发至各个计算节点。
不同的计算节点可以在不同的时机开始监听目标数据库中以目标VPC的VPC标识作为关键字的消息。代理服务器可以对不同计算节点的监听请求进行聚合,聚合不同计算节点监听(watch)的相同key。
对于某一个计算节点,代理服务器可以接收该计算节点的监听请求,以请求监听目标数据库中一个或多个关键字的事件变动,一个或多个关键字可以包括目标VPC的VPC标识。
对于目标VPC的VPC标识,如果其他节点之间已经发送过监听请求,且已经在代理服务器和服务端之间的通信连接(第一通信连接),则代理服务器可以不再重新建立代理服务器和服务端之间的通信连接,而是将第一通信连接与该计算节点与代理服务器之间的通信连接(第二通信连接)进行关联。
下面结合示例对代理服务器聚合不同计算节点监听的相同关键词的方式进行解释说明。
如图3所示,服务端为ETCD的服务端,ETCD-proxy(代理服务器的一种)是ETCD的一种代理服务,可扩展,将相同key的watch聚合成一个,再watch到ETCD服务,防止大量的连接直接连到ETCD,适合VPC的场景。
在图3中,计算节点包括:vgw1,vgw2,vgw3,vgw4,其中,vgw1上分布有d1(VPC domain 1)和d2,vgw2上分布有d1,vgw3上分布有d2和d3,vgw4上分布有d1和d2。vgw1可以watch key(关键字)为d1和d2的事件变动,vgw2可以watch key为d1的事件变动,vgw3可以watch key为d2和d3的事件变动,vgw1可以watch key为d1和d2的事件变动。
ETCD-proxy可以聚合watch的key,来降低ETCD集群负载,例如,ETCD-proxy可以聚合vgw1、vgw2和vgw4所watch的d1,聚合vgw1、vgw3和vgw4所watch的d2。
通过本实施例,通过代理服务器聚合不同计算节点所监听的关键字,可以降低数据库集群的负载,提高通信资源的利用率。
在某些实施方案中,在接收客户端发送的目标配置指令之前,上述方法还包括:
S71,接收第三节点发送的目标监听请求,其中,目标监听请求配置为请求监听目标版本之后以目标云服务的目标云服务标识作为关键字的事件变动,一次以目标云服务标识作为关键字的事件变动对应于一个版本;以及
S72,响应目标监听请求,启动第五监听任务,其中,第五监听任务配置为监听目标版本之后以目标云服务标识作为关键字的事件变动。
在某个节点启动时或者从异常中恢复时,可以指定某个历史版本开始监听,从而将丢失的事件弥补回来。
第三节点可以确定本节点上保存的、以目标VPC的VPC标识作为关键字的事件变动的版本(即,目标版本),一次事件变动可以对应于一个版本。第三节点可以向服务端发送目标监听请求,该目标监听请求中可以携带有目标版本的版本信息,该目标监听请求可以配置为请求监听目标版本之后以目标VPC的VPC标识作为关键字的事件变动。
在接收到第三节点发送的目标监听请求之后,服务端可以启动第五监听任务,第五监听任务配置为监听目标数据库中,目标版本之后以目标VPC的VPC标识作为关键字的事件变动。
通过本实施例,通过指定某个历史版本开始监听,可以将丢失的事件弥补回来,提高了计算节点上保存的配置信息的完整性。
下面结合示例对本公开实施例中的操作通知方法进行解释说明。在本示例中,可以使用watch方式替换MQ轮询通知,将通知时间变为常量。
可以采用zookeeper watch机制,计算节点watch自己关注的VPC,服务端只需要将消息写到zookeeper,相关计算节点就能收到该变动。通知时间为常量,不会随着规模增加而增加。
由于Zookeeper通知的channel不能复用,收到每个消息后需要重新建立channel;如果事件来得太快,zookeeper客户端处理完某个事件后还来不及重新watch,期间的事件会丢失;并且,zookeeper无法获取历史版本信息。
在某些实施方案中,也可以利用ETCD的发布订阅功能,计算节点watch自己关注的VPC,服务端只需要将消息写到ETCD,相关计算节点就能收到该变动。通知时间为常量,不会随着规模增加而增加。
由于ETCD可以复用channel,可以指定历史某个版本开始监听,将丢失的事件弥补回来,并且,ETCD-proxy可以聚合watch的key,大大降低ETCD集群负载,从而解决采用zookeeper watch机制所存在的问题。
以在计算节点上创建了一台VPC的虚拟机为例,如图4所示,本示例中的操作通知方法的流程可以包括以下步骤:
步骤S402,前端指示服务端创建了一台VPC的虚拟机;以及
步骤S404,服务端将创建虚拟机的消息写入到ETCD,通知相关计算节点。
所有计算节点启动时,都会监听自己hostname为key的事件变动,还可以从服务端获取该计算节点上分布的VPC列表,并监听这些VPC id的事件变动。
如果需要在计算节点hostname 1创建一台vpc-id-1的虚拟机,相关人员可以通过其终端设备(前端设备)向服务端发送配置指令,以指示在计算节点hostname 1创建了一台vpc-id-1的虚拟机。
服务端可以将创建虚拟机的消息以key为hostname 1写入ETCD,通知hostname 1(第一节点)。服务端将创建虚拟机的消息以key为vpc-id-1写入ETCD,通知该VPC所跨的其他计算节点(第二节点)。
若该虚拟机为此计算节点(hostname1)上vpc-id-1的第一台虚拟机,则该计算节点监听vpc-id-1的事件变动。
此外,如果在计算节点上删除了一台VPC的虚拟机,可以采用类似的方式通知相关计算节点。若该虚拟机为此计算节点(hostname 1)上vpc-id-1的最后一台虚拟机,则该计算节点取消监听vpc-id-1的事件变动。
通过本示例,使用watch方式替换MQ轮询通知,将通知时间变为常量,可以提高配置通知和配置生效的效率。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本公开并不受所描述的动作顺序的限制,因为依据本公开,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于部分实施例,所涉及的动作和模块并不一定是本公开所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
第二方面,本公开还提供了配置为实施上述操作通知方法的操作通知装置。图5是根据本公开实施方案的一种操作通知装置的结构框图,如图5所示,该装置可以包括:
第一接收单元502,配置为接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;
写入单元504,与第一接收单元502相连,配置为响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;以及
第一发送单元506,与写入单元504相连,配置为向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果。
需要说明的是,该实施例中的第一接收单元502可以配置为执行上述步骤S202,该实施例中的写入单元504可以配置为执行上述步骤S204,该实施例中的第一发送单元506可以配置为执行上述步骤S206。
通过上述模块,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置 操作;向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果,解决了相关技术中的操作通知方式存在由于通知时间随着云服务规模的增加而增加导致的用户无法及时获知操作通知结果的问题,提高了操作通知效率、提升了用户获知操作通知结果的及时性。
在某些实施方案中,上述装置还包括:
第一监听单元,配置为在向目标数据库写入目标配置消息之后,监听到目标数据库发生的目标事件,其中,目标事件为写入目标配置消息所触发的事件;以及
第二发送单元,配置为向目标节点发送目标通知消息,其中,目标通知消息配置为通知对目标云服务执行目标配置操作。
在某些实施方案中,写入单元504包括:
第一写入单元,配置为在目标配置操作为在第一节点上对目标云服务执行的配置操作的情况下,向目标数据库写入第一配置消息,其中,第一配置消息配置为触发通知第一节点在第一节点上对目标云服务执行目标配置操作;以及
第二写入单元,配置为向目标数据库写入第二配置消息,其中,第二配置消息配置为触发通知第二节点目标云服务在第一节点上被执行目标配置操作,第二节点为布设有目标云服务的节点。
在某些实施方案中,上述装置还包括:
第二监听单元,配置为在向目标数据库写入第一配置消息之后,监听到目标数据库发生的第一事件,其中,第一事件为写入第一配置消息所触发的事件,第一配置消息为以第一节点的目标节点标识作为关键字的消息;以及
第三发送单元,配置为向第一节点发送第一通知消息,其中,第一通知消息配置为通知在第一节点上对目标云服务执行目标配置操作,第一节点是订阅了第一监听任务的节点,第一监听任务配置为监听目标数据库中以目标节点标识作为关键字的消息。
在某些实施方案中,上述装置还包括:
第三监听单元,配置为在向目标数据库写入第二配置消息之后,监听到目标数据库发生的第二事件,其中,第二事件为写入第二配置消息所触发的事件,第二配置消息为以目标云服务的目标云服务标识作为关键字的消息;以及
第四发送单元,配置为向第二节点发送第二通知消息,其中,第二通知消息配置为通知目标云服务在第一节点上被执行目标配置操作,第二节点是订阅了第二监听任务的节点,第二监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息。
在某些实施方案中,上述装置还包括:
订阅单元,配置为在向第一节点发送第一通知消息之后,在目标配置操作为在第一节点上创建目标云服务的第一虚拟机,且第一虚拟机为第一节点上目标云服务的第一台虚拟机的情况下,为第一节点订 阅第三监听任务,其中,第三监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息;以及
取消单元,配置为在目标配置操作为在第一节点上删除目标云服务的第二虚拟机,且第二虚拟机为第一节点上目标云服务的最后一台虚拟机的情况下,为第一节点取消第四监听任务,其中,第四监听任务配置为监听目标数据库中以目标云服务标识作为关键字的消息。
在某些实施方案中,上述装置还包括:
第一创建单元,配置为在接收客户端发送的目标配置指令之前,在代理服务器与目标数据库之间创建第一通信连接,其中,第一通信连接配置为向代理服务器发送第三通知消息,第三通知消息配置为通知对目标云服务执行目标配置操作;以及
第二创建单元,配置为在代理服务器与目标节点的各个节点之间创建第二通信连接,其中,第一通信连接与第二通信连接具有关联关系,第二通信连接配置为向各个节点发送第四通知消息,第四通知消息配置为通知对目标云服务执行目标配置操作。
在某些实施方案中,上述装置还包括:
第二接收单元,配置为在接收客户端发送的目标配置指令之前,接收第三节点发送的目标监听请求,其中,目标监听请求配置为请求监听目标版本之后以目标云服务的目标云服务标识作为关键字的事件变动,一次以目标云服务标识作为关键字的事件变动对应于一个版本;以及
启动单元,配置为响应目标监听请求,启动第五监听任务,其中,第五监听任务配置为监听目标版本之后以目标云服务标识作为关键字的事件变动。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现,其中,硬件环境包括网络环境。
第三方面,本公开还提供了配置为实施上述操作通知方法的电子装置,该电子装置可以是终端设备、服务器、或者其组合。
图6是根据本公开实施方案的一种电子装置的结构框图,如图6所示,该电子装置包括存储器602和处理器604,该存储器602中存储有计算机程序,该处理器604被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
在某些实施方案中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
在某些实施方案中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;
S2,响应目标配置指令,向目标数据库写入目标配置消息,其中, 目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;以及
S3,向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果。
在某些实施方案中,存储器602可配置为存储软件程序以及模块,如本公开实施例中的操作通知方法和装置对应的程序指令/模块,处理器604通过运行存储在存储器602内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述操作通知方法。存储器602可包括高速随机存储器,还可以包括非易失性存储器,如一个或多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器602可进一步包括相对于处理器604远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。其中,存储器602可以但不限于配置为存储推理模型、资源数据等。
在某些实施方案中,如图6所示,上述存储器602中可以但不限于包括上述操作通知装置中的第一接收单元502、写入单元504、以及第一发送单元506。此外,还可以包括但不限于上述操作通知装置中的其他模块单元,本示例中不再赘述。
在某些实施方案中,上述的传输装置606配置为经由一个网络接收或者发送数据。上述的网络相关的实施例可包括有线网络及无线网络。在一个实例中,传输装置606包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置606为射频(Radio Frequency,RF)模块,其配置为通过无线方式与互联网进行通讯。
在某些实施方案中,上述电子装置还包括:连接总线608,配置为连接上述电子装置中的各个模块部件。
在某些实施方案中,本实施例中的示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。
本领域普通技术人员可以理解,图6所示的结构仅为示意,实施上述操作通知方法的设备可以是终端设备,该终端设备可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图6其并不对上述电子装置的结构造成限定。例如,终端设备还可包括比图6中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图6所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
第四方面,本公开还提供了存储介质。在某些实施方案中,上述存储介质可以配置为执行操作通知方法的程序代码。
在某些实施方案中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。
在某些实施方案中,存储介质被设置为存储配置为执行以下步骤的程序代码:
S1,接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;
S2,响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;以及
S3,向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果。
在某些实施方案中,本实施例中的示例可以参考上述实施例中所描述的示例,本实施例中对此不再赘述。
在某些实施方案中,上述存储介质可以包括但不限于:U盘、ROM、RAM、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。
在本公开的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本公开所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例中所提供的方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单 元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本公开的实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本公开原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本公开的保护范围。
工业实用性
在本公开中,采用数据库进行辅助通知的方式,通过接收客户端发送的目标配置指令,其中,目标配置指令配置为指示通知对目标云服务执行目标配置操作;响应目标配置指令,向目标数据库写入目标配置消息,其中,目标配置消息配置为触发通知与目标云服务关联的目标节点对目标云服务执行目标配置操作;以及向客户端发送与目标配置指令对应的目标响应消息,其中,目标响应消息配置为指示目标配置操作的通知结果,由于接收到客户端的配置指令后,服务端只需要将消息写到目标数据库,相关计算节点就能收到该变动,而服务端在将消息写到目标数据库之后即可返回客户端通知结果,通知时间为常量,不会随着云服务规模的增加而增加,实现了缩短配置操作的通知时间的目的,达到了提高操作通知效率、提升用户获知操作通知结果的及时性的技术效果,进而解决了相关技术中的操作通知方式存在由于通知时间随着云服务规模的增加而增加导致的用户无法及时获知操作通知结果的问题。

Claims (11)

  1. 操作通知方法,其包括:
    接收客户端发送的目标配置指令,其中,所述目标配置指令配置为指示通知对目标云服务执行目标配置操作;
    响应所述目标配置指令,向目标数据库写入目标配置消息,其中,所述目标配置消息配置为触发通知与所述目标云服务关联的目标节点对所述目标云服务执行所述目标配置操作;以及
    向所述客户端发送与所述目标配置指令对应的目标响应消息,其中,所述目标响应消息配置为指示所述目标配置操作的通知结果。
  2. 如权利要求1所述的方法,其中,在向所述目标数据库写入所述目标配置消息之后,所述方法还包括:
    监听到所述目标数据库发生的目标事件,其中,所述目标事件为写入所述目标配置消息所触发的事件;以及
    向所述目标节点发送目标通知消息,其中,所述目标通知消息配置为通知对所述目标云服务执行所述目标配置操作。
  3. 如权利要求1或2所述的方法,其中,向所述目标数据库写入所述目标配置消息包括:
    在所述目标配置操作为在第一节点上对所述目标云服务执行的配置操作的情况下,向所述目标数据库写入第一配置消息,其中,所述第一配置消息配置为触发通知所述第一节点在所述第一节点上对所述目标云服务执行所述目标配置操作;以及
    向所述目标数据库写入第二配置消息,其中,所述第二配置消息配置为触发通知第二节点所述目标云服务在所述第一节点上被执行所述目标配置操作,所述第二节点为布设有所述目标云服务的节点。
  4. 如权利要求3所述的方法,其中,在向所述目标数据库写入所述第一配置消息之后,所述方法还包括:
    监听到所述目标数据库发生的第一事件,其中,所述第一事件为写入所述第一配置消息所触发的事件,所述第一配置消息为以所述第一节点的目标节点标识作为关键字的消息;以及
    向所述第一节点发送第一通知消息,其中,所述第一通知消息配置为通知在所述第一节点上对所述目标云服务执行所述目标配置操作,所述第一节点是订阅了第一监听任务的节点,所述第一监听任务配置为监听所述目标数据库中以所述目标节点标识作为关键字的消息。
  5. 如权利要求3或4所述的方法,其中,在向所述目标数据库写入所述第二配置消息之后,所述方法还包括:
    监听到所述目标数据库发生的第二事件,其中,所述第二事件为 写入所述第二配置消息所触发的事件,所述第二配置消息为以所述目标云服务的目标云服务标识作为关键字的消息;以及
    向所述第二节点发送第二通知消息,其中,所述第二通知消息配置为通知所述目标云服务在所述第一节点上被执行所述目标配置操作,所述第二节点是订阅了第二监听任务的节点,所述第二监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
  6. 如权利要求4或5所述的方法,其中,在向所述第一节点发送所述第一通知消息之后,所述方法还包括:
    在所述目标配置操作为在所述第一节点上创建所述目标云服务的第一虚拟机,且所述第一虚拟机为所述第一节点上所述目标云服务的第一台虚拟机的情况下,为所述第一节点订阅第三监听任务,其中,所述第三监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息;以及
    在所述目标配置操作为在所述第一节点上删除所述目标云服务的第二虚拟机,且所述第二虚拟机为所述第一节点上所述目标云服务的最后一台虚拟机的情况下,为所述第一节点取消第四监听任务,其中,所述第四监听任务配置为监听所述目标数据库中以所述目标云服务标识作为关键字的消息。
  7. 如权利要求1至6中任一权利要求所述的方法,其中,在接收所述客户端发送的所述目标配置指令之前,所述方法还包括:
    在代理服务器与目标数据库之间创建第一通信连接,其中,所述第一通信连接配置为向所述代理服务器发送第三通知消息,所述第三通知消息配置为通知对所述目标云服务执行所述目标配置操作;以及
    在所述代理服务器与所述目标节点的各个节点之间创建第二通信连接,其中,所述第一通信连接与所述第二通信连接具有关联关系,所述第二通信连接配置为向所述各个节点发送第四通知消息,所述第四通知消息配置为通知对所述目标云服务执行所述目标配置操作。
  8. 如权利要求1至7中任一权利要求所述的方法,其中,在接收所述客户端发送的所述目标配置指令之前,所述方法还包括:
    接收第三节点发送的目标监听请求,其中,所述目标监听请求配置为请求监听目标版本之后以所述目标云服务的目标云服务标识作为关键字的事件变动,一次以所述目标云服务标识作为关键字的事件变动对应于一个版本;以及
    响应所述目标监听请求,启动第五监听任务,其中,所述第五监听任务配置为监听所述目标版本之后以所述目标云服务标识作为关键字的事件变动。
  9. 操作通知装置,其包括:
    第一接收单元,配置为接收客户端发送的目标配置指令,其中,所述目标配置指令配置为指示通知对目标云服务执行目标配置操作;
    写入单元,配置为响应所述目标配置指令,向目标数据库写入目标配置消息,其中,所述目标配置消息配置为触发通知与所述目标云服务关联的目标节点对所述目标云服务执行所述目标配置操作;以及
    第一发送单元,配置为向所述客户端发送与所述目标配置指令对应的目标响应消息,其中,所述目标响应消息配置为指示所述目标配置操作的通知结果。
  10. 计算机可读的存储介质,其中,所述存储介质中存储有计算机程序,所述计算机程序被设置为运行时执行权利要求1至8中任一权利要求所述的方法。
  11. 电子装置,其包括存储器和处理器,其中,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行权利要求1至8中任一权利要求所述的方法。
PCT/CN2021/110032 2020-09-25 2021-08-02 操作通知方法和装置、存储介质和电子装置 WO2022062661A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011027454.XA CN112153146B (zh) 2020-09-25 2020-09-25 操作通知方法和装置、存储介质和电子装置
CN202011027454.X 2020-09-25

Publications (1)

Publication Number Publication Date
WO2022062661A1 true WO2022062661A1 (zh) 2022-03-31

Family

ID=73897514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/110032 WO2022062661A1 (zh) 2020-09-25 2021-08-02 操作通知方法和装置、存储介质和电子装置

Country Status (2)

Country Link
CN (1) CN112153146B (zh)
WO (1) WO2022062661A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153146B (zh) * 2020-09-25 2022-08-16 北京金山云网络技术有限公司 操作通知方法和装置、存储介质和电子装置
CN113452592B (zh) * 2021-06-09 2022-02-25 北京奥星贝斯科技有限公司 混合云架构下的跨云数据访问方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017218276A1 (en) * 2016-06-15 2017-12-21 Microsoft Technology Licensing, Llc Service provisioning in cloud computing systems
CN108139964A (zh) * 2017-12-06 2018-06-08 深圳达闼科技控股有限公司 云服务配置方法、装置、存储介质及云服务系统
CN108322490A (zh) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 虚拟机配置及部署分布式云服务系统的方法、装置和服务器
CN108494598A (zh) * 2018-03-27 2018-09-04 北京邦邦共赢网络科技有限公司 一种应用服务的配置方法和装置
CN112153146A (zh) * 2020-09-25 2020-12-29 北京金山云网络技术有限公司 操作通知方法和装置、存储介质和电子装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872038A (zh) * 2016-03-28 2016-08-17 汉柏科技有限公司 云桌面系统的高并发处理方法及装置
US10728106B1 (en) * 2016-04-29 2020-07-28 Architecture Technology Corporation Multi-domain cloud computing
CN107666493B (zh) * 2016-07-27 2020-08-14 腾讯科技(深圳)有限公司 一种数据库配置方法及其设备
CN106603281A (zh) * 2016-12-07 2017-04-26 乐视控股(北京)有限公司 配置文件管理方法及系统
CN108449410B (zh) * 2018-03-19 2022-03-22 深信服科技股份有限公司 一种云平台中消息管理方法、系统及相关装置
CN110300050B (zh) * 2019-05-23 2023-02-07 中国平安人寿保险股份有限公司 消息推送方法、装置、计算机设备及存储介质
CN111314131A (zh) * 2020-02-13 2020-06-19 北京奇艺世纪科技有限公司 任务下发方法和装置、存储介质和电子装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017218276A1 (en) * 2016-06-15 2017-12-21 Microsoft Technology Licensing, Llc Service provisioning in cloud computing systems
CN108322490A (zh) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 虚拟机配置及部署分布式云服务系统的方法、装置和服务器
CN108139964A (zh) * 2017-12-06 2018-06-08 深圳达闼科技控股有限公司 云服务配置方法、装置、存储介质及云服务系统
CN108494598A (zh) * 2018-03-27 2018-09-04 北京邦邦共赢网络科技有限公司 一种应用服务的配置方法和装置
CN112153146A (zh) * 2020-09-25 2020-12-29 北京金山云网络技术有限公司 操作通知方法和装置、存储介质和电子装置

Also Published As

Publication number Publication date
CN112153146A (zh) 2020-12-29
CN112153146B (zh) 2022-08-16

Similar Documents

Publication Publication Date Title
US11036598B2 (en) Notification mechanism for disaster recovery events
JP7389791B2 (ja) コンフィギュレーション・シナリオ順守のためのモバイル・デバイスによるコンプライアンス設定の実装
US10270648B2 (en) Configuration information management method, device, network element management system and storage medium
JP6707153B2 (ja) クラウドコンピューティングノードのセキュアな設定
WO2021203979A1 (zh) 运维处理方法、装置及计算机设备
CN107800565B (zh) 巡检方法、装置、系统、计算机设备和存储介质
WO2022062661A1 (zh) 操作通知方法和装置、存储介质和电子装置
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
CN110324399B (zh) 将集群意识纳入设施管理门户
US20180025049A1 (en) Server and Data Processing Method
US10944655B2 (en) Data verification based upgrades in time series system
US20070115818A1 (en) Triggered notification
CN1787432B (zh) 用于认证请求另一节点执行工作的节点的方法和系统
CN111258565B (zh) 小程序的生成方法、系统、服务器及存储介质
CN111625496B (zh) 分布式文件系统在虚拟机环境下的部署方法、装置及设备
US10892970B2 (en) Centralized, scalable, resource monitoring system
WO2021013056A1 (zh) 基于微服务的数据处理方法、装置、设备及可读存储介质
US20170033980A1 (en) Agent manager for distributed transaction monitoring system
US8543680B2 (en) Migrating device management between object managers
US11461288B2 (en) Systems and methods for database management system (DBMS) discovery
CN113220433B (zh) 一种代理程序运行管理方法及系统
WO2018188607A1 (zh) 流处理方法及装置
CN106933932B (zh) 数据处理方法、装置及应用服务器
US11403093B1 (en) Application modification with proxy service process
CN110768855B (zh) 链路化性能测试的方法和装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21871039

Country of ref document: EP

Kind code of ref document: A1