CN118101675A - Method, device and storage medium for updating resource state information - Google Patents

Method, device and storage medium for updating resource state information Download PDF

Info

Publication number
CN118101675A
CN118101675A CN202410234033.6A CN202410234033A CN118101675A CN 118101675 A CN118101675 A CN 118101675A CN 202410234033 A CN202410234033 A CN 202410234033A CN 118101675 A CN118101675 A CN 118101675A
Authority
CN
China
Prior art keywords
resource
target
information
cloud platform
interface management
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410234033.6A
Other languages
Chinese (zh)
Inventor
宋文平
徐源浩
郭敬宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202410234033.6A priority Critical patent/CN118101675A/en
Publication of CN118101675A publication Critical patent/CN118101675A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of cloud platforms, and discloses a method, a device and a storage medium for updating resource state information, wherein the method comprises the following steps: when at least one resource change message exists in a message queue of the target cloud platform, acquiring a target resource change message from the message queue; analyzing the target resource change message to obtain a target event type and a resource information item, wherein the resource information item at least comprises identification information of a target user and identification information of a target resource; determining whether the target resource change message is a resource state change message according to the target event type and a pre-acquired event type list; and when the target resource change information is determined to be a resource state change message, the target event type and the resource information item are sent to the interface management node. The invention can update the resource information in time and avoid the problem of asynchronous update of the resource information.

Description

Method, device and storage medium for updating resource state information
Technical Field
The present invention relates to the field of server technologies, and in particular, to a method, an apparatus, and a storage medium for updating resource status information.
Background
In the technical field of cloud platforms, resources are generally divided into computing resources, storage resources and network resources, and users can query resource state information at related interfaces.
Generally, the interface management node can perform nano-tube on a plurality of cloud platforms at the same time, and any cloud platform can send the resource information in the current period to the interface management node in each period. And after receiving the resource information of the cloud platform in the current period, the interface management node integrally replaces the resource information of the previous period corresponding to the cloud platform.
In the related art, a problem of unsynchronized resource information is easily occurred.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a cloud platform, an interface management node, and a storage medium for updating resource status information, so as to solve the problem of asynchronous resource information.
In a first aspect, the present invention provides a method for updating resource status information, where the method is applied to a cloud platform management system, where the cloud platform management system includes an interface management node and at least one cloud platform, the method is performed by a target cloud platform, and the target cloud platform is any one of the at least one cloud platform, and the method includes:
when at least one resource change message exists in a message queue of the target cloud platform, acquiring a target resource change message from the message queue;
Analyzing the target resource change message to obtain a target event type and a resource information item, wherein the resource information item at least comprises identification information of a target user and identification information of a target resource;
determining whether the target resource change message is a resource state change message according to the target event type and a pre-acquired event type list;
When the target resource change message is determined to be a resource state change message, the target event type and the resource information item are sent to the interface management node, wherein the interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of a target resource pool according to the identification information of the target user, and updates state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
The method for updating the resource state information has the following advantages:
By monitoring the resources in the target cloud platform, a resource change message is generated immediately after the monitored resources change and is stored in a message queue. Therefore, the condition that the resource change can be timely obtained by monitoring the message queue is informed to the interface management node. In this way, delayed updating of resource information can be avoided. In addition, only after the resource information is changed, the resource information is updated instead of completely replacing the resource information, so that the problem of resource waste can be avoided. Further, the target cloud platform filters the resource change message, and performs relevant processing on the resource change message only when the resource change message is determined to be the resource state change message. Thus, the purpose of updating the resource status change message can be achieved.
In an optional implementation manner, when it is monitored that at least one resource change message exists in a message queue of the target cloud platform, before the target resource change message is acquired from the message queue, the method further includes:
When a resource pool adding request sent by the interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool adding request;
Performing user authentication operation according to the user information;
When the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
When the target resource pool is determined not to be marked as the added interface management, monitoring the resource information of the target resource pool;
When the resource information of the target resource pool is monitored to be changed, generating a resource change message, and adding the resource change message into the message queue;
Marking the target resource pool as added interface management;
Acquiring the resource information of the target resource pool, and sending the resource information to the interface management node so that the interface management node generates a resource information list of the target resource pool according to the resource information of the target resource pool;
Or when the target resource pool is determined to be marked as the added interface management, sending a first notification message to the interface management node, wherein the first notification message is used for indicating that the target resource pool is added with the interface management.
Specifically, as different manufacturers provide cloud platform related services, each user can be provided with own resource pools on different cloud platforms. Therefore, by the scheme, the operation of optionally adding the resource pool for management can be realized, and the actual requirements are met.
In an alternative embodiment, the method further comprises:
When a resource pool deleting request sent by the interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool deleting request;
performing user authentication according to the user information;
When the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
when the target resource pool is determined to be marked as the added interface management, canceling monitoring of the target resource pool, and marking the target resource pool as the non-added interface management;
Sending a second notification message to the interface management node, wherein the second notification message is used for indicating the interface management node to delete a resource information list of the target resource pool;
Or when the target resource pool is not marked as the added interface management, sending a third notification message to the interface management node, wherein the third notification message is used for indicating that the deletion of the target resource pool fails.
Specifically, the monitoring operation of the resource pool can be cancelled from the interface management node at will, and the actual requirement is met.
In an optional embodiment, the event type list is an event type white list, and the determining whether the target resource change message is a resource status change message according to the target event type and the pre-acquired event type list includes:
determining whether the target event type is an event type included in the event type white list;
and when the target event type is determined to be the event type in the event type white list, determining the target resource change message as a resource state change message.
Specifically, by the scheme, which resource change messages are resource state change messages can be accurately determined, and the resource change messages are subjected to relevant processing only when the resource change messages are determined to be the resource state change messages. In this way, the purpose of updating the resource status change message can be achieved.
In a second aspect, the present invention provides a method for updating resource status information, where the method is applied to a cloud platform management system, where the cloud platform management system includes an interface management node and at least one cloud platform, and the method is performed by the interface management node, and the method includes:
receiving a target event type and a resource information item sent by a target cloud platform, wherein the target cloud platform is any one of at least one cloud platform;
acquiring the identification information of the target user and the identification information of the target resource from the resource information item;
determining a resource information list of a target resource pool according to the identification information of the target user;
Determining first state information of the target resource in the resource information list according to the identification information of the target resource;
And determining second state information according to the target event type, and updating the first state information into the second state information.
The method for updating the resource state information has the following advantages:
The interface management node can determine the target resource, update the state information of the target resource instead of completely replacing the resource information, so that the problem of resource waste can be avoided.
In a third aspect, the present invention provides an apparatus for updating resource status information, where the apparatus is applied to a cloud platform management system, where the cloud platform management system includes an interface management node and at least one cloud platform, and the apparatus includes:
The acquisition module is used for acquiring the target resource change message from the message queue when at least one resource change message exists in the message queue of the target cloud platform;
The analysis module is used for analyzing the target resource change message to obtain a target event type and a resource information item, wherein the resource information item at least comprises identification information of a target user and identification information of a target resource;
The determining module is used for determining whether the target resource changing message is a resource state changing message according to the target event type and the pre-acquired event type list;
And the sending module is used for sending the target event type and the resource information item to the interface management node when the target resource change message is determined to be the resource state change message, wherein the interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of a target resource pool according to the identification information of the target user, and updates state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
In a fourth aspect, the present invention provides an apparatus for updating resource status information, where the apparatus is applied to a cloud platform management system, where the cloud platform management system includes an interface management node and at least one cloud platform, and the apparatus includes:
The receiving module is used for receiving a target event type and a resource information item sent by a target cloud platform, wherein the target cloud platform is any one of at least one cloud platform;
the acquisition module is used for acquiring the identification information of the target user and the identification information of the target resource from the resource information item;
The determining module is used for determining a resource information list of the target resource pool according to the identification information of the target user; determining first state information of the target resource in the resource information list according to the identification information of the target resource;
And the updating module is used for determining second state information according to the target event type and updating the first state information into the second state information.
In a fifth aspect, the present invention provides a cloud platform, including: the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so that the method for updating resource state information in the first aspect or any implementation manner corresponding to the first aspect is executed.
In a sixth aspect, the present invention provides a cloud platform, including: the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so that the method for updating resource state information in the first aspect or any implementation manner corresponding to the first aspect is executed.
In a seventh aspect, the present invention provides a computer readable storage medium, where computer instructions are stored on the computer readable storage medium, where the computer instructions are configured to cause a cloud platform to perform the method of updating resource status information according to the first aspect or any implementation manner corresponding to the first aspect.
In an eighth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing an interface management node to perform the method of updating resource status information of the second aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the related art, the drawings that are required to be used in the description of the embodiments or the related art will be briefly described, and it is apparent that the drawings in the description below are some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a schematic architecture diagram of a cloud platform management system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of updating resource status information according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method of updating resource status information according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method of updating resource status information according to an embodiment of the present invention;
FIG. 5 is a flow diagram of yet another method of updating resource status information according to an embodiment of the present invention;
FIG. 6 is a flow diagram of yet another method of updating resource status information according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for updating resource status information according to an embodiment of the present invention;
FIG. 8 is a block diagram of an apparatus for updating resource status information according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The embodiment of the invention provides a cloud platform management system, which is shown in fig. 1. The cloud platform management system may include an interface management node and at least one cloud platform. The target cloud platform is any one of the at least one cloud platform. The target cloud platform may be an OpenStack type cloud platform. The architecture of the target cloud platform is described below by taking the target cloud platform as an example.
In the embodiment of the invention, the target cloud platform can be deployed with telmet components, message queues, resource monitoring components and databases. Wherein telmet components may include telmet-api components, telmet-agent components. The message queue may specifically be RabbitMQ. The resource monitoring component monitors the change condition of the resource by the main user, generates a resource change message after monitoring the change of the resource transmission, and transmits the resource change message to the message queue. The resource monitoring components may include a nova component for monitoring computing resources (e.g., cloud hosts, etc.), a cinder component for monitoring storage resources (e.g., cloud hard disks, images, snapshots, etc.), and a neutron component for monitoring network resources. A plurality of resource pools may be included in the database. The target cloud platform may also be deployed with a Keystone component for user authentication. The target cloud platform can be further provided with a websocket-server component which is mainly used for sending resource change information to the interface management node.
The target cloud platform may include a plurality of nodes. The components can be deployed on the same node in the target cloud platform or on different nodes. The latter is described as an example.
The interface management node may be deployed with a websocket-clinet component that is primarily used to receive resource change messages.
The embodiment of the invention provides a method for updating resource state information, which updates the changed resource information after monitoring the change of resources, can ensure the real-time update of the resource information and save resources.
In accordance with an embodiment of the present invention, there is provided a method embodiment for updating resource status information, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
The embodiment provides a method for updating resource state information, which is applied to the cloud platform management system. Fig. 2 is a flowchart of a method of updating resource status information according to an embodiment of the present invention, as shown in fig. 2, the flowchart including the steps of:
step S201, when the target cloud platform monitors that at least one resource change message exists in the message queue, the target resource change message is obtained from the message queue.
Each resource change message may include identification information of the message, event type, priority, and resource related information. The resource-related information may include identification information of the tenant, identification information of the user, identification information of the resource, a name of the resource, status information of the resource, and the like. The identification information of the resource may be identification information of a cloud host, identification information of a cloud hard disk, and the like. For example, the tenant may be an enterprise renting a cloud platform, the user may be an employee of the enterprise, and so on.
Specifically, when the target cloud platform monitors that the resource change message exists in the message queue, the target resource change message can be acquired from the message queue.
For example, the target resource change message may be as follows:
{message_id:0a2b942f-7e96-42f9-be58-dddaba514c9c,
publisher_id:compute.devstack,
event_type:compute.instance.power_on.start,
priority:INFO,
payload:
{tenant_id:5f4e3a17002140c4bac50169a7edcbf7,
user_id:dda26f08380945a498d3977705e0d6b1,
instance_id:0c8d8fd3-1c93-4a82-95ed-f3ec66a0857d,
display_name:aaa,…}
The message_id is identification information of a target resource change message, the public_id is a device identification corresponding to the target resource change message in a target cloud platform, the event_type is a target event type, the priority is a priority of the target resource change message, the payload is resource related information, the parent_id is identification information of a tenant, the user_id is identification information of a target user, the instance_id is identification information of a target cloud host, and the display_name is a name of the target cloud host.
Step S202, the target cloud platform analyzes the target resource change message to obtain the target event type and the resource information item.
The resource information item may include identification information of the target user and identification information of the target resource.
Specifically, the target cloud platform may parse the target resource change message, and may obtain a plurality of information items included in the target resource change message after parsing. The target cloud platform can determine the target event type and the resource information items from the plurality of information items, and temporarily cache other information items.
Step S203, the target cloud platform determines whether the target resource change message is a resource state change message according to the target event type and the pre-acquired event type list.
The event type list may be an event type white list or an event type black list. For example, the event type whitelist may be as shown in table 1 and the event type blacklist may be as shown in table 2.
TABLE 1
Processed messages
In cloud host disk mapping
In cloud host network configuration
Cloud host creation completion
Cloud hard disk creation completion
In cloud host deletion
Cloud host deletion completion
……
TABLE 2
Discarded messages
Cloud host screening node
Storage pool capacity variation
Cloud hard disk screening storage back end
Resource pool state change
Authority authentication
Security group add member
……
Specifically, when the event type list is an event type white list, this step may include:
Step one, it is determined whether the target event type is an event type included in the event type white list.
And step two, when the target event type is determined to be the event type in the event type white list, the target resource change message is determined to be the resource state change message.
When the event type list is an event type blacklist, this step may include:
step one, determining whether the target event type is an event type in an event type blacklist.
And step two, when the target event type is not any event type included in the event type blacklist, determining the target resource change message as a resource state change message.
Step S204, when the target cloud platform determines that the target resource change message is a resource state change message, the target event type and the resource information item are sent to the interface management node.
Specifically, when the target cloud platform determines that the target resource change message is a resource state change message, the target event type and the resource information item may be sent to the interface management node, so that the interface management node obtains the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of the target resource pool according to the identification information of the target user, and updates the state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
When the target cloud platform determines that the target resource change message is not the resource state change message, all information items in the target resource change message can be deleted, so that storage resources are saved.
In some optional embodiments, the target cloud platform may perform a preset operation on the target event type, the resource information item, and the cached other information items, obtain a target message, and send the target message to the interface management node. The target message carries the target event type and the resource information item.
Taking the above-given target resource change message as an example, the preset operation may include the following steps:
First, the "publicher_id: computer. Devstack" is modified to "publicher_id: telmet. Devstack". Thus, after receiving the target message sent by the target cloud platform, the interface management node determines that the message is processed by the telmet component and is a screened resource change message.
Second, a virtual communication address (Virtual Internet Protocol, VIP) of the target cloud platform and region information of the target cloud platform are added. Thus, after receiving the target message, the interface management node can extract the VIP and the region information of the target cloud platform from the target message, and the range for searching the target resource pool is narrowed.
Thirdly, analyzing the resource configuration items. Because the resource configuration items are originally arranged in the payload: { }, the interface management node cannot analyze the payload: { } by itself, so that the target cloud platform can analyze the payload: { } in advance, and each information item obtained after analysis is respectively placed in the target message.
After the above operation, the target message may be as follows:
{message_id:0a2b942f-7e96-42f9-be58-dddaba514c9c,
publisher_id:telmet.devstack,
region: cloud platform-Huadong test one area
vip:10.10.11.33
event_type:compute.instance.power_on.start,
tenant_id:5f4e3a17002140c4bac50169a7edcbf7
user_id:dda26f08380945a498d3977705e0d6b1,
instance_id:0c8d8fd3-1c93-4a82-95ed-f3ec66a0857d,
display_name:aaa,…}
In some alternative embodiments, since status information of a plurality of resources may be changed in a target resource pool corresponding to a target user, at this time, a plurality of in-process resource change messages corresponding to the target user may be present in the target cloud platform. Therefore, when the target cloud platform sends the target event type and the resource item corresponding to the target resource change message, whether the priority level extracted from the target resource change message is greater than or equal to the preset priority level can be determined first, and if so, the target event type and the resource information item can be immediately sent to the interface management node. If not, determining whether resource state change information which corresponds to the identification information of the target user and has a priority smaller than the preset priority exists in the resource state change information which is processed by the target cloud platform according to the identification information of the target user, and if so, packaging event types and resource information items which respectively correspond to the resource state change information, and target event types and resource information items which correspond to the target resource change information, and sending the event types and the resource information items to an interface management node together. Because the encapsulation and packaging of each message need to occupy resources, the resource status change messages with lower priority can be packaged and sent together, and resources are saved.
In step S205, the interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item.
Specifically, after receiving the target event type and the resource information item, the interface management node may acquire the identification information of the target user and the identification information of the target resource from the resource information item.
In some optional embodiments, after receiving the target message, the interface management node may extract the target event type and the resource information item from the target message, and may further obtain the identification information of the target user and the identification information of the target resource from the resource information item.
In step S206, the interface management node determines a resource information list of the target resource pool according to the identification information of the target user.
Specifically, the interface management node stores resource information lists of the resource pools corresponding to the multiple users, so that the resource information list of the target resource pool can be determined according to the identification information of the target user.
In some optional embodiments, before step S206, the interface management node may further extract VIP and region information of the target cloud platform from the target message. In this way, the interface management node may determine, according to the region information, a resource information list corresponding to the region information, and further determine, according to VIP of the target cloud platform, a resource information list corresponding to the target cloud platform from the resource information list corresponding to the region information. And finally, determining the resource information list of the target resource pool from the resource information list corresponding to the target cloud platform according to the identification information of the target user.
In step S207, the interface management node determines first state information of the target resource in the resource information list according to the identification information of the target resource.
Specifically, the interface management node may determine, according to the identification information of the target resource, first state information of the target resource in the resource information list of the target resource pool.
In some alternative embodiments, before step S207, the interface management node may determine a target resource type according to the target event type, and further, may determine a resource information list corresponding to the target resource type from resource information lists of the target resource pool according to the resource type. Finally, according to the identification information of the target resource, the first state information corresponding to the target resource can be determined in the resource information list corresponding to the target resource type.
In step S208, the interface management node determines the second state information according to the target event type, and updates the first state information to the second state information.
Specifically, since the target event type is defined by the type and the state information of the target resource, the interface management node may directly determine the second state information in the target event type. For example, the target event type is "computer.instance.power_on.start", and thus, the second state information may be determined to be "in cloud host power-on". Or according to the target event type and the corresponding relation between the event type and the state information, determining the second state information corresponding to the target event type, and replacing the first state information with the second state information.
In some alternative embodiments, the resource information item may further include second state information of the target resource, so that the interface management node does not need to determine the second state information according to the target event type, but may directly obtain the second state information from the resource information item.
In some optional embodiments, the scheme can be applied to a cloud host thermomigration process. Accordingly, each time the cloud host thermomigration enters a new step, a process message may be generated and stored in the message queue. The cloud platform may extract the process message from the message queue and send the process message to the interface management node. The interface management node can update the progress of the cloud host thermomigration according to the received process message, and synchronize the progress to the user terminal. The user terminal can be displayed to the user in the form of a progress bar so that the user can clearly know the progress of the cloud host thermomigration process. The cloud host hot migration process may include target node selection, checking, creating disks, creating networks, source node de-disk mapping, deleting network interfaces, memory migration, and so forth.
According to the method for updating the resource state information, the resources in the target cloud platform are monitored, and after the monitored resources are changed, the resource change message is immediately generated and stored in the message queue. Therefore, the condition that the resource change can be timely obtained by monitoring the message queue is informed to the interface management node. In this way, delayed updating of resource information can be avoided. In addition, only after the resource information is changed, the resource information is updated instead of completely replacing the resource information, so that the problem of resource waste can be avoided. Further, the target cloud platform filters the resource change message, and performs relevant processing on the resource change message only when the resource change message is determined to be the resource state change message. In this way, the purpose of updating the resource status change message can be achieved.
The embodiment provides a method for updating resource state information, which is applied to the target cloud platform. FIG. 3 is a flow chart of a method of updating resource status information according to an embodiment of the present invention, as shown in FIG. 3, the flow comprising the steps of:
step S301, when it is monitored that at least one resource change message exists in the message queue of the target cloud platform, the target resource change message is obtained from the message queue.
Step S302, analyzing the target resource change message to obtain the target event type and the resource information item.
The resource information item at least comprises identification information of a target user and identification information of a target resource.
Step S303, according to the target event type and the pre-acquired event type list, determining whether the target resource change message is a resource state change message.
Step S304, when the target resource changing message is determined to be the resource state changing message, the target event type and the resource information item are sent to the interface management node.
The interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of the target resource pool according to the identification information of the target user, and updates state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the type of the target event.
The specific processing of steps S301 to S304 may be similar to the specific processing of steps S201 to S204, and will not be described here.
According to the method for updating the resource state information, the resources in the target cloud platform are monitored, and after the monitored resources are changed, the resource change message is immediately generated and stored in the message queue. Therefore, the condition that the resource change can be timely obtained by monitoring the message queue is informed to the interface management node. In this way, delayed updating of resource information can be avoided. In addition, only after the resource information is changed, the resource information is updated instead of completely replacing the resource information, so that the problem of resource waste can be avoided. Further, the target cloud platform filters the resource change message, and performs relevant processing on the resource change message only when the resource change message is determined to be the resource state change message. In this way, the purpose of updating the resource status change message can be achieved.
In this embodiment, a method for updating resource status information is provided, which is applied to the interface management node described above. Fig. 4 is a flowchart of a method of updating resource status information according to an embodiment of the present invention, as shown in fig. 4, the flowchart including the steps of:
step S401, receiving a target event type and a resource information item sent by a target cloud platform.
Step S402, obtaining the identification information of the target user and the identification information of the target resource from the resource information item.
Step S403, determining a resource information list of the target resource pool according to the identification information of the target user.
Step S404, according to the identification information of the target resource, the first state information of the target resource is determined in the resource information list.
Step S405, determining second state information according to the target event type, and updating the first state information to the second state information.
The specific processing of steps S401 to S405 may be similar to the specific processing of steps S205 to S208, and will not be described here.
According to the method for updating the resource state information, the interface management node can determine the target resource and update the state information of the target resource instead of completely replacing the resource information, so that the problem of resource waste can be avoided.
The embodiment provides a method for adding a target cloud platform, which is applied to the cloud platform management system. Fig. 5 is a flowchart of a method for adding a target cloud platform according to an embodiment of the present invention, as shown in fig. 5, the flowchart includes the following steps:
In step S501, the interface management node sends a resource pool adding request to the target cloud platform.
Specifically, the user may input user information, a virtual communication address of the resource pool, and VIP of the target cloud platform at the management interface, where the user information may include a user name, a password, and the like. And the user terminal generates a resource pool adding request according to the information input by the user and sends the resource pool adding request to the interface management node. And after receiving the resource pool adding request, the interface management node extracts the VIP of the target cloud platform from the resource pool adding request. And adding the communication address of the resource pool into the resource pool adding request, and forwarding the resource pool adding request to the target cloud platform according to the VIP of the target cloud platform.
In step S502, the target cloud platform extracts the user information and the virtual communication address of the resource pool from the resource pool addition request.
Specifically, after receiving the resource pool adding request, the target cloud platform can extract user information, a virtual communication address of the resource pool and a communication address of an interface management node from a node where the Keystone component is located. The node where the Keystone component is located can send the communication address of the interface management node to the node where the telmet-agent component is located.
In step S503, the target cloud platform performs a user authentication operation according to the user information.
Specifically, the target cloud platform may perform a user authentication operation according to a user name and a user password.
In step S504, when the authentication result of the user authentication is passed, the target cloud platform determines, according to the virtual communication address of the resource pool, whether the target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management.
Specifically, when the authentication result of the user authentication is failure, an add failure notification message is sent to the interface management node. The interface management node forwards the addition failure notification message to the user terminal to inform the user of the addition result.
When the authentication result of the user authentication is that the user authentication is passed, the node where the Keystone component is located can forward the virtual communication address of the resource pool to the node where the telmet-api component is located, and the node where the telmet-api component is located sends the virtual communication address of the resource pool to the node where the database is located. After receiving the virtual communication address of the resource pool, the node where the database is located can determine a target resource pool according to the virtual communication address of the resource pool, and determine whether the target resource pool is marked as added interface management. And the node where the database is located informs telmet the node where the api component is located of the result.
In step S505, when it is determined that the target resource pool is not marked as the added interface management, the target cloud platform monitors the resource information of the target resource pool.
Specifically, when it is determined that the target resource pool is not marked as having interface management added, the node where the telmet-api component is located may be a remote procedure call (Remote Procedure Call, RPC) telmet-agent component is located. And adding a message monitoring mechanism to the target resource pool through telmet-agent components, and reloading configuration information of the target resource pool. In addition, the node where the telmet-agent component is located can establish communication connection with the interface management node according to the communication address of the interface management node, so that when the resource change message is obtained from the message queue later, the resource change message can be sent to the interface management node.
In step S506, when it is determined that the target resource pool is marked as having added interface management, the target cloud platform sends a first notification message to the interface management node.
The first notification message is used for indicating that the target resource pool is managed by the added interface.
Specifically, when it is determined that the target resource pool is marked as having added interface management, the telmet-api component may send an add failure notification message to the interface management node, which forwards the add failure notification message to the user terminal to inform the user of the add result.
In step S507, when the target cloud platform monitors that the resource information of the target resource pool is changed, a resource change message is generated, and the resource change message is added into the message queue.
Specifically, when the resource monitoring component monitors that the resource information of the target resource pool changes, a resource change message can be generated and sent to the message queue, so that when the node where the telmet-agent component is located can monitor that the message queue has the resource change message, relevant processing is performed.
In step S508, the target cloud platform marks the target resource pool as having interface management added.
Specifically, the node where the database is located may mark the target resource pool as the interface management added, store the configuration information, and inform the node where the telme-apit component is located that the configuration information is successfully stored after the storage is successful, so that the node where the telme-apit component is located may send a notification message of the successful addition to the interface management node, and then forward the notification message to the user terminal by the interface management node.
Step S509, the target cloud platform acquires resource information of the target resource pool.
Step S510, the target cloud platform sends the resource information of the target resource pool to the interface management node.
Specifically, the node where the database is located may acquire resource information of all resources in the target resource pool, and send the resource information to the interface management node
In step S511, the interface management node generates and stores a resource information list of the target resource pool according to the resource information of the target resource pool.
Specifically, after receiving the resource information of the target resource pool, the interface management node may generate and store a resource information list of the target resource pool according to the resource information of the target resource pool. For example, the resources in the target resource pool may be classified, and a corresponding resource information list may be generated according to the resource type.
According to the method for adding the target cloud platform, as different manufacturers provide cloud platform related services, each user can be provided with own resource pools on different cloud platforms. Therefore, by the scheme, the operation of optionally adding the resource pool for management can be realized, and the actual requirements are met.
The embodiment provides a method for deleting a target resource pool, which is applied to the cloud platform management system. Fig. 6 is a flowchart of a method of deleting a target resource pool according to an embodiment of the present invention, as shown in fig. 5, the flowchart including the steps of:
step S601, the interface management node sends a resource pool deletion request to the target cloud platform.
Specifically, the user may input user information in the management interface, select the target resource pool, and delete the target resource pool. At this time, the user terminal may generate a resource pool deletion request according to the virtual communication address of the target resource pool, the VIP of the target cloud platform to which the target resource pool belongs, and the user information, and send the resource pool deletion request to the interface management node, where the interface management node sends the resource pool deletion request to the target cloud platform.
In step S602, the target cloud platform extracts the user information and the virtual communication address of the resource pool from the resource pool deletion request.
Step S603, the target cloud platform performs user authentication operation according to the user information.
In step S604, when the authentication result of the user authentication is passed, the target cloud platform determines, according to the virtual communication address of the resource pool, whether the target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management.
The specific processing of step S602 to step S604 is similar to the specific processing of step S502 to step S504, and will not be described here.
In step S605, when it is determined that the target resource pool is marked as the interface management has been added, the target cloud platform cancels the monitoring of the target resource pool and marks the target resource pool as the interface management not having been added.
Specifically, when it is determined that the target resource pool is marked as having interface management added, the node where the telmet-api component is located may remotely call telmet-the node where the agent component is located, delete the message monitoring mechanism for the target resource pool, and reload configuration information of the target resource pool. the node where telmet-api component is located informs the node where the database is located that monitoring of the target resource pool has been canceled. The node where the database is located can mark the target resource pool as non-added interface management and save the configuration information. In addition, the node where the telmet-agent component is located may break the communication connection with the interface management node.
Step S606, the target cloud platform sends a second notification message to the interface management node.
Specifically, the node where the database is located marks the target resource pool as
In step S607, the interface management node deletes the resource information list of the target resource pool.
Specifically, after receiving the second notification message, the interface management node may determine, according to the virtual communication address of the target resource pool, a resource information list of the target resource pool, and delete the resource information list.
In step S608, when it is determined that the target resource pool is not marked as having interface management added, the target cloud platform sends a third notification message to the interface management node.
The third notification message is used for indicating that the deletion of the target resource pool fails.
Specifically, when it is determined that the target resource pool is marked as having interface management added, the telmet-api component may send a third notification message to the interface management node, and the interface management node forwards the third notification message to the user terminal to inform the user of the deletion result.
The method for deleting the target cloud platform can cancel the monitoring operation of the resource pool from the interface management node at will, and meets the actual requirements.
The embodiment also provides a device for updating the resource status information, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides an apparatus for updating resource status information, as shown in fig. 7, including:
an obtaining module 701, configured to obtain, when it is monitored that at least one resource change message exists in a message queue of the target cloud platform, a target resource change message from the message queue;
The parsing module 702 is configured to parse the target resource change message to obtain a target event type and a resource information item, where the resource information item at least includes identification information of a target user and identification information of a target resource;
a determining module 703, configured to determine whether the target resource change message is a resource status change message according to the target event type and the pre-acquired event type list;
And a sending module 704, configured to send the target event type and the resource information item to the interface management node when it is determined that the target resource change message is the resource status change message, where the interface management node obtains the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of the target resource pool according to the identification information of the target user, and updates status information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
In some alternative embodiments, the apparatus further comprises an adding module 705, the adding module 705 configured to:
when a resource pool adding request sent by an interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool adding request;
Performing user authentication operation according to the user information;
when the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
When the target resource pool is determined not to be marked as the added interface management, monitoring the resource information of the target resource pool;
When the resource information of the target resource pool is monitored to be changed, generating a resource change message, and adding the resource change message into a message queue;
marking the target resource pool as added interface management;
Acquiring resource information of a target resource pool, and sending the resource information to an interface management node so that the interface management node generates a resource information list of the target resource pool according to the resource information of the target resource pool;
Or when the target resource pool is determined to be marked as the added interface management, sending a first notification message to the interface management node, wherein the first notification message is used for indicating that the target resource pool is added with the interface management.
In some alternative embodiments, the apparatus further comprises a deletion module 706, the deletion module 706 being configured to:
When a resource pool deleting request sent by an interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool deleting request;
performing user authentication according to the user information;
when the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
When the target resource pool is determined to be marked as the added interface management, canceling the monitoring of the target resource pool, and marking the target resource pool as the non-added interface management;
sending a second notification message to the interface management node, wherein the second notification message is used for indicating the interface management node to delete the resource information list of the target resource pool;
or when the target resource pool is determined not to be marked as the added interface management, sending a third notification message to the interface management node, wherein the third notification message is used for indicating that the deletion of the target resource pool fails.
In some alternative embodiments, the event type list is an event type white list, and the determining module 703 is configured to:
determining whether the target event type is an event type included in the event type white list;
and when the target event type is determined to be the event type in the event type white list, determining the target resource change message as a resource state change message.
The present embodiment provides an apparatus for updating resource status information, as shown in fig. 8, including:
the receiving module 801 is configured to receive a target event type and a resource information item sent by a target cloud platform, where the target cloud platform is any one of at least one cloud platform;
An obtaining module 802, configured to obtain, from the resource information item, identification information of the target user and identification information of the target resource;
A determining module 803, configured to determine a resource information list of the target resource pool according to the identification information of the target user; determining first state information of the target resource in a resource information list according to the identification information of the target resource;
The updating module 804 is configured to determine the second status information according to the target event type, and update the first status information to the second status information.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The means for updating resource status information in this embodiment is presented in the form of functional units, where the units are ASIC (Application SPECIFIC INTEGRATED Circuit) circuits, processors and memories executing one or more software or firmware programs, and/or other devices that can provide the above-described functions.
The embodiment of the invention also provides a computer device which is provided with the device for updating the resource state information shown in the figure 7 or the figure 8.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 9, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 9.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (10)

1. A method for updating resource status information, the method being applied to a cloud platform management system, the cloud platform management system including an interface management node and at least one cloud platform, the method being performed by a target cloud platform, the target cloud platform being any one of the at least one cloud platform, the method comprising:
when at least one resource change message exists in a message queue of the target cloud platform, acquiring a target resource change message from the message queue;
Analyzing the target resource change message to obtain a target event type and a resource information item, wherein the resource information item at least comprises identification information of a target user and identification information of a target resource;
determining whether the target resource change message is a resource state change message according to the target event type and a pre-acquired event type list;
When the target resource change information is determined to be a resource state change message, the target event type and the resource information item are sent to the interface management node, wherein the interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of a target resource pool according to the identification information of the target user, and updates state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
2. The method of claim 1, wherein when it is monitored that at least one resource change message exists in a message queue of the target cloud platform, before obtaining the target resource change message from the message queue, the method further comprises:
When a resource pool adding request sent by the interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool adding request;
Performing user authentication operation according to the user information;
When the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
When the target resource pool is determined not to be marked as the added interface management, monitoring the resource information of the target resource pool;
When the resource information of the target resource pool is monitored to be changed, generating a resource change message, and adding the resource change message into the message queue;
Marking the target resource pool as added interface management;
Acquiring the resource information of the target resource pool, and sending the resource information to the interface management node so that the interface management node generates a resource information list of the target resource pool according to the resource information of the target resource pool;
Or when the target resource pool is determined to be marked as the added interface management, sending a first notification message to the interface management node, wherein the first notification message is used for indicating that the target resource pool is added with the interface management.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
When a resource pool deleting request sent by the interface management node is received, extracting user information and a virtual communication address of a resource pool from the resource pool deleting request;
performing user authentication according to the user information;
When the authentication result of the user authentication is passing, determining whether a target resource pool corresponding to the virtual communication address of the resource pool is marked as added interface management according to the virtual communication address of the resource pool;
when the target resource pool is determined to be marked as the added interface management, canceling monitoring of the target resource pool, and marking the target resource pool as the non-added interface management;
Sending a second notification message to the interface management node, wherein the second notification message is used for indicating the interface management node to delete a resource information list of the target resource pool;
Or when the target resource pool is not marked as the added interface management, sending a third notification message to the interface management node, wherein the third notification message is used for indicating that the deletion of the target resource pool fails.
4. The method according to claim 1 or 2, wherein the event type list is an event type white list, and the determining whether the target resource change message is a resource status change message according to the target event type and the pre-acquired event type list includes:
determining whether the target event type is an event type included in the event type white list;
and when the target event type is determined to be the event type in the event type white list, determining the target resource change message as a resource state change message.
5. A method of updating resource status information, the method being applied to a cloud platform management system comprising an interface management node and at least one cloud platform, the method being performed by the interface management node, the method comprising:
receiving a target event type and a resource information item sent by a target cloud platform, wherein the target cloud platform is any one of at least one cloud platform;
acquiring the identification information of the target user and the identification information of the target resource from the resource information item;
determining a resource information list of a target resource pool according to the identification information of the target user;
Determining first state information of the target resource in the resource information list according to the identification information of the target resource;
And determining second state information according to the target event type, and updating the first state information into the second state information.
6. An apparatus for updating resource status information, wherein the apparatus is applied to a cloud platform management system, the cloud platform management system including an interface management node and at least one cloud platform, the apparatus comprising:
The acquisition module is used for acquiring the target resource change message from the message queue when at least one resource change message exists in the message queue of the target cloud platform;
The analysis module is used for analyzing the target resource change message to obtain a target event type and a resource information item, wherein the resource information item at least comprises identification information of a target user and identification information of a target resource;
The determining module is used for determining whether the target resource changing message is a resource state changing message according to the target event type and the pre-acquired event type list;
And the sending module is used for sending the target event type and the resource information item to the interface management node when the target resource change message is determined to be the resource state change message, wherein the interface management node acquires the identification information of the target user and the identification information of the target resource from the resource information item, determines a resource information list of a target resource pool according to the identification information of the target user, and updates state information corresponding to the identification information of the target resource in the resource information list of the target resource pool according to the target event type.
7. An apparatus for updating resource status information, wherein the apparatus is applied to a cloud platform management system, the cloud platform management system including an interface management node and at least one cloud platform, the apparatus comprising:
The receiving module is used for receiving a target event type and a resource information item sent by a target cloud platform, wherein the target cloud platform is any one of at least one cloud platform;
the acquisition module is used for acquiring the identification information of the target user and the identification information of the target resource from the resource information item;
The determining module is used for determining a resource information list of the target resource pool according to the identification information of the target user; determining first state information of the target resource in the resource information list according to the identification information of the target resource;
And the updating module is used for determining second state information according to the target event type and updating the first state information into the second state information.
8. A cloud platform, comprising:
A memory and a processor in communication with each other, the memory having stored therein computer instructions, the processor executing the method of updating resource status information of any of claims 1 to 4 by executing the computer instructions.
9. An interface management node, comprising:
A memory and a processor, said memory and said processor being communicatively coupled to each other, said memory having stored therein computer instructions, said processor executing the method for updating resource status information of claim 5 by executing said computer instructions.
10. A computer readable storage medium, wherein computer instructions are stored on the computer readable storage medium, the computer instructions for causing a cloud platform to perform the method of updating resource status information according to any one of claims 1 to 4, or the computer instructions for causing an interface management node to perform the method of updating resource status information according to claim 5.
CN202410234033.6A 2024-02-29 2024-02-29 Method, device and storage medium for updating resource state information Pending CN118101675A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410234033.6A CN118101675A (en) 2024-02-29 2024-02-29 Method, device and storage medium for updating resource state information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410234033.6A CN118101675A (en) 2024-02-29 2024-02-29 Method, device and storage medium for updating resource state information

Publications (1)

Publication Number Publication Date
CN118101675A true CN118101675A (en) 2024-05-28

Family

ID=91150162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410234033.6A Pending CN118101675A (en) 2024-02-29 2024-02-29 Method, device and storage medium for updating resource state information

Country Status (1)

Country Link
CN (1) CN118101675A (en)

Similar Documents

Publication Publication Date Title
CN108683668B (en) Resource checking method, device, storage medium and equipment in content distribution network
EP3057281A1 (en) M2m application remote registration method, device, system and storage medium
EP4277239A1 (en) Cloud platform and bucket management method for object storage service provided thereby
CN109361525B (en) Method, device, control terminal and medium for restarting distributed deployment of multiple services
WO2019085074A1 (en) Website vulnerability scanning method and apparatus, computer device and storage medium
CN111159233B (en) Distributed caching method, system, computer equipment and storage medium
CN107644075B (en) Method and device for collecting page information
CN113268308B (en) Information processing method, device and storage medium
CN109462507B (en) Configuration updating method, device and system and electronic equipment
CN106506490A (en) A kind of Distributed Calculation control method and distributed computing system
CN105468433A (en) Method and system for acquiring disc data of virtual machines
EP3174318B1 (en) Method for realizing resource attribute notification, and common service entity
CN112217684A (en) API gateway monitoring method, device and system
US11281446B2 (en) Updating method, terminal and electronic device
CN112463549A (en) Auditing method, device and equipment of cloud platform and computer readable storage medium
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN109327499B (en) Service interface management method and device, storage medium and terminal
CN112087475A (en) Message pushing method and device for cloud platform component application and message server
CN111478953B (en) Self-construction method, device, system, equipment and storage medium of server cluster
CN111008209B (en) Data reconciliation method, device and system, storage medium and electronic device
US20170270031A1 (en) Information processing apparatus, test execution method, and computer-readable recording medium
US9852031B2 (en) Computer system and method of identifying a failure
CN118101675A (en) Method, device and storage medium for updating resource state information
CN113032263A (en) Case test processing method and device, server and readable storage medium
CN112000618A (en) File change management method, device, equipment and storage medium for cluster nodes

Legal Events

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