Metadata request optimization method and device, computer equipment, readable storage medium and program product

By sharding metadata in the Kubernetes cluster and transmitting one by one, the memory overflow problem caused by excessive metadata on the interface server is solved, ensuring the stability and availability of the Kubernetes cluster.

CN119474174APending Publication Date: 2025-02-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411690013.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In a large-scale Kubernetes cluster of cloud native containers, the interface server overflows due to excessive metadata transmitted by it, which in turn causes the problem that the overall Kubernetes service is unavailable.

Method used

By receiving metadata acquisition requests from the client, establishing a long connection, and obtaining the target metadata from the distributed key-value database, sharding it according to the container, sending it to the client one by one, and sending the current version number to support version monitoring at the same time. deal with.

Benefits of technology

It effectively avoids the risk of memory overflow caused by excessive metadata transmission and ensures the stability and availability of Kubernetes cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474174A_ABST
    Figure CN119474174A_ABST
Patent Text Reader

Abstract

The invention relates to a metadata request optimization method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: receiving a metadata acquisition request from a client; establishing a long connection with the client; based on the metadata acquisition request, determining target metadata needing to be acquired; obtaining the target metadata from a distributed key value database, and fragmenting the obtained target metadata according to a container to obtain at least one piece of container configuration data; sending the at least one container configuration data to the client one by one through the long connection; and sending the current version number of the target metadata to a client to instruct the client to perform version monitoring processing based on the current version number. By adopting the method, the metadata can be fragmented and transmitted one by one, and the problem that the overall Kubernetes service is unavailable due to memory overflow caused by overlarge transmitted metadata of an interface server can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud native technology, and in particular to a metadata request optimization method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] In the practice of building large-scale Kubernetes clusters for cloud-native containers, the number of nodes in a super-large-scale Kubernetes cluster will easily exceed 10,000+ nodes, so the number of Pods deployed on it will easily exceed 100,000+. When a client (Client) obtains and listens (List-Watch) resources, the API Server component will package the full amount of metadata and send it to the client at one time. At this time, the amount of metadata packaged and sent to the client is large, and the encoding and decoding of the data (Encode / Decode) will consume a lot of memory resources.

[0003] When faced with a large number of List operations on API Server components, these operations may quickly consume the memory resources of the API Server, causing it to face the risk of Out Of Memory (OOM). Once an API Server component fails due to OOM, the List requests originally sent to this component will flow to other API Server components instead, which may cause all API Server components in the entire Kubernetes cluster to crash due to memory pressure one after another, ultimately causing the unavailability of the entire Kubernetes service. Summary of the invention

[0004] Based on this, it is necessary to provide a metadata request optimization method, apparatus, computer device, computer-readable storage medium and computer program product that can segment metadata and transmit them one by one to address the above technical problems.

[0005] In a first aspect, the present application provides a metadata request optimization method, comprising:

[0006] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0007] Based on the metadata acquisition request, determining target metadata to be acquired;

[0008] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0009] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0010] In one embodiment, the metadata acquisition request carries a client identifier; and establishing a persistent connection with the client includes:

[0011] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0012] In one embodiment, obtaining the target metadata from a distributed key-value database further includes:

[0013] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0014] In one embodiment, the method further comprises:

[0015] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0016] In one embodiment, the method further comprises:

[0017] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0018] In one embodiment, the step of establishing a monitoring object and monitoring the version number of the target metadata includes:

[0019] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0020] In a second aspect, the present application further provides a metadata request optimization device, the device comprising:

[0021] The receiving module is used to establish a persistent connection with the client after receiving a metadata acquisition request from the client;

[0022] A query module, used to determine target metadata to be obtained based on the metadata acquisition request;

[0023] An acquisition module, used to acquire the target metadata from a distributed key-value database, and to slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0024] A sending module is used to send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number.

[0025] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0026] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0027] Based on the metadata acquisition request, determining target metadata to be acquired;

[0028] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0029] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0031] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0032] Based on the metadata acquisition request, determining target metadata to be acquired;

[0033] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0034] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0035] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0036] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0037] Based on the metadata acquisition request, determining target metadata to be acquired;

[0038] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0039] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0040] The above-mentioned metadata request optimization method, apparatus, computer equipment, computer-readable storage medium and computer program product, after receiving a metadata acquisition request from a client; establish a long connection with the client; determine the target metadata to be acquired based on the metadata acquisition request; acquire the target metadata from a distributed key-value database, and shard the acquired target metadata according to the container to obtain at least one container configuration data; send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number. After receiving the metadata acquisition request from the client, by sharding the metadata and transmitting it to the client one by one, the problem of the interface server causing memory overflow due to excessively large transmitted metadata, which in turn causes the overall Kubernetes service to be unavailable, can be effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0042] FIG1 is an application environment diagram of a metadata request optimization method in one embodiment;

[0043] Figure 2 A schematic diagram of a process flow of a metadata request optimization method in one embodiment;

[0044] Figure 3 A schematic diagram of a metadata request optimization method in one embodiment;

[0045] Figure 4 It is a structural block diagram of a metadata request optimization device in one embodiment;

[0046] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The metadata request optimization method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. Among them, the client 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. After the server 104 receives the metadata acquisition request from the client; establishes a long connection with the client; the server 104 determines the target metadata to be acquired based on the metadata acquisition request; the server 104 acquires the target metadata from the distributed key-value database, and slices the acquired target metadata according to the container to obtain at least one container configuration data; the server 104 sends the at least one container configuration data to the client one by one through the long connection; and sends the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number. Among them, the client 102 can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server 104 can be a cloud server that provides cloud computing services.

[0049] In an exemplary embodiment, Figure 2 As shown, a metadata request optimization method is provided, which is described by taking the method applied to the server 104 in FIG. 1 as an example, and includes the following steps 202 to 206. Among them:

[0050] Step 202: after receiving a metadata acquisition request from a client, a persistent connection is established with the client.

[0051] Among them, a long connection means that multiple data packets can be sent continuously on a connection. During the connection maintenance period, if no data packet is sent, both parties will send link detection packets to maintain the connection status.

[0052] Optionally, the client may be an application on a device such as a computer. The acquisition request may be a List request, which is used to acquire a series of key-value pairs stored in a distributed key-value database.

[0053] Exemplarily, after receiving the metadata acquisition request from the client, a persistent connection is established with the client according to the metadata acquisition request.

[0054] Step 204: Determine the target metadata to be obtained based on the metadata acquisition request.

[0055] Among them, in Kubernetes, metadata is an important part of API objects, which is used to describe the basic information and properties of objects. Each API object in Kubernetes (such as Pod, Deployment, Service, etc.) contains metadata fields.

[0056] Exemplarily, based on the metadata acquisition request, metadata that the client needs to acquire is determined as target metadata.

[0057] Step 206: Acquire the target metadata from the distributed key-value database, and segment the acquired target metadata according to the container to obtain at least one container configuration data.

[0058] Optionally, the distributed key-value database may be etcd.

[0059] Exemplarily, target metadata is obtained from a distributed key-value database, and the obtained target metadata is differentiated and fragmented according to containers to obtain a plurality of fragmented container configuration data.

[0060] Step 208: Send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number.

[0061] The resource version number is Resource Version, which represents the current version of the target metadata.

[0062] Exemplarily, at least one container configuration data is sent to the client one by one through a long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0063] The above-mentioned metadata request optimization method, apparatus, computer equipment, computer-readable storage medium and computer program product, after receiving a metadata acquisition request from a client; establish a long connection with the client; determine the target metadata to be acquired based on the metadata acquisition request; acquire the target metadata from a distributed key-value database, and shard the acquired target metadata according to the container to obtain at least one container configuration data; send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number. After receiving the metadata acquisition request from the client, by sharding the metadata and transmitting it to the client one by one, the problem of the interface server causing memory overflow due to excessively large transmitted metadata, which in turn causes the overall Kubernetes service to be unavailable, can be effectively solved.

[0064] In an exemplary embodiment, the metadata acquisition request carries a client identifier; and establishing a long connection with the client includes:

[0065] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0066] The client ID is used to uniquely identify the client and can be a string of numbers.

[0067] Among them, the list stream processing interface (List-Stream) is an interface used to establish a long connection.

[0068] The address of the client is used to determine, among multiple connected clients, to which client interface a long connection is to be established. Optionally, the address may be an IP address, etc.

[0069] Exemplarily, the metadata acquisition request is parsed to obtain a client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0070] In this embodiment, by parsing the client identifier and determining the client address, a persistent connection is established, and the client sending the metadata acquisition request can be located, thereby accurately establishing the persistent connection.

[0071] In an exemplary embodiment, the step of obtaining the target metadata from a distributed key-value database further includes:

[0072] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0073] The client identification list stores information of all clients that are allowed to communicate.

[0074] Exemplarily, a list of client identifiers that have been authorized for access is obtained; whether the client identifier is in the client identifier list is determined; if the client identifier is in the client identifier list, identity authentication is passed; based on the client identifier, the permission level of the client is determined; based on the target metadata, the permission requirement level of the target metadata is determined; if the client's permission level is not less than the permission requirement level, the permission verification is passed; and the target metadata is obtained from a distributed key-value database.

[0075] In this embodiment, by performing identity authentication and authority verification on the client, it is determined that the client has the corresponding identity and authority before transmitting data, which can ensure data security.

[0076] In an exemplary embodiment, the method further comprises:

[0077] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0078] Among them, disconnecting from the client means shielding the client and rejecting all information of the client.

[0079] Exemplarily, if the client's identifier is not in the client identifier list, the identity authentication fails, the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected and a prompt of insufficient permissions is returned.

[0080] In this embodiment, when the identity authentication or permission verification fails, the long connection will be disconnected, which can effectively prevent the data from being illegally obtained.

[0081] In an exemplary embodiment, the method further comprises:

[0082] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0083] The monitoring object refers to the key-value pair or key set with a specific prefix monitored by the Watch mechanism.

[0084] The version number represents the version of the metadata. When the metadata changes, the version number will also be updated.

[0085] Exemplarily, a monitoring request from a client is received; the monitoring request is parsed, the version number of the target metadata to be monitored by the client is determined, and a monitoring object is established to monitor the version number of the target metadata.

[0086] In this embodiment, by establishing a monitoring object, changes in target metadata in a distributed key-value database can be monitored in real time, and the changed data can be obtained in a timely manner.

[0087] In an exemplary embodiment, the step of establishing a monitoring object and monitoring the version number of the target metadata includes:

[0088] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0089] Exemplarily, when the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0090] In this embodiment, when the version number of the target metadata changes, it means that the target metadata has also changed. By timely acquiring the latest target metadata and its version number, the client can always acquire the latest metadata.

[0091] In an exemplary embodiment, Figure 3As shown, a metadata request optimization method is applied to Kube-Apiserver (interface server), including: after receiving a metadata acquisition request (List) from a client (Client), parsing the metadata acquisition request to obtain a client identifier; determining the client address based on the client identifier; based on the address, calling the list stream processing interface (List-Stream) to establish a long connection with the client. Based on the metadata acquisition request, determine the metadata that the client needs to obtain as the target metadata. Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is not in the client identifier list, the identity authentication fails, and the long connection and the connection with the client are disconnected. If the client identifier is in the client identifier list, the identity authentication passes; determine the client's permission level based on the client identifier; and determine the permission requirement level of the target metadata based on the target metadata. If the client's permission level is less than the permission requirement level, the permission verification fails, the long connection is disconnected, and a prompt of insufficient permission is returned. If the client's permission level is not less than the permission requirement level, the permission verification passes. Obtain the target metadata from the distributed key-value database (ETCD), distinguish and shard the obtained target metadata according to the container, and obtain multiple sharded container configuration data (pod-0, pod-1, and pod-2). Send at least one container configuration data to the client one by one through a long connection; and send the current version number (Revision Version, RV) of the target metadata to the client to instruct the client to perform version monitoring based on the current version number. Receive a monitoring (watch) request from the client; parse the monitoring request, determine the version number of the target metadata that the client wants to monitor, and establish a monitoring object to monitor the version number of the target metadata. When the version number of the target metadata changes, it means that the target metadata has also changed. By obtaining the latest target metadata and its version number in a timely manner, the client can always obtain the latest metadata.

[0092] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0093] In an exemplary embodiment, Figure 4 As shown, a metadata request optimization device is provided, including: a receiving module, a query module, an acquisition module and a sending module, wherein:

[0094] The receiving module is used to establish a persistent connection with the client after receiving a metadata acquisition request from the client;

[0095] A query module, used to determine target metadata to be acquired based on the metadata acquisition request;

[0096] An acquisition module, used to acquire the target metadata from a distributed key-value database, and to slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0097] A sending module is used to send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number.

[0098] In one embodiment, the receiving module is further configured to:

[0099] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0100] In one embodiment, the acquisition module is further used to:

[0101] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0102] In one embodiment, the acquisition module is further used to:

[0103] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0104] In one embodiment, it further includes: a monitoring module, which is used to:

[0105] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0106] In one embodiment, the monitoring module is further used to:

[0107] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0108] Each module in the above metadata request optimization device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0109] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store metadata. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a metadata request optimization method is implemented.

[0110] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0111] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0112] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0113] Based on the metadata acquisition request, determining target metadata to be acquired;

[0114] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0115] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0116] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0117] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0118] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0119] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0120] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0121] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0122] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0123] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0124] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0125] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0126] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0127] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0128] Based on the metadata acquisition request, determining target metadata to be acquired;

[0129] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0130] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0131] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0132] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0133] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0134] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0135] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0136] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0137] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0138] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0139] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0140] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0141] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0142] After receiving a metadata acquisition request from a client; establishing a persistent connection with the client;

[0143] Based on the metadata acquisition request, determining target metadata to be acquired;

[0144] Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data;

[0145] The at least one container configuration data is sent to the client one by one through the long connection; and the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0147] The metadata acquisition request is parsed to obtain the client identifier; the address of the client is determined based on the client identifier; based on the address, a list stream processing interface is called to establish a long connection with the client.

[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0149] Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; if the client identifier is in the client identifier list, the identity authentication is passed; determine the permission level of the client based on the client identifier; based on the target metadata, determine the permission requirement level of the target metadata; if the permission level of the client is not less than the permission requirement level, the permission verification is passed; obtain the target metadata from a distributed key-value database.

[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0151] If the client's identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; if the client's permission level is less than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt of insufficient permission is returned.

[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0153] Receive a monitoring request from the client; parse the monitoring request, determine the version number of the target metadata to be monitored by the client, and establish a monitoring object to monitor the version number of the target metadata.

[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0155] When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client via a long connection; the version number of the changed target metadata is sent to the client via a long connection.

[0156] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0157] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0158] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A metadata request optimization method, characterized in that: include: After receiving the metadata acquisition request from the client; Establishing a persistent connection with the client; Based on the metadata acquisition request, determining target metadata to be acquired; Acquire the target metadata from a distributed key-value database, and slice the acquired target metadata according to containers to obtain at least one container configuration data; Sending the at least one container configuration data to the client one by one through the long connection; And the current version number of the target metadata is sent to the client to instruct the client to perform version monitoring processing based on the current version number.

2. The method according to claim 1, characterized in that The metadata acquisition request carries a client identifier; The establishing a long connection with the client includes: Parsing the metadata acquisition request to obtain the client identifier; Determining an address of a client based on the client identifier; Based on the address, a list stream processing interface is called to establish a persistent connection with the client.

3. The method according to claim 1, characterized in that The step of acquiring the target metadata from the distributed key-value database further includes: Obtain a list of client identifiers that have been authorized to access; determine whether the client identifier is in the client identifier list; If the client identifier is in the client identifier list, the identity authentication is successful; Determining the authority level of the client based on the client identifier; Based on the target metadata, determining a permission requirement level of the target metadata; If the authority level of the client is not less than the authority requirement level, the authority verification is passed; The target metadata is obtained from a distributed key-value database.

4. The method according to claim 3, characterized in that The method further comprises: If the client identifier is not in the client identifier list, the identity authentication fails, and the persistent connection and the connection with the client are disconnected; If the permission level of the client is lower than the permission requirement level, the permission verification fails, the persistent connection is disconnected, and a prompt indicating insufficient permission is returned.

5. The method according to claim 1, characterized in that The method further comprises: Receiving a monitoring request from the client; The monitoring request is parsed to determine the version number of the target metadata to be monitored by the client, and a monitoring object is established to monitor the version number of the target metadata.

6. The method according to claim 5, characterized in that The step of establishing a monitoring object and monitoring the version number of the target metadata includes: When the version number of the target metadata stored in the distributed key-value database is changed, the changed target metadata is sent to the client through a long connection; The version number of the changed target metadata is sent to the client through the long connection.

7. A metadata request optimization device, characterized in that: The device comprises: A receiving module, configured to establish a persistent connection with the client upon receiving a metadata acquisition request from the client; A query module, used to determine target metadata to be acquired based on the metadata acquisition request; An acquisition module, used to acquire the target metadata from a distributed key-value database, and to slice the acquired target metadata according to containers to obtain at least one container configuration data; A sending module is used to send the at least one container configuration data to the client one by one through the long connection; and send the current version number of the target metadata to the client to instruct the client to perform version monitoring processing based on the current version number.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.