Service access methods, devices, equipment and computer storage media
By querying and establishing a service information database between the cloud platform and the edge gateway, the problem of container application migration in communication between the cloud and the edge gateway is solved, normal access between containers is realized, and the user experience is improved.
Patent Information
- Application Number
- CN202410634487.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-05-20
AI Technical Summary
During communication between the cloud and the edge gateway, external business systems and middleware container applications cannot be migrated, resulting in service unavailability and impacting user experience.
By receiving the access request of the target service at the first access end, querying the service information database, determining the target service information and establishing an access channel, and if no channel is found, sending the target service information to the second access end to establish a data and communication channel, normal access between containers is achieved.
This avoids the problem of poor user experience caused by service unavailability and ensures that containers can access services in the edge gateway normally.
Smart Images

Figure CN118945221B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) technology, and in particular relates to a service access method, apparatus, device, and computer storage medium. Background Technology
[0002] With the popularization of IoT devices and the improvement of edge computing capabilities, the large amount of data generated by various devices in the edge gateway can be transmitted to the cloud for further analysis and storage after initial processing, thereby improving the speed and accuracy of data processing, while reducing the cost and bandwidth requirements of data transmission.
[0003] In related technologies, communication between the cloud and edge gateways can be achieved through the MQTT (Message Queuing Telemetry Transport) and WebSocket protocols. Alternatively, the open-source, high-performance remote procedure call (gRPC) system can be used to establish communication between the cloud and edge gateways.
[0004] However, in related technologies, during the communication process between the cloud and the edge gateway, the external business systems and middleware container applications existing in the cloud and the edge gateway cannot be migrated, resulting in the container applications becoming unavailable and affecting the user experience. Summary of the Invention
[0005] This application provides a service access method, apparatus, device, and computer storage medium. When a first access terminal receives an access request for a target service and determines that the target service is deployed on a second access terminal, the method queries a service information database for the target service information corresponding to the access request and its corresponding access channel. If the target service information is found but the target service access channel is not found, the method determines the second target access terminal corresponding to the target service and sends the target service information to the second target access terminal. This allows the second target service terminal to return to the first channel based on the target service information, enabling the first access terminal to establish an access channel for the target service and access the target service through the target service channel. This allows containers in the first access terminal to access services in the second access terminal, avoiding the problem of service unavailability during interaction between the first and second access terminals, which leads to a poor user experience.
[0006] In a first aspect, embodiments of this application provide a service access method applied to a first access terminal. The method includes: in response to receiving an access request for a target service, if the target service is determined to be a service deployed on a second access terminal, querying a service information database for the target service information corresponding to the access request and its corresponding target service access channel, wherein the first access terminal and the second access terminal are, respectively, a cloud platform and an edge gateway; if the target service information is found but the target service access channel is not found, determining the second target access terminal corresponding to the target service through the target service information; sending the target service information to the second target access terminal; receiving a first channel returned by the second access terminal, and establishing a target service access channel based on the first channel, wherein the first channel is obtained by the second target access terminal by binding the data transmission channel and communication channel of the target service, the data transmission channel of the target service is established by the second target access terminal with the target service upon receiving the target service information, and the communication channel is the communication channel between the second target access terminal and the first access terminal; and accessing the target service based on the target service access channel.
[0007] In one embodiment, before responding to receiving an access request for the target service, the method further includes: receiving second service information sent by a second access terminal; and constructing a service information database based on the first service information and the second service information registered in the first access terminal.
[0008] In one implementation, determining that the target service is a second access service includes: parsing the access request of the target service to obtain the domain name information corresponding to the target service; and querying a service information database based on the domain name information to determine that the target service is a second access service.
[0009] In one embodiment, after establishing the target service access channel, the method further includes: storing the target service access channel in a service information database.
[0010] In one embodiment, after receiving an access request for a target service, the method further includes: if the target service is determined to be a service deployed on a first access terminal, obtaining target service information corresponding to the access request from a service information database; and accessing the target service based on the target service information.
[0011] In one embodiment, after querying the target service information corresponding to the access request and its corresponding target service access channel in the service information database, the method further includes: if the target service information and the target service access channel are found, accessing the target service based on the target service access channel.
[0012] Secondly, embodiments of this application provide a service access device, the device comprising:
[0013] The query module is used to respond to the received access request for the target service. If it is determined that the target service is a service deployed on the second access terminal, the module queries the service information database for the target service information corresponding to the access request and its corresponding target service access channel. Among the first access terminal and the second access terminal, one is a cloud platform and the other is an edge gateway.
[0014] The determination module is used to determine the second target access terminal corresponding to the target service when the target service information is found but the target service access channel is not found.
[0015] The sending module is used to send target service information to the second target access terminal;
[0016] The receiving module is used to receive the first channel returned by the second access terminal and establish a target service access channel based on the first channel. The first channel is obtained by the second target access terminal by binding the data transmission channel and communication channel of the target service. The data transmission channel of the target service is the data transmission channel established by the second target access terminal with the target service when the target service information is received. The communication channel is the communication channel between the second target access terminal and the first access terminal.
[0017] The access module is used to access the target service based on the target service access channel.
[0018] Thirdly, embodiments of this application provide a service access device, the device including: a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the method as described in the first aspect or any embodiment of the first aspect.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the method as described in the first aspect or any of the embodiments of the first aspect.
[0020] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform a method as described in the first aspect or any of the embodiments of the first aspect.
[0021] The service access method, apparatus, device, and computer storage medium of this application embodiment, when a first access terminal receives an access request for a target service and determines that the target service is deployed on a second access terminal, queries the service information database corresponding to the access request and its corresponding target service access channel. If the target service information is found but the target service access channel is not found, the second target access terminal corresponding to the target service is determined, and the target service information is sent to the second target access terminal. This allows the second target service terminal to return to the first channel based on the target service information, enabling the first access terminal to establish an access channel for the target service based on the first channel and access the target service through the target service channel. This allows the container in the first access terminal to access the service in the second access terminal, avoiding the problem of service unavailability during interaction between the first and second access terminals, which leads to a poor user experience. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This paper shows a schematic diagram of the structure of an edge-cloud collaborative system provided in one embodiment of the present application;
[0024] Figure 2 A flowchart illustrating a service access method provided in one embodiment of this application is shown;
[0025] Figure 3 A flowchart illustrating another service access method provided in one embodiment of this application is shown;
[0026] Figure 4 A flowchart illustrating another service access method provided in one embodiment of this application is shown;
[0027] Figure 5 A flowchart illustrating another service access method provided in one embodiment of this application is shown;
[0028] Figure 6 A flowchart illustrating another service access method provided in one embodiment of this application is shown;
[0029] Figure 7 A schematic diagram of the structure of a service access device provided in one embodiment of this application is shown;
[0030] Figure 8 A schematic diagram of the hardware structure for service access provided in an embodiment of this application is shown. Detailed Implementation
[0031] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0032] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0033] With the rapid advancement of cloud computing and edge computing capabilities, edge-cloud collaborative systems are gradually becoming an important component of the Internet of Things (IoT) industry. In related technologies, edge-cloud collaborative systems typically consist of a cloud platform and an edge gateway. The cloud platform and edge gateway can connect via MQTT (Message Queuing Telemetry Transport) and WebSocket protocols. Alternatively, gRPC can be used to establish communication between the cloud and the edge gateway. gRPC is an open-source remote procedure call system. This system is based on the HTTP / 2 protocol and uses Protocol Buffers as its interface description language. Furthermore, gRPC offers advantages such as support for bidirectional streaming and multiplexing.
[0034] However, with the continuous development of technology, more and more middleware and external systems need to be connected to cloud platforms or edge gateways. In related technologies, for container applications that rely on external systems or middleware, the lack of a consistent access method prevents cloud platform applications from migrating properly to edge gateways, or vice versa. This results in the unavailability of services corresponding to container applications, impacting the user experience.
[0035] Therefore, embodiments of this application provide a service access method, apparatus, device, and computer storage medium. The service access method provided by embodiments of this application will be described below.
[0036] The service access method provided in this application embodiment can be applied to an edge-cloud collaborative system. The edge-cloud collaborative system includes at least a cloud platform and an edge gateway, and both the cloud platform and the edge gateway can access one or more external systems and / or middleware.
[0037] Furthermore, in the edge-cloud collaborative system of this application embodiment, both the cloud platform and the edge gateway may include a communication module, a protocol proxy module, and a service management module. The communication module can be used to establish an edge-cloud connection and realize edge-cloud communication. It is understood that the communication module can rely on a communication protocol. The protocol proxy module can be used to receive service access requests sent by external systems or middleware. The service management module can be used to provide external systems or middleware with the ability to register as services, and can be used to store service information corresponding to external systems or middleware.
[0038] In one example, Figure 1 A schematic diagram of the structure of an edge-cloud collaborative system provided in one embodiment of this application is shown, as follows: Figure 1 As shown, the edge-cloud collaboration system 100 includes a cloud platform 110 and an edge gateway 120. The cloud platform 110 includes a first container application 111, a first protocol proxy module 112, a first service management module 113, and a communication server 114. The first container application 111 is an application based on the cloud platform.
[0039] The first protocol proxy module 112 may include a resolver for resolving service access requests sent by the first container application 111. For example, the resolver may be a Domain Name System (DNS) resolver. In one example, when the protocol proxy module receives a domain name resolution request sent by the container application, it can resolve the domain name resolution request through the DNS resolver.
[0040] The first service management module 113 can be used to provide the ability for external systems or middleware connected to the cloud platform to register as services, and can also be used to store service information corresponding to the external systems or middleware. The service management module can provide at least two registration methods: a web page and an Application Programming Interface (API). The registration parameters include at least the service name, local Internet Protocol (IP), and port information. The service information stored in the service management module includes at least the service name, local IP, port, environment, protocol, and gateway IP. The environment information can indicate whether the service is located on an edge gateway or on the cloud platform.
[0041] In this context, the communication server 114 can be a gRPC server. Furthermore, the edge gateway can use a gRPC client to connect to this server, enabling edge-cloud communication based on the gRPC protocol.
[0042] In this embodiment, the edge gateway 120 may include a second container application 121, a second protocol proxy module 122, a second service management module 123, and a communication client 124. The container application 121 may be an application within the edge gateway.
[0043] The second protocol proxy module 122 and the second service management module 123 have the same functions as the first protocol proxy module 112 and the first service management module 113, and will not be described in detail here. The communication client 124 can be a gRPC client, which connects to the tunnel server through the gRPC protocol to realize cloud-edge communication.
[0044] Furthermore, it is understood that the service access method provided in this application embodiment can be applied to the above-mentioned edge-cloud collaborative system, thereby enabling normal migration of applications.
[0045] The service access method provided in the embodiments of this application is described below.
[0046] Figure 2 A flowchart illustrating a service access method provided in one embodiment of this application is shown. Figure 2 As shown, the service access method is applied to the first access terminal. The service access method provided in this application embodiment includes the following steps:
[0047] S210. In response to receiving an access request for the target service, if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel.
[0048] In this scenario, one of the first access endpoints is a cloud platform, and the other is an edge gateway. In one example, if the first access endpoint is a cloud platform, the second access endpoint can be an edge gateway. In another example, if the first access endpoint is an edge gateway, the second access endpoint can be a cloud platform.
[0049] In this embodiment of the application, the target service may be a service that the application in the first access terminal needs to access.
[0050] In this embodiment, when the first access terminal receives a target service access request sent by an application in the first access terminal, it determines whether the target service in the access request is a service deployed on the second access terminal. If it is determined that the target service is a service deployed on the second access terminal, it queries the service information database for the target service information corresponding to the access request and its corresponding target service access channel.
[0051] In one example, the first access endpoint is a cloud platform, and the second access endpoint can be an edge gateway. When the protocol proxy module in the cloud platform receives a target service access request from an application in the cloud platform, it determines whether the target service is deployed on the edge gateway. If the target service is determined to be deployed on the edge gateway, it queries the target service information and its corresponding target service access channel in the service information database in service management.
[0052] Furthermore, by parsing the access request to the target service, the domain name information corresponding to the target service can be obtained. Based on the domain name information, the service information database can be queried to determine that the target service is the second access service.
[0053] In one example, where the first access point is a cloud platform and the second access point can be an edge gateway, the access request for the target service can be parsed through the protocol proxy module of the cloud platform to obtain the domain name information corresponding to the target service. Based on the domain name information, the service information database can be queried to determine that the target service is the service of the second access point.
[0054] It is understood that, in this embodiment of the application, there may be one or more second access terminals communicating with the first access terminal.
[0055] In this embodiment of the application, by parsing the access request of the target service, the domain name information corresponding to the target service is obtained, and the service information database is queried based on the domain name information to determine that the target service is the second access terminal service, thereby enabling the quick and accurate determination of the second target access terminal where the target service is located.
[0056] S220. If the target service information is found but the target service access channel is not found, the second target access terminal corresponding to the target service is determined through the target service information.
[0057] In this embodiment of the application, the second target access terminal may be the second access terminal for deploying the target service.
[0058] In this embodiment of the application, if the target service information is found in the service information database but the target service access channel is not found, the second target access terminal corresponding to the target service is determined through the target service information.
[0059] S230, Send target service information to the second target access terminal.
[0060] In this embodiment of the application, target service information can be sent from the first access terminal to the second target access terminal.
[0061] In one example, the gRPC server on the cloud platform can send target service information to the gRPC client on the edge gateway. For example, it can send a channel establishment message to the gRPC client, where the channel establishment message contains the target service information and the channel establishment request.
[0062] S240: Receive the first channel returned by the second access terminal, and establish a target service access channel based on the first channel.
[0063] The first channel is obtained by the second target access terminal through binding the data transmission channel and communication channel of the target service. The data transmission channel of the target service is established by the second target access terminal when it receives the target service information, and the communication channel is the communication channel between the second target access terminal and the first access terminal.
[0064] Understandably, when the second target access terminal receives the target service information sent by the first access terminal, it can identify the target service through this information and establish a connection between itself and the target service. This connection allows for data transmission of the target service. Furthermore, the second target access terminal can also establish a connection with the first access terminal, bind this connection to the connection between the target access terminal and the target service, and send this binding back to the first access terminal. Upon receiving the bound connection channel from the second target access terminal, the first access terminal, in conjunction with the access request, establishes a target service access channel.
[0065] S250, Access the target service based on the target service access channel.
[0066] In this embodiment of the application, the application on the first server can access the target service through the established target service access channel.
[0067] When the first access terminal receives an access request for a target service and determines that the target service is deployed on the second access terminal, it queries the service information database for the target service information corresponding to the access request and its corresponding access channel. If the target service information is found but the target service access channel is not found, the second target access terminal corresponding to the target service is determined, and the target service information is sent to the second target access terminal. This allows the second target service terminal to return to the first channel based on the target service information, enabling the first access terminal to establish an access channel for the target service based on the first channel and access the target service through the target service channel. This allows the container in the first access terminal to access the service in the second access terminal, avoiding the problem of service unavailability during interaction between the first and second access terminals, which would lead to a poor user experience.
[0068] As another implementation of this application, in order to enable the first access terminal to query the target service information corresponding to the target service, this application also provides another implementation of the service access method, as detailed in the following embodiments.
[0069] Please see Figure 3 , Figure 3 The diagram illustrates a flowchart of another service access method provided in an embodiment of this application, including the following steps:
[0070] S310, Receive the second service information sent by the second access terminal.
[0071] In this embodiment, the second service information may be information corresponding to one or more external systems and / or one or more middlewares deployed in the second access terminal. It is understood that before the second access terminal sends the second service information to the first access terminal, the external systems or middleware in the second access terminal can register through the service management module in the second access terminal and store the registration information in the service management module.
[0072] In this embodiment of the application, service information can be transmitted through the communication module in the second access terminal.
[0073] S320. Based on the first service information and the second service information registered in the first access terminal, construct a service information database.
[0074] In this embodiment of the application, the first service information is information corresponding to one or more external systems and / or one or more middlewares deployed in the first access terminal.
[0075] In this embodiment of the application, the first access terminal can establish a service information database by combining the first service information and the second service information.
[0076] S330. In response to receiving an access request for the target service, if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel.
[0077] S340. If the target service information is found but the target service access channel is not found, determine the second target access terminal corresponding to the target service through the target service information.
[0078] S350, Send target service information to the second target access terminal.
[0079] S360: Receive the first channel returned by the second access terminal, and establish a target service access channel based on the first channel.
[0080] S370, Access the target service based on the target service access channel.
[0081] In this embodiment, S320 to S370 are the same as S210 to S250 in the above embodiment, and will not be described in detail here for the sake of brevity.
[0082] In this embodiment, a service information database is established by receiving second service information sent by the second access terminal and combining it with first service information registered by external systems or middleware in the first access terminal. This allows the first access terminal to determine whether the target service is deployed on the second access terminal when it receives an access request, based on the service information database. Furthermore, by synchronizing the service information database built with the second service information of the second access terminal, it is also possible to obtain the target service information of the target service and send it to the second access terminal if the target service is deployed on the second terminal. This enables the second access terminal to determine the target service through the target service information and thus establish an access channel for the target service.
[0083] Furthermore, in order to improve the communication efficiency of the edge-cloud collaborative system and save communication resources, this application also provides another implementation of the service access method, as detailed in the following embodiments.
[0084] Please see Figure 4 , Figure 4 The diagram illustrates a flowchart of another service access method provided in one embodiment of this application, including the following steps:
[0085] S410. In response to receiving an access request for the target service, if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel.
[0086] S420. If the target service information is found but the target service access channel is not found, determine the second target access terminal corresponding to the target service through the target service information.
[0087] S430: Send target service information to the second target access terminal.
[0088] S440: Receive the first channel returned by the second access terminal, and establish a target service access channel based on the first channel.
[0089] S450, Access the target service based on the target service access channel.
[0090] S460, Store the target service access channel to the service information database.
[0091] In this embodiment, S410 to S450 are the same as S210 to S250 in the above embodiment, and will not be described in detail here for the sake of brevity.
[0092] In this embodiment, the first access terminal stores the target service access channel in the service information database. When the first access terminal receives an access request to access the target service again, it can access it through the established access channel, thereby improving access efficiency and saving resources.
[0093] In this embodiment, after receiving an access request for the target service, the first access terminal can further determine that the target service is deployed on the first access terminal through a service information database. Furthermore, this application also provides another implementation of the service access method, as detailed in the following embodiments.
[0094] Please see Figure 5 , Figure 5 The diagram illustrates a flowchart of another service access method provided in one embodiment of this application, including the following steps:
[0095] S510. In response to receiving an access request for the target service, if it is determined that the target service is a service deployed on the first access terminal, the target service information corresponding to the access request is obtained from the service information database.
[0096] S520, Access the target service based on the target service information.
[0097] In this embodiment of the application, the first access terminal can determine the domain name information corresponding to the target service by parsing the access request of the target service, and query the service information database through the parsed domain name information, thereby determining that the target service is a service deployed on the first access terminal.
[0098] In this embodiment of the application, when the target service is determined to be a service deployed on the first access terminal, the first access terminal can obtain the target service information corresponding to the access request from the service information database, and establish a connection with the target service based on the target service information, thereby realizing access to the target service.
[0099] In this embodiment of the application, when the target service is determined to be a service deployed on the first access terminal, the target service information corresponding to the access request is obtained from the service information database, and a connection between the target service and the target service is established based on the target service information to realize access to the target service. This allows the application of the first access terminal to access the service corresponding to the external system or middleware deployed on the first access terminal in a simple and efficient way.
[0100] In this application embodiment, in order to improve the communication efficiency of the edge-cloud collaborative system and save communication resources, this application also provides another implementation of the service access method, as detailed in the following embodiments.
[0101] Please see Figure 6 , Figure 6 The diagram illustrates a flowchart of another service access method provided in an embodiment of this application, including the following steps:
[0102] S610. In response to receiving an access request for the target service, if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel.
[0103] S620. If the target service information and the target service access channel are found, access the target service based on the target service access channel.
[0104] In this embodiment, S610 is the same as S210 in the above embodiment, and will not be described in detail here for the sake of brevity.
[0105] In this embodiment of the application, when it is determined that the target service is a service deployed on the second access terminal, and the target service information and the target service access channel are found in the service information database, the target service can be accessed directly through the target access channel, thereby saving resources and improving the access speed of the target service.
[0106] In this embodiment of the application, combined with Figure 1 The edge-cloud collaborative system involved in this application, along with the following examples, illustrates the service access method. It is understood that in the examples below, the cloud platform is used as the first access point, and the edge gateway as the second access point.
[0107] In this embodiment, edge-cloud communication can be established between the cloud platform and the edge gateway by defining gRPC protocol interfaces. In one example, a gRPC service with two interfaces can be defined: a Tunnel interface and a Stream interface. Both interfaces have stream parameters and return types, indicating that both interfaces can perform streaming communication between the gRPC client and gRPC server in the edge-cloud collaborative system. The Tunnel interface can be used by the edge gateway to connect to the cloud platform as an initial communication channel. The Stream interface can be used by the edge gateway to establish a new communication channel with the cloud platform, specifically for communication between applications on the cloud platform and the corresponding services on the edge gateway, carrying and forwarding Transmission Control Protocol (TCP) communication.
[0108] In this embodiment, the gRPC service client can connect to the cloud platform's gRPC server. The gRPC client calls the Tunnel method to establish an initial communication channel between the edge gateway and the cloud platform. Service information is then synchronized through this initial communication channel.
[0109] Understandably, service information can be registered through the cloud platform and the first and second service management modules in the edge gateway before service information synchronization.
[0110] In this embodiment, the cloud platform can register external systems and middleware deployed on the first access terminal using the registration capability provided by the first service management module, and store the corresponding first service information. The edge gateway can register external systems and middleware deployed on the second access terminal using the registration capability provided by the second service management module, and store the corresponding second service information.
[0111] It is understood that external systems or middleware deployed in cloud platforms or edge gateways typically communicate using the TCP protocol. Therefore, in this embodiment, the target service in the access request can be determined to be the service corresponding to the external system or middleware by judging whether the target service communicates using the TCP protocol. Furthermore, it is understood that in this embodiment, external systems or middleware using other protocols for communication, such as Hypertext Transfer Protocol (HTTP), Kafka, or MySQL, can also be registered through the service management module. Here, Kafka can represent data publish-subscribe processing, and MySQL can represent persistent data storage.
[0112] In this embodiment, the registration parameters for external systems or middleware include at least the service name, local Internet Protocol (IP) information, and port information. The service information stored in the service management module includes at least the service name, local IP address, port, environment, protocol, and gateway IP address. The environment information indicates whether the service resides on an edge gateway or a cloud platform. Furthermore, in this embodiment, the gateway ID can be set as a namespace to distinguish services between different gateways. It is understood that this embodiment adheres to the principle that cloud-edge applications and services within the same namespace can communicate freely, simplifying the communication process and ensuring resource isolation.
[0113] Furthermore, the edge gateway synchronizes the second service information to the cloud platform through the initial communication channel. The first service management module in the cloud platform establishes a service information database based on the second service information and the first service information.
[0114] In this embodiment, when the cloud platform receives an access request from the first container application 111, it parses the access request based on the first protocol proxy module to determine the domain name information corresponding to the target service in the access request, and queries the service information database stored in the first service management module 113 to determine whether it is a service in the edge gateway and whether it is a TCP protocol. The Kubernetes mechanism can be used to set the DNS to the address of the first protocol proxy module, meaning the domain name resolution is performed by the first protocol proxy module.
[0115] In this embodiment of the application, if the target service is a service in the edge gateway or is not a TCP protocol, the original Kubernetes domain name resolution server is requested to obtain the domain name resolution result and return it to the first container application 111.
[0116] In this embodiment, if the target service is a service in the edge gateway and also uses the TCP protocol, the first protocol proxy module 112 can send a message to the edge gateway's gPRC client on the Tunnel information channel based on the gPRC connection between the cloud platform and the edge gateway. The message includes at least the service name and a newly created stream. After receiving the message, the gPRC client forwards the service name to the second protocol proxy module 122. The second protocol proxy module 122 obtains the target service information, including IP address, port, and TCP protocol, based on the service name, and initiates a TCP connection to the target service. After a successful TCP connection, a new information stream is created using the stream interface, and this information stream is bound to the TCP connection stream. The stream interface returns normally after successful binding.
[0117] In this embodiment of the application, the first protocol proxy module 112 receives a newly created stream from the stream interface, connects the access request with the stream information flow, and thus establishes an access channel for the target service.
[0118] In this embodiment, the first access terminal is an edge gateway and the second access terminal is the cloud. The process is the same as the above embodiments, and will not be described in detail here.
[0119] Based on the service access method provided in the above embodiments, this application also provides specific implementations of the service access device. Please refer to the following embodiments.
[0120] First see Figure 7 , Figure 7 This paper shows a schematic diagram of the structure of a service access device 700 according to an embodiment of the present application. The service access device 700 includes the following modules:
[0121] The query module 710 is used to respond to the received access request for the target service, and if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel. Among the first access terminal and the second access terminal, one is a cloud platform and the other is an edge gateway.
[0122] The determination module 720 is used to determine the second target access terminal corresponding to the target service based on the target service information when the target service information is found but the target service access channel is not found.
[0123] The sending module 730 is used to send target service information to the second target access terminal.
[0124] The receiving module 740 is used to receive the first channel returned by the second access terminal and establish a target service access channel based on the first channel. The first channel is obtained by the second target access terminal by binding the data transmission channel and communication channel of the target service. The data transmission channel of the target service is established by the second target access terminal with the target service when it receives the target service information. The communication channel is the communication channel between the second target access terminal and the first access terminal.
[0125] Access module 750 is used to access the target service based on the target service access channel.
[0126] In one embodiment, in order to enable the first access terminal to query the target service information corresponding to the target service, the above-mentioned device may further include: a storage module, used to receive second service information sent by the second access terminal; and to construct a service information database based on the first service information and the second service information registered in the first access terminal.
[0127] In one embodiment, the determining module 720 determines the target service as the second access service in the following way: parsing the access request of the target service to obtain the domain name information corresponding to the target service; querying the service information database based on the domain name information to determine the target service as the second access service.
[0128] In one embodiment, the storage module is further configured to: store the target service access channel to the service information database.
[0129] In one embodiment, the query module 710 is further configured to: if it is determined that the target service is a service deployed on the first access terminal, retrieve the target service information corresponding to the access request from the service information database. The access module 750 is further configured to access the target service based on the target service information.
[0130] In one embodiment, in order to improve the communication efficiency of the edge-cloud collaborative system and save communication resources, the access module 750 is further configured to: access the target service based on the target service access channel when the target service information is found and the target service access channel is found.
[0131] Figure 8 A schematic diagram of the hardware structure for service access provided in an embodiment of this application is shown.
[0132] The service access device may include a processor 801 and a memory 802 storing computer program instructions.
[0133] Specifically, the processor 801 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0134] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.
[0135] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.
[0136] The processor 801 implements any of the service access methods described in the above embodiments by reading and executing computer program instructions stored in the memory 802.
[0137] In one example, the service access device may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.
[0138] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0139] Bus 810 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0140] The service access device can receive access requests for the target service and execute the service access method in this application embodiment, thereby achieving a combination Figure 2 and Figure 7 Described service access methods and apparatus.
[0141] In addition, in conjunction with the service access methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the online data traffic billing methods in the above embodiments.
[0142] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0143] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0144] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0145] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0146] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A service access method, characterized in that, Applied to the first access terminal, the method includes: In response to receiving an access request for a target service, if it is determined that the target service is a service deployed on a second access terminal, the service information database is queried for the target service information corresponding to the access request and its corresponding target service access channel, wherein, of the first access terminal and the second access terminal, one is a cloud platform and the other is an edge gateway. If the target service information is found but the target service access channel is not found, the second target access terminal corresponding to the target service is determined through the target service information. Send the target service information to the second target access terminal; The system receives the first channel returned by the second access terminal and establishes a target service access channel based on the first channel. The first channel is obtained by the second target access terminal through binding the data transmission channel and communication channel of the target service. The data transmission channel of the target service is established by the second target access terminal and the target service when the second target access terminal receives the target service information. The communication channel is the communication channel between the second target access terminal and the first access terminal. Access the target service based on the target service access channel.
2. The service access method according to claim 1, characterized in that, Prior to responding to receiving an access request for the target service, the method further includes: Receive the second service information sent by the second access terminal; A service information database is constructed based on the first service information and the second service information registered in the first access terminal.
3. The method according to any one of claims 1 or 2, characterized in that, The determination that the target service is the second access terminal service includes: Parse the access request to the target service to obtain the domain name information corresponding to the target service; Based on the domain name information, the service information database is queried to determine that the target service is the second access terminal service.
4. The service access method according to claim 1, characterized in that, After establishing the target service access channel, the method further includes: Store the target service access channel in the service information database.
5. The service access method according to claim 1, characterized in that, After responding to receiving an access request for the target service, the method further includes: If the target service is determined to be a service deployed on the first access terminal, the target service information corresponding to the access request is obtained from the service information database; Access the target service based on the target service information.
6. The service access method according to claim 1, characterized in that, After querying the target service information corresponding to the access request and its corresponding target service access channel in the service information database, the method further includes: If the target service information and the target service access channel are found, the target service is accessed based on the target service access channel.
7. A service access device, characterized in that, Applied to a first access terminal, the device includes: The query module is used to respond to receiving an access request for a target service, and if it is determined that the target service is a service deployed on the second access terminal, query the service information database for the target service information corresponding to the access request and its corresponding target service access channel, wherein the first access terminal and the second access terminal are, respectively, a cloud platform and an edge gateway. The determination module is used to determine the second target access terminal corresponding to the target service based on the target service information when the target service information is found but the target service access channel is not found. The sending module is used to send the target service information to the second target access terminal; The receiving module is used to receive the first channel returned by the second access terminal, and establish a target service access channel based on the first channel. The first channel is obtained by the second target access terminal by binding the data transmission channel and communication channel of the target service. The data transmission channel of the target service is established by the second target access terminal and the target service when the second target access terminal receives the target service information. The communication channel is the communication channel between the second target access terminal and the first access terminal. The access module is used to access the target service based on the target service access channel.
8. A service access device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the service access method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the service access method as described in any one of claims 1-6.
10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device causes the electronic device to perform the service access method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data transmission method and device based on gateway cascade, equipment and storage medium
CN112152996A
Node access method, device and apparatus and computer readable storage medium
CN112165532A