Data transmission method, device and computer-readable storage medium
By using gateway nodes to encapsulate and deencapsulate data in the container orchestration system, and through a special target data transmission channel, the problem of cloud nodes and edge nodes is solved, and the security and reliability of data transmission are ensured.
Patent Information
- Application Number
- CN202211686954.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-12-27
AI Technical Summary
In the container orchestration system, the pods of cloud nodes and edge nodes have a problem of network disconnection, which leads to difficulty in data interaction during edge autonomy.
After determining that the service components of cloud nodes and edge nodes meet the communication conditions, the data is sent to the gateway node, and the gateway nodes are used for data encapsulation and deencapsulation, and the service data interaction between the cloud nodes and edge nodes is realized through a special target data transmission channel.
It realizes business data interaction between cloud nodes and edge nodes, solves the problem of network blockage, and ensures the security and reliability of data transmission.
Smart Images

Figure CN115955512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device, and computer-readable storage medium. Background Art
[0002] In the container orchestration system (Kubernetes, k8s), in order to improve the processing rate of the service, the service will be deployed in the pod of the edge node where the user is located. At this time, the service deployed on the edge node needs to achieve edge autonomy to deal with abnormal situations such as network disconnection between the cloud node and the edge node, or data loss. Currently, a World Wide Web (Web) cache proxy is added to the edge node to store the data required for the service in the Web cache proxy. In this way, when an abnormality occurs, the pod of the edge node can also obtain data from the Web cache proxy when executing the service, thereby achieving edge autonomy. However, the above method still has the problem of network disconnection between the pod in the cloud node and the pod in the edge node. Summary of the Invention
[0003] To solve the above technical problems, the embodiments of the present application hope to provide a data transmission method, device and computer-readable storage medium, which solve the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0004] The technical solution of this application is achieved as follows:
[0005] A data transmission method, the method comprising:
[0006] Determining first business data of a first business component in a cloud node;
[0007] When it is determined that the first business component and the second business component meet the first communication condition, the first business data is sent to the gateway node; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to interact with the business data between the cloud node and the edge node.
[0008] In the above solution, before sending the first service data to the gateway node when it is determined that the first service component and the second service component meet the first communication condition, the method further includes:
[0009] Determining network information corresponding to the second service component; wherein the network information is used to locate the second service component;
[0010] Matching the network information corresponding to the second service component with the first address matching table;
[0011] In the case of a successful match with the first address matching table, it is determined that the first service component and the second service component meet the first communication condition.
[0012] In the above solution, determining the first business data of the first business component in the cloud node includes:
[0013] Determining initial business data of a first business component in the cloud node;
[0014] A first encapsulation is performed on the first target address in the initial service data based on the network information corresponding to the gateway node to obtain the first service data.
[0015] A data transmission method, the method comprising:
[0016] receiving first business data of a first business component in the cloud node sent by a cloud node;
[0017] determining second service data based on the first service data;
[0018] When it is determined that the first business component and the second business component meet the second communication condition, the second business data is sent to the second business component in the edge node through the target data transmission channel; wherein, the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0019] In the above solution, determining the second service data based on the first service data includes:
[0020] Decapsulating the first service data to obtain initial service data of the first service component in the cloud node;
[0021] A second encapsulation is performed on the second target address in the initial service data based on the network information corresponding to the gateway node to obtain the second service data.
[0022] In the above solution, before sending the second service data to the second service component in the edge node through the target data transmission channel when determining that the first service component and the second service component meet the second communication condition, the method further includes:
[0023] Determine first network information corresponding to the first service component and second network information corresponding to the second service component; wherein the first network information is used to locate the first service component, and the second network information is used to locate the second service component;
[0024] Based on the first network information and the second network information, it is determined whether the first service component and the second service component meet the second communication condition.
[0025] In the above solution, determining whether the first service component and the second service component meet the second communication condition based on the first network information and the second network information includes:
[0026] matching the first network address and the second network address with a second address matching table;
[0027] If a match with the second address matching table is successful, matching the first network port and the second network port with the address filtering table; wherein the first network information includes the first network address and the first network port, and the second network information includes the second network address and the second network port;
[0028] In case of a successful match with the address filtering table, it is determined that the first service component and the second service component meet the second communication condition.
[0029] A first data transmission device, comprising:
[0030] A first processing unit, configured to determine first business data of a first business component in a cloud node;
[0031] A first sending unit is used to send the first business data to the gateway node when it is determined that the first business component and the second business component meet the first communication condition; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to interact with the business data between the cloud node and the edge node.
[0032] A second data transmission device, comprising:
[0033] a receiving unit, configured to receive first service data of a first service component in the cloud node sent by a cloud node;
[0034] a second processing unit, configured to determine second service data based on the first service data;
[0035] The second sending unit is used to send the second business data to the second business component in the edge node through the target data transmission channel when it is determined that the first business component and the second business component meet the second communication condition; wherein, the target data transmission channel is used to interact with the business data between the cloud node and the edge node.
[0036] A cloud node, comprising: a first processor, a first memory, and a first communication bus;
[0037] The first communication bus is used to implement a communication connection between the first processor and the first memory;
[0038] The first processor is used to execute the data transmission program in the first memory to implement the steps of the above-mentioned data transmission method.
[0039] A gateway node, comprising: a second processor, a second memory, and a second communication bus;
[0040] The second communication bus is used to implement a communication connection between the second processor and the second memory;
[0041] The second processor is used to execute the data transmission program in the second memory to implement the steps of the above-mentioned data transmission method.
[0042] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned data transmission method.
[0043] The data transmission method, device and computer-readable storage medium provided in the embodiments of the present application can determine the first business data of the first business component in the cloud node, and send the first business data to the gateway node when it is determined that the first business component and the second business component meet the first communication condition; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel, and the target data transmission channel is used to interact with the business data between the cloud node and the edge node; in this way, the first business component in the cloud node can first send the first business data to the gateway node, and then the gateway node sends the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of another data transmission method provided in an embodiment of the present application;
[0046] Figure 3 A flowchart of another data transmission method provided in an embodiment of the present application;
[0047] Figure 4 A flowchart of a data transmission method provided in another embodiment of the present application;
[0048] Figure 5 A schematic diagram of a flow chart for determining whether a first service component and a second service component meet communication conditions in a data transmission method provided in an embodiment of the present application;
[0049] Figure 6 A flowchart of another data transmission method provided in another embodiment of the present application;
[0050] Figure 7 A schematic structural diagram of a first data transmission device provided in an embodiment of the present application;
[0051] Figure 8 A schematic structural diagram of a second data transmission device provided in an embodiment of the present application;
[0052] Figure 9 A schematic diagram of the structure of a cloud node provided in an embodiment of the present application;
[0053] Figure 10 A schematic diagram of the structure of a gateway node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0055] It should be understood that the “embodiments of the present application” or “the aforementioned embodiments” mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, “in the embodiments of the present application” or “in the aforementioned embodiments” appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0056] Unless otherwise specified, when an electronic device performs any step in the embodiments of the present application, the processor of the electronic device may perform the step. It is also worth noting that the embodiments of the present application do not limit the order in which the electronic device performs the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be independently executed by the electronic device, that is, when the electronic device performs any step in the following embodiments, it can be independent of the execution of other steps.
[0057] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0058] The present invention provides a data transmission method that can be applied to a cloud node. Figure 1 As shown, the method includes the following steps:
[0059] Step 101: Determine first business data of a first business component in a cloud node.
[0060] In the embodiment of the present application, the cloud node is the center of cloud computing, and the edge node is the edge side of cloud computing; the cloud node can control the edge node; Figure 1 As shown, the k8s cluster can be divided into the cloud and the edge through the firewall. The upper side of the firewall in the figure is the cloud, and the lower side of the firewall in the figure is the edge. The cloud can include multiple cloud nodes, and the edge can include multiple edge nodes; both the cloud node and the edge node include multiple pods, and the pod can correspond to the container network interface (Container Network Interface, CNI). The CNI focuses on the network connection of the container and allocates network resources to the container. The first business component can be a pod in the cloud node; the second business component can be a pod in the edge node. Both the first business component and the second business component can be used to process business. The first business data can be business data that the first business component needs to transmit to the second business component; in a feasible implementation method, the business data can be data required for a certain business when processing.
[0061] Generally, applications deployed on pods in k8s are called services, and each business can correspond to one or more services, that is, each business can be executed by one or more pods. Since services are deployed on pods of edge nodes in k8s, the pods of edge nodes need to obtain the data required for this business from the cloud nodes when executing a certain business. At this time, the pods of edge nodes need to interact with the pods of cloud nodes for business data. In a feasible implementation method, when it is determined that the second business component needs to execute a certain business, this business and the data required for this business can be determined as the first business data; or, after receiving a data acquisition request for a certain business sent by the second business component, the first business component can process the data acquisition request so that the first business component obtains the data required for this business based on the data acquisition request, and determines the acquired data as the first business data. It should be noted that the first business data can be business data that the first business component actively sends to the second business component, or it can be business data that is passively sent to the second business component, and the embodiment of the present application only uses the above two methods as examples to illustrate the steps of determining the first business data, and the embodiment of the present application does not limit the method of determining the first business data.
[0062] Step 102: When it is determined that the first service component and the second service component meet the first communication condition, send the first service data to the gateway node.
[0063] Among them, the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0064] In an embodiment of the present application, the first communication condition is used to determine whether to transmit business data to the gateway node, so as to transmit the business data to the second business component through the gateway node and the target data transmission channel, thereby realizing the interaction of business data between the first business component and the second business component; the first communication condition can be pre-set, and the first communication condition can be set according to the network address of the first business component and the network address of the second business component, or the first communication condition can be set according to other data, which is not limited in the embodiment of the present application. The target data transmission channel is used to interact with business data between the cloud node and the edge node, that is, the interaction of business data between the first business component in the cloud node and the second business component in the edge node can be realized through the target data transmission channel; the target data transmission channel is the data transmission channel between the gateway node and the edge node, and this target data transmission channel is only used to transmit business data between the first business component and the second business component that meet the communication conditions; it should be noted that the target data transmission channel is different from the data transmission channel in the prior art for the cloud node to send control data to the edge node, and is also different from the data transmission channel for data transmission between cloud nodes; in a feasible implementation method, the target data transmission channel can be an Internet Protocol Security (IPSEC) tunnel. The gateway node is a node selected from a plurality of cloud nodes included in the cloud, and is used to forward business data transmitted between the first business component and the second business component to implement business data interaction between the first business component and the second business component.
[0065] In the embodiment of the present application, when it is determined that the first business component and the second business component meet the first communication condition, the first business data is sent to the gateway node, that is, not all data can be exchanged through the gateway node and the target data transmission channel. Only when the first business component and the second business component meet the first communication condition, the business data between the first business component and the second business component will be exchanged through the gateway node and the target data transmission channel; wherein, Figure 2 The routing rule in determines that the first service component and the second service component meet the first communication condition.
[0066] In a feasible implementation, since the cloud node and the gateway node are in the same network, the cloud node and the gateway node can use the existing cloud intranet data transmission channel to interact with the first business data; in this case, the first business component of the cloud node can send the first business data to the gateway node through the cloud intranet, and the gateway node sends the first business data to the second business component of the edge node through a specially set target data transmission channel. At this time, the first business component of the cloud node and the second business component of the edge node interact with each other through the cloud intranet between the cloud node and the gateway node and the target data transmission channel specially set between the gateway node and the edge node for transmitting business data across the network; wherein the data transmission channel of the cloud intranet can be a virtual eXtensible Local Area Network (VXLAN) tunnel. Figure 2 As shown, the cloud node and the gateway node are in the same network, and the first business data can be sent to the gateway node through the VXLAN tunnel. The gateway node and the edge node are in different networks, and the first business data can be sent to the second business component of the edge node through a specially set IPSEC tunnel to realize the interaction of business data between the first business component of the cloud node and the second business component of the edge node; in addition, the edge nodes can interact with each other through the data transmission channel of the edge intranet, and the data transmission channel of the edge intranet can also be a VXLAN tunnel.
[0067] In another feasible implementation method, a data transmission channel can be re-established between the cloud node and the gateway node, specifically for sending the first business data to the gateway node; in this case, the first business component of the cloud node can send the first business data to the gateway node through the re-established data transmission channel, and the gateway node sends the first business data to the second business component of the edge node through the specially set target data transmission channel. At this time, the first business component of the cloud node and the second business component of the edge node interact with each other through the re-established data transmission channel between the cloud node and the gateway node and the specially set target data transmission channel between the gateway node and the edge node. In this way, the interaction of business data between the first business component of the cloud node and the second business component of the edge node is achieved through the re-established data transmission channel and the specially set data transmission channel, which can further ensure the security of business data during transmission.
[0068] According to the data transmission method provided in the embodiment of the present application, the first business component in the cloud node can first send the first business data to the gateway node, and then the gateway node sends the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0069] Based on the above embodiments, the present application provides a data transmission method, referring to Figure 3 As shown, the method includes the following steps:
[0070] Step 201: Receive first business data of a first business component in the cloud node sent by a cloud node.
[0071] In the embodiments of this application, Figure 2 As shown, the cloud node and the gateway node are in the same network, so the first business data of the first business component in the cloud node sent by the cloud node can be received through the cloud intranet.
[0072] Step 202: Determine second business data based on the first business data.
[0073] In an embodiment of the present application, the second business data is business data obtained based on the first business data; in a feasible implementation method, the first business data can be directly determined as the second business data; or, the first business data can be processed and the processed first business data can be determined as the second business data.
[0074] Step 203: When it is determined that the first service component and the second service component meet the second communication condition, the second service data is sent to the second service component in the edge node through the target data transmission channel.
[0075] Among them, the target data transmission channel is used to interact with business data between cloud nodes and edge nodes.
[0076] In an embodiment of the present application, the second communication condition is used to determine whether to transmit business data through the target data transmission channel. The second communication condition can be set according to the network address and network port of the first business component and the network address and network port of the second business component, and the embodiment of the present application does not limit this. Sending the second business data to the second business component in the edge node through a specially set target data transmission channel can prevent the problem of network anomalies between the cloud and the edge causing the business to be unable to proceed normally, and can further ensure the security of the business data.
[0077] The data transmission method provided in the embodiment of the present application is that after the gateway node receives the first business data of the first business component in the cloud node sent by the cloud node, the gateway node can send the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0078] Based on the above embodiments, the present application provides a data transmission method, referring to Figure 4 As shown, the method includes the following steps:
[0079] Step 301: The cloud node determines initial business data of a first business component in the cloud node.
[0080] In an embodiment of the present application, the business components of the cloud node and the business components of the edge node can interact with business data, that is, the business components of the cloud node can send business data to the business components of the edge node, and the business components of the edge node can also send business data to the business components of the cloud node. The embodiment of the present application takes the example of the business component of the cloud node sending business data to the business component of the edge node. It should be understood that the process of the business component of the edge node sending business data to the business component of the cloud node is similar to the process of the business component of the cloud node sending business data to the business component of the edge node. The embodiment of the present application will not go into details about this.
[0081] In the embodiment of the present application, the initial service data is the data required by the current service. In a feasible implementation, the initial service data of the first service component can be obtained from the database corresponding to the cloud node according to the service identifier of the current service.
[0082] Step 302: The cloud node performs a first encapsulation on the first target address in the initial service data based on the network information corresponding to the gateway node to obtain first service data.
[0083] In an embodiment of the present application, the network information may include a network address and a network port. The network information corresponding to the gateway node is used to locate the gateway node, and the network information corresponding to the gateway node may include the Internet Protocol (IP) address for interconnection between networks of the gateway node. The first business data is the business data after the initial business data is encapsulated based on the network information corresponding to the gateway node, and only the public network address is exposed to the outside, thereby ensuring the security of the business data. The first target address is the receiving address. Since the first business data of the first business component in the cloud node needs to pass through the gateway node to be transmitted to the second business component of the edge node, it is necessary to encapsulate the receiving address in the initial business data based on the network information corresponding to the gateway node to obtain the first business data, so as to send the first business data to the gateway node.
[0084] In a feasible implementation, an address conversion rule can be used to encapsulate the first target address in the initial business data based on the network information corresponding to the gateway node to obtain the first business data; wherein the address conversion rule can be a Network Address Translation (NAT) rule. Specifically, a NAT rule can be used to encapsulate the sending address and receiving address in the initial business data based on the public network IP of the cloud node and the public network IP of the gateway node to obtain the first business data, that is, the sending address is the public network IP of the cloud node at this time, and the receiving address is the public network IP of the gateway node at this time, that is, the sender of the first business data is the cloud node and the receiver is the gateway node at this time, so as to send the first business data of the first business component to the gateway node. It is worth noting that the cloud node sets the next-hop gateway to the network information of the gateway node through the NAT rule to transmit the first business data to the gateway node, and then transmits it to the second business component of the edge node through the gateway node.
[0085] It should be noted that the initial business data may include the network information of the first business component and the network information of the second business component. The first target address in the initial business data is first encapsulated based on the network information corresponding to the gateway node. The first business data can be sent to the gateway node, and the gateway node can be informed that the first business data is to be sent to the second business component of the edge node. The security of the business data, the network information of the first business component, and the network information of the second business component can also be ensured.
[0086] Step 303: The cloud node determines the network information corresponding to the second service component.
[0087] The network information is used to locate the second service component.
[0088] In an embodiment of the present application, the network information corresponding to the second service component is used to locate the second service component. The network information corresponding to the second service component may include the network address and network port of the second service component. In one feasible implementation, the network information corresponding to the second service component may be the network address of the second service component. Since the first service component is the sender and the second service component is the receiver, the network address of the second service component can be referred to as the destination address.
[0089] Step 304: The cloud node matches the network information of the second service component with the first address matching table.
[0090] In an embodiment of the present application, the first address matching table is used to filter data based on the destination address. In a feasible implementation, the destination address that can exchange business data through the gateway node and the target data processing channel can be stored in the first address matching table in advance. In this way, the network address of the second business component can be judged through the first address matching table to determine whether the first business component and the second business component meet the first communication condition. It should be noted that the first address matching table can be a newly added routing table, and the first address matching table has the highest priority, so that the data to be transmitted will be matched through the first address matching table first.
[0091] Step 305: If the first address matching table is successfully matched, the cloud node determines that the first service component and the second service component meet the first communication condition.
[0092] In an embodiment of the present application, the network information of the second business component is successfully matched with the first address matching table, indicating that the first business component and the second business component meet the first communication condition and can interact with business data through the gateway node and the target data processing channel.
[0093] Step 306: When it is determined that the first service component and the second service component meet the first communication condition, the cloud node sends the first service data to the gateway node.
[0094] Among them, the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to realize data interaction between the first business component and the second business component.
[0095] In an embodiment of the present application, when it is determined that the first business component and the second business component meet the first communication condition, the encapsulated business data (i.e., the first business data) is sent, that is, at this time the first business data has encapsulated the initial business data according to the IP address of the gateway node.
[0096] Step 307: The gateway node receives the first business data of the first business component in the cloud node sent by the cloud node.
[0097] In the embodiment of the present application, what is received at this time is the first service data obtained by encapsulating the destination address of the initial service data according to the IP address of the gateway node.
[0098] Step 308: The gateway node decapsulates the first business data to obtain the initial business data of the first business component in the cloud node.
[0099] In this embodiment of the present application, since the first service data is the data obtained by encapsulating the destination address of the initial service data according to the IP address of the gateway node, it is necessary to decapsulate the first service data to obtain the initial service data and expose the original source and destination addresses. In one feasible implementation, an Xfrm rule can be used to decapsulate the first service data to obtain the initial service data.
[0100] Step 309: The gateway node performs a second encapsulation on the second target address in the initial service data based on the network information of the gateway node to obtain second service data.
[0101] In an embodiment of the present application, the second service data is the data obtained by performing a second encapsulation of the second destination address in the initial service data based on the network information of the gateway node. The second destination address is the sending address. The second encapsulation of the sending address in the initial service data based on the network information of the gateway node is performed so that when the gateway node sends service data to the second service component of the edge node, the sending address is modified to the network information of the gateway node. This makes it easier to understand where the service data comes from, which nodes it passes through, and where it is transmitted to.
[0102] In a feasible implementation, an address conversion rule can be adopted to perform a second encapsulation on the second target address in the initial business data based on the network information corresponding to the gateway node to obtain the second business data. Specifically, a NAT rule can be adopted to encapsulate the sending address and receiving address in the initial business data based on the IP address of the gateway node and the IP address of the edge node to obtain the second business data, that is, the sending address is the public network IP of the gateway node, and the receiving address is the intranet IP of the edge node, that is, the sender of the second business data is the gateway node, and the receiver is the second business component of the edge node, so as to send the second business data to the second business component of the edge node through the gateway node.
[0103] In an embodiment of the present application, Xfrm rule matching can be performed through the IPSEC module of the gateway node, and after a successful match, the second business data is encapsulated into the IPSEC tunnel.
[0104] Step 310: The gateway node determines first network information corresponding to the first service component and second network information corresponding to the second service component.
[0105] The first network information is used to locate the first service component, and the second network information is used to locate the second service component.
[0106] In an embodiment of the present application, the first network information is the network information of the first business component, that is, the network information of the sender, that is, the source address; the first network information is used to locate the first business component, that is, the first business component can be found through the first network information; the first network information may include a first network address and a first network port; the first network address may be the IP address of the first business component, and the first network port may be the pod network segment of the first business component. The second network information is the network information of the second business component, that is, the network information of the receiver, that is, the destination address; the second network information is used to locate the second business component, that is, the second business component can be found through the second network information; the second network information may include a second network address and a second network port; the second network address may be the IP address of the second business component, and the second network port may be the pod network segment of the second business component. In a feasible implementation method, the network information of the first business component (that is, the first network information) and the network information of the second business component (that is, the second network information) can be directly determined; or, the first network information and the second network information can be determined from the initial business data.
[0107] Step 311: The gateway node determines whether the first service component and the second service component meet the second communication condition based on the first network information and the second network information.
[0108] In an embodiment of the present application, it is possible to determine whether the first business component and the second business component meet the second communication condition based on the network information of the first business component and the network information of the second business component, that is, to determine whether the first business component and the second business component can interact with business data through the target data transmission channel based on the network information of the first business component and the network information of the second business component.
[0109] Step 311 can be implemented by the following steps:
[0110] Step 311a: The gateway node matches the first network address and the second network address with the second address matching table.
[0111] In an embodiment of the present application, the second address matching table is used to filter data based on the source address and destination address. The second address matching table can be an IPSEC tunnel rule. In one feasible implementation, the source addresses and destination addresses that can exchange business data between the gateway node and the target data processing channel can be pre-stored in the second address matching table. In this way, after receiving data, the gateway node can determine whether the data is business data that can be transmitted through the target data transmission channel based on the second address matching table.
[0112] Step 311b: When the second address matching table is successfully matched, the gateway node matches the first network port and the second network port with the address filtering table.
[0113] The first network information includes a first network address and a first network port, and the second network information includes a second network address and a second network port.
[0114] In an embodiment of the present application, the address filtering table is used to perform a second filtering based on the network port. Since the source address and destination address when the cloud node sends configuration data to the edge node may be the same as the first network address and the second network address, it is not desirable for the configuration data to pass through the gateway node and the target data transmission channel. Therefore, a second filtering based on the network port is required. A network address can correspond to multiple network ports, but the network port can more accurately locate the business component. Therefore, a second filtering based on the network port can more accurately determine the business component that can interact through the gateway node and the target data transmission channel.
[0115] Step 311c: If the address filtering table is successfully matched, the gateway node determines that the first service component and the second service component meet the second communication condition.
[0116] In the embodiment of the present application, a successful match with the address filtering table indicates that the second address matching table and the address filtering table have been matched. In this case, it is determined that the first service component and the second service component meet the second communication condition.
[0117] In the embodiment of the present application, the first address matching table, the second address matching table and the address filtering table can all be set Figure 2 Specifically, Figure 5As shown, the tunnel rules in the figure are IPSEC Tunnel rules, and the pass rules in the figure are IPSEC Pass rules; users can send communication conditions as rules to the advanced (Advance) routing of the edge node, the tunnel rules and pass rules of the gateway node. The advanced routing corresponds to the above-mentioned first address matching table, the tunnel rules correspond to the above-mentioned second address matching table, and the pass rules correspond to the above-mentioned address filtering table; among them, the priority of the Advance routing is the highest, that is, the data needs to be judged by the Advance routing first. The purpose of the Advance routing setting is to judge by the Advance routing first to determine which data can be transmitted to the gateway node and enter the IPSEC module of the gateway node; specifically, after determining the business data of the first business component, the edge node can first judge by the Advance routing and match the business data to the corresponding The destination address is matched with the Advance route. After a successful match, the business data is sent to the gateway node. Before sending the business data through the target data transmission channel, the gateway node first matches it through the tunnel rules of the IPSEC module, and matches the source address and destination address corresponding to the business data with the tunnel rules. After a successful match, it continues to match through the access rules of the IPSEC module, and matches the first network port of the sender and the second network port of the receiver corresponding to the business data with the access rules. After a successful match, it is determined that the first business component and the second business component can transmit business data through the target data transmission channel (meeting the second communication condition); any mismatch in any of the above three times indicates that the data cannot be transmitted through the gateway node and the target data transmission channel.
[0118] In a feasible implementation method, the intranet IP and pod network segments of all nodes in the cloud can be added to the IPSEC module of the gateway node for encapsulation configuration, and the intranet IP and pod network segments of all nodes in the edge can be added to the IPSEC module of the gateway node for encapsulation configuration. In this way, before sending the second business data, the gateway node can also match the original source address and destination address according to the IPSEC module. After the match is successful, the second business data is sent to the second business component of the edge node through the target data transmission channel to ensure the security of the business data.
[0119] Step 312: When it is determined that the first service component and the second service component meet the second communication condition, the gateway node sends the second service data to the second service component in the edge node through the target data transmission channel.
[0120] Among them, the target data transmission channel is used to interact with business data between cloud nodes and edge nodes.
[0121] In an embodiment of the present application, what is received at this time is the second business data that is second-encapsulated based on the second target address in the initial business data based on the network information corresponding to the gateway node; after receiving the second business data, Xfrm rule matching can be performed through the IPSEC module, and after a successful match, the second business data is decapsulated to expose the original source address and destination address; when the second business component of the edge node replies to the data, it can send the reply data to the first business component of the cloud node along the original path.
[0122] It should be noted that when the first business component of the cloud node sends the first business data to the gateway node, the receiving address of the initial business data is first encapsulated based on the network information of the gateway node. When the gateway node sends the second business data to the second business component of the edge node, the sending address of the initial business data is secondly encapsulated based on the network information of the gateway node. This can achieve cloud-edge network intercommunication and symmetry of the packet sending and receiving paths, making it convenient for operation and maintenance personnel to study and analyze the transmission of business data.
[0123]
[0124] In an embodiment of the present application, the rule configuration of the cloud node, gateway node and edge node can be as shown in the table above: Dst is the destination address, Src is the source address, and Gw is the gateway node; through the routing rules of the cloud node, it can be known that the destination address is the edge node (edge_node), the next-hop gateway is the gateway node, and the business data is sent from the flannel.1 network port of the gateway node. When it is determined that the first business component and the second business component meet the first communication condition, it is necessary to encapsulate the business data through the address masquerade (MASQUERADE, MASQ) rule of the NAT rule to protect the security of the business data; the Xfrm rule of the gateway node is to decapsulate the received business data to expose the source address and destination address before encapsulation; the gateway node uses the MASQ rule to modify the source address of the decapsulated business data, and then sends the modified business data to the second business component of the edge node. It should be noted that the rule configuration in the table can use an independent namespace and give priority to matching during search. This achieves cloud-edge intercommunication while retaining the original rules, does not affect the existing data processing of k8s, and has zero modification and zero intrusion to K8S. When uninstalling, you only need to delete the corresponding namespace to restore the original environment.
[0125] like Figure 6As shown, when the first business component of the cloud node sends initial business data to the second business component of the edge node, it can first match the routing rules, send the initial business data to the next-hop gateway node flannel.1 through the flannel.1 network port, and then perform source address conversion, encapsulate through flannel to obtain the first business data, and send the first business data to the gateway node through the Vxlan tunnel; after the gateway node receives the first business data, it decapsulates through flannel to obtain the initial business data, and then performs routing forwarding. The initial business data is judged by the IPSEC module. After successfully matching the Xfrm rule, the initial business data is encapsulated by the IPSEC tunnel to obtain the second business data, and then forwarded to the edge node; after the edge node receives the second business data, it passes through the IPsec module. After successfully matching the Xfrm rule, the second business data is decapsulated to expose the original source address, destination address and initial business data; when the second business component of the edge node replies to data, it can use the above-mentioned original path to send the reply data to the first business component of the cloud node.
[0126] The data transmission method provided in the embodiment of the present application realizes secure cloud-edge interconnection through IPSEC tunnel, connects routing and NAT technology to realize network diversion, and achieves the purpose of full interoperability of cloud-edge network; the rule configuration corresponding to the communication conditions can be deployed in a plug-in manner without modifying the system configuration of k8s, achieving zero modification and zero intrusion to k8s, and also achieving the purpose of separation of control plane and data plane, that is, only the business data of the data plane will be transmitted through the gateway node and the target data transmission channel, and the data of the control plane will go through the original one-way channel; the gateway node can also be in master-slave mode, and the control node detects the status of the master node and performs abnormal switching; VIP technology is used to enable non-cluster nodes in the cloud to switch without perception; the data transmission method provided in the embodiment of the present application can support all scenarios of accessing pods, realize full interoperability of cloud-edge network, and unified access mode.
[0127] It should be noted that, for the description of the same steps and contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0128] According to the data transmission method provided in the embodiment of the present application, the first business component in the cloud node can first send the first business data to the gateway node, and then the gateway node sends the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0129] Based on the above embodiments, the present invention provides a first data transmission device, which can be applied to Figure 1 and 4 In the data transmission method provided in the corresponding embodiment, refer to Figure 7 As shown, the first data transmission device 4 may include:
[0130] A first processing unit 41 is configured to determine first business data of a first business component in a cloud node;
[0131] The first sending unit 42 is used to send the first business data to the gateway node when it is determined that the first business component and the second business component meet the first communication condition; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0132] In other embodiments of the present application, the first processing unit 41 is further configured to perform the following steps:
[0133] Determining network information corresponding to the second service component; wherein the network information is used to locate the second service component;
[0134] Matching the network information corresponding to the second service component with the first address matching table;
[0135] If the first address matching table is successfully matched, it is determined that the first service component and the second service component meet the first communication condition.
[0136] In other embodiments of the present application, the first processing unit 41 is specifically configured to perform the following steps:
[0137] Determining initial business data of a first business component in a cloud node;
[0138] A first encapsulation is performed on the first target address in the initial service data based on the network information corresponding to the gateway node to obtain first service data.
[0139] It should be noted that the specific description of the steps performed by each unit can be referred to Figure 1 and 4 The data transmission method provided in the corresponding embodiment will not be described in detail here.
[0140] The first data transmission device provided in the embodiment of the present application is a first business component in a cloud node that can first send the first business data to a gateway node, and then the gateway node sends the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0141] Based on the above embodiments, the present invention provides a second data transmission device, which can be applied to Figure 3 and 4 In the data transmission method provided in the corresponding embodiment, refer to Figure 8 As shown, the second data transmission device 5 may include:
[0142] A receiving unit 51 is configured to receive first business data of a first business component in the cloud node sent by the cloud node;
[0143] A second processing unit 52 is configured to determine second service data based on the first service data;
[0144] The second sending unit 53 is used to send the second business data to the second business component in the edge node through the target data transmission channel when it is determined that the first business component and the second business component meet the second communication condition; wherein the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0145] In other embodiments of the present application, the second processing unit 52 is specifically configured to perform the following steps:
[0146] Decapsulating the first business data to obtain initial business data of the first business component in the cloud node;
[0147] A second encapsulation is performed on the second target address in the initial service data based on the network information corresponding to the gateway node to obtain second service data.
[0148] In other embodiments of the present application, the second processing unit 52 is specifically configured to perform the following steps:
[0149] Determine first network information corresponding to the first service component and second network information corresponding to the second service component; wherein the first network information is used to locate the first service component, and the second network information is used to locate the second service component;
[0150] Based on the first network information and the second network information, it is determined whether the first service component and the second service component meet a second communication condition.
[0151] In other embodiments of the present application, the second processing unit 52 is specifically configured to perform the following steps:
[0152] matching the first network address and the second network address with a second address matching table;
[0153] If the second address matching table is successfully matched, the first network port and the second network port are matched with the address filtering table; wherein the first network information includes the first network address and the first network port, and the second network information includes the second network address and the second network port;
[0154] In case of a successful match with the address filtering table, it is determined that the first service component and the second service component meet the second communication condition.
[0155] It should be noted that the specific description of the steps performed by each unit can be referred to Figure 3 and 4 The data transmission method provided in the corresponding embodiment will not be described in detail here.
[0156] The second data transmission device provided in the embodiment of the present application can, after the gateway node receives the first business data of the first business component in the cloud node sent by the cloud node, send the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0157] Based on the above embodiments, the embodiments of the present application provide a cloud node, which can be applied to Figure 1 and 4 In the data transmission method provided in the corresponding embodiment, refer to Figure 9 As shown, the cloud node 6 may include: a first processor 61, a first memory 62 and a first communication bus 63, wherein:
[0158] The first communication bus 63 is used to realize the communication connection between the first processor 61 and the first memory 62;
[0159] The first processor 61 is configured to execute the data transmission program in the first memory 62 to implement the following steps:
[0160] Determining first business data of a first business component in a cloud node;
[0161] When it is determined that the first business component and the second business component meet the first communication condition, the first business data is sent to the gateway node; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node through the target data transmission channel; the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0162] In other embodiments of the present application, the first processor 61 is configured to execute the data transmission program in the first memory 62 and further implement the following steps:
[0163] Determining network information corresponding to the second service component; wherein the network information is used to locate the second service component;
[0164] Matching the network information corresponding to the second service component with the first address matching table;
[0165] If the first address matching table is successfully matched, it is determined that the first service component and the second service component meet the first communication condition.
[0166] In other embodiments of the present application, the first processor 61 is configured to execute the data transmission program in the first memory 62 to determine the first business data of the first business component in the cloud node, so as to implement the following steps:
[0167] Determining initial business data of a first business component in a cloud node;
[0168] A first encapsulation is performed on the first target address in the initial service data based on the network information corresponding to the gateway node to obtain first service data.
[0169] It should be noted that the specific description of the steps performed by the processor can be referred to Figure 1 and 4 The data transmission method provided in the corresponding embodiment will not be described in detail here.
[0170] In the cloud node provided in the embodiment of the present application, the first business component in the cloud node can first send the first business data to the gateway node, and then the gateway node sends the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0171] Based on the above embodiments, the embodiments of the present application provide a gateway node, which can be applied to Figure 3 and 4 In the data transmission method provided in the corresponding embodiment, refer to Figure 10 As shown, the gateway node 7 may include: a second processor 71, a second memory 72 and a second communication bus 73, wherein:
[0172] The second communication bus 73 is used to realize the communication connection between the second processor 71 and the second memory 72;
[0173] The second processor 71 is used to execute the data transmission program in the second memory 72 to implement the following steps:
[0174] receiving first business data of a first business component in the cloud node sent by the cloud node;
[0175] determining second business data based on the first business data;
[0176] When it is determined that the first business component and the second business component meet the second communication condition, the second business data is sent to the second business component in the edge node through the target data transmission channel; wherein the target data transmission channel is used to interact with business data between the cloud node and the edge node.
[0177] In other embodiments of the present application, the second processor 71 is configured to execute the data transmission program in the second memory 72 to determine the second service data based on the first service data, so as to implement the following steps:
[0178] Decapsulating the first business data to obtain initial business data of the first business component in the cloud node;
[0179] A second encapsulation is performed on the second target address in the initial service data based on the network information corresponding to the gateway node to obtain second service data.
[0180] In other embodiments of the present application, the second processor 71 is used to execute the data transmission program in the second memory 72 and further implement the following steps:
[0181] Determine first network information corresponding to the first service component and second network information corresponding to the second service component; wherein the first network information is used to locate the first service component, and the second network information is used to locate the second service component;
[0182] Based on the first network information and the second network information, it is determined whether the first service component and the second service component meet a second communication condition.
[0183] In other embodiments of the present application, the second processor 71 is configured to execute the data transmission program in the second memory 72, based on the first network information and the second network information, to determine whether the first service component and the second service component meet the second communication condition, so as to implement the following steps:
[0184] matching the first network address and the second network address with a second address matching table;
[0185] If the second address matching table is successfully matched, the first network port and the second network port are matched with the address filtering table; wherein the first network information includes the first network address and the first network port, and the second network information includes the second network address and the second network port;
[0186] In case of a successful match with the address filtering table, it is determined that the first service component and the second service component meet the second communication condition.
[0187] It should be noted that the specific implementation of the steps executed by the processor can refer to Figure 3 and 4 The description of the data transmission method provided in the corresponding embodiment will not be repeated here.
[0188] The gateway node provided in the embodiment of the present application can, after receiving the first business data of the first business component in the cloud node sent by the cloud node, send the first business data to the second business component in the edge node through a specially set target data transmission channel, so as to realize the interaction of business data between the first business component in the cloud node and the second business component in the edge node, thereby solving the problem of network disconnection between the pod in the cloud node and the pod in the edge node in the related technology.
[0189] Based on the above embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement Figure 1 and 4 or Figure 3 and 4 The corresponding embodiment provides steps of the data transmission method.
[0190] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0191] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. 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.
[0192] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0194] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.
Claims
1. A data transmission method, characterized in that: Applied to a cloud node of a k8s cluster, the method includes: Determine first business data of a first business component in a cloud node; the first business data is business data of a data plane in the cloud node; When it is determined that the first business component and the second business component meet the first communication condition, the first business data is sent to the gateway node; wherein the gateway node is used to determine the second business data based on the first business data, and send the second business data to the second business component in the edge node of the k8s cluster through the target data transmission channel; the target data transmission channel is used to interact with the business data between the cloud node and the edge node; the rule configuration corresponding to the first communication condition is deployed by using an independent namespace.
2. The method according to claim 1, characterized in that Before sending the first service data to the gateway node when it is determined that the first service component and the second service component meet the first communication condition, the method further includes: Determining network information corresponding to the second service component; wherein the network information is used to locate the second service component; Matching the network information corresponding to the second service component with the first address matching table; In the case of a successful match with the first address matching table, it is determined that the first service component and the second service component meet the first communication condition.
3. The method according to claim 1, characterized in that The determining of the first business data of the first business component in the cloud node includes: Determining initial business data of a first business component in the cloud node; A first encapsulation is performed on the first target address in the initial service data based on the network information corresponding to the gateway node to obtain the first service data.
4. A data transmission method, characterized in that: The method comprises: Receive first business data of a first business component in the cloud node sent by a cloud node of the k8s cluster; the first business data is business data of the data plane in the cloud node; determining second service data based on the first service data; When it is determined that the first business component and the second business component meet the second communication condition, the second business data is sent to the second business component in the edge node of the k8s cluster through the target data transmission channel; wherein, the target data transmission channel is used to interact with the business data between the cloud node and the edge node; the rule configuration corresponding to the second communication condition is deployed by using an independent namespace.
5. The method according to claim 4, characterized in that The determining the second service data based on the first service data includes: Decapsulating the first service data to obtain initial service data of the first service component in the cloud node; A second encapsulation is performed on the second target address in the initial service data based on the network information corresponding to the gateway node to obtain the second service data.
6. The method according to claim 4, characterized in that Before sending the second service data to the second service component in the edge node through the target data transmission channel when it is determined that the first service component and the second service component meet the second communication condition, the method further includes: Determine first network information corresponding to the first service component and second network information corresponding to the second service component; wherein the first network information is used to locate the first service component, and the second network information is used to locate the second service component; Based on the first network information and the second network information, it is determined whether the first service component and the second service component meet the second communication condition.
7. The method according to claim 6, characterized in that The determining, based on the first network information and the second network information, whether the first service component and the second service component meet the second communication condition includes: matching the first network address and the second network address with a second address matching table; If a match with the second address matching table is successful, matching the first network port and the second network port with the address filtering table; wherein the first network information includes the first network address and the first network port, and the second network information includes the second network address and the second network port; In case of a successful match with the address filtering table, it is determined that the first service component and the second service component meet the second communication condition.
8. A cloud node, characterized in that: The cloud node includes: a first processor, a first memory and a first communication bus; The first communication bus is used to implement a communication connection between the first processor and the first memory; The first processor is configured to execute the data transmission program in the first memory to implement the steps of the data transmission method according to any one of claims 1 to 3.
9. A gateway node, characterized in that: The gateway node includes: a second processor, a second memory and a second communication bus; The second communication bus is used to implement a communication connection between the second processor and the second memory; The second processor is configured to execute the data transmission program in the second memory to implement the steps of the data transmission method according to any one of claims 4 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the data transmission method according to any one of claims 1 to 3 or 4 to 7.
Citation Information
Patent Citations
Residential gateway, cloud server and method for communicating residential gateway and cloud server
CN102638460A