Disclosure of Invention
The application mainly aims to provide a decentralized cloud computing platform, a service deployment and access method and a service deployment and access component, and aims to solve the technical problem that the cloud computing platform is low in service performance.
In order to achieve the above object, the present application provides a decentralized cloud computing platform, which is implemented based on DHT, and includes: a plurality of decentralized nodes, each decentralized node comprising: DHT instances and POD instances;
the process of implementing the decentralized cloud computing platform based on DHT comprises the following steps:
collecting a plurality of nodes;
deploying an agent process in each node;
deploying the DHT instance and the POD instance in each node by using the agent process so as to convert each node into a decentralized node.
In order to achieve the above object, the present application further provides a service deployment method applied to the decentralized cloud computing platform, including:
receiving a deployment request of a service;
determining a plurality of target decentralized nodes for deploying the service;
storing the service name and the service information of the service in the DHT instance of each target decentralized node so that each target decentralized node can complete the broadcast of the service information based on a DHT network protocol to obtain a service information list;
and storing the service information list into the DHT instance of each target decentralized node.
Preferably, the service is a server program developed and obtained by using the SDK of the decentralized cloud computing platform.
Preferably, the service information list includes a plurality of service information, and the service information includes: DHT communication information and/or extranet communication information, service ports and extension information.
Preferably, the storing the service name and the service information of the service in the DHT instance of each target decentralized node includes:
storing the service name and the service information of the service in a Key-Value Key Value pair mode in the DHT instance of each target decentralized node; key is the service name, Value is the service information;
and the service information corresponding to different target decentralized nodes is different.
In order to achieve the above object, the present application further provides a service access method applied to the decentralized cloud computing platform, including:
receiving an access request of a service;
inquiring a service information list of the service according to the access request;
and selecting target service information in the service information list, and responding to the access request by using the target service information.
Preferably, the access request is initiated by a client of the service, and the client is developed and obtained by using an SDK of the decentralized cloud computing platform.
Preferably, the querying a service information list of the service according to the access request includes:
extracting a service name of the service from the access request;
querying the service information list by using the service name, wherein the service information list comprises a plurality of service information, and each service information comprises: DHT communication information and/or extranet communication information, service ports and extension information.
Preferably, the responding to the access request by using the target service information includes:
and if the target service information comprises the extranet communication information, responding to the access request by using the extranet communication information.
Preferably, the responding to the access request by using the target service information includes:
and if the target service information only comprises the DHT communication information, responding to the access request by using the DHT communication information.
Preferably, the responding to the access request by using the DHT communication information includes:
and forwarding the access request to a POD instance in a decentralized node corresponding to the target service information by using the DHT communication information, and responding to the access request by using the POD instance.
In order to achieve the above object, the present application further provides a service deployment apparatus applied to the decentralized cloud computing platform, including:
a first receiving module, configured to receive a deployment request of a service;
a determination module to determine a plurality of target decentralized nodes to deploy the service;
the storage module is used for storing the service name and the service information of the service in the DHT instance of each target decentralized node so that each target decentralized node can complete the broadcast of the service information based on a DHT network protocol to obtain a service information list;
and the sharing module is used for storing the service information list into the DHT instances of all the target decentralized nodes.
To achieve the above object, the present application further provides a service access apparatus applied to the decentralized cloud computing platform, including:
the second receiving module is used for receiving an access request of the service;
the query module is used for querying a service information list of the service according to the access request;
and the response module is used for selecting target service information in the service information list and responding the access request by utilizing the target service information.
To achieve the above object, the present application further provides an apparatus comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the method of the preceding disclosure.
To achieve the above object, the present application further provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the method disclosed in the foregoing.
According to the above scheme, the application provides a decentralized cloud computing platform, which is implemented based on DHT, and includes: a plurality of decentralized nodes, each decentralized node comprising: DHT instances and POD instances; the process of implementing the decentralized cloud computing platform based on DHT comprises the following steps: collecting a plurality of nodes; deploying an agent process in each node; deploying the DHT instance and the POD instance in each node by using the agent process so as to convert each node into a decentralized node.
Therefore, the present application adopts DHT to implement a decentralized cloud computing platform, and each node in the platform includes a DHT instance and a POD instance, so that each node becomes a decentralized node. The decentralized nodes can realize information sharing and exchange by utilizing the DHT instance and the POD instance, so that the platform has the P2P network capability, and the platform service performance is improved.
Accordingly, a service deployment method and a component (i.e., a device, an apparatus, and a readable storage medium) provided by the present application, and a service access method and a component (i.e., a device, an apparatus, and a readable storage medium) also have the above technical effects.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Referring to fig. 1, fig. 1 illustrates a decentralized cloud computing platform according to the present disclosure. In this embodiment, the decentralized cloud computing platform is implemented based on a DHT (Distributed Hash Table), and includes: a plurality of decentralized nodes, each decentralized node comprising: DHT instances and POD instances.
In this embodiment, the process of implementing a decentralized cloud computing platform based on DHT includes: collecting a plurality of nodes; deploying an agent process in each node; the DHT instance and POD instance are deployed in various nodes using a proxy process to translate each node into a decentralized node. The proxy process may also be set up in a proxy server, with each node corresponding to a proxy server.
Based on the platform provided by this embodiment, a user may develop a client program and a server program, deploy the server program on some decentralized nodes of the platform (i.e., deploy services), and then access the server program on the node (i.e., access the services) with the client. That is, after the user deploys the service on the platform, the DHT instances on the nodes of the platform are updated accordingly, and a POD instance corresponding to the service is also generated.
Specifically, each decentralized node includes an agent process, and the agent process is used for managing and deploying platform tasks. Meanwhile, the agent process deploys the DHT instances in the decentralized node, so that all DHT instances form a DHT network.
If a service is deployed on the platform, a service information list is provided in the DHT instance on each node, the service information list includes a plurality of service information, and each service information includes: DHT communication information and/or extranet communication information, service port and extension information, etc. Since each decentralized node has a service information list, information sharing can be realized. Storing a service name and service information in a Key-Value Key Value pair mode in a service information list; key is a service name, and Value is service information; wherein, the service information corresponding to different decentralized nodes is different. One service corresponds to one POD instance, which is used for responding to an access request initiated by the corresponding service. Multiple POD instances may be included in a decentralized node.
It should be noted that, one service is deployed in a plurality of decentralized nodes, and after the service is deployed in a certain decentralized node, service information corresponding to the current decentralized node can be obtained; a decentralized node can therefore be considered to correspond to a service message. All the service information is arranged into a list, namely, a service information list can be obtained. Because each decentralized node has one DHT instance, each decentralized node can complete the broadcast of the service information based on the DHT network protocol, so that each DHT instance of each decentralized node has one service information list, and thus, information sharing can be realized.
As can be seen, in the present embodiment, a decentralized cloud computing platform is implemented by using DHT, and each node in the platform includes a DHT instance and a POD instance, so that each node becomes a decentralized node. The decentralized nodes can realize information sharing and exchange by utilizing the DHT instance and the POD instance, so that the platform has the P2P network capability, and the platform service performance is improved.
Referring to fig. 2, fig. 2 is a service deployment method disclosed in the present application. In this embodiment, the method applied to the decentralized cloud computing platform provided in the above embodiment includes:
s201, receiving a service deployment request.
The service is a server program obtained by development of the SDK using the decentralized cloud computing platform.
S202, determining a plurality of target decentralized nodes for deploying the service.
Specifically, a plurality of target decentralized nodes for deploying the service may be determined by using a service orchestration policy preset in the platform. Service orchestration policies are as follows: a random selection strategy, a load balancing strategy, etc. The deployment service may be implemented by invoking the Put interface of the DHT.
S203, storing the service name and the service information of the service in the DHT instance of each target decentralized node, so that each target decentralized node completes the broadcast of the service information based on the DHT network protocol to obtain a service information list.
In one embodiment, the service information list includes a plurality of service information, and the service information includes: DHT communication information and/or extranet communication information, service ports and extension information.
And S204, storing the service information list into the DHT instance of each target decentralized node.
In one embodiment, storing the service name and the service information of the service in the DHT instance of each target decentralized node comprises: storing service names and service information of services in a Key-Value Key Value pair mode in DHT instances of each target decentralized node; key is a service name, and Value is service information; and the service information corresponding to different target decentralized nodes is different.
It should be noted that a server program is deployed on the decentralized cloud computing platform, and when the server program is deployed on the decentralized cloud computing platform, a TCP port or a UDP port is configured to provide a service. A user can develop a client program based on an SDK (Software Development Kit) on a decentralized cloud computing platform. The client program is used for accessing the server program deployed on the platform.
As can be seen from the above, the present embodiment implements a decentralized cloud computing platform based on DHT. In the service deployment process, the platform can realize information sharing and exchange by using the DHT, so that the platform has the P2P network capability, and the platform service performance is improved.
Referring to fig. 3, fig. 3 illustrates a service access method disclosed in the present application. In this embodiment, the method applied to the decentralized cloud computing platform provided in the above embodiment includes:
s301, receiving an access request of the service.
In one embodiment, the access request is initiated by a client of the service, and the client is developed and obtained by using an SDK of the decentralized cloud computing platform.
S302, inquiring a service information list of the service according to the access request.
The service information list is stored in a DHT instance of a decentralized node, and the decentralized node is a node with a service deployed in a decentralized cloud computing platform.
In one embodiment, querying a service information list of a service according to an access request includes: extracting a service name of the service from the access request; inquiring a service information list by using the service name, wherein the service information list comprises a plurality of service information, and each service information comprises: DHT communication information and/or extranet communication information, service ports and extension information. The query service is implemented by calling the Get interface of the DHT.
S303, selecting the target service information from the service information list, and responding to the access request by using the target service information.
When the target service information is selected from the service information list, the node with the short network distance and the good network quality is taken as the optimal selection target. Of course, the selection may also be made according to other strategies, such as random selection. Since one decentralized node corresponds to one service information, a certain service information is selected, namely the node where the service information is located is selected to perform request response.
In one embodiment, responding to the access request with the target service information includes: and if the target service information comprises the external network communication information, responding to the access request by using the external network communication information.
In one embodiment, responding to the access request with the target service information includes: and if the target service information only comprises the DHT communication information, responding to the access request by using the DHT communication information. The method for responding to the access request by utilizing the DHT communication information comprises the following steps: and forwarding the access request to a POD instance in the decentralized node corresponding to the target service information by utilizing the DHT communication information, and responding to the access request by utilizing the POD instance.
As can be seen from the above, in the embodiment, service access is performed on the decentralized cloud computing platform implemented based on the DHT, and in the process, the platform can implement information sharing and exchange by using the DHT, so that the platform has a P2P network capability, and the platform service performance is improved.
In the following, a decentralized cloud computing-based platform provided by an embodiment of the present application is introduced, and a decentralized cloud computing-based platform described below and a service access method described above may refer to each other.
The embodiment provides a decentralized cloud computing based platform, which comprises: platform building, service deployment, service access and the like.
Building a platform: the platform collects and manages decentralized nodes. A proxy server (in which a proxy process is provided) for managing and deploying platform tasks is arranged in each decentralized node, and a DHT instance (i.e. the DHT in fig. 4) is deployed in each decentralized node by using the proxy server, and all the DHT instances form a DHT network.
Service deployment: a User develops a server program, deploys the server program on a decentralized cloud computing platform, and configures a TCP (Transmission Control Protocol) port or a UDP (User Datagram Protocol) port to provide services. Specifically, when a server program is deployed on the decentralized cloud computing platform, a suitable decentralized node can be selected on the current platform. And if the proxy server in the selected decentralized node receives the deployment message, downloading the mirror image and starting the service. Referring specifically to fig. 4, in fig. 4, the deployed services are run in POD (container) instances (i.e., PODs in fig. 4), one service for each POD instance.
After the service is started, the proxy server performs service registration (i.e. service deployment), and the specific operations are as follows: the Put interface that invokes the DHT instance receives and stores the < Key-Value > Key-Value pair. The key is a character string of a service name, such as a format of a domain name: com. Value, namely service information of the current service in the current decentralized node, includes: DHT communication information (communication IP/Port of DHT, etc.) and/or extranet communication information (extranet IP, etc.), service Port (POD Port, etc.) and extension information. Moreover, the DHT instance in each decentralized node may broadcast key-Value pairs to other decentralized nodes based on the DHT network protocol, such that each decentralized node has a Value list. The Value may be subsequently queried through the Get interface. During query, the input parameter is Key (service name), and the output is a Value list. For the same service, the key is the same and the value is different in DHT instances of different decentralized nodes.
Service access: before the service access, a Get interface is called to query the list of values, and then one Value is selected from the list as a target Value, and a schematic diagram of selecting the target Value can be seen in fig. 5. Since one Value corresponds to one decentralized node, selecting the destination Value means selecting the decentralized node corresponding to the destination Value to provide the service. At this time, a communication channel is established with the decentralized node corresponding to the target Value, and the communication capability of a transmission layer (TCP or UDP) is provided for an upper layer. Of course, TCP may be further encapsulated to provide communication capabilities of HTTP (Hyper Text transfer Protocol).
Specifically, a client program and a server program developed by a client communicate at an application layer. In the decentralized cloud computing platform, each decentralized node does not necessarily store external network communication information, and therefore data transmission of a client and a server needs to be guaranteed by using a DHT communication protocol. That is, the DHT communication information is used to forward the access request to the POD instance in the decentralized node corresponding to the target Value, and the POD instance is used to respond to the access request.
The underlying protocol stack is shown in fig. 6. Specifically, on the basis that the DHT can communicate, a layer of proxy protocol for TCP or UDP is encapsulated, and an original TCP or UDP data packet is sent to a TCP or UDP port of a service.
For example: the server program monitors that a UDP port of a local 8080 provides a service to the outside, and the service name is www.abc.com; the client wants to send a UDP signaling (called traffic signaling) to the 8080 service of service www.abc.com. A POD instance is first located based on the service name www.abc.com to obtain the communication included in its service information. If only DHT communication information exists in the communication information, the client sends an agent signaling (comprising a service name, a port type and an original signaling), and after receiving the agent signaling, the server sends the original signaling to a monitoring port (8080) of a local server program according to the service name, the port and the port type; the server program then receives a signaling from the client from the 8080 port, and end-to-end communication is realized. If the communication information has an external network address, the part of the DHT transmission protocol can be saved, the external network address can be directly obtained (obtained by a Get interface query interface), and end-to-end communication is completed by utilizing TCP/IP.
Therefore, the decentralized cloud computing-based platform provided by the embodiment solves the problems of stable supply and operation and maintenance difficulty of the decentralized service node. Based on the high-quality DHT network, the development threshold of service discovery and network communication is reduced, the development efficiency is greatly improved, and information sharing and exchange are realized.
In the following, a service deployment apparatus provided in an embodiment of the present application is introduced, and a service deployment apparatus described below and a service deployment method described above may be referred to each other.
Referring to fig. 7, fig. 7 is a schematic diagram of a service deployment apparatus disclosed in the present application. In this embodiment, the apparatus is applied to a decentralized cloud computing platform implemented based on DHT, and includes:
a first receiving module 701, configured to receive a deployment request of a service;
a determining module 702 for determining a plurality of target decentralized nodes for deploying a service;
a storage module 703, configured to store the service name and the service information of the service in the DHT instance of each target decentralized node, so that each target decentralized node completes broadcasting of the service information based on the DHT network protocol to obtain a service information list;
a sharing module 704, configured to store the service information list in the DHT instances of the respective target decentralized nodes.
In one embodiment, the service is a server program developed and obtained by using an SDK of a decentralized cloud computing platform.
In one embodiment, the service information list includes a plurality of service information, and the service information includes: DHT communication information and/or extranet communication information, service ports and extension information.
In one embodiment, the storage module is specifically configured to:
storing service names and service information of services in a Key-Value Key Value pair mode in DHT instances of each target decentralized node; key is a service name, and Value is service information;
and the service information corresponding to different target decentralized nodes is different.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
As can be seen, the present embodiment implements a decentralized cloud computing platform based on DHT. In the service deployment process, the platform can realize information sharing and exchange by using the DHT, so that the platform has the P2P network capability, and the platform service performance is improved.
In the following, a service access device provided by an embodiment of the present application is introduced, and a service access device described below and a service access method described above may be referred to each other.
Referring to fig. 8, fig. 8 is a schematic diagram of a service access device disclosed in the present application. In this embodiment, the apparatus is applied to a decentralized cloud computing platform implemented based on DHT, and includes:
a second receiving module 801, configured to receive an access request of a service;
a query module 802, configured to query a service information list of a service according to an access request;
a response module 803, configured to select target service information from the service information list, and respond to the access request with the target service information.
In one embodiment, the access request is initiated by a client of the service, and the client is developed and obtained by using an SDK of the decentralized cloud computing platform.
In one embodiment, the query module comprises:
an extracting unit configured to extract a service name of the service from the access request;
the query unit is used for querying a service information list by using the service name, the service information list comprises a plurality of service information, and each service information comprises: DHT communication information and/or extranet communication information, service ports and extension information.
In one embodiment, the response module is specifically configured to:
and if the target service information comprises the external network communication information, responding to the access request by using the external network communication information.
In one embodiment, the response module is specifically configured to:
and if the target service information only comprises the DHT communication information, responding to the access request by using the DHT communication information.
In one embodiment, the response module is specifically configured to:
and forwarding the access request to a POD instance in the decentralized node corresponding to the target service information by utilizing the DHT communication information, and responding to the access request by utilizing the POD instance.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
As can be seen, the present embodiment implements a decentralized cloud computing platform based on DHT. In the service access process, the platform can realize information sharing and exchange by using the DHT, so that the platform has the P2P network capability, and the platform service performance is improved.
In the following, a device provided by an embodiment of the present application is introduced, and a device described below and a service access method and device described above may be referred to each other.
Referring to fig. 9, fig. 9 is a schematic view of an apparatus disclosed herein. In this embodiment, the apparatus includes:
a memory 901 for storing a computer program;
a processor 902 for executing the computer program to implement the method disclosed in any of the embodiments above.
Referring to fig. 10, fig. 10 is a schematic view of another apparatus disclosed herein. The device may include a memory 11, a processor 12, and a bus 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the device, for example a hard disk of the device. The memory 11 may also be an external storage device of the device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the memory 11 may also include both an internal storage unit of the device and an external storage device. The memory 11 can be used not only for storing application software installed in the device and various kinds of data such as a code of a service access program, a service deployment code, and the like, but also for temporarily storing data that has been output or is to be output.
Processor 12, which in some embodiments may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip, executes program code or processes data stored in memory 11, such as executing service access programs, service deployment programs, etc.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but this is not intended to represent only one bus or type of bus.
Further, the device may further include a network interface, which may optionally include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the device and other electronic devices.
Optionally, the device may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the device and for displaying a visualized user interface.
Fig. 10 shows only the device with the components 11-13, and it will be understood by those skilled in the art that the structure shown in fig. 10 does not constitute a limitation of the device, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
A readable storage medium provided by embodiments of the present application is described below, and a readable storage medium described below and any of the embodiments described above may be referred to with each other.
A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the method disclosed in any of the embodiments. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.