CN115134231A - Communication method, device and device for communication - Google Patents

Communication method, device and device for communication Download PDF

Info

Publication number
CN115134231A
CN115134231A CN202110287984.6A CN202110287984A CN115134231A CN 115134231 A CN115134231 A CN 115134231A CN 202110287984 A CN202110287984 A CN 202110287984A CN 115134231 A CN115134231 A CN 115134231A
Authority
CN
China
Prior art keywords
container
configuration information
service
target
container node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110287984.6A
Other languages
Chinese (zh)
Other versions
CN115134231B (en
Inventor
崔昊
高振安
满桂杰
李永昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202110287984.6A priority Critical patent/CN115134231B/en
Publication of CN115134231A publication Critical patent/CN115134231A/en
Application granted granted Critical
Publication of CN115134231B publication Critical patent/CN115134231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a communication method, a communication device and a communication device. The method is applied to an agent container, the agent container is deployed in a target container node of a container arrangement engine, and the method comprises the following steps: receiving dynamic configuration information sent by a service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by a target container node are changed; performing configuration update based on the dynamic configuration information; and forwarding the request sent by the service container in the target container node based on the updated configuration. This embodiment improves the communication efficiency.

Description

Communication method, device and device for communication
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a communication method and device and a device for communication.
Background
A container orchestration engine (e.g., kubernets) is a tool that supports automated deployment and application containerization management. A container node (Pod) is the smallest unit of deployment and management of a container orchestration engine, and one container node can typically accommodate at least one traffic container.
In the prior art, when a service container in a certain container node needs to request a resource from a service container in another container node, the service container needs to be resolved by a Domain Name System (DNS), and forwarded by a proxy server (e.g., Nginx). This method needs to rely on the external physical device to forward the request to the target container node, and when the container node is changed, it needs to spend a long time to reload the proxy server, so the communication efficiency is low.
Disclosure of Invention
The embodiment of the application provides a communication method, a communication device and a communication device, and aims to solve the technical problem of low communication efficiency in the prior art.
In a first aspect, an embodiment of the present application provides a communication method, which is applied to a proxy container, where the proxy container is deployed in a target container node of a container orchestration engine, and the method includes: receiving dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by the target container node are changed; performing configuration update based on the dynamic configuration information; and forwarding the request sent by the service container in the target container node based on the updated configuration.
In some embodiments, before receiving the dynamic configuration information sent by the service grid manager in real time, the method further comprises: obtaining initial configuration information from the service grid manager, the initial configuration information including information of other container nodes on which the target container node depends; and performing initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
In some embodiments, the obtaining initial configuration information from the service grid manager comprises: creating a first process and a second process, wherein the second process is a sub-process of the first process; generating, by the first process, start-up configuration information of the second process; and starting the second process based on the starting configuration information, and communicating with the service grid manager through the second process to obtain initial configuration information.
In some embodiments, the forwarding the request sent by the traffic container in the target container node based on the updated configuration includes: responding to a request sent by a service container in the target container node, and determining whether a domain name management file generated in advance contains a target domain name of the request; and forwarding a request sent by a service container in the target container node under the condition that the domain name management file contains the target domain name.
In some embodiments, the domain name in the domain name management file points to a native loopback address; and, the forwarding the request sent by the service container in the target container node includes: receiving the request based on the native loopback address; and forwarding the request.
In some embodiments, after forwarding the request sent by the traffic container in the target container node, the method further comprises: and deleting the target domain name in the domain name management file under the condition that the request fails to be forwarded or the service grid manager fails so as to forward the request through a proxy server of the container arrangement engine.
In some embodiments, the service grid manager communicates with the proxy container via a data plane standard protocol.
In some embodiments, the dynamic configuration information includes a target resource, the target resource is obtained based on an IP address of a change container node, and the change container node is a container node on which a change occurs among other container nodes on which the target container node depends.
In a second aspect, an embodiment of the present application provides a communication apparatus, which is applied to a proxy container, where the proxy container is deployed in a target container node of a container orchestration engine, and the apparatus includes: a receiving unit configured to receive, in real time, dynamic configuration information sent by the service grid manager, the dynamic configuration information being generated when other container nodes on which the target container node depends are changed; a configuration unit configured to perform configuration update based on the dynamic configuration information; a forwarding unit configured to forward a request sent by a service container in the target container node based on the updated configuration.
In some embodiments, the apparatus further comprises an acquisition unit configured to: obtaining initial configuration information from the service grid manager, the initial configuration information including information of other container nodes on which the target container node depends; and carrying out initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
In some embodiments, the obtaining unit is further configured to: creating a first process and a second process, wherein the second process is a sub-process of the first process; generating, by the first process, start-up configuration information of the second process; and starting the second process based on the starting configuration information, and communicating and connecting with the service grid manager through the second process to acquire initial configuration information.
In some embodiments, the forwarding unit is further configured to: in response to detecting a request sent by a service container in the target container node, determining whether a domain name management file generated in advance contains a requested target domain name; and forwarding a request sent by a service container in the target container node under the condition that the domain name management file contains the target domain name.
In some embodiments, the domain name in the domain name management file points to a native loopback address; and, the forwarding unit, further configured to: receiving the request based on the native loopback address; and forwarding the request.
In some embodiments, the apparatus further comprises a deletion unit configured to: and deleting the target domain name in the domain name management file under the condition that the request fails to be forwarded or the service grid manager fails so as to forward the request through a proxy server of the container arrangement engine.
In some embodiments, the service grid manager communicates with the proxy container via a data plane standard protocol.
In some embodiments, the dynamic configuration information includes a target resource, the target resource is obtained based on an IP address of a change container node, and the change container node is a container node on which a change occurs among other container nodes on which the target container node depends.
In a third aspect, an embodiment of the present application provides an apparatus for communication, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for: receiving dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by the target container node are changed; performing configuration update based on the dynamic configuration information; and forwarding the request sent by the service container in the target container node based on the updated configuration.
In some embodiments, the device being configured to execute the one or more programs by the one or more processors includes instructions for: obtaining initial configuration information from the service grid manager, the initial configuration information including information of other container nodes on which the target container node depends; and carrying out initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
In some embodiments, said obtaining initial configuration information from said services grid manager comprises: creating a first process and a second process, wherein the second process is a sub-process of the first process; generating, by the first process, start-up configuration information of the second process; and starting the second process based on the starting configuration information, and communicating and connecting with the service grid manager through the second process to acquire initial configuration information.
In some embodiments, the forwarding the request sent by the traffic container in the target container node based on the updated configuration includes: in response to detecting a request sent by a service container in the target container node, determining whether a domain name management file generated in advance contains a requested target domain name; and forwarding a request sent by a service container in the target container node under the condition that the domain name management file contains the target domain name.
In some embodiments, the domain name in the domain name management file points to a native loopback address; and, the forwarding the request sent by the service container in the target container node includes: receiving the request based on the native loopback address; and forwarding the request.
In some embodiments, the device being configured to execute the one or more programs by the one or more processors includes instructions for: and deleting the target domain name in the domain name management file under the condition that the request fails to be forwarded or the service grid manager fails so as to forward the request through a proxy server of the container arrangement engine.
In some embodiments, the services grid manager communicates with the proxy container via a data plane standard protocol.
In some embodiments, the dynamic configuration information includes a target resource, the target resource is obtained based on an IP address of a change container node, and the change container node is a container node on which a change occurs among other container nodes on which the target container node depends.
In a fourth aspect, embodiments of the present application provide a computer-readable medium on which a computer program is stored, which when executed by a processor, implements the method as described in the first aspect above.
According to the communication method and device and the device for communication provided by the embodiment of the application, the service grid manager actively pushes the dynamic configuration information to the proxy container deployed in the target container node of the container arrangement engine when other container nodes on which the target container node depends are changed, so that the proxy container can perform configuration updating based on the dynamic configuration information, and forwards the request sent by the service container in the target container node based on the updated configuration. Because the agent container is deployed in the container node, the request can be sent to the target container node without reloading external physical equipment or relying on the external physical equipment to carry out transfer in the process, the loopback (loopback) of the request in the same container node is realized, and the communication efficiency is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flow chart diagram of one embodiment of a communication method according to the present application;
FIG. 2A is a flow chart of yet another embodiment of a communication method according to the present application;
FIG. 2B is a schematic diagram of an application scenario of a communication method according to the present application;
FIG. 3 is a schematic block diagram of one embodiment of a communications device according to the present application;
FIG. 4 is a schematic block diagram of an apparatus for communication according to the present application;
FIG. 5 is a schematic diagram of a server in accordance with some embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Referring to fig. 1, a flow 100 of one embodiment of a communication method according to the present application is shown. The method is applied to a proxy container that is deployable in a target container node of a container orchestration engine.
Among them, a container orchestration engine (e.g., kubernets) is a tool that supports automated deployment and application containerization management. Container nodes (Pod) are the smallest units that a container orchestration engine deploys and manages. The target container node may be any one of the container nodes in the container orchestration engine.
Each container node may typically hold at least one business container (business container) and one proxy container (proxy container). Each business container may correspond to a service. The proxy container can be an Envoy proxy container, which can be configured using native Envoy (an open source proxy), and thus has a low learning cost.
The target container node may be communicatively connected to the services grid manager. For example, the proxy container may be communicated with based on data plane standard protocol (XDS). The data plane standard protocol may relate to a series of Discovery services such as Listener Discovery Service (LDS), Route Discovery Service (RDS), Cluster Discovery Service (CDS), Cluster Endpoint Discovery Service (EDS), and request log Discovery Service (ALS). This is not further enumerated here.
A Service mesh is an infrastructure layer of inter-Service communication, and is responsible for network invocation, current limiting, fusing, and monitoring between services. The service grid is a middle layer of communication between application programs, and the core of the service grid is to provide a uniform global method for controlling and measuring all request traffic between applications or services.
The service grid manager is a core device of the service grid, which can issue configuration information to the proxy container based on the data plane standard protocol. All service meta-information it accesses may be stored in a database, which may include, but is not limited to, upstream and downstream relationships between services. The service grid manager can accurately push the change configuration of a certain service and the downstream service according to the relationship, so that the configuration information is more concise.
The service grid manager may be provided with a console dashboard (console dashboard) to improve convenience of operation and maintenance. The service grid manager may use a lower hardware configuration, such as a generic 4-core 4G virtual machine.
In addition, the service grid manager can adopt an independent design or a distributed design, for example, 3 nodes can be deployed, any node fails, and the agent container connected with the node can automatically find the next available node to establish connection.
The communication method in this embodiment may include the following steps:
step 101, receiving dynamic configuration information sent by a service grid manager in real time.
In this embodiment, the executing agent of the communication method (i.e., the proxy container in the target container node) may be communicatively coupled to the service grid manager. It may receive dynamic configuration information sent by the service grid manager in real time. Wherein the dynamic configuration information may be generated when other container nodes on which the target container node depends are changed. And when detecting that other container nodes depended on by the target container node are changed once, the service grid manager can generate dynamic configuration information and push the dynamic configuration information to the target container node. Dynamic configuration information is sent to the agent container through the service grid manager to update the configuration, business codes do not need to be modified, and therefore learning cost is low.
Here, each container node in the container orchestration engine may be dependent on one or more other container nodes, where the dependence may refer to relying on services provided by the business containers in the other container nodes. If service node m in container node a can provide service a, service node n in container node B can provide service B, and service node p in container node C can provide service C, then container node a can be considered to be dependent on both container node B and container node C if service a needs to use the data provided by service B and service C.
In this embodiment, the dynamic configuration information may be used to configure the proxy container. In some examples, the dynamic configuration information may include a target resource. The target resource may be obtained based on the IP address of the change container node, such as but not limited to IP (Internet Protocol) address of the change container node, the cluster to which it belongs, and related information of downstream services. The change container node may be a container node that has been changed among other container nodes that the target container node depends on.
In practice, the service grid manager may comprise a plurality of modules, such as a service registration and discovery module and a dashboard module. The service registration and discovery module may subscribe to container node events of the container orchestration engine using the mechanisms provided by the container orchestration engine. The service registration and discovery module may synchronize the IP address of the container node into the database when the lifecycle of the container node changes. Meanwhile, for the IP address of the container node where the change occurs, the service registration and discovery module may encapsulate it as a general Event (Event) and notify it to the dashboard module. The dashboard module may update endpoint discovery services, etc. in the XDS resources and push the changed resources to the relevant proxy containers. Therefore, any proxy container can receive the dynamic configuration information sent by the service grid manager in real time.
In addition, the embodiment can also ensure that the request is not lost when the service is updated in a rolling way. Specifically, when the service is updated in a rolling manner, the new container node may first perform 100% capacity expansion and allocate an IP address after the new container node is ready. The service grid manager may detect IP address changes for all services. When the IP address of the new container node is pushed to the related container node, the IP address of the upstream request back-end proxy service of the related proxy container can be updated. And then, the container agent corresponding to the downstream service can send a request to the newly added node, the new service can start to provide the service, and the establishment of the new container node is completed. The container orchestration engine may then harvest the old container nodes, broadcast its own meta-information (including IP addresses, etc.) to the service grid manager, and then wait a predetermined amount of time (e.g., 15 seconds, during which the services may still be provided) for the old container nodes to fully process the received requests. Finally, the service grid manager can remove the IP address of the old service, update the downstream service IP list and then send the request to the old container node.
And 102, updating the configuration based on the dynamic configuration information.
In this embodiment, the execution body may perform configuration update based on the dynamic configuration information. The dynamic configuration information can accurately push the change configuration of a certain service and a downstream service, but not the full configuration, so that the configuration update based on the dynamic configuration information can be incremental update. Therefore, the simplicity and pertinence of configuration information can be improved, and the configuration efficiency is improved.
For example, a service node in container node a may provide service a, a service node in container node B may provide service B, and a service node in container node C may provide service C. The target container node a depends on container node B and container node C, i.e. service a needs to use data provided by service B as well as data provided by service C. The execution body is originally configured with the IP address X of the container node B, the IP address Y of the container node C, and other related information. If the IP address Y of the container node C is replaced with the IP address Z in the dynamic configuration information, it means that the IP address of the container node C has been changed. At this time, the IP address of the container node C recorded locally may be reconfigured synchronously with the dynamic configuration information, and changed to the IP address Z.
Step 103, forwarding the request sent by the service container in the target container node based on the updated configuration.
In this embodiment, the executing body may forward the request sent by the service container in the target container node based on the updated configuration, for example, forward the request to the updated IP address.
In some optional implementation manners of this embodiment, the execution main body may store a domain name management file generated in advance. The domain name management file may be a host name and an IP configuration file such as an/etc/hosts file. The domain name management file may contain domain names of other container nodes on which the target container node depends. The domain names of container node B and container node C in the above example. At this time, in response to detecting a request sent by the service container in the target container node, the execution subject may first determine whether a domain name management file generated in advance includes a requested target domain name. And forwarding the request sent by the service container in the target container node under the condition that the domain name management file contains the target domain name.
In some optional implementations of this embodiment, the domain name in the domain name management file points to a native loopback address (e.g., 127.0.0.1), which is also referred to as a local loopback address. When forwarding a request sent by a traffic container in a target container node, the request may first be received based on the native loopback address. And then forwards the request. Therefore, the loopback (loopback) of the request can be realized, the communication efficiency is improved and the DNS loss is reduced through loopback communication.
In some optional implementations of this embodiment, after forwarding the request sent by the service container in the target container node, the executing main body may further delete the target domain name in the domain name management file when the request forwarding fails or when the service grid manager fails, so that the request is forwarded through a proxy server (e.g., Nginx) of the container orchestration engine. Therefore, the request can still be ensured to be forwarded under the condition that the request forwarding fails or the condition that the service grid manager fails, and the stability of the system is improved.
In the method provided by the foregoing embodiment of the present application, when other container nodes on which the target container node depends are changed, the service grid manager actively pushes dynamic configuration information to the proxy container deployed in the target container node of the container orchestration engine, so that the proxy container performs configuration update based on the dynamic configuration information, and forwards a request sent by a service container in the target container node based on the updated configuration. Because the agent container is deployed in the container node, the request can be sent to the target container node without reloading external physical equipment or relying on the external physical equipment for transferring, loopback (loopback) of the request in the same container node is realized, and the communication efficiency is improved.
With further reference to fig. 2A, a flow 200 of yet another embodiment of a communication method is shown. The method is applied to proxy containers that can be deployed in target container nodes of a container orchestration engine (e.g., kubernets). The container orchestration engine is a tool that supports automated deployment and application containerization management. Container nodes (Pod) are the smallest units deployed and managed by a container orchestration engine, and a container node can typically hold at least one container, such as a service container and a proxy container. The target container node may be any one of the container nodes in the container orchestration engine.
The process 200 of the communication method includes the following steps:
step 201, initial configuration information is obtained from a service grid manager.
In this embodiment, the executing body of the communication method (i.e. the proxy container in the target container node) may obtain initial configuration information from the service grid manager, where the initial configuration information includes information of other container nodes on which the target container node depends. In some examples, the service grid manager communicates with the execution principal through a data plane standard protocol.
In some optional implementation manners of this embodiment, the executing entity may obtain the initial configuration information from the service grid manager by:
in a first step, a first process (which may be referred to as an Agent process) and a second process (which may be referred to as an Envoy process) are created, the second process being a child process of the first process.
And secondly, generating starting configuration information of a second process through the first process.
Here, the Agent process may generate a basic start-up configuration required by the Envoy process, for example, the basic start-up configuration may include an IP address of the execution subject, a cluster to which the execution subject belongs, and the like, and may further include an IP address of the service grid manager. Meanwhile, the Agent process can also write the domain name corresponding to each service into a domain name management file at regular time, specifically a host name and an IP configuration file, such as an/etc/hosts file. And points the domain name in the domain name management file to a native loopback address (e.g., 127.0.0.1).
And thirdly, starting a second process based on the starting configuration information, and communicating and connecting with the service grid manager through the second process to obtain the initial configuration information.
The Envoy process may be launched based on the launch configuration information. After the start, the initial configuration information returned by the service grid manager can be obtained by requesting the initial configuration information from the service grid manager through the communication connection with the service grid manager based on the IP of the service grid manager. The initial configuration information may include information of each other container node on which the target container node depends, such as an IP address.
Step 202, performing initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
In this embodiment, the executing entity may perform initial configuration based on the initial configuration information, and since the initial configuration information includes information such as IP addresses of other container nodes that the target container node depends on, the request sent by the service container in the target container node may be forwarded based on the initial configuration.
When forwarding, it may first be determined whether the requested target domain name is located in the domain name management file. If the request is located in the domain name management file, the request can be directly pointed to a local loopback address (such as 127.0.0.1), so that request transfer is not required to be carried out by relying on external physical equipment, loopback (loopback) of the request in the same container node is realized, and the communication efficiency is improved.
And step 203, receiving the dynamic configuration information sent by the service grid manager in real time.
Step 203 in this embodiment can refer to step 101 in the corresponding embodiment of fig. 1, and is not described herein again.
In some optional implementations of this embodiment, in some examples, the dynamic configuration information includes a target resource. The target resource may be obtained based on the IP address of the change container node, such as but not limited to, the IP (Internet Protocol) address of the change container node, the cluster to which the target resource belongs, and related information of the downstream service. Wherein the changed container node is a container node that has been changed among other container nodes that the target container node depends on.
And step 204, updating the configuration based on the dynamic configuration information.
Step 204 in this embodiment can refer to step 102 in the corresponding embodiment of fig. 1, and is not described herein again.
Step 205, forwarding the request sent by the service container in the target container node based on the updated configuration.
Step 205 in this embodiment can refer to step 103 in the corresponding embodiment of fig. 1, and is not described herein again.
In some optional implementations of this embodiment, in response to detecting a request sent by a service container in a target container node, it may be determined whether a domain name management file generated in advance contains a target domain name of the request; and forwarding the request sent by the service container in the target container node under the condition that the domain name management file contains the target domain name.
In some optional implementations of this embodiment, the domain name in the domain name management file points to a native loopback address; and, forwarding a request sent by a service container in the target container node, including: receiving a request based on a native loopback address; the request is forwarded.
In some optional implementations of this embodiment, after forwarding the request sent by the service container in the target container node, the execution subject may delete the target domain name in the domain name management file in the case that forwarding of the request fails or in the case that the service grid manager fails, so that the request is forwarded through the proxy server of the container orchestration engine.
Please refer to fig. 2B, which shows a schematic diagram of an application scenario of the present embodiment. As shown in fig. 2B, both container node a and container node B may accommodate one traffic container and one proxy container. The traffic container in container node a may provide service a and the traffic container in container node B may provide service B. The proxy container may include an Agent process and an Envoy process. The Agent process can generate a starting configuration required by the Envoy process, and the starting configuration comprises the IP address of the service grid manager. The Agent process may also write the domain name corresponding to each service into a domain name management file at regular time, specifically, the domain name may be a host name and an IP configuration file, such as an/etc/hosts file. And points the domain name in the domain name management file to a native loopback address (e.g., 127.0.0.1). The Envoy process may be launched based on the launch configuration information. After the start-up, the initial configuration information returned by the service grid manager can be obtained by requesting the service grid manager for the initial configuration information through the communication connection with the service grid manager based on the IP of the service grid manager. The initial configuration information may include information of each other container node on which the target container node depends, such as an IP address. Taking the proxy container in the container node a as an example, the proxy container may receive, in real time, dynamic configuration information sent by the service grid manager, where the dynamic configuration information may include information that the container node B has changed, such as a changed IP address. Based on the dynamic configuration information, the proxy container in container node a may perform configuration updates. Thus, when a service container providing service a initiates a request for service B, the request can be sent directly to the proxy container in container node a, which forwards the request based on the updated configuration.
The flow 200 of the communication method in this embodiment relates to a step of obtaining initial configuration information from the service grid manager, and on this basis, when there is an update in other container nodes on which the target container node depends, the relevant configuration can be updated incrementally, thereby improving the configuration efficiency and further improving the communication efficiency.
With further reference to fig. 3, as an implementation of the methods shown in the above diagrams, the present application provides an embodiment of a communication apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to a proxy container, and the proxy container may be deployed in a target container node of a container orchestration engine.
As shown in fig. 3, the communication device 300 of the present embodiment includes: a receiving unit 301 configured to receive, in real time, dynamic configuration information sent by the service grid manager, where the dynamic configuration information is generated when another container node on which the target container node depends is changed; a configuration unit 302 configured to perform configuration update based on the dynamic configuration information; a forwarding unit 303 configured to forward the request sent by the service container in the target container node based on the updated configuration.
In some optional implementations of this embodiment, the apparatus further includes an obtaining unit configured to: acquiring initial configuration information from the service grid manager, wherein the initial configuration information comprises information of other container nodes on which the target container node depends; and performing initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
In some optional implementations of this embodiment, the obtaining unit is further configured to: creating a first process and a second process, wherein the second process is a subprocess of the first process; generating start configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and performing communication connection with the service grid manager through the second process to acquire initial configuration information.
In some optional implementations of this embodiment, the forwarding unit 303 is further configured to: responding to a request sent by a service container in the target container node, and determining whether a domain name management file generated in advance contains a target domain name of the request; and forwarding a request sent by a service container in the target container node when the domain name management file contains the target domain name.
In some optional implementation manners of this embodiment, the domain name in the domain name management file points to a native loopback address; and, the forwarding unit 303 is further configured to: receiving the request based on the native loopback address; and forwarding the request.
In some optional implementations of this embodiment, the apparatus further includes a deletion unit configured to: and deleting the target domain name in the domain name management file under the condition that the request is unsuccessfully forwarded or the service grid manager fails so that the request is forwarded through a proxy server of the container arrangement engine.
In some optional implementations of this embodiment, the service grid manager communicates with the proxy container via a data plane standard protocol.
In some optional implementation manners of this embodiment, the dynamic configuration information includes a target resource, the target resource is obtained based on an IP address of a change container node, and the change container node is a container node that has changed in other container nodes that the target container node depends on.
In the apparatus provided in the foregoing embodiment of the present application, when another container node on which a target container node depends is changed, a service grid manager actively pushes dynamic configuration information to a proxy container deployed in the target container node of a container arrangement engine, so that the proxy container performs configuration update based on the dynamic configuration information, and forwards a request sent by a service container in the target container node based on updated configuration. Because the agent container is deployed in the container node, the request can be sent to the target container node without reloading external physical equipment or relying on the external physical equipment to carry out transfer in the process, the loopback (loopback) of the request in the same container node is realized, and the communication efficiency is improved.
Fig. 4 is a block diagram illustrating an apparatus 400 for communication according to an example embodiment, where the apparatus 400 may be an intelligent terminal or a server. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the apparatus 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 400 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a Microphone (MIC) configured to receive external audio signals when apparatus 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor component 414 may detect the open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the apparatus 400, the sensor component 414 may also detect a change in position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 5 is a schematic diagram of a server in some embodiments of the present application. The server 500 may vary widely in configuration or performance and may include one or more Central Processing Units (CPUs) 522 (e.g., one or more processors) and memory 532, one or more storage media 530 (e.g., one or more mass storage devices) storing applications 542 or data 544. Memory 532 and storage media 530 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 522 may be configured to communicate with the storage medium 530, and execute a series of instruction operations in the storage medium 530 on the server 500.
The server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input-output interfaces 558, one or more keyboards 556, and/or one or more operating systems 541, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of an apparatus (smart terminal or server) enable the apparatus to perform a communication method, the method comprising: receiving dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by the target container node are changed; performing configuration update based on the dynamic configuration information; and forwarding the request sent by the service container in the target container node based on the updated configuration.
Optionally, prior to receiving dynamic configuration information sent by the service grid manager in real-time, the device being configured to execute the one or more programs by the one or more processors includes instructions for: obtaining initial configuration information from the service grid manager, the initial configuration information including information of other container nodes on which the target container node depends; and performing initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
Optionally, the obtaining initial configuration information from the service grid manager includes: creating a first process and a second process, wherein the second process is a sub-process of the first process; generating, by the first process, start-up configuration information of the second process; and starting the second process based on the starting configuration information, and communicating and connecting with the service grid manager through the second process to acquire initial configuration information.
Optionally, the forwarding, based on the updated configuration, the request sent by the service container in the target container node includes: in response to detecting a request sent by a service container in the target container node, determining whether a domain name management file generated in advance contains a requested target domain name; and forwarding a request sent by a service container in the target container node under the condition that the domain name management file contains the target domain name.
Optionally, the domain name in the domain name management file points to a local loopback address; and, the forwarding the request sent by the service container in the target container node includes: receiving the request based on the native loopback address; and forwarding the request.
Optionally, after forwarding the request sent by the traffic container in the target container node, the apparatus is configured to execute, by one or more processors, the one or more programs including instructions for: and deleting the target domain name in the domain name management file under the condition that the request fails to be forwarded or the service grid manager fails so as to forward the request through a proxy server of the container arrangement engine.
Optionally, the service grid manager communicates with the proxy container through a data plane standard protocol.
Optionally, the dynamic configuration information includes a target resource, the target resource is obtained based on an IP address of a change container node, and the change container node is a container node that has been changed in other container nodes that the target container node depends on.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
The foregoing detailed description is directed to a communication method, a communication device, and a communication device provided in the present application, and specific examples are used herein to illustrate the principles and implementations of the present application, which are merely provided to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A communication method applied to a proxy container deployed in a target container node of a container orchestration engine, the method comprising:
receiving dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by the target container node are changed;
performing configuration update based on the dynamic configuration information;
and forwarding the request sent by the service container in the target container node based on the updated configuration.
2. The method of claim 1, wherein prior to receiving dynamic configuration information sent by the service grid manager in real-time, the method further comprises:
obtaining initial configuration information from the service grid manager, the initial configuration information including information of other container nodes on which the target container node depends;
and carrying out initial configuration based on the initial configuration information, and forwarding a request sent by a service container in the target container node based on the initial configuration.
3. The method of claim 2, wherein obtaining initial configuration information from the service grid manager comprises:
creating a first process and a second process, wherein the second process is a sub-process of the first process;
generating, by the first process, start-up configuration information of the second process;
and starting the second process based on the starting configuration information, and communicating and connecting with the service grid manager through the second process to acquire initial configuration information.
4. The method of claim 1, wherein forwarding the request sent by the traffic container in the target container node based on the updated configuration comprises:
in response to detecting a request sent by a service container in the target container node, determining whether a domain name management file generated in advance contains a requested target domain name;
and forwarding a request sent by a service container in the target container node under the condition that the domain name management file contains the target domain name.
5. The method according to claim 4, wherein the domain name in the domain name management file points to a native loopback address; and the number of the first and second groups,
the forwarding of the request sent by the service container in the target container node includes:
receiving the request based on the native loopback address;
and forwarding the request.
6. The method of claim 4, wherein after forwarding the request sent by the traffic container in the target container node, the method further comprises:
and deleting the target domain name in the domain name management file under the condition that the request fails to be forwarded or the service grid manager fails so as to forward the request through a proxy server of the container arrangement engine.
7. The method of claim 1, wherein the services grid manager communicates with the proxy container via a data plane standard protocol.
8. A communications apparatus for use with a proxy container deployed in a target container node of a container orchestration engine, the apparatus comprising:
a receiving unit configured to receive, in real time, dynamic configuration information sent by the service grid manager, the dynamic configuration information being generated when other container nodes on which the target container node depends are changed;
a configuration unit configured to perform configuration update based on the dynamic configuration information;
a forwarding unit configured to forward a request sent by a service container in the target container node based on the updated configuration.
9. An apparatus for communication comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for:
receiving dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes depended on by the target container node are changed;
performing configuration update based on the dynamic configuration information;
and forwarding the request sent by the service container in the target container node based on the updated configuration.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110287984.6A 2021-03-17 2021-03-17 Communication method, device and device for communication Active CN115134231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110287984.6A CN115134231B (en) 2021-03-17 2021-03-17 Communication method, device and device for communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110287984.6A CN115134231B (en) 2021-03-17 2021-03-17 Communication method, device and device for communication

Publications (2)

Publication Number Publication Date
CN115134231A true CN115134231A (en) 2022-09-30
CN115134231B CN115134231B (en) 2024-03-08

Family

ID=83374494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110287984.6A Active CN115134231B (en) 2021-03-17 2021-03-17 Communication method, device and device for communication

Country Status (1)

Country Link
CN (1) CN115134231B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050021594A1 (en) * 2002-02-04 2005-01-27 James Bernardin Grid services framework
CN1842078A (en) * 2005-03-28 2006-10-04 北京航空航天大学 Gridding service container
US20130103837A1 (en) * 2011-10-25 2013-04-25 LonoCloud, Inc. Federated, policy-driven service meshes for distributed software systems
US20150188995A1 (en) * 2014-01-02 2015-07-02 International Business Machines Corporation Deploying programs in a cluster node
US20150244616A1 (en) * 2014-02-24 2015-08-27 Red Hat, Inc. Routing a message in a dynamic service mesh
CN106603592A (en) * 2015-10-15 2017-04-26 中国电信股份有限公司 Application cluster migrating method and migrating device based on service model
US20170257432A1 (en) * 2011-02-09 2017-09-07 Cliqr Technologies Inc. Apparatus, systems and methods for container based service deployment
CN108958796A (en) * 2017-05-23 2018-12-07 阿里巴巴集团控股有限公司 service request processing method and device, service request processing system
CN109933329A (en) * 2019-03-01 2019-06-25 深圳微品致远信息科技有限公司 A kind of method that software product carries out intelligent deployment O&M by cloud
CN110109686A (en) * 2019-04-25 2019-08-09 中电科嘉兴新型智慧城市科技发展有限公司 It is a kind of that O&M method and system is applied based on Container Management engine
CN110609732A (en) * 2019-08-13 2019-12-24 平安普惠企业管理有限公司 Application program deployment method and device, computer equipment and storage medium
CN111682954A (en) * 2019-03-11 2020-09-18 国际商业机器公司 Network for managing microservices
CN111930473A (en) * 2020-09-25 2020-11-13 亮风台(上海)信息科技有限公司 Method and apparatus for deploying image recognition service on container cloud
CN112000365A (en) * 2020-08-24 2020-11-27 百度时代网络技术(北京)有限公司 Service grid configuration method, device, equipment and medium based on micro-service architecture
CN112187581A (en) * 2020-09-29 2021-01-05 北京百度网讯科技有限公司 Service information processing method, device, equipment and computer storage medium
CN112506553A (en) * 2020-11-30 2021-03-16 北京达佳互联信息技术有限公司 Method and device for upgrading data plane container of service grid and electronic equipment
CN112511611A (en) * 2020-11-19 2021-03-16 腾讯科技(深圳)有限公司 Communication method, device and system of node cluster and electronic equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050021594A1 (en) * 2002-02-04 2005-01-27 James Bernardin Grid services framework
CN1842078A (en) * 2005-03-28 2006-10-04 北京航空航天大学 Gridding service container
US20170257432A1 (en) * 2011-02-09 2017-09-07 Cliqr Technologies Inc. Apparatus, systems and methods for container based service deployment
US20130103837A1 (en) * 2011-10-25 2013-04-25 LonoCloud, Inc. Federated, policy-driven service meshes for distributed software systems
US20150188995A1 (en) * 2014-01-02 2015-07-02 International Business Machines Corporation Deploying programs in a cluster node
US20150244616A1 (en) * 2014-02-24 2015-08-27 Red Hat, Inc. Routing a message in a dynamic service mesh
CN106603592A (en) * 2015-10-15 2017-04-26 中国电信股份有限公司 Application cluster migrating method and migrating device based on service model
CN108958796A (en) * 2017-05-23 2018-12-07 阿里巴巴集团控股有限公司 service request processing method and device, service request processing system
CN109933329A (en) * 2019-03-01 2019-06-25 深圳微品致远信息科技有限公司 A kind of method that software product carries out intelligent deployment O&M by cloud
CN111682954A (en) * 2019-03-11 2020-09-18 国际商业机器公司 Network for managing microservices
CN110109686A (en) * 2019-04-25 2019-08-09 中电科嘉兴新型智慧城市科技发展有限公司 It is a kind of that O&M method and system is applied based on Container Management engine
CN110609732A (en) * 2019-08-13 2019-12-24 平安普惠企业管理有限公司 Application program deployment method and device, computer equipment and storage medium
CN112000365A (en) * 2020-08-24 2020-11-27 百度时代网络技术(北京)有限公司 Service grid configuration method, device, equipment and medium based on micro-service architecture
CN111930473A (en) * 2020-09-25 2020-11-13 亮风台(上海)信息科技有限公司 Method and apparatus for deploying image recognition service on container cloud
CN112187581A (en) * 2020-09-29 2021-01-05 北京百度网讯科技有限公司 Service information processing method, device, equipment and computer storage medium
CN112511611A (en) * 2020-11-19 2021-03-16 腾讯科技(深圳)有限公司 Communication method, device and system of node cluster and electronic equipment
CN112506553A (en) * 2020-11-30 2021-03-16 北京达佳互联信息技术有限公司 Method and device for upgrading data plane container of service grid and electronic equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SUN, Z等: "Design and evaluation of mega container terminal configurations: An integrated simulation framework", 《SIMULATION-TRANSACTIONS OF THE SOCIETY FOR MODELING AND SIMULATION INTERNATIONAL》, 31 July 2013 (2013-07-31) *
任辉;黄旭;吴艳平;袁浩;张乔宾;任浩;: "基于微服务的二次装置平台设计与应用", 电力信息与通信技术, no. 05, 25 May 2020 (2020-05-25) *
李庆华, 朱海峰, 王多强, 周玉龙: "基于可扩展性的网格服务结构的研究", 计算机工程与设计, no. 01 *
高秉博;谢传节;曾少斌;: "基于WSRF的网格空间服务及其管理", 地球信息科学学报, no. 06 *

Also Published As

Publication number Publication date
CN115134231B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
CN107862514B (en) Bus card management method, device and system and storage medium
CN106354840B (en) File processing method and device and distributed file system
CN106254467A (en) Sharing files method and device
CN113259161B (en) Application management method and device, electronic equipment and storage medium
CN104660685A (en) Method and device for obtaining equipment information
CN109005096B (en) Application interaction method and device
CN113507517A (en) Screen projection equipment discovery method and device, electronic equipment and storage medium
CN113783774B (en) Cross-cluster network configuration method and device, communication equipment and storage medium
CN109814942B (en) Parameter processing method and device
CN108600529B (en) Information interaction method and device and computer readable storage medium
CN105094904A (en) Application program installation method and device
CN111274205B (en) Data block access method and device and storage medium
CN112925788A (en) Data set management method, system, device, electronic equipment and storage medium
CN109033393A (en) Paster processing method, device, storage medium and electronic equipment
CN113596175A (en) Scene synchronization method, terminal, server and system
WO2020041988A1 (en) Server node selection method and terminal device
CN115134231B (en) Communication method, device and device for communication
CN110995767B (en) Request processing method and device
CN115587860A (en) Service processing method, device, storage medium and electronic equipment
CN112769677B (en) Data synchronization method, apparatus, electronic device, storage medium, and program product
CN114430370B (en) Method, device, equipment and storage medium for determining network slice
CN109948012B (en) Serial number generation method and device and storage medium
CN104468523B (en) UI themes acquisition methods, terminal and router
CN106992882B (en) Router file migration method and device
CN107463414B (en) Application installation method and device

Legal Events

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