A method for updating the status of an instance after operation

By introducing the message transit mechanism and the Websocket protocol in the OpenStack cloud platform, the challenges of state dynamic monitoring and display after instance operations are solved, real -time update and timely display are realized, and the user experience and operational efficiency of cloud service products are improved.

CN113901066BActive Publication Date: 2025-01-28SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111096993.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-18
Publication Date
2025-01-28
Estimated Expiration
2041-09-18

AI Technical Summary

Technical Problem

In the Openstack cloud platform, there are challenges in dynamic monitoring and timely display of status after instance operation, especially the synchronization of asynchronous operation results, which leads to inaccurate or inaccurate front-end display.

Method used

By introducing a message transit mechanism at the back end, using the WebSocket protocol for asynchronous transmission, receiving instance status and operating results, and updating the front -end list data through the instance ID to display the operation results.

Benefits of technology

In the case of changes that do not change OpenStack, update the instance status in real time, and inform the front end of the final execution results in time, which improves the user experience and operational efficiency of cloud service products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901066B_ABST
    Figure CN113901066B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and specifically provides a method for updating the state of an instance after operation. First, the front end, i.e., the client, is displayed, and the instance operation request is synchronously sent to the back end as the initiator; then, the back end receives two types of information, the instance state and the operation result, which are returned asynchronously through message forwarding; finally, the received state information is directly updated to the list data through the instance ID, and the received operation result is displayed through the corresponding component. Compared with the prior art, the present invention does not modify Openstack, is not associated with the internal components of Openstack, and while ensuring the timely display of the front end state, the final execution result is timely informed to the front end through the back end analysis and processing, and finally the operation result is timely displayed to the customer, which is more conducive to the construction and operation of cloud service products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular provides a method for updating the state of an instance after operation. Background Art

[0002] With the popularity of cloud services, more and more manufacturers have launched cloud computing services such as ECS. The underlying cloud platforms these products rely on include Openstack, VMware and other products. Among them, Openstack, as an open source cloud platform, has increased its market share in private cloud and other fields year by year. The open source community has gradually grown and has become the first choice for building cloud platforms.

[0003] Openstack has modules such as computing, storage, and network. The instances in the computing module are the most important functions of the cloud platform. Various cloud service products run on instances. During this period, other modules of Openstack provide basic services such as creation, communication, and storage for instances. Therefore, it is particularly important to monitor the instance status when performing operations on the instance.

[0004] There are many operations on instances in Openstack, from simple power on and off to complex operations such as virtual machine creation. Each operation will change the instance status. It is particularly important to display the instance status in a timely and dynamic manner through the front-end service product page. Summary of the invention

[0005] The present invention aims at the above-mentioned deficiencies of the prior art and provides a method for updating the state of an instance after operation with strong practicability.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A method for updating the status of an instance after operation, firstly, performing a front-end, i.e., a client display, and synchronously sending an instance operation request to a back-end as an initiator;

[0008] Then, the backend receives two types of information, instance status and operation result, returned asynchronously through message forwarding;

[0009] Finally, the received status information is directly used to update the list data through the instance ID, and the received operation results are displayed through the corresponding components.

[0010] Furthermore, the message forwarding selects the Websocket protocol according to the actual application scenario to perform asynchronous transmission from the back end to the front end.

[0011] Preferably, the Websocket Handler in the Websocket protocol includes serverStatusHandler and serverStatusResultHandler.

[0012] Furthermore, the serverStatusHandler receives the instance status and updates the front-end to display the status; the serverStatusResultHandler receives the instance operation result, which is received and displayed by the front-end.

[0013] Furthermore, the backend receives the instance operation request and makes an Openstack API call according to the request. The Openstack instance operation API is an asynchronous interface, which requires subsequent query and analysis of the instance details to determine the operation result, and transmits the result to the message relay to be received by the front end.

[0014] Furthermore, the front-end display specifically includes the following steps:

[0015] S101, receiving an incoming instance operation action and instance ID serverId;

[0016] S102, define the timeout time as 3-7 minutes after the current time and the blank status.

[0017] Furthermore, when the message is transferred, the following steps are specifically included:

[0018] S201, determine whether it has timed out, if not, proceed to step S202; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0019] S202, determine whether status is ERROR, if not, proceed to step S203; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0020] S203, determine whether status is SOFT_DELETED, if not, proceed to step S204; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0021] S204, determine whether status is DELETED, if not, proceed to step S205; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0022] S205, determine if the action is not VERIFY_RESIZE and the status is VERIFY_RESIZE, if not, proceed to step S206; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0023] S206, sleep for several seconds;

[0024] S207, query details by instance ID, if the queried instance status is different from status, continue to assign the instance status to status, if the same, then go to the backend for processing;

[0025] S208. Send the instance ID, instance status and power status information to the serverStatusHandler of the websocket, which is received and displayed by the front end.

[0026] Furthermore, when operating at the back end, the following steps are specifically included:

[0027] S301, determine that the operation is REVERT_RESIZE and the status is not REVERT_RESIZE and VERIFY_RESIZE, if so, send to the serverStatusResultHandler of the websocket, the message is cancel migration and / or resize success, then this process ends; if not, proceed to step S302;

[0028] S302, determine whether the task in the instance details is empty and the action is not VERIFY_RESIZE, if yes, continue to step S303, if no, jump to step S201;

[0029] S303, determine whether the action is CREATE and the status is BUILD, if yes, proceed to step S201, if no, proceed to step S304;

[0030] S304. Send different messages to the serverStatusResultHandler of the websocket according to different conditions.

[0031] Compared with the prior art, the method for updating the state of an instance after operation of the present invention has the following outstanding beneficial effects:

[0032] The present invention does not need to modify Openstack or be associated with Openstack internal components. While ensuring the timely display of the front-end status, the front-end is informed of the final execution result in a timely manner through the back-end analysis and processing, and the operation result is finally displayed to the customer in a timely manner, which is more conducive to the construction and operation of cloud service products. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Attached Figure 1 It is a flowchart diagram of a method for updating the state of an instance after operation (I). Implementation

[0035] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] A best embodiment is given below:

[0037] like Figure 1 As shown, a method for updating the state of an instance after operation in this embodiment, a method for updating the state of an instance after operation;

[0038] First, the front-end, i.e., the client, is displayed, and as the initiator, the instance operation request is synchronously sent to the back-end.

[0039] Then, the backend receives two types of information, instance status and operation result, returned asynchronously through message forwarding;

[0040] Message forwarding uses the Websocket protocol according to the actual application scenario for asynchronous transmission from the backend to the frontend. The Websocket Handler in the Websocket protocol includes serverStatusHandler and serverStatusResultHandler. The serverStatusHandler receives the instance status and updates the frontend to display the status. The serverStatusResultHandler receives the instance operation results, which are received and displayed by the frontend.

[0041] Finally, the received status information is directly used to update the list data through the instance ID, and the received operation results are displayed through the corresponding components.

[0042] The backend receives the instance operation request and calls the Openstack API according to the request. The Openstack instance operation API is an asynchronous interface, which requires subsequent query and analysis of the instance details to determine the operation result, and transmits the result to the message relay to be received by the frontend.

[0043] Openstack has dozens of instance operations. This patent only takes the commonly used instance operations as an example. In actual use, the logic can be adjusted according to the increase in operations. The following table shows 18 instance operations, the instance status during each instance operation, and the instance status after the operation is successful. By comparing the operation with the successful operation status, the final operation result can be obtained.

[0044]

[0045]

[0046]

[0047]

[0048] When displayed on the front end, the following steps are included:

[0049] S101, receiving an incoming instance operation action and instance ID serverId;

[0050] S102, define the timeout time as 3-7 minutes after the current time and the blank status.

[0051] When the message is transferred, the following steps are included:

[0052] S201, determine whether it has timed out, if not, proceed to step S202; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0053] S202, determine whether status is ERROR, if not, proceed to step S203; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0054] S203, determine whether status is SOFT_DELETED, if not, proceed to step S204; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0055] S204, determine whether status is DELETED, if not, proceed to step S205; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0056] S205, determine if the action is not VERIFY_RESIZE and the status is VERIFY_RESIZE, if not, proceed to step S206; if yes, send different information to the serverStatusResultHandler of the websocket according to different conditions;

[0057] S206, sleep for several seconds;

[0058] S207, query details by instance ID, if the queried instance status is different from status, continue to assign the instance status to status, if the same, then go to the backend for processing;

[0059] S208. Send the instance ID, instance status and power status information to the serverStatusHandler of the websocket, which is received and displayed by the front end.

[0060] When operating on the back end, the following steps are included:

[0061] S301, determine that the operation is REVERT_RESIZE and the status is not REVERT_RESIZE and VERIFY_RESIZE, if so, send to the serverStatusResultHandler of the websocket, the message is cancel migration and / or resize success, then this process ends; if not, proceed to step S302;

[0062] S302, determine whether the task in the instance details is empty and the action is not VERIFY_RESIZE, if yes, continue to step S303, if no, jump to step S201;

[0063] S303, determine whether the action is CREATE and the status is BUILD, if yes, proceed to step S201, if no, proceed to step S304;

[0064] S304. Send different messages to the serverStatusResultHandler of the websocket according to different conditions. The conditions and information are shown in the table:

[0065]

[0066]

[0067] Without changing Openstack or associating with Openstack internal components (DB, MQ), a solution for real-time instance status update is provided. While ensuring the timely display of the front-end status, the final execution result is promptly informed to the front-end through back-end analysis and processing, and the operation result is finally displayed to the customer in a timely manner.

[0068] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any method claim that conforms to the present invention for updating the state after operation of an example and any appropriate changes or substitutions made by a person of ordinary skill in the art shall fall within the patent protection scope of the present invention.

[0069] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for updating the state of an instance after operation, characterized in that: First, perform front-end display and send instance operation requests to the back-end synchronously as the initiator; Then, the backend receives two types of information, instance status and operation result, returned asynchronously through message forwarding; Finally, the received status information is directly used to update the list data through the instance ID, and the received operation results are displayed through the corresponding components; The message transfer uses the Websocket protocol according to the actual application scenario to perform asynchronous transmission from the back end to the front end; The Websocket Handler in the Websocket protocol includes serverStatusHandler and serverStatusResultHandler; The serverStatusHandler receives the instance status and updates the front-end to display the status in real time; the serverStatusResultHandler receives the instance operation result, which is received and displayed by the front-end; When the front-end is displayed, the following steps are included: S101, receiving an incoming instance operation action and an instance ID; S102, define the timeout time as 3-7 minutes after the current time, and the blank state status-1; When the message is transferred, the following steps are included: S201, determine whether it has timed out, if not, proceed to step S202; if yes, send different information to the serverStatusResultHandler of Websocket according to different conditions; S202, determine whether status is ERROR, ERROR means instance exception, if not, proceed to step S203; if yes, send different information to serverStatusResultHandler of Websocket according to different conditions; S203, determine whether status is SOFT_DELETED, SOFT_DELETED is a soft deletion instance, if not, proceed to step S204; if yes, send different information to the serverStatusResultHandler of Websocket according to different conditions; S204, determine whether status is DELETED, DELETED means deleting the instance, if not, proceed to step S205; if yes, send different information to the serverStatusResultHandler of Websocket according to different conditions; S205, determine whether the instance operation action is not VERIFY_RESIZE and the instance status status is VERIFY_RESIZE; if not, proceed to step S206; if yes, send different information to the serverStatusResultHandler of the Websocket according to different conditions; S206, sleep for several seconds; S207, query details by instance ID, if the queried instance status is different from status, continue to assign the instance status to status, if they are the same, go to the backend for processing; S208. Send the instance ID, status and power status information to the serverStatusHandler of the Websocket, which is received and displayed by the front end.

2. A method for updating the state of an instance after operation according to claim 1, characterized in that: The backend receives the instance operation request and makes an Openstack API call according to the request. The Openstack instance operation interface is an asynchronous interface, which requires subsequent query and analysis of the instance details to determine the operation result, and transmits the result to the message relay for reception by the front end.

3. A method for updating the state of an instance after operation according to claim 2, characterized in that: When operating on the back end, the following steps are included: S301, determine whether the operation is REVERT_RESIZE and the status is not REVERT_RESIZE and VERIFY_RESIZE, REVERT_RESIZE means canceling the instance resize, if yes, send a message to the serverStatusResultHandler of the Websocket, the message is canceling the migration and / or resizing successfully, then this process ends; if no, proceed to step S302; S302, determine whether the task in the instance details is empty and the action is not VERIFY_RESIZE, if yes, continue to step S303, if no, jump to step S201; S303, determine whether the operation action is CREATE and the status is BUILD, where CREATE is an instance of a create operation; if so, proceed to step S201, if not, proceed to step S304; S304. Send different messages to the serverStatusResultHandler of Websocket according to different conditions.

Citation Information

Patent Citations

  • Method and device for interacting page template data

    CN108664247A

  • Multilayer B / S and C / S hybrid software system and asynchronous real-time communication method between layers

    CN110995797A