Cloud container multi-level access method, apparatus, storage medium, and chip
By setting the corresponding relationship between subnet information, cloud container information and container identification in the cache server, the complex access problem of multiple different cloud containers in the existing technology is solved, and the cloud container access across multiple levels of servers is realized, and the technical cost is reduced. .
Patent Information
- Application Number
- PCT/CN2024/102673
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-14
- Filing Date
- 2024-06-28
- Publication Date
- 2025-02-20
AI Technical Summary
In the prior art, access to multiple different cloud containers is relatively complex, and the technical cost is high, making it difficult to achieve multi-level server access to cloud containers.
By setting the corresponding relationship between subnet information, cloud container information and container identification in the cache server, when receiving the access request from the user, query the cache server to obtain the address information of the cloud container, and pass the entrance gateway server and the subnet gateway The server implements access to cloud containers across multiple levels of servers.
Multi-level access to cloud containers is realized, the system is simple, easy to implement, and the technical cost is low. By forming the corresponding relationship between subnet information, cloud container information and container identification in the URL, the multi-level address information of cloud containers is obtained.
Smart Images

Figure CN2024102673_20022025_PF_FP_ABST
Abstract
Description
Cloud container multi-level access method, device, storage medium and chip
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 14, 2023, with application number 202311021054.1 and application name “Multi-level access method, device, storage medium and chip for cloud container”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a cloud container multi-level access method, device, storage medium, and chip. Background Art
[0003] In order to develop applications for different electronic devices (such as POS machines), it is often necessary to deploy different embedded system development environments and simulation environments for the corresponding electronic devices. Since the deployment of the environment is closely related to the operating system, compiler version, dependent libraries, etc., the process is relatively cumbersome, and it is even more difficult to achieve the coexistence of multiple different types of environments.
[0004] In order to meet the above business needs, a programming environment or simulation environment can be created in the cloud container. Users access the cloud container through electronic devices and then use the programming environment or simulation environment in the cloud container. However, since each user has multiple needs, it is necessary to create multiple different types of programming environments or simulation environments for the user. In the existing technology, access to multiple different cloud containers is relatively complicated (for example, using Kubernetes cluster technology), and the technical cost is relatively high.
[0005] Summary of the Invention
[0006] The present application provides a multi-level access method, device, storage medium and chip for cloud containers. By setting the correspondence between subnet information, cloud container information and container identifier on a cache server, upon receiving an access request sent by a user terminal, the cache server is queried for the address information corresponding to the container identifier. The user accesses the cloud container in the subnet based on the subnet information and cloud container information in the address information. This method is easy to implement, has low technical cost, and enables access to cloud containers across multiple servers through an entry gateway server and a subnet gateway server.
[0007] To achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, a multi-level access method for a cloud container is provided, which is applied to an ingress gateway server. The method includes:
[0009] Receive an access request sent by a user terminal, wherein the access request carries a uniform resource locator (URL), and the URL carries a container identifier;
[0010] Sending a query request to a cache server according to the access request, the query request carrying the container identifier, the cache server storing a corresponding relationship, the corresponding relationship being an association between the container identifier and address information, the address information including subnet information and cloud container information;
[0011] receiving a query response sent by the cache server, wherein the query response carries the address information;
[0012] Updating the access request according to the cloud container information to obtain a redirected access request, where the redirected access request carries the cloud container information;
[0013] Send a redirect access request to a subnet gateway corresponding to the subnet information, so that the subnet gateway forwards the redirect access request to the cloud container corresponding to the cloud container information.
[0014] In some embodiments, the method further comprises:
[0015] receiving an update message sent by the user terminal;
[0016] The update message is forwarded to the web application server, where the update message is used to instruct the web application server to update the URL of the cloud container and update the corresponding relationship in the cache server according to the container identifier in the updated URL.
[0017] In some embodiments, the method further comprises:
[0018] receiving a creation request sent by the user terminal, wherein the creation request carries user information;
[0019] Forward the creation request to the web application server, where the creation request is used to instruct the web application server to determine a subnet based on the user information, create a cloud container in the subnet, generate a container identifier for the cloud container, and then store a correspondence between the container identifier, the subnet information where the cloud container is located, and the cloud container information in the cache server.
[0020] In some embodiments, the method further comprises:
[0021] A response message from the web application server is received, where the response message carries a URL corresponding to the cloud container.
[0022] In some embodiments, the corresponding relationship in the cache server has a preset time. If the corresponding relationship in the cache server exceeds the preset time, the cache server deletes the corresponding relationship. After a query request is sent to the cache server based on the access request, the query response indicates that the cache server does not store the corresponding relationship corresponding to the container identifier.
[0023] If the corresponding relationship in the cache server does not exceed the preset time, the cache server stores the corresponding relationship, and the query response carries the address information.
[0024] In some embodiments, the method further comprises:
[0025] receiving a query message sent by the user terminal, wherein the query message is used to query a URL of a specified cloud container;
[0026] Forwarding the query message to the web application server;
[0027] The query response is received, where the query response carries a URL of a specified cloud container.
[0028] In some embodiments, the container identifier is a random string, and the URL is formed by concatenating the container identifier and domain name information.
[0029] In a second aspect, an entry gateway server is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method in any optional implementation of the first aspect are implemented.
[0030] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of the first aspects are implemented.
[0031] In a fourth aspect, a chip is provided, comprising a processor and an interface; the processor is used to read instructions to execute the steps of any one of the methods described in the first aspect.
[0032] The methods, devices, storage media, and chips provided in the embodiments of the present application have the following effective effects:
[0033] The multi-level access method for cloud containers provided in the present application presets a correspondence between address information and container identifiers in a cache server. When an entry gateway server receives an access request carrying a URL, it queries the cache server to obtain the address information corresponding to the container identifier in the URL. Then, based on the address information, a redirect access request is sent to the corresponding subnet gateway server, so that the subnet gateway server forwards the redirect request to the corresponding cloud container, thereby achieving access to the cloud container. The system of the above-mentioned access process is simple and easy to implement. By forming a correspondence between the subnet information where the sub-cloud container is located, the cloud container information and the container identifier in the URL, the multi-level address information of the cloud container can be obtained, thereby achieving multi-level server access through the entry gateway server and the subnet gateway server. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] FIG1 is a schematic diagram of an application scenario provided in an embodiment of the present application.
[0035] FIG2 is a flow chart of a multi-level access method for a cloud container provided in an embodiment of the present application.
[0036] FIG3 is a schematic diagram of another application scenario provided by an embodiment of the present application.
[0037] FIG4 is a flow chart of another multi-level access method for cloud containers provided in an embodiment of the present application.
[0038] FIG5 is a flow chart of another multi-level access method for cloud containers provided in an embodiment of the present application.
[0039] FIG6 is a flow chart of another multi-level access method for cloud containers provided in an embodiment of the present application.
[0040] FIG7 is a schematic diagram of the structure of a subnet gateway server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two, and "at least one" and "one or more" refer to one, two or more. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the definition of "first" and "second" features can explicitly or implicitly include one or more of the features.
[0042] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0043] In actual applications, when users program and develop applications for electronic devices (such as POS machines) or verify applications, this can be achieved by deploying an environment in the cloud. For example, a pre-configured development environment is deployed in a cloud container, and developers access the cloud container to use the programming environment in the cloud container to program and develop applications on electronic devices. For example, in the development of electronic device applications, in order to verify the running effect of the program in the electronic device of a certain model without a physical electronic device of that model, the program is downloaded to the emulator in the cloud container and run, and the screen results after the run are sent back for display, so that developers can realize the simulation verification of the program by accessing the emulator in the cloud container.
[0044] However, due to the diversity of developer needs, multiple cloud containers are usually set up in multiple subnets. Most existing technologies can only access multiple cloud containers in the same subnet, and cannot achieve multi-level proxy access, that is, it is impossible to access the cloud container in any subnet among multiple subnets.
[0045] Based on the above technical problems, an embodiment of the present application provides a method for accessing a cloud container. Before a user accesses a cloud container, a cache server stores the correspondence between a container identifier and cloud container address information. When receiving an access request from the user, the cache server is queried through the container identifier in the access request to obtain the address information of the cloud container. Multi-level access to the cloud container is achieved through the entry gateway server and the subnet gateway server based on the address information. The above access process system is simple and easy to implement. By querying the cache server to obtain the address information, there is no need to additionally set up a service to query the cloud container address, which reduces software costs. The address information contains subnet information and cloud container information. Access to different cloud containers in multiple subnets can be achieved through the subnet information and cloud container information.
[0046] First, the application scenarios of the cloud container access method provided in this application are described.
[0047] The following is an explanation through the application scenario shown in Figure 1. Please refer to Figure 1. Figure 1 is a schematic diagram of an application scenario of a web system provided by an embodiment of the present application. The web system in Figure 1 includes a subnet gateway server and a cache server. The user can send an access request to the subnet gateway server through an application in an electronic device (such as a browser). After the subnet gateway server receives the access request sent by the user terminal, it sends a query request to the cache server based on the access request to obtain address information including subnet information and cloud container information, and then sends a redirect access request to the corresponding subnet gateway server based on the address information, so that the subnet gateway server forwards the redirect access request to the cloud container corresponding to the cloud container information, thereby realizing access to the cloud container in the subnet.
[0048] Among them, the subnet in Figure 1 includes a cloud container. It can be understood that in other embodiments, there may be at least two cloud containers in each subnet, and the subnet gateway server can determine the corresponding cloud container based on each cloud container information (such as IP address).
[0049] Among them, the subnet in Figure 1 includes one subnet. It can be understood that in other embodiments, the user terminal can access multiple subnets through the entry gateway server. The entry gateway server can determine the corresponding subnet based on the subnet information and access the cloud container in the subnet through the subnet gateway server.
[0050] Among them, in Figure 1, access across two levels of servers can be achieved through the cooperation of the entry gateway server and the subnet gateway server. It can be understood that in other embodiments, there can be at least one small subnet in each subnet, and the subnet information of the address information includes the entry subnet information and information of other subnets in the subnet, so that the entry gateway server can determine the entry subnet based on the subnet information, and the entry subnet gateway server can determine the small subnet in the subnet based on the subnet information, thereby achieving access across multiple levels of servers.
[0051] Optionally, the cloud container in FIG1 may be a virtual computer resource or a physical computer device with an IP address and network access capability, such as a server, a virtual machine, an emulator, an IoT device, or other resource devices.
[0052] Please refer to FIG2 , which is a flowchart of a multi-level access method for cloud containers provided in an embodiment of the present application. The multi-level access method for cloud containers can be applied to the web system shown in FIG1 . The method may include the following steps:
[0053] S201: The entry gateway server receives an access request sent by a user terminal.
[0054] The access request carries a uniform resource locator (URL), and the URL carries a container identifier.
[0055] Illustratively, the URL is https: / / www.example.com / aaaaaaaaa / emulator / 1, where the container identifier is aaaaaaaaaa.
[0056] In some optional implementations, the URL further carries auxiliary information, and the identification information and the auxiliary information cooperate to uniquely identify the cloud container in the subnet.
[0057] For example, the URL is https: / / www.example.com / aaaaaaaaa / emulator / 1, where the container identifier is aaaaaaaaaa and the auxiliary information is emulator / 1. The container identifier and the auxiliary information are configured to indicate that the URL is used to access cloud container 1.
[0058] In some optional implementations, the user enters a URL in an application of the electronic device, and the application forms an access request and sends the access request to the entry gateway server. Optionally, the application of the electronic device may be a browser.
[0059] S202: The entry gateway server sends a query request to the cache server based on the access request.
[0060] The query request carries a container identifier, which can be used to identify a cloud container or a type of cloud container in the subnet (for example, a cloud container with similar functions or a cloud container with the same development environment).
[0061] S203: The cache server receives the query request, determines the address information according to the query request and the corresponding relationship, and sends a query response to the entry gateway server.
[0062] The query response carries address information, which includes the subnet information where the cloud container is located and the cloud container information.
[0063] Furthermore, the subnet information can be the IP information corresponding to the subnet, and the cloud container information can be the IP address or container name (container name) of the cloud container, where the container name can be resolved by the DNS system in the subnet. Since the IP address of the cloud container may change after the cloud container is restarted, but the container name is relatively fixed, after the IP address changes, the corresponding cloud container can be found by the container name. Therefore, compared with the IP address, the container name is more adaptable.
[0064] The cache server stores a corresponding relationship, which describes the association between the container identifier and the address information. The cache server queries the corresponding relationship based on the container identifier in the query request to determine the address information corresponding to the container identifier.
[0065] Optionally, the cache server stores multiple corresponding relationships, each corresponding relationship corresponding to a specific cloud container and container identifier.
[0066] S204: The entry gateway server receives the query response sent by the cache server.
[0067] The query response carries the address information corresponding to the container identifier.
[0068] S205: The entry gateway server updates the access request according to the cloud container information and obtains a redirected access request.
[0069] The redirected access request carries the cloud container information.
[0070] Optionally, the cloud container information is in a header in the redirected access request.
[0071] S206: The entry gateway server sends a redirect access request to the subnet gateway server corresponding to the subnet information, so that the subnet gateway server forwards the redirect access request to the cloud container corresponding to the cloud container information.
[0072] Specifically, the entry gateway server sends a redirect access request to the subnet gateway server of the subnet where the cloud container is located. Since the redirect access request carries cloud container information, the subnet gateway server parses the redirect request and obtains the cloud container information. The subnet gateway server searches for the address of the corresponding cloud container based on static configuration rules and other methods, and forwards the redirect request to the corresponding cloud container, thereby enabling users to access the cloud container.
[0073] For example, when a user enters the URL https: / / www.example.com / aaaaaaaaa / emulator / 1 in a browser, the ingress gateway server receives the access request and parses the URL according to the rules to obtain the container identifier "aaaaaaaaa". It then sends a query request to the cache server, which carries the container identifier. The cache server queries the corresponding address information based on the container identifier: "192.168.1.2 > 172.16.0.100" and returns the address information to the ingress gateway server through a query response. The ingress gateway server parses the address information and obtains the subnet IP address "192.168.1.2 > 172.16.0.100". 2", the container IP is "172.16.0.100", and the access request is updated to a redirect update request: "http: / / 192.168.1.2 / emulator / 1". The redirect access request carries the header "Next-Address:172.16.0.100". The entry gateway server sends a redirect access request to the subnet. After receiving the redirect access request, the gateway server in the subnet obtains the next-hop forwarding address, "http: / / 172.16.0.100 / emulator / 1", based on the header "Next-Address" in the redirect access request, and forwards the redirect access request to the cloud container. After receiving the request, the service running in the cloud container resolves the "emulator / 1" in the URL and returns the corresponding simulation effect data along the original path as a response. After receiving the response data, the browser will draw the data and display it on the browser interface.
[0074] The above-mentioned cloud container access method presets the correspondence between address information and container identifier in the cache server. When the entry gateway server receives an access request carrying a URL, it queries the cache server to obtain the address information corresponding to the container identifier in the URL, and then sends a redirect access request to the corresponding subnet gateway server based on the address information, so that the subnet gateway server forwards the redirect request to the corresponding cloud container, thereby realizing access to the cloud container. The above-mentioned access process system is simple and easy to implement. By forming a correspondence between the subnet information where the sub-cloud container is located, the cloud container information and the container identifier, the multi-level address information of the cloud container can be obtained, so that multi-level server access to the cloud container can be realized through the entry gateway server and the subnet gateway server, and then the resources in the cloud container can be used.
[0075] In some embodiments, the correspondence stored in the cache server has a preset time. If the correspondence stored in the cache server exceeds the preset time, the cache server deletes the correspondence. The validity period of the correspondence is limited by the preset time to prevent malicious access to the cloud container due to URL leakage, thereby improving the security of cloud container access.
[0076] Optionally, the cache server may set a timer for each correspondence, where the timer duration is a preset time. While the timer is valid, the entry gateway server may query the address information in the correspondence through a query request; when the timer exceeds the validity period, the cache server deletes the correspondence, thereby preventing the entry gateway server from querying the address information corresponding to the container identifier in the URL through a query message.
[0077] Optionally, the corresponding relationship in the cache server is temporarily stored in the cache server via cache, and the edge entry gateway server performs a quick query. Since the temporary data stored in the cache has a validity period of a preset time, the cached corresponding relationship in the cache server becomes invalid after the preset time.
[0078] Among them, the preset time can be customized by the user.
[0079] Since the corresponding relationship in the cache server has a preset time, if the corresponding relationship in the cache server exceeds the preset time, the cache server deletes the corresponding relationship, and the method further includes:
[0080] The ingress gateway server sends a query request to the cache server based on the access request, and the query request carries the container identifier;
[0081] The entry gateway server receives a query response sent by the cache server, where the query response does not carry address information and indicates that the cache server does not have a corresponding relationship with the container identifier in the URL.
[0082] In this way, by setting a preset time for the correspondence to limit the validity period of the correspondence, the security of cloud container access is improved. If the correspondence in the cache server exceeds the preset time, the entry gateway server cannot obtain the address information of the cloud container, and the user cannot access the corresponding cloud container through the URL.
[0083] Optionally, when the entry gateway server receives the query response sent by the cache server, the entry gateway server sends a response message to the user terminal to prompt the user that the URL has expired, and returns a 404 error to the browser used by the user, informing the developer that the resource corresponding to the URL address does not exist.
[0084] When the access URL address becomes invalid, when the developer uses the invalid URL address to access the web system again, the entry gateway server will return a page that cannot be provided, such as a 404 error page, because the corresponding data cannot be found in the cache server.
[0085] Please refer to Figure 3, which is a schematic diagram of another application scenario provided by an embodiment of the present application. The web system in Figure 3 is similar to the web system in Figure 1, and the web system includes an entry gateway server and a cache server. The difference is that the web system in Figure 3 also includes a web application server, which can be connected to multiple subnets. Users can update the URL corresponding to the cloud container through the web application server and update the corresponding relationship in the cache server based on the updated URL.
[0086] Please refer to FIG4 , which is a flow chart of a multi-level access method for a cloud container provided by an embodiment of the present application. After the web system receives the update message sent by the user terminal, the multi-level access method for the cloud container further includes:
[0087] S401: The entry gateway server receives an update message sent by the user terminal.
[0088] In some embodiments, a user can access the web login interface provided by the web system through an application on an electronic device (such as a browser). The user performs identity authentication in the user interface (such as entering a user name and password for identity authentication). After successful authentication, the user can enter an update indication operation in the user interface (such as clicking an update indication icon) to form an update message sent to the entry gateway server.
[0089] In some embodiments, the update message carries information about a specific cloud container (e.g., a container identifier) to instruct the web application server to update the corresponding relationship corresponding to the specific cloud container. In other embodiments, the update message does not carry information about a specific cloud container to instruct the web application server to update all corresponding relationships in the cache server.
[0090] S402: The entry gateway server forwards the update message to the web application server.
[0091] S403: The web application server receives the update message, updates the URL of the cloud container according to the update message, and updates the corresponding relationship in the cache server according to the container identifier in the updated URL.
[0092] Optionally, after the web application server receives the update message, the web application server updates the URL of the cloud container according to the update message, and then forms a new correspondence based on the container identifier in the updated URL, the cloud container information corresponding to the container identifier, and the subnet information where the cloud container is located. The web application server writes the new correspondence to the cache server.
[0093] Optionally, the web application server updates the corresponding URL by updating the container identifier.
[0094] Optionally, the web application server writes the new correspondence into the cache server. If the cache server stores the correspondence of the cloud container, the new correspondence overwrites the original correspondence.
[0095] In some embodiments, the web application server updates the URL according to the update message, including:
[0096] Generate a container identifier based on the update message, which is a random string;
[0097] The updated URL is obtained by concatenating the container identifier string and the domain name information.
[0098] In this way, a random string is generated to form a container identifier, and the container identifiers are concatenated to form a URL to ensure the randomness of the URL, thereby improving the security of cloud container access.
[0099] Furthermore, before splicing the updated URL based on the container identifier and the domain name information, the web application server is also used to check the duplication of the random string to check whether the string is repeated with the container identifier (or the existing random string) in the URL in the corresponding relationship in the cache server. If repeated, the web application server regenerates the random string and performs the duplication check again until a non-repeating random string is obtained and the random string is used as the container identifier, and then the updated URL is spliced based on the container identifier and the domain name information.
[0100] In some embodiments, after S403, the cloud container multi-level access method further includes:
[0101] The web application server sends a response message to the ingress gateway server, which carries the URL of the cloud container.
[0102] The ingress gateway server receives the response message sent by the web application server and forwards the response message to the user end.
[0103] In this way, after the web application server updates the URL according to the update message, it is also used to return the updated URL to the user terminal through the entry gateway server.
[0104] Optionally, the response message forwarded by the ingress gateway server to the user terminal displays the updated URL in the form of a hyperlink on the user interface of the web system.
[0105] In the multi-level cloud container access method shown in FIG4 , the web application server updates the correspondence between the container identifier in the URL corresponding to the cloud container and the cache server based on an update message from the user. It is understood that in other embodiments, a timer corresponding to the URL may be set in the web application server. After the timer for the corresponding URL expires, the web application server updates the URL of the cloud container and then forms a new correspondence based on the updated URL, the cloud container information corresponding to the container information in the URL, and the subnet information where the cloud container resides. The web application server then writes the new correspondence to the cache server. If the user cannot access the cloud container based on the URL, the user can send a query message to the web system to obtain the updated URL.
[0106] Please refer to FIG. 5 , which is a flowchart of another cloud container multi-level access method provided in an embodiment of the present application. When the user terminal cannot access the cloud container according to the URL, the cloud container multi-level access method further includes:
[0107] S501: The entry gateway server receives a query message sent by a user terminal.
[0108] The query message is used to query the URL of the cloud container.
[0109] In some embodiments, a user can access the web login interface provided by the web system through an application on an electronic device (such as a browser). The user performs identity authentication in the user interface (for example, enters a user name and password for identity authentication). After successful authentication, the user can enter a query indication operation in the user interface (for example, click a query indication mark) to form a query message sent to the entry gateway server for querying the URL corresponding to the specified cloud container.
[0110] S502: The entry gateway server forwards the query message to the web application server.
[0111] S503. The web application server receives the query message and returns a query response to the ingress gateway server. The query response carries the URL corresponding to the cloud container.
[0112] S504: After receiving the query response, the entry gateway server forwards the query response to the user terminal.
[0113] In this way, when the user cannot access the cloud container through the URL, he can log in to the web system. After successful login, he can send a query message to the web application server through the entry gateway server to query the latest URL corresponding to the cloud container.
[0114] In some embodiments, when the user exits the web system, the web application server sends a deletion instruction to the cache server to delete the corresponding relationship in the cache server.
[0115] In some embodiments, if the URL of the specified container triggers a reset instruction (for example, the container corresponding timer times out, etc.), the web application server updates the specified URL, forms a correspondence based on the container identifier, cloud container information, and subnet information where the cloud container is located in the updated URL, and overwrites the old correspondence of the cloud container in the cache server with this correspondence.
[0116] Furthermore, the web application server has a cloud container creation function. When receiving a creation request sent by a user terminal, the web application server creates a cloud container in the corresponding subnet according to the creation request, then generates a URL corresponding to the cloud container, and forms a corresponding relationship based on the URL, cloud container information, and subnet information where the cloud container is located. The corresponding relationship is stored in the cache server. Please refer to Figure 6, which is a flowchart of another cloud container multi-level access method provided by an embodiment of the present application. When the entry gateway server receives the creation request from the user terminal, the cloud container multi-level access method further includes:
[0117] S601: The portal gateway server receives a creation request sent by a user terminal.
[0118] The creation request is used to instruct the web application server to create a corresponding cloud container in the subnet.
[0119] In some embodiments, a user can access the web login interface provided by the web system through an application on an electronic device (such as a browser). The user performs identity authentication in the user interface (for example, enters a user name and password for identity authentication). After successful authentication, the user can enter a creation indication operation in the user interface (for example, clicks a creation indication logo) to form a creation message sent to the entry gateway server for creating a corresponding cloud container.
[0120] Optionally, the creation request carries a container type, and the container type is used to indicate the type of the cloud container to be created. It is understandable that the web application server can create different types of containers for different user needs.
[0121] S602: The entry gateway server forwards the creation request to the web application server.
[0122] S603: The web application server forwards the creation request to create a cloud container in the subnet.
[0123] Optionally, the web application server determines the corresponding subnet based on the creation request, sends a creation message to the container management server of the subnet, and implements the creation of the cloud container through the container management server. For example, the web application server determines the Docker Deamon service in the subnet and calls the interface provided by it to complete the creation of the container.
[0124] S604: The web application server generates a container identifier for the cloud container, and then stores the corresponding relationship between the container identifier, the subnet information where the cloud container is located, and the cloud container information in the cache server.
[0125] In this way, when a user has a demand to create a cloud container, the creation of the cloud container is completed by sending a creation request to the web system.
[0126] In some embodiments, after S604, the cloud container multi-level access method further includes:
[0127] The web application server sends a response message to the ingress gateway server, which carries the URL of the cloud container.
[0128] The ingress gateway server receives the response message sent by the web application server and forwards the response message to the user end.
[0129] In this way, after the web application server creates the cloud container, the URL corresponding to the cloud container is sent to the user terminal through the entry gateway server.
[0130] It is understandable that different users have different permissions. For example, user A can use resources in subnet 1, while user B can use resources in subnet 2 and subnet 3. Or different users have different preferences. User A sets the web application server to only apply resources in subnet 4. The web then selects a specific subnet based on the user corresponding to the creation request; this is to meet the preferences or personalized needs of different users.
[0131] In some embodiments, the creation request carries user information, and S603 includes:
[0132] The target subnet is determined based on user information and preset matching rules, and a cloud container is created in the target subnet.
[0133] Optionally, the user information may be a user identifier, such as an identity identifier, a work number, or the like.
[0134] Optionally, the preset matching rule may be a matching relationship between users and subnets.
[0135] Optionally, the user terminal sends an access request to the web system, and after access to the cloud container is achieved through the cooperation of the entry gateway server and the subnet gateway server, a password must be entered before the resources of the cloud container can be used.
[0136] For example, in the Nextuido project, cloud containers are mainly used to provide IDE services for online programming. After the user accesses the IDE service page according to the URL, the user is prompted to enter a password before further access. Password verification is performed to improve the security of cloud container access.
[0137] Please refer to Figure 7 for a schematic diagram of the structure of a subnet gateway server provided in an embodiment of the present application. As shown in Figure 7, the subnet gateway server 70 provided in this embodiment may include: a processor 740, a memory 741, and a computer program 742 stored in the memory 741 and executable on the processor 740, such as a program corresponding to the method. When the processor 740 executes the computer program 742, it implements the steps described above in the method embodiment, such as the steps shown in Figures 1 to 6.
[0138] Exemplarily, computer program 742 may be divided into one or more modules / units, one or more of which are stored in memory 741 and executed by processor 740 to implement the present application. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of computer program 742 in subnet gateway server 70.
[0139] Those skilled in the art will understand that FIG7 is merely an example of the subnet gateway server 70 and does not constitute a limitation on the subnet gateway server 70 , which may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0140] The processor 740 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0141] The memory 741 may be an internal storage unit of the subnet gateway server 70, such as a hard disk or memory of the subnet gateway server 70. The memory 741 may also be an external storage device of the subnet gateway server 70, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, or a flash card equipped on an electronic device. Furthermore, the memory 741 may include both an internal storage unit of the subnet gateway server 70 and an external storage device.
[0142] The memory 741 is used to store computer programs and other programs and data required by the electronic device. The memory 741 can also be used to temporarily store data that has been output or is to be output.
[0143] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units as needed, that is, the internal structure of the power supply control device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0144] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0145] An embodiment of the present application provides a chip including a processor and an interface; the processor is used to read instructions to execute the steps in the above-mentioned various method embodiments.
[0146] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0147] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0148] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
[0149] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A multi-level access method for cloud containers, wherein: Applied to an ingress gateway server, the method comprises: Receive an access request sent by a user terminal, wherein the access request carries a uniform resource locator URL, and the URL carries a container identifier; Sending a query request to a cache server according to the access request, wherein the query request carries the container identifier, and a corresponding relationship is stored in the cache server, wherein the corresponding relationship is an association relationship between the container identifier and address information, and the address information includes subnet information and cloud container information; receiving a query response sent by the cache server, wherein the query response carries the address information; updating the access request according to the cloud container information to obtain a redirected access request, where the redirected access request carries the cloud container information; A redirect access request is sent to a subnet gateway corresponding to the subnet information, so that the subnet gateway forwards the redirect access request to the cloud container corresponding to the cloud container information.
2. The method according to claim 1, wherein: The method further comprises: Receive an update message sent by the user terminal; forward the update message to the web application server, wherein the update message is used to instruct the web application server to update the URL of the cloud container and update the corresponding relationship in the cache server according to the container identifier in the updated URL.
3. The method according to claim 1, wherein: The method further comprises: Receive a creation request sent by the user terminal, the creation request carrying user information; forward the creation request to a web application server, the creation request is used to instruct the web application server to determine a subnet according to the user information, create a cloud container in the subnet, generate a container identifier of the cloud container, and then store the correspondence between the container identifier and the subnet information and cloud container information where the cloud container is located in the cache server.
4. The method according to claim 2 or 3, wherein: The method further comprises: A response message from the web application server is received, where the response message carries a URL corresponding to the cloud container.
5. The method according to claim 1, wherein: The corresponding relationship in the cache server has a preset time. If the corresponding relationship in the cache server exceeds the preset time, the cache server deletes the corresponding relationship, and the query response indicates that the cache server does not store the corresponding relationship corresponding to the container identifier; If the corresponding relationship in the cache server does not exceed the preset time, the cache server stores the corresponding relationship, and the query response carries the address information.
6. The method according to claim 5, wherein: The method further comprises: receiving a query message sent by the user terminal, wherein the query message is used to query a URL of a specified cloud container; Forwarding the query message to a web application server; A query response is received, where the query response carries a URL of a specified cloud container.
7. The method according to claim 1, wherein: The container identifier is a random string, and the URL is formed by concatenating the container identifier and domain name information.
8. An entry gateway server, wherein: The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a multi-level access method for a cloud container is implemented. The multi-level access method for a cloud container comprises: Receive an access request sent by a user terminal, wherein the access request carries a uniform resource locator URL, and the URL carries a container identifier; Sending a query request to a cache server according to the access request, wherein the query request carries the container identifier, and a corresponding relationship is stored in the cache server, wherein the corresponding relationship is an association relationship between the container identifier and address information, and the address information includes subnet information and cloud container information; receiving a query response sent by the cache server, wherein the query response carries the address information; updating the access request according to the cloud container information to obtain a redirected access request, where the redirected access request carries the cloud container information; A redirect access request is sent to a subnet gateway corresponding to the subnet information, so that the subnet gateway forwards the redirect access request to the cloud container corresponding to the cloud container information.
9. The ingress gateway server according to claim 8, wherein: When the processor executes the computer program, it is also used to implement: Receive an update message sent by the user terminal; forward the update message to the web application server, wherein the update message is used to instruct the web application server to update the URL of the cloud container and update the corresponding relationship in the cache server according to the container identifier in the updated URL.
10. The ingress gateway server according to claim 8, wherein: When the processor executes the computer program, it is also used to implement: Receive a creation request sent by the user terminal, the creation request carrying user information; forward the creation request to a web application server, the creation request is used to instruct the web application server to determine a subnet according to the user information, create a cloud container in the subnet, generate a container identifier of the cloud container, and then store the correspondence between the container identifier and the subnet information and cloud container information where the cloud container is located in the cache server.
11. The ingress gateway server according to claim 9, wherein: When the processor executes the computer program, it is also used to implement: A response message from the web application server is received, where the response message carries a URL corresponding to the cloud container.
12. The ingress gateway server according to claim 8, wherein: The corresponding relationship in the cache server has a preset time. If the corresponding relationship in the cache server exceeds the preset time, the cache server deletes the corresponding relationship, and the query response indicates that the cache server does not store the corresponding relationship corresponding to the container identifier; If the corresponding relationship in the cache server does not exceed the preset time, the cache server stores the corresponding relationship, and the query response carries the address information.
13. The ingress gateway server according to claim 12, wherein: When the processor executes the computer program, it is also used to implement: receiving a query message sent by the user terminal, wherein the query message is used to query a URL of a specified cloud container; Forwarding the query message to a web application server; A query response is received, where the query response carries a URL of a specified cloud container.
14. The ingress gateway server according to claim 8, wherein: The container identifier is a random string, and the URL is formed by concatenating the container identifier and domain name information.
15. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a cloud container multi-level access method, the cloud container multi-level access method comprising: Receive an access request sent by a user terminal, wherein the access request carries a uniform resource locator URL, and the URL carries a container identifier; Sending a query request to a cache server according to the access request, wherein the query request carries the container identifier, and a corresponding relationship is stored in the cache server, wherein the corresponding relationship is an association relationship between the container identifier and address information, and the address information includes subnet information and cloud container information; receiving a query response sent by the cache server, wherein the query response carries the address information; updating the access request according to the cloud container information to obtain a redirected access request, where the redirected access request carries the cloud container information; A redirect access request is sent to a subnet gateway corresponding to the subnet information, so that the subnet gateway forwards the redirect access request to the cloud container corresponding to the cloud container information.
16. A chip, wherein: including processor, storage medium and interface; The storage medium stores computer instructions, and the processor is used to read the computer instructions to execute a cloud container multi-level access method, wherein the cloud container multi-level access method includes: Receive an access request sent by a user terminal, wherein the access request carries a uniform resource locator URL, and the URL carries a container identifier; Sending a query request to a cache server according to the access request, wherein the query request carries the container identifier, and a corresponding relationship is stored in the cache server, wherein the corresponding relationship is an association relationship between the container identifier and address information, and the address information includes subnet information and cloud container information; receiving a query response sent by the cache server, wherein the query response carries the address information; updating the access request according to the cloud container information to obtain a redirected access request, where the redirected access request carries the cloud container information; A redirect access request is sent to a subnet gateway corresponding to the subnet information, so that the subnet gateway forwards the redirect access request to the cloud container corresponding to the cloud container information.
17. The chip according to claim 16, wherein: The cloud container multi-level access method includes: Receive an update message sent by the user terminal; forward the update message to the web application server, wherein the update message is used to instruct the web application server to update the URL of the cloud container and update the corresponding relationship in the cache server according to the container identifier in the updated URL.
18. The chip according to claim 16, wherein: The cloud container multi-level access method includes: Receive a creation request sent by the user terminal, the creation request carrying user information; forward the creation request to a web application server, the creation request is used to instruct the web application server to determine a subnet according to the user information, create a cloud container in the subnet, generate a container identifier of the cloud container, and then store the correspondence between the container identifier and the subnet information and cloud container information where the cloud container is located in the cache server.
19. The chip according to claim 17 or 18, wherein: The cloud container multi-level access method includes: A response message from the web application server is received, where the response message carries a URL corresponding to the cloud container.
20. The chip according to claim 16, wherein: The corresponding relationship in the cache server has a preset time. If the corresponding relationship in the cache server exceeds the preset time, the cache server deletes the corresponding relationship, and the query response indicates that the cache server does not store the corresponding relationship corresponding to the container identifier; If the corresponding relationship in the cache server does not exceed the preset time, the cache server stores the corresponding relationship, and the query response carries the address information.
Citation Information
Patent Citations
Cross-platform login unify authentication docking method, storage medium, and electronic device
CN109063457A
Resource isolation system, request processing method and request processing device
CN113067803A
Cloud container multi-level access method and device, storage medium and chip
CN117076046A
Method and apparatus for processing service request
US20200344208A1
Techniques for selective container access to cloud services based on hosting node
US20220217139A1