Edge cluster node label synchronization method and device, electronic equipment, storage medium and program product
By decoupling the underlying resource management module with the edge cluster management module in the edge cluster, and using Kafka messages for asynchronous communication, tag synchronization is only performed when necessary, the cloud-edge communication pressure problem caused by tag synchronization in large-scale edge clusters is solved, and the system performance is improved.
Patent Information
- Application Number
- CN202411716289.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-27
AI Technical Summary
In large-scale edge clusters, traditional methods synchronize labels to edge nodes one by one, resulting in frequent cloud-edge communication, increasing the pressure of network bandwidth and delay, and the host synchronization process consumes a lot of resources and takes a long time.
By decoupling the underlying resource management module and the edge cluster management module, Kafka messages are used for asynchronous communication. Only when the fields involving node tag synchronization in the host resource information of the node device change, tag synchronization messages are generated and cloud-edge communication is performed to avoid invalid cloud-edge communication.
It reduces the communication burden between the central node and the edge node, improves the overall performance of the system, and achieves efficient and reliable edge cluster node label synchronization.
Smart Images

Figure CN119788689A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of edge computing technology, and in particular to an edge cluster node label synchronization method, device, electronic device, storage medium and program product. Background Art
[0002] An edge cluster is a loosely coupled computer system consisting of a group of independent edge nodes. Edge nodes refer to computer nodes at the edge of the network close to users, providing storage, computing, network and other resources, and sinking some key 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 an important role in edge computing systems. Edge cluster node labels are used to identify and classify individual nodes in an edge cluster. Each node can be assigned one or more labels that describe the characteristics, functions, and other information of the node. Related business components can identify and distinguish different nodes based on labels, facilitating the organization and allocation of resources.
[0004] Label synchronization refers to labeling edge cluster nodes accordingly based on factors such as the node's attributes, functions, roles, and status.
[0005] Asset tags are used to distinguish asset usage, which facilitates the management of edge cluster assets. In the field of edge computing, edge nodes are usually deployed independently of the center (also known as the cloud) to manage Kubernetes cluster resources. When synchronizing tags, the cloud needs to obtain information such as the status, role, and asset tags of edge nodes from the operation and maintenance platform, set the tags of each edge node according to the tag synchronization logic, and store the set tags in the database and update them to the edge nodes. When triggering host synchronization, physical machines, topologies, tags, etc. will be synchronized, which means that tag synchronization is a link 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 edge nodes one by one, frequent cloud-edge communication will be caused, which will put pressure on network bandwidth and latency. In addition to tag synchronization, the host synchronization process also synchronizes resources such as physical machines and networks. Therefore, large-scale edge cluster host synchronization is a process that consumes a lot of resources and takes a long time.
[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] Embodiments of the present invention provide an edge cluster node label synchronization method, device, electronic device, storage medium and program product to at least partially solve the above problems.
[0008] A first aspect of an embodiment of the present invention provides a method for synchronizing labels of edge cluster nodes, the method comprising: When the external service calls the interface to trigger the synchronization of the 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 label synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; When it is determined that the fields related to node label synchronization in the current host resource information of the first node device and the pre-stored host resource information are different, a label synchronization message for the first node device is sent to the label topic of Kafka, and the label synchronization message carries the fields related to node label synchronization.
[0009] Optionally, the method further comprises: When it is determined that the fields related to node label synchronization in the current host resource information of the second node device and the pre-stored host resource information are the same, determining not to send a label synchronization message for the second node device; The current host resource information of each node device is updated to the first database.
[0010] A second aspect of an embodiment of the present invention provides a method for synchronizing labels of edge cluster nodes, the method comprising: Based on the subscribed Kafka tag topic, receive a tag synchronization message for the first node device; Determine a current label value of the first node device based on the label synchronization message of the first node device; Comparing the current label value of the first node device with the original label value of the first node device; When it is determined that there is a difference between the current label value and the original label value, the current label value of the first node device is updated to the second database and the first node device.
[0011] Optionally, updating the current label value of the first node device to the second database and the first node device includes: Updating the current label value of the first node device to the second database as a first update task, and updating the current label value of the first node device to the first node device as a second update task; In the event of failure of any update task, the first node device label in the second database and the first node device is maintained as the original label value.
[0012] Optionally, updating the current label value of the first node device to the second database and the first node device includes: Based on the database transaction, updating the current label value of the first node device to the second database; Obtain a cloud-edge communication mode, connect to an edge cluster, and update the current label value of the first node device to the first node device.
[0013] Optionally, the method further comprises: Receive a label acquisition request; the label acquisition request carries an identifier of a target node device; In response to the label acquisition request, the label value of the target node device is acquired from the second database and returned.
[0014] A third aspect of an embodiment of the present invention provides an edge cluster node label synchronization device, the device comprising: an underlying resource management module and an edge cluster management module; The bottom layer resource management module is used for: When the external service calls the interface to trigger the synchronization of the 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 label synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; When it is determined that the fields related to node label synchronization in the current host resource information of the first node device and the pre-stored host resource information are different, a label synchronization message for the first node device is sent to the label topic of Kafka, where the label synchronization message carries the fields related to node label synchronization; The edge cluster management module is used to: Based on the subscribed Kafka tag topic, receive a tag synchronization message for the first node device; Determine a current label value of the first node device based on the label synchronization message of the first node device; Comparing the current label value of the first node device with the original label value of the first node device; When it is determined that there is a difference between the current label value and the original label value, the current label value of the first node device is updated to the second database and the first node device.
[0015] A fourth aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when executed, the processor implements the edge cluster node label synchronization method as described in the first aspect or the second aspect of the present invention.
[0016] A fifth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for synchronizing edge cluster node labels as described in the first aspect or the second aspect of the present invention is implemented.
[0017] A sixth aspect of an embodiment of the present invention provides a computer program product, including a computer program / instruction, which is implemented by a processor to implement the steps in the edge cluster node label synchronization method as described in the first aspect or the second aspect of the present invention.
[0018] In an embodiment of the present invention, the underlying resource management module is decoupled from the edge cluster management module. The underlying resource management module provides notifications of underlying resource change information to the edge cluster management micromodule by sending Kafka messages. This asynchronous communication method decouples the business logic between label synchronization and other resource synchronization. At the same time, the consistency of the database and edge node label information is maintained in the edge cluster management module. Under this premise, a label verification link 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0020] Figure 1 It is a flowchart of the steps of the edge cluster node label synchronization method provided by an embodiment of the present invention; Figure 2 It is a flowchart of another method for synchronizing labels of edge cluster nodes provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of the overall process of the edge cluster node label synchronization method provided by an embodiment of the present invention; Figure 4 It is a workflow diagram of the underlying resource management module in the edge cluster node label synchronization device provided by an embodiment of the present invention; Figure 5 It is a working flow diagram of an edge cluster management module in an edge cluster node label synchronization device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] Considering that in an architecture where edge nodes are deployed independently of the central Kubernetes cluster to manage resources, label 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, and may cause performance degradation of the central node and edge nodes.
[0023] The embodiment of the present invention proposes: decoupling the underlying resource management module from the edge cluster management module, and the underlying resource management module provides notification of underlying resource change information to the edge cluster management micromodule by sending Kafka messages. This asynchronous communication method decouples the business logic between label synchronization and other resource synchronization; at the same time, the consistency of database and edge node label information is maintained in the edge cluster management module. Under this premise, a label verification link is added to avoid useless cloud-edge communication, reduce the communication burden between central nodes and edge nodes, and improve the overall performance of the system.
[0024] Specifically, an embodiment of the present invention provides a method for synchronizing labels of edge cluster nodes, such as Figure 1 As shown, the method comprises the following steps: S101, when an external service calls an interface to trigger synchronization of host resources in an edge cluster, obtain current host resource information of each node device in the edge cluster from a configuration management database, and compare it with pre-stored host resource information of each node device; S102, determining whether the fields related to node label synchronization in the current host resource information of each node device and the pre-stored host resource information are the same; S103, when it is determined that the fields related to node label synchronization in the current host resource information of the first node device and the pre-stored host resource information are different, a label synchronization message for the first node device is sent to the label topic of Kafka, and the label synchronization message carries the fields related to node label synchronization.
[0025] In an embodiment of the present invention, an edge cluster refers to a loosely coupled computer system consisting of a group of independent edge nodes. An edge node refers to a computer node on the edge side of a network close to a user, providing storage, computing, network and other resources, sinking some key business applications to the edge of the access network to reduce the bandwidth and delay loss caused by network transmission and multi-level forwarding. In an edge cluster, the central node is responsible for cloud-edge collaborative management: the central node plays the role of cloud management in the edge cluster, responsible for managing and scheduling the resources and applications of edge nodes. It realizes unified management and control of edge computing tasks through communication with edge nodes. The central node can run Kubernetes control plane components such as API server, etcd storage and scheduler, which are responsible for cluster management and node scheduling. The central node can also use Kubernetes native methods to realize resource allocation scheduling and application deployment and maintenance of edge nodes. The central node is responsible for data synchronization with edge nodes to ensure that the status of edge nodes is consistent with the cloud. For example, in the KubeEdge architecture, the edgecontroller is deployed in the cloud to control the state synchronization of Kubernetes API Server with edge nodes, applications and configurations. In some edge cluster solutions, the central node is also responsible for managing the network access of edge nodes, such as implementing edge cloud network access through EdgeMesh components. In a multi-region environment, the central node can also implement cross-network domain communication with edge nodes through specific components (such as Raven) to support centralized monitoring and operation.
[0026] In the embodiment of the present 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 in the central node.
[0027] In the embodiment of the present invention, the node devices refer to edge nodes in an edge cluster.
[0028] In the embodiment of the present invention, labels refer to labels in k8s (Kubernetes), which are key-value pairs attached to Kubernetes objects (such as Pods). For large-scale edge clusters, labels play an important role in the identification classification, selection and filtering, coupling mapping, query monitoring, etc. of resource objects.
[0029] In the embodiment of the present invention, the above steps S101 to S103 are applied to the underlying resource management module. The underlying resource management module is mainly responsible for interacting with the external AXE operation and maintenance platform for underlying information and providing underlying information to the business side.
[0030] In related technologies, host resource synchronization is usually completed through cloud-edge collaboration. Specifically, edge computing platforms such as KubeEdge provide a cloud-edge collaboration mechanism to achieve information synchronization between the cloud and the edge through CloudHub and EdgeHub components. CloudHub is deployed in the cloud and receives information synchronized to the cloud by edgehub; EdgeController is deployed in the cloud to control the state synchronization of Kubernetes API Server and edge nodes, applications, and configurations. This solution requires frequent cloud-edge communication, which will put pressure on network bandwidth and latency.
[0031] In the embodiment of the present invention, when an external service calls an interface to trigger synchronization of edge cluster host resources, in addition to label synchronization, synchronization of physical machines, networks and other resources is also required.
[0032] In the embodiment of the present invention, label synchronization is decoupled from other resource synchronization processes through the underlying resource management module and the edge cluster management module, and nodes that need label synchronization can be updated on a node-by-node basis while other resources are being synchronized.
[0033] In the embodiment of the present invention, the underlying resource management module and the edge cluster management module can be deployed on the central node of the edge cluster in the form of two microservices.
[0034] In the embodiment of the present invention, the current host resource information of each node device in the edge cluster is obtained from the configuration management database (CMDB) through the underlying resource management module, and compared with the pre-stored host resource information of each node device pre-stored in the database to determine whether the fields related to node label synchronization in the current host resource information of each node device and the pre-stored host resource information are the same. A label synchronization message is generated for the node device that has changed, and the edge cluster management module subsequently completes the label synchronization based on the cloud-edge communication. For the node device that has not changed, no label synchronization message is generated, and there is no need for cloud-edge communication, thereby reducing the number of cloud-edge communications and reducing network latency.
[0035] In an embodiment of the present invention, a configuration management database (CMDB) is a core component in IT service management (ITSM), which is used to store and manage information about hardware, software, network devices and other configuration items (CI) in an organization's IT environment. After an external service call interface triggers cluster host resource synchronization, the latest host resource information of each node device in the cluster can be obtained from the CMDB.
[0036] Specifically, in the embodiment of the present invention, the method further includes the following steps: S104: When it is determined that the fields related to node label synchronization in the current host resource information of the second node device and the pre-stored host resource information are the same, determine not to send a label synchronization message for the second node device.
[0037] S105: Update the current host resource information of each node device to the first database.
[0038] In the embodiment of the present invention, the fields involved in node label synchronization include: node group identification, node role label, node label, node status, node type label, node function, unique identification of edge node, etc.
[0039] The node grouping identifier is specifically as follows: In edge cluster management, the gridUniqKey field is used to indicate the label key value (label key) of the node grouping, which is the key field for achieving node label synchronization.
[0040] Node label: When grouping edge nodes, you need to label the nodes. The key of these labels is consistent with gridUniqKey, and the value is the unique identifier of the node group.
[0041] Unique identifier of edge nodes: When an edge node joins a cluster, it will have 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.
[0042] Node role labels: In Kubernetes, nodes are usually labeled with role-related labels, such as node-role.kubernetes.io / master, node-role.kubernetes.io / worker, etc. These labels are also very important when synchronizing nodes.
[0043] Edge node type label: In an edge cluster, nodes may be labeled with labels indicating their types, such as type=edge, which helps to identify and manage edge nodes in the cluster.
[0044] In the embodiment of the present invention, the first database is a host resource database, which is managed by an underlying resource management module and is used to store the host underlying resource information of each edge node in the edge cluster.
[0045] In the embodiment of the present invention, after the external service call triggers the host resource synchronization, the underlying resource management module can obtain the host underlying resource information from the CMDB and compare it with the host resource database.
[0046] Among them, the host underlying resource information may include: hardware specification information, system information, resource usage, hardware health status, system performance indicators, software and drivers, virtualization information, security information, environmental information, configuration information, etc.
[0047] Among them, the hardware specification information includes: CPU model: including CPU model, number of cores, number of threads, main frequency, etc., memory capacity: the physical memory size of the host, storage capacity: including hard disk type (HDD / SSD), capacity, read and write speed, etc., GPU model: including GPU model, video memory size, etc., network interface: including network interface card (NIC) model and speed (such as 1GbE, 10GbE, etc.).
[0048] System information includes: operating system: including operating system type (such as Linux distribution), version, kernel version, etc. System architecture: such as x86_64, ARM, etc.
[0049] Resource usage includes: CPU usage: real-time or historical CPU usage, memory usage: real-time or historical memory usage, storage usage: disk space usage, including used and remaining space, network traffic: real-time or historical traffic data of the network interface.
[0050] Hardware health status includes: Temperature: temperature readings of CPU, GPU, hard disk and other hardware, 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.
[0051] System performance indicators include: I / O performance: performance indicators of input / output operations, network latency: latency of network communication, throughput: throughput of network and storage.
[0052] Software and drivers include: System services: system services and daemons running on the host, Driver version: driver version of the hardware device.
[0053] Virtualization information includes: Virtual machine list: If the host supports virtualization, it lists the detailed information of all virtual machines; Container list: If container technology is used, it lists the detailed information of all containers.
[0054] Security information includes: Firewall rules: the host's firewall configuration and rules, Security patches: applied security patches and updates.
[0055] Environmental information includes: physical location: the physical location information of the host, environmental monitoring: monitoring data of environmental factors such as humidity and vibration.
[0056] The configuration information includes: BIOS / UEFI settings: configuration information of the basic input and output system or unified extensible firmware interface, network configuration: including network configuration information such as IP address, subnet mask, gateway, DNS server, etc.
[0057] In the embodiment of the present invention, based on the host underlying resource information stored in the host resource database, the underlying resource management module can provide underlying information to the service side.
[0058] In an embodiment of the present invention, when a field related to node label synchronization changes in the host resource information of a node device, the changed field related to node label synchronization is further used as resource information in units of nodes to obtain a label synchronization message, which is sent to the label topic of Kafka (for example, TopicK8sServerLabelData topic). After that, the first database is updated based on the current host resource information of each node device obtained from the CMDB; therefore, if the relevant fields related to node label synchronization of a node device have not changed, the Kafka message is not sent, thereby reducing the processing pressure of the edge cluster management module.
[0059] In an embodiment of the present invention, the host resource information includes a large amount of information, of which only some fields are related to node label synchronization. For a large-scale edge cluster, 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 may not be performed, and only a label synchronization message is generated for the node where the fields related to node label synchronization have changed to perform node label synchronization. In this way, the processing pressure of the edge cluster management module can be reduced. In addition, the information in the first database can be updated based on the current host resource information obtained, so that the host resource information in the first database can be real-time and up-to-date, so as to provide underlying information for the business side.
[0060] The edge cluster node label synchronization method provided by the embodiment of the present invention can decouple the business logic between label synchronization and other resource synchronization, synchronize edge node labels efficiently and reliably, reduce the communication burden between central nodes and edge nodes, and improve the overall performance of the system.
[0061] The embodiment of the present invention also provides a method for synchronizing labels of edge cluster nodes. Figure 2 As shown, the method comprises the following steps: S201, receiving a label synchronization message for a first node device based on a subscribed Kafka label topic.
[0062] S202: Determine a current label value of the first node device based on the label synchronization message of the first node device.
[0063] S203: Compare the current label value of the first node device with the original label value of the first node device.
[0064] S204: When it is determined that there is a difference between the current label value and the original label value, update the current label value of the first node device to the second database and the first node device.
[0065] In an embodiment of the present invention, the above steps S201~S204 can be executed by the edge cluster management module, which is mainly responsible for setting and verifying the label value, updating the label to the database and edge nodes, and the underlying resource management module and the edge cluster management module communicate asynchronously through Kafka.
[0066] In the embodiment of the present invention, the edge cluster management module subscribes to the label topic of Kafka (for example, TopicK8sServerLabelData topic), thereby receiving the label synchronization message from the underlying resource management module. When the label synchronization message is received, the label synchronization logic is triggered.
[0067] Specifically, in an embodiment of the present invention, the edge cluster management module can parse the relevant fields of the underlying host resource information from the received Kafka message, that is, the fields involved in 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 to NewLabels.
[0068] In the embodiment of the present invention, the technical means for determining the current label value of the first node device may adopt any mature technical means in the relevant technology.
[0069] For example, you can identify key fields based on host resource information, including fields related to node label synchronization. Define the key and value of the label based on business logic. For example, if the business logic needs to classify resources by department, the label key can be "department" and the label value can be a specific department name, such as "R&D Department", "Marketing Department", etc.
[0070] In the embodiment of the present invention, the edge cluster management module can read the original label of the first node device from the second database, set it 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 of 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.
[0071] Specifically, in an embodiment of the present invention, step S204 includes: updating the current label value of the first node device to the second database as a first update task, and updating the current label value of the first node device to the first node device as a second update task; in the event of failure of any update task, keeping the first node device label in the second database and the first node device as the original label value.
[0072] In the embodiment of the present invention, during the update process of the node label, the update of the second database and the update of the edge node are regarded as an indivisible work unit, and the operation of updating the label of the first node device in the second database and updating the label of the first node device in the edge node is either completed in full or not completed in full. Thus, the consistency of the label of each node device in the second database and the node label in the edge cluster is ensured.
[0073] Specifically, when the label value of the first node device fails to be updated, the data of the second database can be rolled back so that the corresponding data is the label value before the update.
[0074] Specifically, in the embodiment of the present invention, step S204 includes: S2041: Based on a database transaction, update the current label value of the first node device to a second database.
[0075] S2042: Obtain a cloud-edge communication mode, connect to an edge cluster, and update a current label value of the first node device to the first node device.
[0076] In an embodiment of the present invention, the edge cluster management module can update the current label value of the first node device to the second database by opening a database transaction, connect the cloud and the edge cluster by acquiring a cloud-edge communication method, and update the current label value of the first node device to the first node device through cloud-edge communication.
[0077] Specifically, in the embodiment of the present invention, the method further includes the following steps: S21, receiving a label acquisition request; the label acquisition request carries an identifier of a target node device; S22, in response to the label acquisition request, obtain the label value of the target node device from the second database and return it.
[0078] In an embodiment of the present invention, a second database is maintained in the cloud through the edge cluster management module, and the labels of the node devices stored in the second database are kept consistent with the label information of the edge nodes. Therefore, other services can communicate directly with the cloud and obtain the labels of the node devices from the second database without accessing the edge cluster.
[0079] For ease of understanding, the following combination Figure 3 The edge cluster node label synchronization method provided by the embodiment of the present invention is explained. Figure 3 The overall process diagram of the edge cluster node label synchronization method provided by an embodiment of the present invention is shown: like Figure 3 As shown, in an embodiment of the present invention, the operation and maintenance personnel can trigger the synchronization of host resources by calling the interface through an external service (for example: AXE operation and maintenance platform), and 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), and compares it with the pre-stored host resource information of each node device pre-stored in the database to determine whether the current host resource information of each node device and the fields involved in node label synchronization in the pre-stored host resource information are the same. A label synchronization message is generated for the node device that has changed and pushed to the label topic of Kafka as a resource synchronization message. The edge cluster management module receives the Kafka message by subscribing to the label topic of Kafka, obtains the underlying host resource information, generates a label value based on the field involved in node label synchronization, and synchronizes the label value to the database and the corresponding edge node to complete the label synchronization when the label value is inconsistent with the original label paper.
[0080] In the embodiment of the present invention, during the process of tag synchronization, when the underlying resource management module sends a message to Kafka, or when Kafka pushes a message to the edge cluster management module, if there is a message sending failure, Kafka returns a push failure message to the underlying resource management module, and then the underlying resource management module can return an error to the external interface, indicating that the tag synchronization failed. If 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 both successful, Kafka returns a push success message to the underlying resource management module, and then the underlying resource management module can return a tag synchronization request success message to the external interface.
[0081] In an embodiment of the present invention, after an external service triggers host resource synchronization, the underlying resource management module can query the underlying resources and generate a label synchronization message to send to Kafka. Kafka can send the label synchronization message to the edge cluster management module through asynchronous messaging. The edge cluster management module processes the label synchronization service after receiving the Kafka message.
[0082] Therefore, in the embodiment of the present invention, the underlying resource management module is decoupled from the edge cluster management module, and the edge cluster management module is notified of underlying resource change information by sending Kafka messages. This asynchronous communication method decouples the business logic between label synchronization and other resource synchronization. Frequent cloud-edge communication can be avoided, the communication burden between the central node and the edge node can be reduced, and the overall performance of the system can be improved.
[0083] Based on the same inventive concept, an embodiment of the present invention further provides an edge cluster node label synchronization device, the device comprising: an underlying resource management module and an edge cluster management module; The bottom layer resource management module is used for: When the external service call interface triggers the synchronization of the host resources of the edge cluster, 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 determined whether the fields involving node label synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; when it is determined that the fields involving node label synchronization in the current host resource information and the pre-stored host resource information of the first node device are not the same, a label synchronization message for the first node device is sent to the label topic of Kafka, and the label synchronization message carries the fields involved in node label synchronization.
[0084] The edge cluster management module is used to: Based on the subscribed Kafka tag topic, receive a tag synchronization message for the first node device; Based on the label synchronization message of the first node device, determine the current label value 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; when it is determined that there is a difference between the current label value and the original label value, update the current label value of the first node device to the second database and the first node device.
[0085] Specifically, the underlying resource management module is also used to: when it is determined that the current host resource information of the second node device is the same as the field involving node label synchronization in the pre-stored host resource information, determine not to send a label synchronization message for the second node device; and update the current host resource information of each node device to the first database.
[0086] In the embodiment of the present invention, the edge cluster node label synchronization device may be deployed in a central node in the edge cluster.
[0087] Specifically, the edge cluster management module is further used to: Updating the current label value of the first node device to the second database is used as a first update task, and updating the current label value of the first node device to the first node device is used as a second update task; in the event of failure of any update task, keeping the first node device label in the second database and the first node device as the original label value.
[0088] Specifically, the edge cluster management module is further used to: based on a database transaction, update the current label value of the first node device to the second database; obtain a cloud-edge communication method, connect to the edge cluster, and update the current label value of the first node device to the first node device.
[0089] Specifically, the edge cluster management module is further used to: A label acquisition request is received; the label acquisition request carries the identification of the target node device; in response to the label acquisition request, a label value of the target node device is acquired from the second database and returned.
[0090] For ease of understanding, the following combination Figure 4 The edge cluster node label synchronization method provided by the embodiment of the present invention is explained. Figure 4 The following figure shows the workflow diagram of the underlying resource management module.
[0091] In an embodiment of the present invention, after an external service call triggers host resource synchronization, the underlying resource management module obtains the host underlying resource information from the CMDB and compares it with the host resource database; determines whether the fields involved in node label synchronization have changed. If there is no change, no Kafka message is sent and the label synchronization process ends. If there is a change, a label synchronization message is sent to the label topic of Kafka (TopicK8sServerLabelData topic), and the host resource database is updated based on the acquired host underlying resource information.
[0092] For ease of understanding, the following combination Figure 5 The edge cluster node label synchronization method provided by the embodiment of the present invention is explained. Figure 5 The edge cluster management module workflow diagram is shown.
[0093] In an embodiment of the present invention, the edge cluster management module subscribes to the label topic (TopicK8sServerLabelData topic) of Kafka. When 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 the business logic, further reads the original label value OldLabels of the corresponding node from the label database, and determines whether NewLabels is completely consistent with OldLabels. If they are consistent, it is determined that label synchronization is not required, and continues to wait for new Kafka messages. If they are not completely consistent, it starts a database transaction, updates the label database, and then obtains the cloud-edge communication mode, connects to the edge cluster, and updates the edge cluster node labels. If the edge node label update fails, the database is rolled back to ensure that the labels of each node device in the label database are consistent with the node labels in the edge cluster.
[0094] Therefore, in an embodiment of the present invention, the underlying resource management module and the edge cluster management module communicate asynchronously through Kafka messages, and different resource types use different message Topics for synchronization, which not only decouples the business logic of the underlying resource management module and the edge cluster management module, but also decouples the business logic between label synchronization and other resource synchronization.
[0095] In the embodiment of the present invention, multiple comparisons and checks between the underlying resource management module and the edge cluster management module are performed to avoid invalid message transmission and synchronization operations, reduce the communication burden between services and between the central node and the edge nodes, and improve the overall performance of the system.
[0096] In the embodiment of the present invention, the consistency of the database and the edge node label information is maintained through database transactions, and other services can directly obtain labels from the database without accessing the edge cluster.
[0097] In the embodiment of the present invention, the underlying resource management module and the edge cluster management module communicate asynchronously through Kafka messages, which realizes the decoupling of various business modules and reduces the dependence between various business modules. Each module can be independently upgraded, optimized or expanded. In addition, in the embodiment of the present invention, both the underlying resource management module and the edge cluster management module can perform data comparison and verification, avoid invalid message transmission and synchronization operations, maintain the consistency of database and edge node label information, and other businesses can directly obtain labels from the database, reduce the communication burden between services and between central nodes and edge nodes, and improve the overall performance of the system.
[0098] The technical solution provided by the embodiment of the present invention can be applied to scenarios where a large number of edge cluster node labels need to be synchronized efficiently and accurately. In particular, in scenarios where cloud computing and edge computing are combined and the edge cluster is large in scale, the technical solution provided by the embodiment of the present invention can achieve cloud-edge collaborative label synchronization, optimize resource utilization, and improve data processing efficiency.
[0099] Specifically, label synchronization involves communication between the cloud and the edge. For large-scale edge clusters, if the traditional method is used to synchronize labels of edge nodes one by one, frequent cloud-edge communication will result, which will put pressure on network bandwidth and latency. The efficient, reliable, and cost-saving technical solution proposed in the embodiment of the present invention can meet the growing demand for label synchronization of large-scale cluster nodes.
[0100] Based on the same inventive concept, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes, the steps in the edge cluster node label synchronization method described in any of the above embodiments are implemented.
[0101] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the edge cluster node label synchronization method described in any of the above embodiments are implemented.
[0102] Based on the same inventive concept, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the edge cluster node label synchronization method described in any of the above embodiments.
[0103] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0104] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product 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 codes.
[0105] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (apparatus), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0108] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0109] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0110] The above is a detailed introduction to an edge cluster node label synchronization method provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for synchronizing labels of edge cluster nodes, characterized in that: The method comprises: When the external service calls the interface to trigger the synchronization of the 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 label synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; When it is determined that the fields related to node label synchronization in the current host resource information of the first node device and the pre-stored host resource information are different, a label synchronization message for the first node device is sent to the label topic of Kafka, and the label synchronization message carries the fields related to node label synchronization.
2. The edge cluster node label synchronization method according to claim 1, characterized in that: The method further comprises: When it is determined that the fields related to node label synchronization in the current host resource information of the second node device and the pre-stored host resource information are the same, determining not to send a label synchronization message for the second node device; The current host resource information of each node device is updated to the first database.
3. A method for synchronizing labels of edge cluster nodes, characterized in that: The method comprises: Based on the subscribed Kafka tag topic, receive a tag synchronization message for the first node device; Determine a current label value of the first node device based on the label synchronization message of the first node device; Comparing the current label value of the first node device with the original label value of the first node device; When it is determined that there is a difference between the current label value and the original label value, the current label value of the first node device is updated to the second database and the first node device.
4. The edge cluster node label synchronization method according to claim 3, characterized in that: Updating the current label value of the first node device to the second database and the first node device includes: Updating the current label value of the first node device to the second database as a first update task, and updating the current label value of the first node device to the first node device as a second update task; In the event of failure of any update task, the first node device label in the second database and the first node device is maintained as the original label value.
5. The edge cluster node label synchronization method according to claim 3, characterized in that: Updating the current label value of the first node device to the second database and the first node device includes: Based on the database transaction, updating the current label value of the first node device to the second database; Obtain a cloud-edge communication mode, connect to an edge cluster, and update the current label value of the first node device to the first node device.
6. The edge cluster node label synchronization method according to any one of claims 3 to 5, characterized in that: The method further comprises: Receive a label acquisition request; the label acquisition request carries an identifier of a target node device; In response to the label acquisition request, the label value of the target node device is acquired from the second database and returned.
7. An edge cluster node label synchronization device, characterized in that: The device comprises: an underlying resource management module and an edge cluster management module; The bottom layer resource management module is used for: When the external service calls the interface to trigger the synchronization of the 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 label synchronization in the current host resource information and the pre-stored host resource information of each node device are the same; When it is determined that the fields related to node label synchronization in the current host resource information of the first node device and the pre-stored host resource information are different, a label synchronization message for the first node device is sent to the label topic of Kafka, where the label synchronization message carries the fields related to node label synchronization; The edge cluster management module is used to: Based on the subscribed Kafka tag topic, receive a tag synchronization message for the first node device; Determine a current label value of the first node device based on the label synchronization message of the first node device; Comparing the current label value of the first node device with the original label value of the first node device; When it is determined that there is a difference between the current label value and the original label value, the current label value of the first node device is updated to the second database and the first node device.
8. 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, the edge cluster node label synchronization method described in any one of claims 1-2 or the edge cluster node label synchronization method described in any one of claims 3-6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the edge cluster node label synchronization method described in any one of claims 1-2 or the edge cluster node label synchronization method described in any one of claims 3-6 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps in the edge cluster node label synchronization method described in any one of claims 1-2 or the edge cluster node label synchronization method described in any one of claims 3-6 are implemented.
Citation Information
Patent Citations
Label authority management method and system based on big data cluster resources
CN112307494A
Data synchronization method and device based on cross-domain edge node, equipment and medium
CN112804313A
Kafka-based high-concurrency data acquisition and distribution edge system
CN116431324A
Multi-cluster monitoring scheduling method, device and equipment and readable storage medium
CN116599875A
Kubernetes-based service container scheduling method and system under cloud edge collaboration
CN118337786A