Edge cluster node tag synchronization method and device, electronic equipment, storage medium and program product
By decoupling the underlying resource management module from the edge cluster management module in the edge computing cluster, and using Kafka messages for asynchronous communication, synchronization is only performed when the node label synchronization field changes, thus solving the network pressure problem caused by label synchronization in large-scale edge clusters and improving system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2024-11-27
- Publication Date
- 2026-05-15
AI Technical Summary
In large-scale edge computing clusters, traditional tag synchronization methods lead to frequent cloud-edge communication, increasing network bandwidth and latency pressure and affecting system performance.
By decoupling the underlying resource management module from the edge cluster management module, asynchronous communication is achieved using Kafka messages. Tag synchronization messages are sent only when the node tag synchronization field changes, reducing unnecessary communication.
This improved system performance, reduced the cloud-edge communication burden, and enabled efficient and reliable tag synchronization.
Smart Images

Figure CN119788689B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing technology, and in particular to an edge cluster node tag synchronization method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] An edge cluster is a loosely coupled computer system consisting of a group of independent edge nodes. Edge nodes refer to computer nodes located at the network edge close to the user, providing storage, computing, and networking resources. They decentralize some critical business applications to the edge of the access network to reduce bandwidth and latency losses caused by network transmission and multi-level forwarding.
[0003] Edge cluster node labels play a crucial role in edge computing systems. They are used to identify and classify individual nodes within an edge cluster. Each node can be assigned one or more labels, which describe its characteristics, functions, and other information. Related business components can identify and differentiate different nodes based on these labels, facilitating resource organization and allocation.
[0004] Tag synchronization refers to assigning appropriate tags to edge cluster nodes based on factors such as node attributes, functions, roles, and status.
[0005] Asset tags are used to distinguish asset uses, facilitating the management of edge cluster assets. In the field of edge computing, an architecture is typically adopted where edge nodes are deployed independently of the central (also known as the cloud) Kubernetes cluster for resource management. During tag synchronization, the cloud needs to obtain information such as the status, role, and asset tags of the edge nodes from the operations and maintenance platform, set tags for each edge node according to the tag synchronization logic, and store the set tags in the database and update the edge nodes. When host synchronization is triggered, physical machines, topology, and tags are synchronized, meaning that tag synchronization is a step in host synchronization. Tag synchronization involves communication between the cloud and the edge. For large-scale edge clusters, if traditional methods are used to synchronize tags for each edge node individually, it will cause frequent cloud-edge communication, putting pressure on network bandwidth and latency. In addition to tag synchronization, the host synchronization process also involves the synchronization of physical machines, network resources, etc. Therefore, host synchronization of large-scale edge clusters is a resource-intensive and time-consuming process.
[0006] Therefore, there is an urgent need for a more efficient, reliable, and cost-effective technical solution to meet the growing demand for large-scale cluster node label synchronization. Summary of the Invention
[0007] This invention provides an edge cluster node tag synchronization method, apparatus, electronic device, storage medium, and program product to at least partially solve the above-mentioned problems.
[0008] The first aspect of this invention provides a method for synchronizing labels on edge cluster nodes, the method comprising:
[0009] When external service call interfaces trigger the synchronization of edge cluster host resources, the current host resource information of each node device in the edge cluster is obtained from the configuration management database and compared with the pre-stored host resource information of each node device.
[0010] Determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same;
[0011] If the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, a tag synchronization message for the first node device is sent to the tag topic of Kafka, and the tag synchronization message carries the fields related to node tag synchronization.
[0012] Optionally, the method further includes:
[0013] If the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the second node device are the same, it is determined not to send a tag synchronization message for the second node device.
[0014] Update the current host resource information of each node device to the first database.
[0015] A second aspect of this invention provides a method for synchronizing labels on edge cluster nodes, the method comprising:
[0016] Based on a subscribed Kafka labeled topic, it receives labeled synchronization messages for the first node device;
[0017] Based on the tag synchronization message of the first node device, determine the current tag value of the first node device;
[0018] Compare the current tag value of the first node device with the original tag value of the first node device;
[0019] If it is determined that there is a difference between the current tag value and the original tag value, the current tag value of the first node device is updated to the second database and the first node device.
[0020] Optionally, updating the current tag value of the first node device to the second database and the first node device includes:
[0021] The first update task is to update the current tag value of the first node device to the second database, and the second update task is to update the current tag value of the first node device to the first node device.
[0022] In the event of any update task failure, the first node device label in the second database and the first node device is kept at the original label value.
[0023] Optionally, updating the current tag value of the first node device to the second database and the first node device includes:
[0024] Based on database transactions, update the current tag value of the first node device to the second database;
[0025] Obtain the cloud-edge communication method, connect to the edge cluster, and update the current tag value of the first node device to the first node device.
[0026] Optionally, the method further includes:
[0027] Receive a tag acquisition request; the tag acquisition request carries the identifier of the target node device;
[0028] In response to the tag acquisition request, the tag value of the target node device is retrieved from the second database and returned.
[0029] A third aspect of this invention provides an edge cluster node tag synchronization device, the device comprising: an underlying resource management module and an edge cluster management module;
[0030] The underlying resource management module is used for:
[0031] When external service call interfaces trigger the synchronization of edge cluster host resources, the current host resource information of each node device in the edge cluster is obtained from the configuration management database and compared with the pre-stored host resource information of each node device.
[0032] Determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same;
[0033] If the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, a tag synchronization message for the first node device is sent to the tag topic of Kafka, and the tag synchronization message carries the fields related to node tag synchronization.
[0034] The edge cluster management module is used for:
[0035] Based on a subscribed Kafka labeled topic, it receives labeled synchronization messages for the first node device;
[0036] Based on the tag synchronization message of the first node device, determine the current tag value of the first node device;
[0037] Compare the current tag value of the first node device with the original tag value of the first node device;
[0038] If it is determined that there is a difference between the current tag value and the original tag value, the current tag value of the first node device is updated to the second database and the first node device.
[0039] A fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the edge cluster node tag synchronization method as described in the first or second aspect of the present invention.
[0040] A fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the edge cluster node tag synchronization method as described in the first or second aspect of the present invention.
[0041] A sixth aspect of the present invention provides a computer program product, including a computer program / instructions, which are implemented by a processor as the steps in the edge cluster node tag synchronization method described in the first or second aspect of the present invention.
[0042] In this embodiment of the invention, the underlying resource management module and the edge cluster management module are decoupled. The underlying resource management module provides notifications of underlying resource change information to the edge cluster management micro-module by sending Kafka messages. This asynchronous communication method decouples the business logic between tag synchronization and other resource synchronization. At the same time, the consistency between the database and the tag information of the edge nodes is maintained in the edge cluster management module. Under this premise, a tag verification step is added to avoid useless cloud-edge communication, reduce the communication burden between the central node and the edge node, and improve the overall performance of the system. Attached Figure Description
[0043] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1This is a flowchart of the steps of the edge cluster node tag synchronization method provided in the embodiments of the present invention;
[0045] Figure 2 This is a flowchart of another edge cluster node label synchronization method provided in an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of the overall process of the edge cluster node tag synchronization method provided in this embodiment of the invention;
[0047] Figure 4 This is a flowchart of the underlying resource management module in the edge cluster node tag synchronization device provided in this embodiment of the invention;
[0048] Figure 5 This is a flowchart of the edge cluster management module in the edge cluster node tag synchronization device provided in this embodiment of the invention. Detailed Implementation
[0049] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0050] In an architecture where edge nodes are deployed independently of the central Kubernetes cluster for resource management, tag synchronization involves frequent communication between the cloud and the edge. Frequent communication between the central node and the edge node will increase network traffic and bandwidth resources, which may lead to a decrease in the performance of the central node and the edge node.
[0051] This invention proposes to decouple the underlying resource management module from the edge cluster management module. The underlying resource management module provides notifications of underlying resource change information to the edge cluster management micro-module by sending Kafka messages. This asynchronous communication method decouples the business logic between tag synchronization and other resource synchronization. At the same time, the consistency between the database and the tag information of the edge nodes is maintained in the edge cluster management module. Under this premise, a tag verification step is added to avoid useless cloud-edge communication, reduce the communication burden between the central node and the edge node, and improve the overall performance of the system.
[0052] Specifically, embodiments of the present invention provide a method for synchronizing edge cluster node labels, such as... Figure 1 As shown, the method includes the following steps:
[0053] S101, when the external service call interface triggers the synchronization of edge cluster host resources, the current host resource information of each node device in the edge cluster is obtained from the configuration management database and compared with the pre-stored host resource information of each node device;
[0054] S102, determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same;
[0055] S103, if it is determined that the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, a tag synchronization message for the first node device is sent to the tag topic of Kafka, and the tag synchronization message carries the fields related to node tag synchronization.
[0056] In this embodiment of the invention, an edge cluster refers to a loosely coupled computer system composed of a group of independent edge nodes. Edge nodes are computer nodes located at the network edge close to the user, providing storage, computing, and network resources. They offload some critical business applications to the edge of the access network to reduce bandwidth and latency losses caused by network transmission and multi-level forwarding. In the edge cluster, the central node is responsible for cloud-edge collaborative management: the central node plays the role of cloud management within the edge cluster, responsible for managing and scheduling the resources and applications of the edge nodes. Through communication with the edge nodes, it achieves unified management and control of edge computing tasks. The central node can run Kubernetes control plane components, such as API servers, etcd storage, and schedulers, which are responsible for cluster management and node scheduling. The central node can also use native Kubernetes methods to implement resource allocation scheduling and application deployment and maintenance for edge nodes. The central node is responsible for data synchronization with edge nodes, ensuring that the state of the edge nodes remains consistent with the cloud. For example, in the KubeEdge architecture, the edge controller is deployed in the cloud to control the synchronization of the Kubernetes API Server with the state of edge nodes, applications, and configurations. In some edge cluster solutions, the central node is also responsible for managing network access for edge nodes, such as enabling edge-cloud network access through the EdgeMesh component. In multi-regional environments, the central node can also achieve cross-network domain communication with edge nodes through specific components (such as Raven) to support centralized monitoring and maintenance.
[0057] In this embodiment of the invention, the method can be applied to a central node. Specifically, an underlying resource management module and an edge cluster management module can be deployed on the central node.
[0058] In this embodiment of the invention, each node device refers to each edge node in the edge cluster.
[0059] In this embodiment of the invention, the label refers to the labels in Kubernetes (k8s), which are key-value pairs attached to Kubernetes objects (such as Pods). For large-scale edge clusters, labels play an important role in identifying and classifying resource objects, selecting and filtering, coupling mapping, and query monitoring.
[0060] In this embodiment of the invention, steps S101 to S103 are applied to the underlying resource management module. The underlying resource management module is primarily responsible for interacting with the external AXE operations and maintenance platform to provide underlying information to the business side.
[0061] In related technologies, host resource synchronization is typically achieved through cloud-edge collaboration. Specifically, edge computing platforms such as KubeEdge provide a cloud-edge collaboration mechanism, using CloudHub and EdgeHub components to synchronize information between the cloud and the edge. CloudHub is deployed in the cloud to receive information synchronized from EdgeHub; EdgeController is deployed in the cloud to control the synchronization of the Kubernetes API Server with the state of nodes, applications, and configurations at the edge. This approach requires frequent cloud-edge communication, which can put pressure on network bandwidth and latency.
[0062] In this embodiment of the invention, when the external service call interface triggers the synchronization of edge cluster host resources, in addition to tag synchronization, it is also necessary to synchronize physical machine, network and other resources.
[0063] In this embodiment of the invention, the tag synchronization process is decoupled from other resource synchronization processes by the underlying resource management module and the edge cluster management module. This allows for updating of nodes that need tag synchronization on a node-by-node basis while other resources are being synchronized.
[0064] In this embodiment of the invention, the underlying resource management module and the edge cluster management module can be deployed as two microservices on the central node of the edge cluster.
[0065] In this embodiment of the invention, the underlying resource management module obtains the current host resource information of each node device in the edge cluster from the configuration management database (CMDB), and compares it with the pre-stored host resource information of each node device in the database to determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same. For node devices that have changed, a tag synchronization message is generated, and the edge cluster management module subsequently completes the tag synchronization based on cloud-edge communication. For node devices that have not changed, no tag synchronization message is generated, and cloud-edge communication is not required, thereby reducing the number of cloud-edge communication sessions and reducing network latency.
[0066] In this embodiment of the invention, the Configuration Management Database (CMDB) is a core component of IT Service Management (ITSM), used to store and manage information on hardware, software, network devices and other configuration items (CI) in the organization's IT environment. After the cluster host resource synchronization is triggered by the external service call interface, the latest host resource information of each node device in the cluster can be obtained from the CMDB.
[0067] Specifically, in this embodiment of the invention, the method further includes the following steps:
[0068] S104, if it is determined that the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the second node device are the same, it is determined not to send a tag synchronization message for the second node device.
[0069] S105, update the current host resource information of each node device to the first database.
[0070] In this embodiment of the invention, the fields involved in node tag synchronization include: node group identifier, node role tag, node tag, node status, node type tag, node function, and unique identifier of edge node, etc.
[0071] Specifically, the node group identifier is: In edge cluster management, the gridUniqKey field is used to specify the label key value of the node group, which is a key field for realizing node label synchronization.
[0072] Node Labels: When grouping edge nodes, it is necessary to label the nodes. The key of these labels is the same as the gridUniqKey, and the value is a unique identifier for the node group.
[0073] Unique identifier for edge nodes: When an edge node joins the cluster, it will be given a unique identifier (such as hz001.local.ffutop.com). This identifier is related to the node's label synchronization and is used to distinguish and manage different edge nodes.
[0074] Node role tags: In Kubernetes, nodes are usually tagged with role-related tags, such as node-role.kubernetes.io / master, node-role.kubernetes.io / worker, etc. These tags are also very important during node synchronization.
[0075] Edge node type label: In an edge cluster, nodes may be labeled to indicate their type, such as type=edge, which helps to identify and manage edge nodes in the cluster.
[0076] In this embodiment of the invention, the first database is a host resource database, which is managed by the underlying resource management module and is used to store the underlying host resource information of each edge node in the edge cluster.
[0077] In this embodiment of the invention, after the host resource synchronization is triggered by an external service call, the underlying resource management module can obtain the underlying resource information of the host from the CMDB and compare it with the host resource database.
[0078] The underlying resource information of the host may include: hardware specifications, system information, resource usage, hardware health status, system performance indicators, software and drivers, virtualization information, security information, environment information, configuration information, etc.
[0079] The hardware specifications include: CPU model: including CPU model, number of cores, number of threads, clock speed, etc.; memory capacity: the physical memory size of the host; storage capacity: including hard drive type (HDD / SSD), capacity, read and write speed, etc.; GPU model: including GPU model, video memory size, etc.; and network interface: including network interface card (NIC) model and speed (e.g., 1GbE, 10GbE, etc.).
[0080] System information includes: Operating system: including the type of operating system (such as Linux distribution), version, kernel version, etc.; System architecture: such as x86_64, ARM, etc.
[0081] Resource usage includes: CPU utilization: real-time or historical CPU usage; memory utilization: real-time or historical memory usage; storage utilization: disk space usage, including used and remaining space; and network traffic: real-time or historical network interface traffic data.
[0082] Hardware health status includes: Temperature: Temperature readings of hardware such as CPU, GPU, and hard drive; Fan speed: Fan speed information; Power status: Power supply status, including voltage and current; Hardware fault log: Records the history of hardware faults and system errors.
[0083] System performance metrics include: I / O performance: performance metrics for input / output operations; network latency: latency of network communication; and throughput: network and storage throughput.
[0084] Software and drivers include: system services: system services and daemons running on the host, and driver versions: driver versions for hardware devices.
[0085] Virtualization information includes: Virtual machine list: If the host supports virtualization, list detailed information for all virtual machines; Container list: If container technology is used, list detailed information for all containers.
[0086] Security information includes: Firewall rules: the host's firewall configuration and rules; Security patches: applied security patches and updates.
[0087] Environmental information includes: physical location: the physical location information of the host, and environmental monitoring: monitoring data of environmental factors such as humidity and vibration.
[0088] Configuration information includes: BIOS / UEFI settings: configuration information for the Basic Input / Output System or Unified Extensible Firmware Interface; network configuration: including network configuration information such as IP address, subnet mask, gateway, and DNS server.
[0089] In this embodiment of the invention, based on the underlying resource information of the host stored in the host resource database, the underlying resource management module can provide underlying information to the business side.
[0090] In this embodiment of the invention, when the fields related to node tag synchronization in the host resource information of a node device change, the changed fields related to node tag synchronization are further treated as resource information on a node-by-node basis to obtain a tag synchronization message, which is then sent to a Kafka tag topic (e.g., TopicK8sServerLabelData topic). Subsequently, the first database is updated based on the current host resource information of each node device obtained from the CMDB. Thus, if the relevant fields related to node tag synchronization of a certain node device do not change, no Kafka message is sent, thereby reducing the processing pressure on the edge cluster management module.
[0091] In this embodiment of the invention, the host resource information includes a large amount of information, of which only some fields are related to node label synchronization. For large-scale edge clusters, if the fields related to node label synchronization in the host resource synchronization update information of a certain node have not changed, the node label synchronization of the corresponding node can be omitted. Only for nodes whose fields related to node label synchronization have changed, a label synchronization message is generated for node label synchronization. This reduces the processing pressure on the edge cluster management module. In addition, updating the information in the first database based on the obtained current host resource information can ensure that the host resource information in the first database is up-to-date in real time, thus providing underlying information for the business side.
[0092] The edge cluster node label synchronization method provided in this embodiment of the invention can decouple the business logic between label synchronization and other resource synchronization, can efficiently and reliably synchronize edge node labels, and reduce the communication burden between the central node and the edge node, thereby improving the overall performance of the system.
[0093] This invention also provides a method for synchronizing edge cluster node labels, such as... Figure 2 As shown, the method includes the following steps:
[0094] S201, based on the subscribed Kafka label topic, receives label synchronization messages for the first node device.
[0095] S202, based on the tag synchronization message of the first node device, determine the current tag value of the first node device.
[0096] S203, compare the current tag value of the first node device with the original tag value of the first node device.
[0097] S204, if it is determined that there is a difference between the current tag value and the original tag value, the current tag value of the first node device is updated to the second database and the first node device.
[0098] In this embodiment of the invention, the above steps S201 to S204 can be executed by the edge cluster management module, which is mainly responsible for setting and verifying the tag value, updating the tag to the database and edge nodes, and communicating asynchronously between the underlying resource management module and the edge cluster management module through Kafka.
[0099] In this embodiment of the invention, the edge cluster management module subscribes to a Kafka tag topic (e.g., the TopicK8sServerLabelData topic) to receive tag synchronization messages from the underlying resource management module. Upon receiving a tag synchronization message, the tag synchronization logic is triggered.
[0100] Specifically, in this embodiment of the invention, the edge cluster management module can parse the relevant fields of the underlying host resource information from the received Kafka message, namely the fields involving node label synchronization (including: node role field, node status field, node attribute field, node function field), and set the label value for the corresponding node device according to the relevant business logic, which is set as NewLabels.
[0101] In this embodiment of the invention, the technical means for determining the current tag value of the first node device can be any mature technical means in the relevant technology.
[0102] For example, key fields can be identified based on host resource information, including those related to node tag synchronization. Tag keys and values are defined according to business logic. For instance, if the business logic requires categorizing resources by department, the tag key could be "department," and the tag value could be the specific department name, such as "R&D Department" or "Marketing Department."
[0103] In this embodiment of the invention, the edge cluster management module can read the original label of the first node device from the second database, set as OldLabels, and compare the label NewLabels to be updated to the edge node with the original label OldLabels to see if they are completely consistent. If they are completely consistent, the subsequent process is terminated, thereby reducing the pressure on cloud-edge communication. If they are inconsistent, the current label value of the first node device is updated to the second database and the first node device.
[0104] Specifically, in this embodiment of the invention, step S204 includes: updating the current tag value of the first node device to the second database as a first update task, and updating the current tag value of the first node device to the first node device as a second update task; in the event that either update task fails, maintaining the first node device tag in the second database and the first node device at the original tag value.
[0105] In this embodiment of the invention, during the node label update process, updating the second database and updating the edge nodes are treated as an indivisible work unit. The operations of updating the labels of the first node devices in the second database and updating the labels of the first node devices in the edge nodes are either all completed or none are completed. This ensures the consistency of the labels of each node device in the second database with the node labels in the edge cluster.
[0106] Specifically, if the tag value update of the first node device fails, the data in the second database can be rolled back so that the corresponding data is the tag value before the update.
[0107] Specifically, in this embodiment of the invention, step S204 includes:
[0108] S2041, based on database transactions, update the current tag value of the first node device to the second database.
[0109] S2042, Obtain the cloud-edge communication method, connect to the edge cluster, and update the current tag value of the first node device to the first node device.
[0110] In this embodiment of the invention, the edge cluster management module can update the current tag value of the first node device to the second database by initiating a database transaction. By acquiring the cloud-edge communication method, the module connects the cloud and the edge cluster, and updates the current tag value of the first node device to the first node device via cloud-edge communication.
[0111] Specifically, in this embodiment of the invention, the method further includes the following steps:
[0112] S21, Receive a tag acquisition request; the tag acquisition request carries the identifier of the target node device;
[0113] S22, in response to the tag acquisition request, retrieve the tag value of the target node device from the second database and return it.
[0114] In this embodiment of the invention, a second database is maintained in the cloud through the edge cluster management module, and the tags of the node devices stored in the second database are kept consistent with the tag information of the edge nodes. As a result, other services can communicate directly with the cloud and obtain the tags of the node devices from the second database without accessing the edge cluster.
[0115] For ease of understanding, the following is combined with Figure 3 The edge cluster node tag synchronization method provided in the embodiments of the present invention will be explained and described. Figure 3 This diagram illustrates the overall process of the edge cluster node tag synchronization method provided in an embodiment of the present invention:
[0116] like Figure 3 As shown in this embodiment of the invention, operations and maintenance personnel can trigger host resource synchronization by calling an interface through an external service (e.g., the AXE operations and maintenance platform). The underlying resource management module configured in the cloud or central node obtains the current host resource information of each node device in the edge cluster from the configuration management database (CMDB), compares it with the pre-stored host resource information of each node device in the database, and determines whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same. For the node devices that have changed, a tag synchronization message is generated and pushed to the Kafka tag topic as a resource synchronization message. The edge cluster management module receives Kafka messages by subscribing to the Kafka tag topic, obtains the underlying host resource information, generates tag values based on the fields related to node tag synchronization, and synchronizes the tag values to the database and the corresponding edge nodes to complete the tag synchronization if the tag values are inconsistent with the original tag values.
[0117] In this embodiment of the invention, during the tag synchronization process, if message sending fails during the process of the underlying resource management module sending a message to Kafka, or Kafka pushing a message to the edge cluster management module, Kafka will return a push failure message to the underlying resource management module. The underlying resource management module can then return an error to the external interface, indicating that tag synchronization has failed. If both the process of the underlying resource management module sending a message to Kafka and the process of Kafka pushing a message to the edge cluster management module are successful, Kafka will return a push success message to the underlying resource management module. The underlying resource management module can then return a tag synchronization request success message to the external interface.
[0118] In this embodiment of the invention, after the external service triggers host resource synchronization, the underlying resource management module can query the underlying resources and generate a tag synchronization message to send to Kafka. Kafka can send the tag synchronization message to the edge cluster management module through asynchronous message passing. After receiving the Kafka message, the edge cluster management module processes the tag synchronization business.
[0119] Therefore, in this embodiment of the invention, the underlying resource management module is decoupled from the edge cluster management module. By sending Kafka messages, notifications of underlying resource changes are provided to the edge cluster management module. This asynchronous communication method decouples the business logic between tag synchronization and other resource synchronization. It avoids frequent cloud-edge communication, reduces the communication burden between the central node and edge nodes, and improves the overall system performance.
[0120] Based on the same inventive concept, this invention also provides an edge cluster node tag synchronization device, the device comprising: a bottom-level resource management module and an edge cluster management module;
[0121] The underlying resource management module is used for:
[0122] When an external service call interface triggers edge cluster host resource synchronization, the current host resource information of each node device in the edge cluster is obtained from the configuration management database and compared with the pre-stored host resource information of each node device. It is then determined whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same. If it is determined that the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, a tag synchronization message for the first node device is sent to the tag topic of Kafka. The tag synchronization message carries the fields related to node tag synchronization.
[0123] The edge cluster management module is used for:
[0124] Based on a subscribed Kafka labeled topic, it receives labeled synchronization messages for the first node device;
[0125] Based on the tag synchronization message of the first node device, the current tag value of the first node device is determined; the current tag value of the first node device is compared with the original tag value of the first node device; if it is determined that there is a difference between the current tag value and the original tag value, the current tag value of the first node device is updated to the second database and the first node device.
[0126] Specifically, the underlying resource management module is also used to: determine not to send a tag synchronization message for the second node device if the fields involving node tag synchronization in the current host resource information and the pre-stored host resource information of the second node device are the same; and update the current host resource information of each node device to the first database.
[0127] In this embodiment of the invention, the edge cluster node label synchronization device can be deployed on the central node in the edge cluster.
[0128] Specifically, the edge cluster management module is also used for:
[0129] The first update task is to update the current tag value of the first node device to the second database, and the second update task is to update the current tag value of the first node device to the first node device. If either update task fails, the tag of the first node device in the second database and the first node device is kept at the original tag value.
[0130] Specifically, the edge cluster management module is also used to: update the current tag value of the first node device to the second database based on database transactions; obtain the cloud-edge communication method, connect to the edge cluster, and update the current tag value of the first node device to the first node device.
[0131] Specifically, the edge cluster management module is also used for:
[0132] Receive a tag acquisition request; the tag acquisition request carries the identifier of the target node device; in response to the tag acquisition request, retrieve the tag value of the target node device from the second database and return it.
[0133] For ease of understanding, the following is combined with Figure 4 The edge cluster node tag synchronization method provided in the embodiments of the present invention will be explained and described. Figure 4 The flowchart of the underlying resource management module is shown.
[0134] In this embodiment of the invention, after the host resource synchronization is triggered by an external service call, the underlying resource management module obtains the host underlying resource information from the CMDB and compares it with the host resource database; it determines whether the fields involving node tag synchronization have changed. If there is no change, no Kafka message is sent and the tag synchronization process ends. If there is a change, a tag synchronization message is sent to the Kafka tag topic (TopicK8sServerLabelData topic), and the host resource database is updated based on the obtained host underlying resource information.
[0135] For ease of understanding, the following is combined with Figure 5 The edge cluster node tag synchronization method provided in the embodiments of the present invention will be explained and described. Figure 5 The flowchart of the edge cluster management module is shown.
[0136] In this embodiment of the invention, the edge cluster management module subscribes to a Kafka label topic (TopicK8sServerLabelData). Upon receiving a message, it parses the message body, extracts the fields related to node label synchronization, sets the current label value NewLabels for the corresponding node according to business logic, and further reads the original label value OldLabels of the corresponding node from the label database. It then determines whether NewLabels and OldLabels are completely consistent. If they are consistent, it is determined that label synchronization is not required, and it continues to wait for new Kafka messages. If they are not completely consistent, a database transaction is initiated to update the label database, thereby obtaining the cloud-edge communication method, connecting to the edge cluster, and updating the edge cluster node labels. If the edge node label update fails, a database rollback is performed to ensure that the labels of each node device in the label database are consistent with the node labels in the edge cluster.
[0137] Therefore, in this embodiment of the invention, the underlying resource management module and the edge cluster management module communicate asynchronously through Kafka messages. Different resource types use different message topics for synchronization, which decouples the business logic between the underlying resource management module and the edge cluster management module, as well as the business logic between tag synchronization and other resource synchronization.
[0138] In this embodiment of the invention, multiple comparisons and verifications between the underlying resource management module and the edge cluster management module avoid invalid message transmission and synchronization operations, reduce the communication burden between services and between central nodes and edge nodes, and improve the overall performance of the system.
[0139] In this embodiment of the invention, database transactions are used to maintain the consistency between the database and the tag information of the edge nodes, so that other services can directly obtain tags from the database without accessing the edge cluster.
[0140] In this embodiment of the invention, the underlying resource management module and the edge cluster management module communicate asynchronously via Kafka messages, decoupling the various business modules, reducing dependencies between them, and allowing each module to be upgraded, optimized, or expanded independently. Furthermore, both the underlying resource management module and the edge cluster management module can perform data comparison and verification, avoiding invalid message transmission and synchronization operations, maintaining the consistency of the database and edge node tag information, and allowing other services to directly obtain tags from the database, reducing the communication burden between services and between central and edge nodes, and improving the overall system performance.
[0141] The technical solution provided by this invention can be applied to scenarios requiring efficient and accurate synchronization of tags for a large number of edge cluster nodes. Especially in scenarios combining cloud computing and edge computing with large-scale edge clusters, the technical solution provided by this invention can achieve cloud-edge collaborative tag synchronization, optimize resource utilization, and improve data processing efficiency.
[0142] Specifically, tag synchronization involves communication between the cloud and the edge. For large-scale edge clusters, if traditional methods are used to synchronize tags for each edge node individually, it will result in frequent cloud-edge communication, putting pressure on network bandwidth and latency. The efficient, reliable, and cost-effective technical solution proposed in this invention can meet the growing demand for tag synchronization of large-scale cluster nodes.
[0143] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the edge cluster node tag synchronization method as described in any of the above embodiments.
[0144] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the edge cluster node tag synchronization method described in any of the above embodiments.
[0145] Based on the same inventive concept, embodiments of the present invention provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the edge cluster node tag synchronization method described in any of the above embodiments.
[0146] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0147] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0148] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (apparatus), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0150] These computer program instructions can also be loaded onto a computer or other programmable terminal device to cause a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0151] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0152] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0153] The above provides a detailed description of the edge cluster node label synchronization method provided by the present invention. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for synchronizing tag information of edge cluster nodes, characterized in that, The method includes: The underlying resource management module is used to retrieve the current host resource information of each node device in the edge cluster from the configuration management database when the edge cluster host resource synchronization is triggered by an external service call interface, and compare it with the pre-stored host resource information of each node device; determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; if it is determined that the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, send a tag synchronization message for the first node device to the tag topic of Kafka, wherein the tag synchronization message carries the fields related to node tag synchronization; The edge cluster management module is used to receive label synchronization messages for the first node device based on the subscribed Kafka label topics; determine the current label value of the first node device based on the label synchronization message of the first node device; compare the current label value of the first node device with the original label value of the first node device; and update the current label value of the first node device to the second database and the first node device if it is determined that there is a difference between the current label value and the original label value.
2. The edge cluster node label synchronization method according to claim 1, characterized in that, The method further includes: If the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the second node device are the same, it is determined not to send a tag synchronization message for the second node device. Update the current host resource information of each node device to the first database.
3. The edge cluster node tag synchronization method according to claim 1, characterized in that, Updating the current tag value of the first node device to the second database and the first node device includes: The first update task is to update the current tag value of the first node device to the second database, and the second update task is to update the current tag value of the first node device to the first node device. In the event of any update task failure, the first node device label in the second database and the first node device is kept at the original label value.
4. The edge cluster node label synchronization method according to claim 1, characterized in that, Updating the current tag value of the first node device to the second database and the first node device includes: Based on database transactions, update the current tag value of the first node device to the second database; Obtain the cloud-edge communication method, connect to the edge cluster, and update the current tag value of the first node device to the first node device.
5. The edge cluster node label synchronization method according to any one of claims 1 to 4, characterized in that, The method further includes: Receive a tag acquisition request; the tag acquisition request carries the identifier of the target node device; In response to the tag acquisition request, the tag value of the target node device is retrieved from the second database and returned.
6. An edge cluster node tag synchronization device, characterized in that, The device includes: a low-level resource management module and an edge cluster management module; The underlying resource management module is used for: When external service call interfaces trigger the synchronization of edge cluster host resources, the current host resource information of each node device in the edge cluster is obtained from the configuration management database and compared with the pre-stored host resource information of each node device. Determine whether the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; If the fields related to node tag synchronization in the current host resource information and the pre-stored host resource information of the first node device are different, a tag synchronization message for the first node device is sent to the tag topic of Kafka, and the tag synchronization message carries the fields related to node tag synchronization. The edge cluster management module is used for: Based on a subscribed Kafka labeled topic, it receives labeled synchronization messages for the first node device; Based on the tag synchronization message of the first node device, determine the current tag value of the first node device; Compare the current tag value of the first node device with the original tag value of the first node device; If it is determined that there is a difference between the current tag value and the original tag value, the current tag value of the first node device is updated to the second database and the first node device.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the edge cluster node label synchronization method according to any one of claims 1-2 or the edge cluster node label synchronization method according to any one of claims 3-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the edge cluster node label synchronization method according to any one of claims 1-2 or the edge cluster node label synchronization method according to any one of claims 3-6.
9. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the edge cluster node label synchronization method according to any one of claims 1-5.