Edge node access method, device, equipment and medium
By setting up proxy components in an edge computing environment and calculating hash values based on edge node names for allocation, the access problem of edge nodes in an unstable network environment is solved, and the rapid response and load balancing of edge node access requests is achieved, ensuring high performance and stability of access services.
Patent Information
- Application Number
- CN202412000434.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Edge nodes are difficult to effectively manage in an environment of unstable network and dispersed locations. Traditional load balancing methods lead to uneven load distribution, delayed requests or failed access due to frequent disconnection of network connections.
By presetting several proxy components, calculating the hash value according to the name of the edge node, allocating the corresponding proxy components to receive access requests, and synchronizing re-access and resource information when necessary, ensuring dynamic access and high availability of edge nodes.
It realizes efficient matching and load balancing between edge nodes and proxy components, ensures rapid response and processing of edge node access requests, avoids the problem of linear increase in resource consumption with the increase of edge nodes, supports dynamic access of edge nodes and ensures high performance and stability of access services.
Smart Images

Figure CN119814786A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cache technology, and in particular to an edge node access method, device, equipment and medium. Background Art
[0002] With the continuous advancement of Internet of Things (IoT) technology, more and more devices such as intelligent transportation systems and remote monitoring equipment are deployed at the edge of the network to collect and process data. Compared with nodes in traditional data centers, these edge nodes have the characteristics of dispersed locations, complex network environments, and poor connection stability.
[0003] In order to effectively manage these edge nodes, container technology and its orchestration tools, especially Kubernetes, have become the industry standard. As an open source container orchestration engine, Kubernetes' main functions include automated deployment of container applications, application expansion, and application lifecycle management. However, the particularity of the edge computing environment, such as network instability, makes it difficult for traditional data center node management methods to cope with it. In related technologies, load balancers are deployed in the cloud to distribute loads through algorithms such as randomness, load, and number of connections. However, since the network connection between the edge node and the cloud may be frequently disconnected, it is difficult for the load balancer to work continuously and effectively, resulting in problems such as uneven load distribution, request delays, or access failures. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an edge node access method, device, equipment and medium. The specific technical solutions are as follows:
[0005] In a first aspect of the implementation of the present invention, a method for accessing an edge node is first provided, the method comprising:
[0006] Pre-set several proxy components;
[0007] When receiving the names of several edge nodes, performing hash value calculation according to the name of each edge node to obtain a first hash value;
[0008] Allocating a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component;
[0009] Receiving an access request of the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node;
[0010] Access the edge node in response to the access request.
[0011] Optionally, after the step of accessing the edge node in response to the access request, the method includes:
[0012] In response to a restart instruction or a preset edge area network disconnection recovery event, determining a re-access time interval according to a pre-acquired access time of each edge node and a current time corresponding to each edge node;
[0013] An access request from the edge node is received according to the re-access time interval.
[0014] Optionally, after the step of accessing the edge node in response to the access request, the method includes:
[0015] After sending the target message to the edge node, persisting the target message and generating a persistent rollback version;
[0016] The persisting the target message comprises:
[0017] Storing the target message in a preset shared memory, where the shared memory is used to store the target message sent by each proxy component to each edge node;
[0018] After the step of persisting the target message and generating a persistent rollback version, the method further includes:
[0019] When the proxy component corresponding to any of the edge nodes is in a faulty state, re-determining a replacement proxy component corresponding to the edge node;
[0020] Comparing the current persistent rollback version with the latest persistent rollback version corresponding to the cluster through the replacement proxy component;
[0021] If the first version number corresponding to the current persistent rollback version is consistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the current persistent rollback version is sent to the edge node;
[0022] If the first version number corresponding to the current persistent rollback version is inconsistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the latest persistent rollback version is sent to the edge node.
[0023] Optionally, allocating the corresponding proxy component to the edge node according to the first Hash value and a pre-acquired second Hash value corresponding to the proxy component includes:
[0024] Obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component;
[0025] Find a proxy component corresponding to the second hash value that is the same as the first hash value, and use the proxy component as the proxy component of the edge node.
[0026] Optionally, after the step of obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component, the method includes:
[0027] If the second hash value identical to the first hash value does not exist, the proxy component that appears for the first time is determined among all the proxy components in a preset order, and the proxy component that appears for the first time is used as the proxy component of the edge node.
[0028] Optionally, after the step of accessing the edge node in response to the access request, the method includes:
[0029] When it is detected that the number of edge nodes connected to each of the proxy components in any cluster is greater than a first preset threshold, the number of corresponding proxy components is increased; the cluster is used to manage the edge nodes;
[0030] When it is detected that the resource usage rate of each of the proxy components in any one of the clusters is greater than a second preset threshold, increasing the corresponding number of the proxy components;
[0031] When it is detected that there is a timeout error log in the pre-acquired server log, the number corresponding to the cluster is increased;
[0032] When it is detected that the resource usage rate in any one of the clusters is greater than a third preset threshold, the corresponding number of the cluster is increased.
[0033] Optionally, after the step of accessing the edge node in response to the access request, the method includes:
[0034] When it is detected that the resource usage of all the proxy components in any cluster is less than a fourth preset threshold, the corresponding number of the proxy components is reduced; the cluster is used to manage the edge node.
[0035] In a second aspect of the implementation of the present invention, an edge node access device is also provided, the device comprising:
[0036] A setting module, used to pre-set several proxy components;
[0037] A calculation module, configured to, when receiving the names of a plurality of edge nodes, perform hash value calculation on the name of each edge node to obtain a first hash value;
[0038] an allocating module, configured to allocate a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component;
[0039] A receiving module, configured to receive an access request from the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node;
[0040] An access module is used to access the edge node in response to the access request.
[0041] In a third aspect of the implementation of the present invention, there is also provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;
[0042] The processor is used to read the program in the memory to implement the edge node access method as described in any one of the first aspects.
[0043] In a fourth aspect of the implementation of the present invention, a readable storage medium is further provided, and when the program is executed by a processor, the edge node access method as described in any one of the first aspects is implemented.
[0044] The edge node access method provided in the embodiment of the present invention pre-sets several proxy components; when receiving the names of several edge nodes, the name of each edge node is hashed to obtain a first hash value; the corresponding proxy component is allocated to the edge node according to the first hash value and the second hash value corresponding to the proxy component obtained in advance; the access request of the corresponding edge node is received through the proxy component, and each proxy component corresponds to at least one edge node; and the edge node is accessed in response to the access request. In the embodiment of the present invention, through the hash value calculation and the allocation of proxy components, efficient matching and load balancing of edge nodes and proxy components are achieved, ensuring rapid response and processing of edge node access requests. Only the hash value of the edge node name is calculated, so resource consumption will not increase linearly with the increase of edge nodes. By setting the proxy component to support dynamic access of edge nodes, the proxy component can be expanded and reduced in capacity later, which can ensure high performance and stability of access services. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0046] Figure 1 A flowchart of a method for accessing an edge node provided by an embodiment of the present invention;
[0047] Figure 2is a device block diagram of an edge node access device provided by an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of a communication device provided by an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of an exemplary edge node access architecture provided by an embodiment of the present invention;
[0050] Figure 5 It is a schematic diagram of an exemplary decision algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it can be understood by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable readers to better understand the present invention. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present invention can also be implemented. The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0052] It should be noted that in the embodiment of the present invention, the overall application scenario architecture refers to Figure 4 As shown, an edge node access method architecture specifically includes two parts: a cloud cluster and an edge node. In an embodiment of the present invention, the edge nodes are managed to achieve dynamic access between the edge nodes and the cloud when there are a large number of edge nodes.
[0053] Among them, there can be at least one k8s cluster on the cloud, each k8s cluster can include cluster management components, proxy components, decision components and detection components, and multi-cluster management components are also deployed on the cloud to manage and schedule multiple clusters.
[0054] Specifically, multi-cluster management component: This component manages multiple k8s clusters in a unified manner and displays all edge nodes. Through this component, you can choose to distribute container applications to a specific edge node.
[0055] Cluster management component: The unified management of edge nodes is implemented using an edge computing framework based on K8S. A K8S cluster consists of management nodes and computing nodes. The node that deploys this component is called a management node. The edge node is a computing node in the K8S cluster. The management component can use the K8S native component. Three copies are used during specific deployment to achieve high availability.
[0056] Proxy component: The process of connecting computing nodes of native K8S or KubeEdge / OpenYurt to the cluster is as follows: All edge nodes register with the management component. Since each management component caches the metadata of all edge nodes and container applications on the nodes, it cannot be linearly expanded. Such an architecture has performance bottlenecks when facing large-scale edge nodes. Therefore, a horizontally scalable proxy component is designed and deployed in the cloud, and edge nodes (computing nodes) are connected to the K8S cluster through the proxy component.
[0057] Decision-making component: Design and deploy decision-making components in the cloud. Before accessing the proxy component, the edge node first asks the decision-making component which proxy component to use to access the cluster, and then accesses the cluster based on the returned proxy component access address.
[0058] Detection component: A detection module is designed on the cloud to detect whether the current cloud proxy component has a performance bottleneck. If so, it needs to be expanded, or it needs to be reduced as the number of edge nodes decreases.
[0059] Reference Figure 4 ,It can be seen that the dynamic access and management of massive ,edge nodes are realized through multi-level distributed edge node access ,access, and edge nodes can be automatically and dynamically ,expanded according to the number of edge nodes and access load, and the consistent ,hashing algorithm is used to ensure the balance and high availability of edge node access.
[0060] Reference Figure 1 , shows a flowchart of the steps of an edge node access method provided by an embodiment of the present invention, and the method may include:
[0061] Step 101, pre-set several proxy components;
[0062] Step 102, when receiving the names of several edge nodes, performing hash value calculation according to the name of each edge node to obtain a first hash value;
[0063] It should be noted that in an embodiment of the present invention, a decision component is designed and deployed in the cloud. Before accessing the proxy component, the edge node first asks the decision component through which proxy component to access the cluster, and accesses according to the returned proxy component access address.
[0064] Therefore, first, it is necessary to allocate proxy components to the edge nodes to be accessed, wherein the edge nodes calculate the hash value according to the node name to obtain the first hash value, for example, as shown in the attached Figure 2 As shown, edge node 1 calculates a hash value of 80.
[0065] Step 103: assigning a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component;
[0066] Further, the allocating the corresponding proxy component to the edge node according to the first hash value and the pre-acquired second hash value corresponding to the proxy component includes:
[0067] Obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component;
[0068] Find a proxy component corresponding to the second hash value that is the same as the first hash value, and use the proxy component as the proxy component of the edge node.
[0069] Further, after the step of obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component, the method includes:
[0070] If the second hash value identical to the first hash value does not exist, the proxy component that appears for the first time is determined among all the proxy components in a preset order, and the proxy component that appears for the first time is used as the proxy component of the edge node.
[0071] It should be noted that, in the embodiment of the present invention, the first address and port information corresponding to each proxy component is obtained to perform hash value calculation to obtain a second hash value. Specifically, the IP+Port combination of the proxy component is hashed to obtain a second hash value, for example, a value of 0 to 1023 is obtained. The edge node is hashed according to the node name and is also mapped to the range of 0 to 1023. At this time, the decision component can return a proxy component equal to the hash value of the edge node name. If it cannot be found, the first proxy component is found clockwise, for example, Figure 5 As shown, edge node 1 calculates a hash value of 80, and cannot find a proxy component equal to 80. The first proxy component can be found clockwise, that is, proxy component 2 with a hash value of 500 in the figure.
[0072] It should be noted that in the hash calculation process, when the edge node is connected, it is necessary to provide the edge node name, and a random string is uniformly generated through the decision component, for example, edgenode-xxx, where xxx is a randomly generated string. By converting the edge node name into a random string, the balance of the edge nodes falling into the consistent hash proxy component instance can be improved.
[0073] Step 104: receiving an access request of the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node;
[0074] It should be noted that, in the embodiment of the present invention, after the proxy component is determined, the access request of the corresponding edge node is received through the proxy component.
[0075] Specifically, after a proxy component is selected, the proxy component is called to generate an edge node access command, which is then added with the token of the decision component and returned to the edge node.
[0076] Among them, the token of the decision component is that a unified token authentication management center can be provided in the decision component. In this way, a token is provided when returning the access address to the return access node. When the proxy component receives the access request from the edge node, it can verify the validity in the token authentication management center of the decision component based on the token provided by the edge node.
[0077] Step 105: Access the edge node in response to the access request.
[0078] The proxy component is responsible for receiving access requests from edge nodes and then sending the requests to the cluster management component to register the edge nodes. At the same time, the proxy component records the information of the edge nodes, including name, IP, session, etc.
[0079] When the management component needs to send an instruction to an edge node, the proxy component listens to the instruction and forwards it to the corresponding edge node through the session.
[0080] It should be noted that in the embodiment of the present invention, each proxy component is only responsible for the access and management of some edge nodes, so the metadata maintained by each proxy component is also within a relatively predictable value, so the resource consumption of a single proxy component will not increase with the increase in the number of overall edge nodes, so that horizontal expansion can be performed. A proxy component can only belong to one K8S cluster, and a single K8S cluster can have multiple proxy components. During initialization, only one cluster and one proxy component can be deployed. As the number of edge nodes increases, the number of proxy components can be expanded.
[0081] In addition, in the embodiment of the present invention, the proxy component exposes an edge node access address on the network accessible by the edge node, which includes information such as IP, port number, access token, etc., where token is the authentication information during access. At the same time, an interface for generating access commands needs to be provided for the decision component to call.
[0082] In one embodiment, after the step of accessing the edge node in response to the access request, the method includes:
[0083] In response to a restart instruction or a preset edge area network disconnection recovery event, determining a re-access time interval according to a pre-acquired access time of each edge node and a current time corresponding to each edge node;
[0084] An access request from the edge node is received according to the re-access time interval.
[0085] It should be noted that, in an embodiment of the present invention, when the management node of the cloud is restarted (in response to a restart instruction) or the edge area network is restored (in response to a pre-set edge area network recovery event), all or a large number of edge nodes will reconnect to the cloud at the same time, resulting in an instantaneous bottleneck. Therefore, at this time, the proxy component adopts a preset backoff algorithm, that is, re-access after different time window lengths.
[0086] Specifically, the preset backoff algorithm is: use the difference in seconds between the time when the edge node accesses the cloud and the current time of the edge node, modulo 100, and use the remainder as the interval time for re-access, so that different edge nodes will randomly re-access the cloud within 100 seconds.
[0087] In another embodiment, after the step of accessing the edge node in response to the access request, the method includes:
[0088] After sending the target message to the edge node, persisting the target message and generating a persistent rollback version;
[0089] The persisting the target message comprises:
[0090] Storing the target message in a preset shared memory, where the shared memory is used to store the target message sent by each proxy component to each edge node;
[0091] It should be noted that in the embodiment of the present invention, the latest message that the proxy component has sent to the edge node is persisted, and shared storage is used between different proxy components to achieve data sharing. The message here is the resource change information in K8S, such as Pod, Service, etc.
[0092] After the step of persisting the target message and generating a persistent rollback version, the method further includes:
[0093] When the proxy component corresponding to any of the edge nodes is in a faulty state, re-determining a replacement proxy component corresponding to the edge node;
[0094] Comparing the current persistent rollback version with the latest persistent rollback version corresponding to the cluster through the replacement proxy component;
[0095] If the first version number corresponding to the current persistent rollback version is consistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the current persistent rollback version is sent to the edge node;
[0096] If the first version number corresponding to the current persistent rollback version is inconsistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the latest persistent rollback version is sent to the edge node.
[0097] It should be noted that in the embodiment of the present invention, the health status of the proxy components can be detected by the detection component. If some proxy components fail, they need to be removed from the consistent hash ring to prevent the edge node from connecting to the failed proxy components.
[0098] The specific detection method is as follows: it is carried out through multiple detections. If it is judged as a fault multiple times within a specified time, it is finally a fault. The judgment method is to obtain an edge node access command as a healthy mark.
[0099] Therefore, when a proxy component fails, the proxy component that takes over continues to send messages after being redistributed by the edge nodes of the decision component.
[0100] Since changes in resources in K8S will correspond to a specific version number revision, when the new proxy component is resent, you only need to compare whether the current persistent reversion is consistent with the latest revision of K8S.
[0101] Specifically, if the first version number corresponding to the current persistent rollback version is consistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the sending can continue.
[0102] If the first version number corresponding to the current persistent rollback version is inconsistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, that is, the sent version is older, the latest version resource information is sent.
[0103] In addition, in the embodiment of the present invention, if only a short restart occurs, the memory cache messages will also be lost, and it is also necessary to compare the sent and unsent messages instead of resending all the messages.
[0104] In another embodiment, after the step of accessing the edge node in response to the access request, the method includes:
[0105] When it is detected that the number of edge nodes connected to each of the proxy components in any cluster is greater than a first preset threshold, the number of corresponding proxy components is increased; the cluster is used to manage the edge nodes;
[0106] When it is detected that the resource usage rate of each of the proxy components in any one of the clusters is greater than a second preset threshold, increasing the corresponding number of the proxy components;
[0107] When it is detected that there is a timeout error log in the pre-acquired server log, the number corresponding to the cluster is increased;
[0108] When it is detected that the resource usage rate in any one of the clusters is greater than a third preset threshold, the corresponding number of the cluster is increased.
[0109] It should be noted that in the embodiment of the present invention, by setting up the proxy component, the performance of the proxy component can be detected, and the proxy component and the cluster deployed in the cloud can be processed accordingly according to the current performance, for example, expansion or reduction.
[0110] Specifically, the edge nodes are connected to the cluster through the proxy component, and then the cluster will manage the connected edge nodes. Access proxy component expansion: There are two methods. One is to set the maximum number of edge nodes for proxy access. When most instances in the proxy component reach a percentage of the maximum number, such as 80%, the proxy component instance is expanded; the other is that the resources of the proxy component reach a performance bottleneck, including CPU, memory, and network bandwidth. As long as one resource reaches a bottleneck, such as CPU exceeds 80% of the total, it needs to be expanded. The two methods can also be combined. When the number of connected edge nodes exceeds a certain value, the resource pool performance bottleneck detection is performed to avoid resource consumption caused by detecting resource performance utilization when there are too few nodes.
[0111] Opportunity for multi-cluster expansion: The management components of a single cluster are mainly etcd and apiserver, which have performance bottlenecks. The constraints are CPU, memory, and network bandwidth. Therefore, under the premise of a single cluster, the proxy components cannot be infinitely expanded to achieve access to massive edge nodes. It is necessary to horizontally expand multiple clusters and add proxy components to the newly added clusters. The detection method is: first, regularly check the apiserver logs, and if there are timeout error logs, add a new cluster; second, check whether the CPU, memory, and network bandwidth performance of the cluster has reached a bottleneck, such as if the usage rate exceeds a percentage, such as 80%. The goal of this invention is not to manage massive edge nodes through massive clusters, but to further expand the scale of edge nodes managed by a single cluster and control the number of clusters to a smaller order of magnitude. One is to save resources, and the other is to reduce the complexity of management.
[0112] In addition, in the embodiment of the present invention, after a performance bottleneck is detected, multiple execution strategies are supported: 1) The most conservative strategy: an alarm is issued to prompt the expansion of the proxy component or the expansion of the cluster, and the expansion is performed manually; 2) A medium strategy: the decision module is notified to deny access to the edge node to ensure the stability of the existing system; 3) An automated strategy: the automatic expansion mechanism is triggered, and the system that needs to be automatically expanded is accessed.
[0113] In another embodiment, after the step of accessing the edge node in response to the access request, the method includes:
[0114] When it is detected that the resource usage of all the proxy components in any cluster is less than a fourth preset threshold, the corresponding number of the proxy components is reduced; the cluster is used to manage the edge node.
[0115] It should be noted that, in the embodiment of the present invention, in addition to the above-mentioned capacity expansion, it is also possible to determine whether the capacity can be reduced based on the resource utilization of edge nodes and proxy components, thereby dynamically reducing the overall system loss.
[0116] Specifically, when it is detected that the overall processing of the proxy components is below a certain resource utilization rate, the number of proxy components is reduced to save resource consumption. The specific detection method is: poll the CPU, memory and network bandwidth of each proxy component. If each indicator is below a certain threshold, such as 30%, the proxy components are reduced one by one to avoid the impact of reducing the proxy components at the same time and causing a large number of edge nodes to access at the same time. After reaching a certain threshold, such as 60%, stop reducing the proxy components. Since the cross-cluster migration of container applications will occur when shrinking the cluster, it will affect the business continuity of edge applications. Therefore, the cluster will only be reduced when there are no edge nodes in a cluster.
[0117] In addition, in an embodiment of the present invention, after the edge nodes are reduced, the proxy components can also be reduced accordingly, and can be directly removed from the hash ring, and the corresponding component services can be shut down. The edge nodes of the original proxies of the reduced components will be re-connected, and new nodes will be allocated according to the new consistent hashing algorithm when re-connected.
[0118] In addition, refer to Figure 4 It can be seen that the embodiment of the present invention can further expand the scale of edge nodes managed by a single cluster, and can also realize the unified management of ultra-large-scale edge nodes. At the same time, through the elastic access of automatic load perception, the dynamic access and launch of edge nodes are met, which reduces the overall operation and management complexity and resource consumption level. The system performance is monitored in real time through the performance detection component, combined with the automatic expansion mechanism, the adaptive expansion of the system is realized, and the stability and response speed of the system are guaranteed.
[0119] The edge node access method provided in the embodiment of the present invention pre-sets several proxy components; when receiving the names of several edge nodes, a hash value is calculated according to the name of each edge node to obtain a first hash value; a corresponding proxy component is allocated to the edge node according to the first hash value and a second hash value corresponding to the proxy component obtained in advance; an access request of the corresponding edge node is received through the proxy component, and each proxy component corresponds to at least one edge node; and the edge node is accessed in response to the access request. In the embodiment of the present invention, efficient matching and load balancing of edge nodes and cloud proxy components are achieved through hash value calculation and allocation of proxy components, ensuring rapid response and processing of edge node access requests. The cloud only calculates the hash value of the edge node name, so resource consumption will not increase linearly with the increase of edge nodes. By setting proxy components to support dynamic access of edge nodes, the proxy components can be expanded and reduced in capacity later, ensuring high performance and stability of cloud access services.
[0120] Reference Figure 2 , shows a schematic diagram of the structure of an edge node access device provided by an embodiment of the present invention, the device comprising:
[0121] A setting module 201, used to pre-set a number of proxy components;
[0122] A calculation module 202, configured to, when receiving the names of several edge nodes, perform hash value calculation on the name of each edge node to obtain a first hash value;
[0123] An allocating module 203, configured to allocate a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component;
[0124] A receiving module 204, configured to receive an access request of the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node;
[0125] The access module 205 is configured to access the edge node in response to the access request.
[0126] The edge node access device provided in the embodiment of the present invention pre-sets several proxy components. When receiving the names of several edge nodes, a hash value is calculated for the name of each edge node to obtain a first hash value; a corresponding proxy component is allocated to the edge node according to the first hash value and a second hash value corresponding to the proxy component obtained in advance; an access request of the corresponding edge node is received through the proxy component, and each proxy component corresponds to at least one edge node; and the edge node is accessed in response to the access request. In the embodiment of the present invention, efficient matching and load balancing of edge nodes and proxy components are achieved through hash value calculation and proxy component allocation, ensuring rapid response and processing of edge node access requests. Only the hash value of the edge node name is calculated, so resource consumption will not increase linearly with the increase of edge nodes. By setting proxy components to support dynamic access of edge nodes, the proxy components can be expanded and reduced in capacity later, ensuring high performance and stability of access services.
[0127] The embodiment of the present invention also provides a communication device, such as Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0128] Memory 303, used for storing computer programs;
[0129] The processor 301, when used to execute the program stored in the memory 303, can implement the following steps:
[0130] Pre-set several proxy components;
[0131] When receiving the names of several edge nodes, performing hash value calculation according to the name of each edge node to obtain a first hash value;
[0132] Allocating a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component;
[0133] Receiving an access request of the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node;
[0134] Access the edge node in response to the access request.
[0135] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits together, which are all well known in the art, so this article will not further describe them. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor can be transmitted on a wired medium or on a wireless medium through an antenna. Further, the antenna also receives data and transmits the data to the processor. The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory can be used to store data used by the processor when performing operations.
[0136] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0137] The communication interface is used for communication between the above terminal and other devices.
[0138] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0139] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0140] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the edge node access method described in any of the above embodiments.
[0141] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the edge node access method described in any one of the above embodiments.
[0142] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0143] 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 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 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 device including the elements.
[0144] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0145] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An edge node access method, characterized in that: The method comprises: Pre-set several proxy components; When receiving the names of several edge nodes, performing hash value calculation according to the name of each edge node to obtain a first hash value; Allocating a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component; Receiving an access request of the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node; Access the edge node in response to the access request.
2. The method according to claim 1, characterized in that After the step of accessing the edge node in response to the access request, the method includes: In response to a restart instruction or a preset edge area network disconnection recovery event, determining a re-access time interval according to a pre-acquired access time of each edge node and a current time corresponding to each edge node; An access request from the edge node is received according to the re-access time interval.
3. The method according to claim 1, characterized in that After the step of accessing the edge node in response to the access request, the method includes: After sending the target message to the edge node, persisting the target message and generating a persistent rollback version; The persisting the target message comprises: Storing the target message in a preset shared memory, where the shared memory is used to store the target message sent by each proxy component to each edge node; After the step of persisting the target message and generating a persistent rollback version, the method further includes: When the proxy component corresponding to any of the edge nodes is in a faulty state, re-determining a replacement proxy component corresponding to the edge node; Comparing the current persistent rollback version with the latest persistent rollback version corresponding to the cluster through the replacement proxy component; If the first version number corresponding to the current persistent rollback version is consistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the current persistent rollback version is sent to the edge node; If the first version number corresponding to the current persistent rollback version is inconsistent with the second version number corresponding to the latest persistent rollback version corresponding to the cluster, the resource information corresponding to the latest persistent rollback version is sent to the edge node.
4. The method according to claim 1, characterized in that: The allocating the corresponding proxy component to the edge node according to the first hash value and the pre-acquired second hash value corresponding to the proxy component includes: Obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component; Find a proxy component corresponding to the second hash value that is the same as the first hash value, and use the proxy component as the proxy component of the edge node.
5. The method according to claim 1, characterized in that After the step of obtaining the first address and port information corresponding to each proxy component and performing hash value calculation to obtain a second hash value corresponding to each proxy component, the method includes: If the second hash value identical to the first hash value does not exist, the proxy component that appears for the first time is determined among all the proxy components in a preset order, and the proxy component that appears for the first time is used as the proxy component of the edge node.
6. The method according to claim 1, characterized in that After the step of accessing the edge node in response to the access request, the method includes: When it is detected that the number of edge nodes connected to each of the proxy components in any cluster is greater than a first preset threshold, the number of corresponding proxy components is increased; the cluster is used to manage the edge nodes; When it is detected that the resource usage rate of each of the proxy components in any one of the clusters is greater than a second preset threshold, increasing the corresponding number of the proxy components; When it is detected that there is a timeout error log in the pre-acquired server log, the number corresponding to the cluster is increased; When it is detected that the resource usage rate in any one of the clusters is greater than a third preset threshold, the corresponding number of the cluster is increased.
7. The method according to claim 1, characterized in that After the step of accessing the edge node in response to the access request, the method includes: When it is detected that the resource usage of all the proxy components in any cluster is less than a fourth preset threshold, the corresponding number of the proxy components is reduced; the cluster is used to manage the edge node.
8. An edge node access device, characterized in that: The device comprises: A setting module, used to pre-set several proxy components; A calculation module, configured to, when receiving the names of several edge nodes, perform hash value calculation according to the name of each edge node to obtain a first hash value; an allocating module, configured to allocate a corresponding proxy component to the edge node according to the first hash value and a pre-acquired second hash value corresponding to the proxy component; A receiving module, configured to receive an access request from the corresponding edge node through the proxy component, each of the proxy components corresponding to at least one edge node; An access module is used to access the edge node in response to the access request.
9. A communication device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the edge node access method according to any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the edge node access method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
System for detecting abnormity of proxy cache cluster based on automatic computing
CN103441906A
Internet of Things terminal node access control method
CN114553604A
Method and device for processing connection allocation, equipment and storage medium
CN114625527A
Service identifier distribution method in computing power aware network and communication device
CN114844865A
Cluster node scheduling method and device
CN119172250A
Cited By
Method, device and equipment for detecting node state in k8s cluster and medium
CN120675991A
Method, device and equipment for detecting node status in k8s cluster and medium
CN120675991B