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

Communication method, device and device for communication Download PDF

Info

Publication number
CN115134231B
CN115134231B CN202110287984.6A CN202110287984A CN115134231B CN 115134231 B CN115134231 B CN 115134231B CN 202110287984 A CN202110287984 A CN 202110287984A CN 115134231 B CN115134231 B CN 115134231B
Authority
CN
China
Prior art keywords
container
service
configuration information
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.)
Active
Application number
CN202110287984.6A
Other languages
Chinese (zh)
Other versions
CN115134231A (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

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 a proxy container deployed in a target container node of a container orchestration engine, the method comprising: receiving dynamic configuration information sent by a service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes on which target container nodes depend are changed; performing configuration updating 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 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, a communication device and a communication device.
Background
A container orchestration engine (e.g., kubernetes) 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, one container node typically can accommodate at least one business container.
In the prior art, when a service container in a certain container node needs to request resources from a service container in another container node, the service container needs to be resolved by DNS (Domain Name System ) and forwarded by a proxy server (such as nginnx). This approach requires reliance on external physical devices to forward the request to the target container node, and requires a long time to reload the proxy server when the container node changes, thus making communication inefficient.
Disclosure of Invention
The embodiment of the application provides a communication method, a communication device and a communication device, which are used for solving the technical problem of lower communication efficiency in the prior art.
In a first aspect, embodiments of the present application provide 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 on which the target container node depends are changed; performing configuration updating 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 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 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 starting configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and communicating with the service grid manager through the second process to acquire initial configuration information.
In some embodiments, the forwarding the request sent by the service 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 pre-generated domain name management file 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 forwarding the request sent by the service container in the target container node, including: receiving the request based on the native loopback address; forwarding the request.
In some embodiments, after forwarding the request sent by the traffic container in the target container node, the method further comprises: deleting the target domain name in the domain name management file in the case of failure of forwarding the request or failure of the service grid manager, so that the request is forwarded through a proxy server of the container orchestration 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 that is obtained based on an IP address of a change container node that is the container node that changed among other container nodes on which the target container node depends.
In a second aspect, embodiments of the present application provide a communications apparatus for use with a proxy container deployed in a target container node of a container orchestration engine, the apparatus comprising: the receiving unit is configured to receive dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is 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; and the forwarding unit is configured to forward the request sent by the 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 acquisition 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 starting configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and communicating 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 pre-generated domain name management file 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 is further configured to: receiving the request based on the native loopback address; forwarding the request.
In some embodiments, the apparatus further comprises a deletion unit configured to: deleting the target domain name in the domain name management file in the case of failure of forwarding the request or failure of the service grid manager, so that the request is forwarded through a proxy server of the container orchestration 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 that is obtained based on an IP address of a change container node that is the container node that changed among other container nodes on which the target container node depends.
In a third aspect, embodiments of the present application provide 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 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 on which the target container node depends are changed; performing configuration updating 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 is configured to execute the one or more programs by one or more processors including 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, 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 starting configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and communicating with the service grid manager through the second process to acquire initial configuration information.
In some embodiments, the forwarding the request sent by the service 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 pre-generated domain name management file 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 forwarding the request sent by the service container in the target container node, including: receiving the request based on the native loopback address; forwarding the request.
In some embodiments, the device is configured to execute the one or more programs by one or more processors including instructions for: deleting the target domain name in the domain name management file in the case of failure of forwarding the request or failure of the service grid manager, so that the request is forwarded through a proxy server of the container orchestration 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 that is obtained based on an IP address of a change container node that is the container node that changed 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 having stored thereon a computer program which, when executed by a processor, implements a method as described in the first aspect above.
According to the communication method, the communication device and the communication device, the service grid manager actively pushes 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 update based on the dynamic configuration information, and the request sent by the service container in the target container node is forwarded based on the updated configuration. Because the proxy container is deployed inside the container node, the process can send the request to the target container node without reloading external physical equipment or relying on external physical equipment for transfer, thereby realizing loop back (loopback) of the request in the same container node and improving communication efficiency.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is a flow chart 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 illustration of an application scenario of a communication method according to the present application;
FIG. 3 is a schematic structural diagram of one embodiment of a communication device according to the present application;
FIG. 4 is a schematic structural view of an apparatus for communication according to the present application;
fig. 5 is a schematic diagram of a server in some embodiments according to the application.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. 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 other things, the container orchestration engine (e.g., kubernetes) is a tool that supports automated deployment and application containerization management. The container node (Pod) is the smallest unit of container orchestration engine deployment and management. The target container node may be any container node in the container orchestration engine.
Each container node may typically house at least one traffic container (business container) and one proxy container (proxy container). Each business container may correspond to a service. The proxy container herein may be an Envoy proxy container, which may use a native Envoy (a type of open source proxy) configuration, and thus has a low learning cost.
The target container node may be communicatively coupled to a service grid manager. For example, the proxy container described above may be communicated with based on data plane standard protocol (XDS). Among other things, the data plane standard protocol may relate to a series of discovery services such as listener discovery service (Listener Discovery Service, LDS), route discovery service (Router Discovery Service, RDS), cluster discovery service (Cluster Discovery Service, CDS), cluster endpoint discovery service (Endpoint Discovery service, EDS), request log discovery service (Accesslog Discovery service, ALS), and the like. And are not listed here.
Service mesh (Service mesh) is the infrastructure layer of inter-Service communication, responsible for network invocation, current limiting, fusing and monitoring between services. The service grid is a middle layer of inter-application communication, and the core of the service grid is to provide a uniform global method to control and measure all request traffic between applications or services.
The service grid manager is the core device of the service grid that can issue configuration information to the proxy container based on the data plane standard protocol. All of the service meta-information it accesses may be stored in a database, and the service meta-information 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 a downstream service according to the relation, so that the configuration information is simpler.
The service grid manager may have a console dashboard (console dashboard) on its own to improve the ease of operation and maintenance. The service grid manager may use a lower hardware configuration, such as a common 4-core 4G virtual machine.
In addition, the service grid manager can adopt independent design or distributed design, for example, 3 nodes can be deployed, any node fails, and a proxy container connected with the node can automatically search for the next available node to establish connection.
The communication method in this embodiment may include the following steps:
and step 101, receiving dynamic configuration information sent by the service grid manager in real time.
In this embodiment, the execution subject of the communication method (i.e., the proxy container in the target container node) may be communicatively connected to the service grid manager. Which can receive dynamic configuration information sent by the service grid manager in real time. Wherein the dynamic configuration information may be generated when changes occur to other container nodes on which the target container node depends. And each time the service grid manager detects that other container nodes on which the target container node depends are changed, dynamic configuration information can be generated and pushed to the target container node. The dynamic configuration information is sent to the proxy container through the service grid manager to perform configuration update without modifying service codes, so that the learning cost is low.
Here, each container node in the container orchestration engine may be dependent on one or more other container nodes, where a dependency may refer to a dependency on a service provided by a business container 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 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, dynamic configuration information may be used to configure the proxy container. In some examples, the dynamic configuration information described above may include a target resource. The target resource may be obtained based on the IP address of the change container node, such as may include, but is not limited to, the IP (Internet Protocol, interconnect protocol) address of the change container node, information about the cluster to which it belongs, downstream services. The change container node may be a container node that changes among other container nodes on which the target container node depends.
In practice, the service grid manager may include 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 mechanisms provided by the container orchestration engine. When there is a life cycle change of the container node, the service registration and discovery module may synchronize the IP address of the container node into the database. Meanwhile, for the IP address of the container node where the change occurs, the service registration and discovery module may encapsulate it as a generic 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 associated proxy container. Thus, any agent 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 rolled and upgraded. Specifically, when a service is rolled up, the new container node may first perform 100% expansion, and assign an IP address after 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 relevant container node, the IP address of the upstream request backend proxy service of the relevant proxy container may be updated. And then, the container agent corresponding to the downstream service can send a request to the newly added node, and the new service can start to provide the service, so that the new container node is established. Thereafter, the container orchestration engine may harvest the old container node, broadcast its own meta-information (including IP address, etc.) to the service grid manager, and then wait for a preset period of time (e.g., 15 seconds, during which service may still be provided) to allow the old container node to adequately process the received request. Finally, the service grid manager may remove the IP address of the old service, update the downstream service IP list, and no further requests are sent to the old container node since then.
And 102, performing configuration updating 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 instead of the full configuration, so that the configuration update based on the dynamic configuration information can be incremental update. Therefore, the simplicity and pertinence of the configuration information can be improved, and the configuration efficiency is improved.
For example, as the service node in container node a may provide service a, the service node in container node B may provide service B, and the service node in container node C may provide service C. The target container node a relies on container node B and container node C, i.e. service a needs to use the data provided by service B and the 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, this means that the IP address of the container node C is changed. At this time, the IP address of the container node C recorded locally can be reconfigured synchronously with the dynamic configuration information, and changed to the IP address Z.
And step 103, forwarding the request sent by the service container in the target container node based on the updated configuration.
In this embodiment, the execution body may forward, based on the updated configuration, a request sent by a service container in the target container node, for example, to the updated IP address.
In some optional implementations of this embodiment, the execution body may store a domain name management file that is generated in advance. The domain name management file may be a hostname and IP configuration file, such as a/etc/hosts file. The domain name management file may include 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 examples. At this time, in response to detecting a request sent by a service container in the target container node, the execution body may first determine whether a target domain name of the request is included in a domain name management file generated in advance. 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 alternative implementations of the present embodiment, the domain name in the domain name management file refers to a native loopback address (e.g., 127.0.0.1), also referred to as a home loopback address. When forwarding a request sent by a service container in a target container node, the request may first be received based on the local loopback address. And then forwards the request. Therefore, the loop back (loopback) of the request can be realized, and through loop back communication, the communication efficiency is improved, and the DNS loss is reduced.
In some optional implementations of this embodiment, after forwarding the request sent by the service container in the target container node, the executing entity may further delete the target domain name in the domain name management file in a case where the request fails to be forwarded or in a case where a service grid manager fails, so that the request is forwarded through a proxy server (such as nginnx) of the container orchestration engine. Therefore, the request can still be ensured to be forwarded under the condition of failure of the request forwarding or the condition of failure of the service grid manager, and the stability of the system is improved.
According to the method provided by the embodiment of the application, the service grid manager actively pushes dynamic configuration information to the proxy container deployed in the target container node of the container orchestration engine when other container nodes on which the target container node depends are changed, so that the proxy container can perform configuration update based on the dynamic configuration information, and the request sent by the service container in the target container node is forwarded based on the updated configuration. Because the proxy container is deployed inside the container node, the process can send the request to the target container node without reloading external physical equipment or relying on external physical equipment for transfer, thereby realizing loop back (loopback) of the request in the same container node and improving communication efficiency.
With further reference to fig. 2A, a flow 200 of yet another embodiment of a communication method is shown. The method is applied to a proxy container that can be deployed in a target container node of a container orchestration engine (e.g., kubernetes). The container orchestration engine is a tool that supports automated deployment and application containment management. A container node (Pod) is the smallest unit of deployment and management of a container orchestration engine, and a container node can typically house at least one container, such as a business container and a proxy container. The target container node may be any container node in the container orchestration engine.
The flow 200 of the communication method comprises the steps of:
step 201, initial configuration information is obtained from a service grid manager.
In this embodiment, the execution body of the communication method (i.e., the proxy container in the target container node) may acquire 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 body described above via a data plane standard protocol.
In some optional implementations 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 sub-process of the first process.
And secondly, generating starting configuration information of the second process through the first process.
Here, the Agent process may generate a basic starting configuration required by the Envoy process, for example, 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, and specifically can be a host name and an IP configuration file, such as a/etc/hosts file. And points the domain name in the domain name management file to the local loopback address (e.g., 127.0.0.1).
And thirdly, starting a second process based on the starting configuration information, and communicating with the service grid manager through the second process to acquire initial configuration information.
The Envoy process may be started based on the start configuration information. After the start-up, the service grid manager may be communicatively connected to the service grid manager based on the IP of the service grid manager to request initial configuration information from the service grid manager, thereby obtaining initial configuration information returned by the service grid manager. The initial configuration information may include information, such as an IP address, of each other container node on which the target container node depends.
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 execution body may perform initial configuration based on the initial configuration information, and because the initial configuration information includes information such as IP addresses of other container nodes on which the target container node depends, 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 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 external physical equipment is not required to be relied on for request transfer, loopback (loopback) of the request in the same container node is realized, and communication efficiency is improved.
And 203, receiving dynamic configuration information sent by the service grid manager in real time.
Step 203 in this embodiment can be referred to step 101 in the corresponding embodiment of fig. 1, and will not be described herein.
In some alternative implementations of the present 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 container node, which may include, but is not limited to, the IP (Internet Protocol, interconnection protocol) address of the container node, the cluster to which the container node belongs, and information about downstream services. Wherein the change container node is a container node that changes among other container nodes on which the target container node depends.
Step 204, performing configuration update based on the dynamic configuration information.
Step 204 in this embodiment can be referred to step 102 in the corresponding embodiment of fig. 1, and will not be described here 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 be referred to step 103 in the corresponding embodiment of fig. 1, and will not be described herein.
In some optional implementations of the present embodiments, in response to detecting a request sent by a service container in a target container node, it may be determined whether a pre-generated domain name management file contains the 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 the present embodiments, 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 the local 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 executing entity may delete the target domain name in the domain name management file in case of a failure in forwarding the request or in case of a failure in the service grid manager, so that the request is forwarded through the proxy server of the container orchestration engine.
Please refer to fig. 2B, which illustrates 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 house one service 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 may generate a startup configuration required by the Envoy process, where the startup configuration includes the IP address of the service grid manager. The Agent process may also write the domain name corresponding to each service into the domain name management file at regular time, specifically, may be a hostname and an IP configuration file, such as a/etc/hosts file. And points the domain name in the domain name management file to the local loopback address (e.g., 127.0.0.1). The Envoy process may be started based on the start configuration information. After the start-up, the service grid manager may be communicatively connected to the service grid manager based on the IP of the service grid manager to request initial configuration information from the service grid manager, thereby obtaining initial configuration information returned by the service grid manager. The initial configuration information may include information, such as an IP address, of each other container node on which the target container node depends. Taking the agent container in the container node a as an example, the agent container can receive the dynamic configuration information sent by the service grid manager in real time, where the dynamic configuration information can include information that the container node B changes, such as a changed IP address, etc. Based on the dynamic configuration information, the proxy container in container node a may be configured for updating. Thus, when a service container providing service a initiates a request for service B, the request may be sent directly to a 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 involves a step of acquiring initial configuration information from the service grid manager, on the basis of which, when there is an update of another container node 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 method shown in the above figures, the present application provides an embodiment of a communication device, which corresponds to the method embodiment shown in fig. 1, and which is specifically applicable to a proxy container, where the proxy container is deployable in a target container node of a container orchestration engine.
As shown in fig. 3, the communication apparatus 300 according to 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 changes; a configuration unit 302 configured to perform configuration update based on the dynamic configuration information; and 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 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 optional implementations of this embodiment, the acquiring 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 starting configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and communicating 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: in response to detecting a request sent by a service container in the target container node, determining whether a pre-generated domain name management file contains a requested target domain name; 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 implementations of this embodiment, the domain name in the domain name management file refers to a native loopback address; and, the forwarding unit 303 is further configured to: receiving the request based on the local loopback address; and forwarding the request.
In some optional implementations of this embodiment, the apparatus further includes a deleting unit configured to: and deleting the target domain name in the domain name management file to forward the request through a proxy server of the container arrangement engine when the request fails to be forwarded or when the service grid manager fails.
In some alternative implementations of the present embodiment, the service grid manager communicates with the proxy container via a data plane standard protocol.
In some optional implementations of this embodiment, the dynamic configuration information includes a target resource, where the target resource is acquired based on an IP address of a change container node, where the change container node is a container node that changes among other container nodes on which the target container node depends.
According to the device provided by the embodiment of the application, the service grid manager actively pushes dynamic configuration information to the proxy container deployed in the target container node of the container orchestration engine when other container nodes on which the target container node depends are changed, so that the proxy container can perform configuration update based on the dynamic configuration information, and the request sent by the service container in the target container node is forwarded based on the updated configuration. Because the proxy container is deployed inside the container node, the process can send the request to the target container node without reloading external physical equipment or relying on external physical equipment for transfer, thereby realizing loop back (loopback) of the request in the same container node and improving communication efficiency.
Fig. 4 is a block diagram illustrating an apparatus 400 for communication, which apparatus 400 may be a smart terminal or a server, according to an exemplary embodiment. For example, apparatus 400 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, apparatus 400 may include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, a multimedia component 408, an audio component 410, an input/output (I/O) interface 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls the 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 part 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 may include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
Memory 404 is configured to store various types of data to support operations at apparatus 400. Examples of such data include instructions for any application or method operating on the apparatus 400, contact data, phonebook data, messages, pictures, videos, and the like. The memory 404 may be implemented by any type or combination of volatile or nonvolatile 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 disk.
The power supply component 406 provides power to the various components of the apparatus 400. The power supply 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 the 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 input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only a boundary of a touch or a sliding action but also a duration and a pressure related to the touch or the sliding operation. In some embodiments, the multimedia component 408 includes a front camera and/or a rear camera. The front camera and/or the rear 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 focal length and optical zoom capabilities.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the 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 be further stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 further 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 a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 414 includes one or more sensors for providing status assessment of various aspects of the apparatus 400. For example, the sensor assembly 414 may detect the on/off state of the device 400, the relative positioning of the components, such as the display and keypad of the apparatus 400, the sensor assembly 414 may also detect the change in position of the apparatus 400 or one component of the apparatus 400, the presence or absence of user contact with the apparatus 400, the orientation or acceleration/deceleration of the apparatus 400, and the change in temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects in the absence of 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 gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate communication between the apparatus 400 and other devices in a wired or wireless manner. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 416 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 416 described above 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, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as memory 404, including instructions executable by processor 420 of apparatus 400 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 5 is a schematic diagram of a server in some embodiments of the present application. The server 500 may vary considerably in configuration or performance and may include one or more central processing units (central processing units, CPU) 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. Wherein memory 532 and storage medium 530 may be transitory or persistent. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, the central processor 522 may be configured to communicate with a 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 ServerTM, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
A non-transitory computer readable storage medium, which when executed by a processor of an apparatus (smart terminal or server) causes the apparatus to perform a method of communication, 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 on which the target container node depends are changed; performing configuration updating 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 is configured to execute the one or more programs by one or more processors including 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.
Optionally, the acquiring 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 starting configuration information of the second process through the first process; and starting the second process based on the starting configuration information, and communicating 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 pre-generated domain name management file 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 forwarding the request sent by the service container in the target container node, including: receiving the request based on the native loopback address; forwarding the request.
Optionally, after forwarding the request sent by the traffic container in the target container node, the device is configured to execute the one or more programs by one or more processors including instructions for: deleting the target domain name in the domain name management file in the case of failure of forwarding the request or failure of the service grid manager, so that the request is forwarded through a proxy server of the container orchestration engine.
Optionally, the service grid manager communicates with the proxy container via a data plane standard protocol.
Optionally, the dynamic configuration information includes a target resource, where the target resource is acquired based on an IP address of a change container node, where the change container node is a container node that changes 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 application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure 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 is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The foregoing description of the preferred embodiments is provided for the purpose of illustration only, and is not intended to limit the invention to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.
The foregoing has outlined some of the more detailed description of a communication method, apparatus and apparatus for communication provided herein, wherein specific examples are provided herein to illustrate the principles and implementations of the present application and to help understand the method and core concepts thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of communication 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 a service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes on which the target container node depends are changed;
performing configuration updating based on the dynamic configuration information;
forwarding a request sent by a service container in the target container node based on the updated configuration;
the forwarding the request sent by the service container in the target container node includes:
receiving the request based on the local loopback address, and forwarding the request;
the service grid manager includes a service registration and discovery module and a dashboard module.
2. The method of claim 1, wherein prior to 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 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 said 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 starting configuration information of the second process through the first process;
and starting the second process based on the starting configuration information, and communicating 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 pre-generated domain name management file 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 of claim 4, wherein the domain name in the domain name management file points to the native loopback address.
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:
deleting the target domain name in the domain name management file in the case of failure of forwarding the request or failure of the service grid manager, so that the request is forwarded through a proxy server of the container orchestration engine.
7. The method of claim 1, wherein the service grid manager communicates with the proxy container via a data plane standard protocol.
8. A communications apparatus for application to a proxy container deployed in a target container node of a container orchestration engine, the apparatus comprising:
the receiving unit is configured to receive dynamic configuration information sent by the service grid manager in real time, wherein the dynamic configuration information is 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;
The forwarding unit is further configured to:
receiving the request based on the local loopback address, and forwarding the request;
the service grid manager includes a service registration and discovery module and a dashboard module.
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 one or more processors, the one or more programs comprising instructions for:
receiving dynamic configuration information sent by a service grid manager in real time, wherein the dynamic configuration information is generated when other container nodes on which a target container node depends are changed;
performing configuration updating based on the dynamic configuration information;
forwarding a request sent by a service container in the target container node based on the updated configuration;
the forwarding the request sent by the service container in the target container node includes:
receiving the request based on the local loopback address, and forwarding the request;
the service grid manager includes a service registration and discovery module and a dashboard module.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any 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 CN115134231A (en) 2022-09-30
CN115134231B true 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 (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1842078A (en) * 2005-03-28 2006-10-04 北京航空航天大学 Gridding service container
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
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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7130891B2 (en) * 2002-02-04 2006-10-31 Datasynapse, Inc. Score-based scheduling of service requests in a grid services computing platform
US10225335B2 (en) * 2011-02-09 2019-03-05 Cisco Technology, Inc. Apparatus, systems and methods for container based service deployment
US9519520B2 (en) * 2011-10-25 2016-12-13 Viasat, Inc. Federated, policy-driven service meshes for distributed software systems
CN104765621B (en) * 2014-01-02 2018-05-01 国际商业机器公司 A kind of method and system of the deployment program in clustered node
US9407546B2 (en) * 2014-02-24 2016-08-02 Red Hat, Inc. Routing a message using a routing table in a dynamic service mesh

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1842078A (en) * 2005-03-28 2006-10-04 北京航空航天大学 Gridding service container
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
Design and evaluation of mega container terminal configurations: An integrated simulation framework;Sun, Z等;《SIMULATION-TRANSACTIONS OF THE SOCIETY FOR MODELING AND SIMULATION INTERNATIONAL》;20130731;全文 *
基于WSRF的网格空间服务及其管理;高秉博;谢传节;曾少斌;;地球信息科学学报(第06期);全文 *
基于可扩展性的网格服务结构的研究;李庆华, 朱海峰, 王多强, 周玉龙;计算机工程与设计(第01期);全文 *
基于微服务的二次装置平台设计与应用;任辉;黄旭;吴艳平;袁浩;张乔宾;任浩;;电力信息与通信技术;20200525(第05期);全文 *

Also Published As

Publication number Publication date
CN115134231A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
CN107862514B (en) Bus card management method, device and system and storage medium
CN109005096B (en) Application interaction method and device
CN108833585B (en) Information interaction method and device and storage medium
WO2016058334A1 (en) Upgrade method, apparatus and device
CN108600529B (en) Information interaction method and device and computer readable storage medium
CN111414230A (en) Service management system, service management method, server, and storage medium
CN109814942B (en) Parameter processing method and device
CN107395624B (en) Information processing method and device
CN113946443A (en) Edge device management and active registration method and device and electronic device
CN111274205B (en) Data block access method and device and storage medium
CN111615694A (en) Server node selection method and terminal equipment
CN111857763B (en) Data processing method, device, electronic equipment and storage medium
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN115134231B (en) Communication method, device and device for communication
CN111241134B (en) Data processing method and device
CN109948012B (en) Serial number generation method and device and storage medium
CN106992882B (en) Router file migration method and device
CN111562994A (en) Application program interface forwarding method and device, electronic equipment and storage medium
CN110995767B (en) Request processing method and device
CN110989987A (en) Portal webpage generation method, portal webpage generation device, client, server and storage medium
CN115002227B (en) User access request response method, storage medium and electronic device
CN107992333B (en) Theme acquisition method and device
CN111274590B (en) Request processing method and device, electronic equipment and storage medium
CN107463414B (en) Application installation method and device
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment

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