A cloud resource retrieval method, device, apparatus and storage medium

By deploying independent components in the cloud operating system to provide advanced search capabilities, the problem of insufficient native search capabilities of Kubernetes is solved, enabling efficient and multi-dimensional retrieval of cloud resources, supporting the retrieval and pagination of custom resources, and improving the user experience.

CN116383266BActive Publication Date: 2026-02-24CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310251575.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-02-24
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

Kubernetes' native search capabilities are weak in resource searching and filtering, and the retrieval function has high resource overhead, resulting in a number of limitations, including lack of support for custom resources, limitations on complex functions, and insufficient scalability of the cluster.

Method used

Deploy a second component that runs independently of the first component in a cloud operating system environment. This component provides advanced search capabilities, including multi-dimensional searches such as field, pagination, and sorting. It performs searches through a distributed storage database, supports cloud-native and custom resources, and reduces dependence on kube-apiserver.

Benefits of technology

It enhances search capabilities, reduces search restrictions, provides an efficient resource retrieval experience, ensures data real-time performance and accuracy, and supports searching, pagination, and sorting for all resource types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116383266B_ABST
    Figure CN116383266B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a cloud resource retrieval method, device, equipment and storage medium provided by the present disclosure. The cloud resource retrieval method comprises the following steps: deploying a second component running independently of a first component in a cloud operating system environment, the first component being used to provide low-level retrieval capability for cloud resources, and the second component being used to provide high-level retrieval capability for cloud resources; obtaining input retrieval information; and performing retrieval in a corresponding distributed storage database according to the retrieval information by using the second component to obtain a first detection result. The method provided by the present disclosure can maximize the retrieval capability and reduce the retrieval limitation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a cloud resource retrieval method, apparatus, device, and storage medium. Background Technology

[0002] Currently, Kubernetes' native search capabilities are relatively weak in resource searching and filtering, and the resource overhead of the retrieval function is also relatively large. Considering the cluster size and scalability, the data that the cluster needs to process is usually packaged and processed on the client side to improve processing performance. However, kube-apiserver in Kubernetes can only provide limited retrieval capabilities, and there are many limitations when the server performs retrieval in this case. Summary of the Invention

[0003] To address the aforementioned technical issues, this disclosure provides a cloud resource retrieval method, apparatus, device, and storage medium that can maximize retrieval capabilities and reduce retrieval limitations.

[0004] In a first aspect, embodiments of this disclosure provide a cloud resource retrieval method, the method comprising:

[0005] Deploy a second component that runs independently of the first component in a cloud operating system environment. The first component is used to provide low-level retrieval capabilities for cloud resources, and the second component is used to provide high-level retrieval capabilities for cloud resources.

[0006] Obtain the input search information;

[0007] The second component is used to perform a search in the corresponding distributed storage database based on the search information to obtain the first detection result.

[0008] Optionally, the number of search dimensions included in the first component is less than the number of search dimensions included in the second component; the search dimensions of the second component include at least one of field dimensions, pagination dimensions, and sorting dimensions.

[0009] Optionally, the step of retrieving information from the corresponding distributed storage database to obtain a first detection result includes:

[0010] The search information is converted according to a preset search formula to obtain the search data corresponding to the search information, and the search data includes preset characters;

[0011] By identifying the preset characters from the search data, the search data is divided into multiple dimensions, and the target characters included in each dimension are determined.

[0012] Based on the target characters included in each dimension of the data, the second detection result retrieved from the corresponding distributed storage database is filtered to obtain the first detection result.

[0013] Optionally, the multiple dimensions of data include field data, paginated data, and sorted data, and the multiple dimensions of data are separated by the preset character.

[0014] Optionally, the step of filtering the second detection result retrieved from the corresponding distributed storage database based on the target characters included in each dimension of the data to obtain the first detection result includes:

[0015] The resource matching the target character included in the field data is retrieved from the corresponding distributed storage database to obtain the second detection result;

[0016] Determine the sorting method corresponding to the target characters included in the sorted data, and sort the second detection results based on the sorting method;

[0017] The sorted second detection result is divided according to the target characters included in the pagination data to obtain the paginated first detection result. The target characters included in the pagination data include the current page number to be displayed and the number of resources displayed on each page.

[0018] Optionally, the detection result may also include resource type and data type, wherein the resource type is cloud-native resource or custom resource.

[0019] Optionally, retrieving resources that match the target characters included in the field data from the corresponding distributed storage database to obtain the second detection result includes:

[0020] In the corresponding distributed storage database, resources matching the target characters included in the field data are retrieved according to the resource type and the retrieval order of the data type, and a second detection result is obtained.

[0021] Optionally, before obtaining the input retrieval information, the method further includes:

[0022] The second component is invoked using a preset invocation method, and search information is entered in the invocation interface of the second component;

[0023] The preset invocation method includes at least one of a preset client and a command line, wherein the preset client has the function of invoking cluster resource objects.

[0024] Optionally, the second component includes a service interface, and the step of invoking the second component using a preset invocation method includes:

[0025] The second component is invoked through the service interface using a preset invocation method. The service interface is used to provide external access capabilities.

[0026] Secondly, embodiments of this disclosure provide a cloud resource retrieval device, the device comprising:

[0027] The deployment module is used to deploy a second component that runs independently of the first component in a cloud operating system environment. The first component is used to provide low-level retrieval capabilities for cloud resources, and the second component is used to provide high-level retrieval capabilities for cloud resources.

[0028] The acquisition module is used to acquire the input search information;

[0029] The retrieval module is used to perform a retrieval in the corresponding distributed storage database based on the retrieval information using the second component, and obtain a first detection result.

[0030] Thirdly, embodiments of this disclosure provide an electronic device, including:

[0031] Memory;

[0032] Processor; and

[0033] Computer programs;

[0034] The computer program is stored in the memory and configured to be executed by the processor to implement the cloud resource retrieval method described above.

[0035] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the cloud resource retrieval method described above.

[0036] This disclosure provides a cloud resource retrieval method, comprising: deploying a second component that runs independently of a first component in a cloud operating system environment, wherein the first component provides low-level retrieval capabilities for cloud resources, and the second component provides high-level retrieval capabilities for cloud resources; acquiring input retrieval information; and using the second component to perform a retrieval in a corresponding distributed storage database based on the retrieval information to obtain a first detection result. The method provided by this disclosure can maximize retrieval capabilities and reduce retrieval limitations. Attached Figure Description

[0037] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0038] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating a cloud resource retrieval method provided in this embodiment of the disclosure;

[0040] Figure 2 An operational architecture diagram provided for an embodiment of this disclosure;

[0041] Figure 3 A flowchart illustrating another cloud resource retrieval method provided in this embodiment of the disclosure;

[0042] Figure 4 This is a schematic diagram of the structure of a cloud resource retrieval device provided in an embodiment of the present disclosure;

[0043] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0044] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0045] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0046] Before providing a detailed description of the cloud resource retrieval method provided in the embodiments of this disclosure, the relevant terms will be explained first, wherein:

[0047] Kubernetes (K8s) is an open-source application used to manage containerized applications across multiple hosts in a cloud platform.

[0048] kube-apiserver is a core component in Kubernetes that controls changes to core resources and serves as the entry point for external operations on cluster resources.

[0049] etcd is a distributed key-value store developed by the server operating system (CoreOS) based on the Raft distributed algorithm protocol. It can be used for service discovery, shared configuration, and consistency assurance.

[0050] Currently, Kubernetes' native search capabilities are weak in resource searching and filtering, and the retrieval function incurs significant resource overhead. Considering cluster size and scalability, the data to be processed by the cluster is usually packaged and processed on the client side to improve performance. Therefore, kube-apiserver only provides limited server-side retrieval capabilities. However, in this case, there are many limitations when the server performs retrieval, specifically: 1) It only supports some built-in resources, and custom resource definitions (CRDs) are not supported; 2) Due to performance considerations, complex functions are not supported, and the supported fields are limited; 3) The larger the cluster size, the more significant the limitations of the retrieval become.

[0051] Currently, to address the issue of weak native search capabilities in Kubernetes, there are generally three solutions: 1) Middleware solution: This involves retrieving data from the kube-apiserver and performing two data processing steps to achieve retrieval. However, this solution increases the load on the kube-apiserver, and the search granularity depends on the kube-apiserver, resulting in insufficient scalability. 2) Bypass data solution: This involves bypassing the distributed key-value store (etcd) to convert data into a relational database and then using the relational database for cloud resource retrieval. However, this solution requires redesigning user data permission controls and suffers from insufficient data real-time performance. 3) etcd integration solution: This solution directly retrieves cloud resources based on etcd. However, this solution increases the load on etcd data processing, has poor search granularity, and lacks scalability.

[0052] To address the aforementioned technical problems, this disclosure provides a cloud resource retrieval method. This method involves deploying a second component, independent of the first component, within a cloud operating system environment. The first component provides basic retrieval capabilities, while the second component offers advanced retrieval capabilities for various cloud resources. Specifically, the second component provides rich multi-dimensional retrieval / search / query capabilities, including rich field selection, pagination, and sorting. It also supports retrieval of all resource types, exhibiting strong scalability, including but not limited to cloud-native resources and custom resources. Utilizing the second component for retrieval effectively reduces retrieval limitations and improves the user's retrieval experience. This will be described in detail through one or more of the following embodiments.

[0053] Figure 1This is a flowchart illustrating a cloud resource retrieval method provided in an embodiment of this disclosure, applied to Kubernetes, specifically including the following: Figure 1 The following steps S110 to S130 are shown:

[0054] S110. Deploy a second component that runs independently of the first component in a cloud operating system environment.

[0055] The first component is used to provide low-level search capabilities for cloud resources, and the second component is used to provide high-level search capabilities for cloud resources; the number of search dimensions included in the first component is less than the number of search dimensions included in the second component; the search dimensions of the second component include at least one of field dimensions, pagination dimensions, and sorting dimensions.

[0056] Understandably, the second component is deployed independently in the cloud operating system environment, separate from the first component. The second component can independently provide advanced data retrieval capabilities. The first component can be seen as a component with native Kubernetes search capabilities. Since kube-apiserver not only provides external query capabilities but also data creation, deletion, and update capabilities, and needs to ensure stable cluster operation, considering performance issues, the native kube-apiserver does not support advanced search capabilities. This results in the native kube-apiserver search capability having weak resource search filtering capabilities. Therefore, the first component is used to provide low-level search capabilities for cloud resources; that is, the first component can be understood as simple search. The second component, relative to the first component, is a component with advanced search capabilities. Specifically, the second component is used to provide advanced search capabilities for cloud resources. The second component can be referred to as hyper-search and runs on the control node (master node) in Kubernetes.

[0057] Understandably, the first component includes fewer search dimensions than the second component. Search dimensions can be understood as search granularity / query granularity / search granularity, which are the search conditions that users can set. Advanced search enables more precise and detailed resource retrieval. The first component can set fewer search conditions than the second component. Specifically, the first component may only include one search dimension: search name. The second component includes at least three search dimensions, such as field dimensions, pagination dimensions, and sorting dimensions. Field dimensions include the search name field and may also include other custom fields, such as resource type and data type fields. Furthermore, the search dimensions in the second component can be customized according to user needs, such as time dimensions and display dimensions. The specific possible search dimensions are not limited here.

[0058] For example, see Figure 2 , Figure 2 This is a diagram illustrating an operational architecture provided in an embodiment of the present disclosure. Figure 2 The process includes the operation flow of the first and second components. The first component operates on the standard client-side call to the native Kubernetes kube-apiserver component. This is the default process for clients to query various resources using the first component. The client calls the first component through the Kubernetes svc interface, which connects to the kube-apiserver. The kube-apiserver then pulls data from the underlying etcd, filters it, performs simple data processing, and returns the results to the client. However, the results from the first component are the data retrieved after a simple search. The client then accesses the second component via the hyper-search interface. Specifically, the second component can be accessed internally via hyper-search-svc and externally via NodePort svc. After startup, the second component connects to Etcd to cache data, ensuring data real-time performance and accuracy. It retrieves resources from the cached data, performs filtering such as pagination and sorting, performs advanced data processing, and returns the results to the client. The results from the second component are the data retrieved after an advanced search.

[0059] S120. Obtain the input search information.

[0060] Understandably, based on the above S110, a first interface is displayed. The first interface can be an input interface with search function provided by Kubernetes. After the user inputs search information based on the first interface, the input search information is obtained.

[0061] Optionally, before obtaining the input retrieval information, the method further includes:

[0062] The second component is invoked using a preset invocation method, and search information is entered in the invocation interface of the second component.

[0063] The preset invocation method includes at least one of a preset client and a command line, wherein the preset client has the function of invoking cluster resource objects.

[0064] Understandably, before retrieving information, the target component for retrieval needs to be determined in the first and second components, i.e., the retrieval method needs to be selected. If the user selects the second component for advanced retrieval, the second component is invoked in the first interface using a preset invocation method, and then the second interface is displayed. The second interface is the invocation interface for the second component, where the user can input retrieval information. The preset invocation method includes at least one of a preset client and a command line. The preset client has the function of invoking cluster resource objects, and the preset client uses the client-go invocation method. After the invocation interface of the second component is displayed using the client-go invocation method, the user enters information in the corresponding input area of ​​each retrieval dimension according to the name of each retrieval dimension displayed on the invocation interface. In response to the trigger operation of the retrieval icon on the invocation interface, the retrieval information entered in the invocation interface is obtained. The command line can specifically be the kubectl command line. Users can enter a statement to call the second component on the first interface, and then update the first interface to the calling interface of the second component based on the statement. On the calling interface, users can enter a program statement composed of information related to each search dimension. For example, users can enter the program statement: search.key = "metadata.labels:etcd&&page:1&&num:5&&order_key:metad ata.name&&order:asc". The program statement will then be executed, and the entered program statement will be automatically retrieved. This program statement is the search information.

[0065] The second component includes a service interface, which is invoked using a preset invocation method, specifically through the following steps:

[0066] The second component is invoked through the service interface using a preset invocation method. The service interface is used to provide external access capabilities.

[0067] Understandably, the second component includes a service interface, denoted as hyper-search. Resource information is queried by calling the hyper-search service interface. Furthermore, services within the cluster can directly access the second component through hyper-search-svc, providing query services to the outside world via NodePort svc. In other words, advanced retrieval can be provided independently to external clusters. Specifically, the second component can be invoked through the service interface using a preset calling method.

[0068] S130. Using the second component, a search is performed in the corresponding distributed storage database based on the search information to obtain the first detection result.

[0069] Understandably, based on the above S120, the second component uses the user-input search information to search the corresponding distributed storage database, obtains the first detection result that matches and is filtered according to the search information, and then displays the first detection result in the call interface for the user to view automatically. The distributed storage database is a database composed of data pulled and cached from etcd by the second component. The second component can obtain data from etcd as soon as it starts and cache it for subsequent retrieval, without putting a large performance pressure on etcd. It does not depend on kube-apiserver and interacts with etcd directly, which can ensure the real-time and correctness of the data. That is, it directly connects to etcd to cache data. When the second component needs to pull resource data from etcd based on the search information, it adopts the serializeble serial read method to further accelerate the data synchronization efficiency. The second component can also be deployed as a single instance or multiple instances. If a single instance is deployed, there is no impact on data latency. If a multiple instance is deployed, the impact of data latency can be effectively reduced by directly connecting to etcd.

[0070] Understandably, the second component supports Kubernetes' role-based access control (RBAC), allowing users to retrieve only the resources they are authorized to access. Furthermore, by reusing the native kube-apiserver authentication and authorization process, it can provide users with comprehensive user permission control and verification, ensuring data security. In other words, the authorization process is consistent with Kubernetes and fully compatible with Kubernetes' RBAC model.

[0071] This disclosure provides a cloud resource detection method that deploys a second component (hyper-search) independently in the cloud operating system environment, separate from the first component (kube-apiserver). This avoids interfering with the first component's operational efficiency. The second component performs advanced resource retrieval, further optimizing system performance. The second component directly interacts with etcd, accelerating data synchronization without placing significant performance pressure on etcd. The second component provides advanced retrieval capabilities to internal and external clusters, supporting searches for all resource types and various granularities of querying, including search, pagination, and sorting, demonstrating strong scalability.

[0072] Based on the above embodiments, Figure 3 This is a flowchart illustrating another cloud resource retrieval method provided in this embodiment. Optionally, in step S130 above, a retrieval is performed in the corresponding distributed storage database based on the retrieval information to obtain a first detection result, specifically including, as follows: Figure 3 Steps S310 to S330 are shown below:

[0073] S310. The search information is converted according to a preset search formula to obtain the search data corresponding to the search information.

[0074] The search data includes preset characters.

[0075] Understandably, the second component uses a key-value (kv) approach to retrieve resources. It defines a preset search query, and the input search statement consists of multiple kv values. The key represents a field, i.e., the name of each search dimension, while the value contains the content to be searched, the pagination value, and the sorting method. The search information is then transformed according to the search query, that is, converted into a recognizable search statement, to obtain the search data.

[0076] S320. By identifying the preset characters from the search data, the search data is divided into multiple dimensions, and the target characters included in each dimension are determined.

[0077] The multiple dimensions of data include field data, paginated data, and sorted data, and the multiple dimensions of data are separated by the preset character.

[0078] Understandably, based on the above S310, after obtaining the transformed search data, the preset characters in the search data are identified. The preset characters can be '&&'. The preset characters are used to separate data of different dimensions. That is, each search granularity (search dimension) in the search data is separated by '&&'. Based on the preset characters, the search data is divided into multiple dimension data, including data field data, paginated data, and sorted data. For example, the search data search = "metadata.labels:etcd&&page:1&&num:5&&order_key:metadata.name&&order:asc", and the data field includes metadata. `.labels:etcd`, where `metadata.labels` is the key field and `etcd` is the value. The value is the target characters included in each dimension of data. The field data indicates that all resources whose labels in the metadata contain the keyword "etcd" are retrieved. The field data is the search content. The pagination data includes `page:1` and `num:5`, where `page` and `num` are the key fields and `1` and `5` are the value fields, indicating that the 5 resource data on the first page are displayed. The sorting data includes `order_key:metadata.name` and `order:asc`, indicating that all retrieved resource data are sorted in ascending order by name.

[0079] S330. Based on the target characters included in each dimension of the data, the second detection result retrieved from the corresponding distributed storage database is filtered to obtain the first detection result.

[0080] Understandably, based on the above S320, after determining the target characters included in each dimension of data, the second detection result is retrieved from the corresponding distributed storage database, and the second detection result is filtered to obtain the first detection result. Filtering refers to performing operations such as pagination and sorting on the second detection result to obtain the first detection result that is finally returned to the client to be displayed to the user.

[0081] Optionally, obtaining the first detection result in S330 can be achieved through the following steps:

[0082] The system retrieves resources that match the target characters included in the field data from the corresponding distributed storage database to obtain a second detection result; it determines the sorting method corresponding to the target characters included in the sorting data and sorts the second detection result based on the sorting method; it divides the sorted second detection result according to the target characters included in the pagination data to obtain a paginated first detection result, wherein the target characters included in the pagination data include the current page number to be displayed and the number of resources displayed per page.

[0083] Understandably, the second detection result is obtained by retrieving all resources that match the target characters included in the field data from the corresponding distributed storage database. The target characters included in the field data refer to the detection content, and the second detection result includes all resource data related to the detection content. For example, as shown in the example above, the metadata.labels field containing the etcd field is searched in all resources stored in the distributed storage database, and the etcd field is the detection content. Subsequently, the sorting method corresponding to the target characters included in the sorting data is determined, and the second detection results are sorted based on the sorting method. Referring to the example above, `order_key:metadata.name` in the sorting data indicates sorting by the name of the searched content in the field data. The second detection results may include names other than the searched content's name among all resource data. `order:asc` in the sorting data indicates the sorting method for the searched content's name, sorting `metada.name` in ascending order, i.e., sorting the `etcd` field in ascending order. The sorting method includes ascending and descending order; descending order is represented by `des`, and ascending order by `asc`. After completing the sorting operation, the sorted second detection results are divided according to the target characters included in the pagination data to obtain the paginated first detection results. The target characters included in the pagination data include the current page number to be displayed and the display value per page. Regarding the number of resources, refer to the example above. `page:1` indicates the current page number to be displayed, and `num:5` indicates that the number of resources displayed per page is 5. For example, if 10 resources are retrieved based on the field data, these 10 resources are used as the second detection result. Then, these 10 resources are sorted in ascending order by name to obtain the sorted second detection result. Names with more characters are placed later, and names with fewer characters are placed earlier. The complete name of each resource will always include "etcd". Finally, the sorted second detection result is filtered according to the pagination data, dividing the 10 resources into 2 pages to obtain the first detection result to be displayed. That is to say, the first detection result only includes the 5 resources divided in the first page. Resources on other pages may not be displayed or may be displayed later. In other words, after displaying the 5 resources divided in the first page, the remaining 5 resources divided in the second page can be displayed. This approach ensures that users see the 5 resource data that are most closely related to etcd first.

[0084] The detection results also include resource type and data type, where the resource type is cloud-native resource or custom resource.

[0085] Optionally, the second detection result obtained above can be achieved through the following steps:

[0086] In the corresponding distributed storage database, resources matching the target characters included in the field data are retrieved according to the resource type and the retrieval order of the data type, and a second detection result is obtained.

[0087] Understandably, the detection results also include resource types and data types. Resource types include native resources and custom (CRD) resources. Native resources include pod resources, deployment resources, ns resources, serviceaccount resources, and daemonset resources, etc. Data types include metadata resources, configuration resources (spec), and status resources (status), etc. For example, querying the list of all nodes with a pod status of "Completed", querying the list of all pods with "nodeName" as "worker0" in their pod specs, and querying the list of all pods whose labels contain the keyword "etcd". Other possible resource types and data types are not limited here.

[0088] This disclosure provides a cloud resource retrieval method that uses a key-value (kV) approach to retrieve resources. By defining the search query, it provides richer field retrieval for cloud-native operating systems and supports pagination and sorting of retrieved resources, thus enhancing search capabilities and providing efficient retrieval for clients.

[0089] Figure 4 This is a schematic diagram of a cloud resource retrieval device provided in an embodiment of the present disclosure. The cloud resource retrieval device provided in this embodiment can execute the processing flow provided in the above-described cloud resource retrieval method embodiments, such as... Figure 4 As shown, the cloud resource retrieval device 400 includes a deployment module 410, an acquisition module 420, and a retrieval module 430, wherein:

[0090] Deployment module 410 is used to deploy a second component that runs independently of the first component in a cloud operating system environment. The first component is used to provide low-level retrieval capabilities for cloud resources, and the second component is used to provide high-level retrieval capabilities for cloud resources.

[0091] The acquisition module 420 is used to acquire the input search information;

[0092] The retrieval module 430 is used to perform a retrieval in the corresponding distributed storage database based on the retrieval information using the second component, and obtain a first detection result.

[0093] Optionally, the number of search dimensions included in the first component of the device 400 is less than the number of search dimensions included in the second component; the search dimensions of the second component include at least one of field dimensions, pagination dimensions, and sorting dimensions.

[0094] Optionally, the retrieval module 430 is used for:

[0095] The search information is converted according to a preset search formula to obtain the search data corresponding to the search information, and the search data includes preset characters;

[0096] By identifying the preset characters from the search data, the search data is divided into multiple dimensions, and the target characters included in each dimension are determined.

[0097] Based on the target characters included in each dimension of the data, the second detection result retrieved from the corresponding distributed storage database is filtered to obtain the first detection result.

[0098] Optionally, the multiple dimension data in device 400 includes field data, pagination data, and sorting data, and the multiple dimension data are separated by the preset character.

[0099] Optionally, the retrieval module 430 is used for:

[0100] The resource matching the target character included in the field data is retrieved from the corresponding distributed storage database to obtain the second detection result;

[0101] Determine the sorting method corresponding to the target characters included in the sorted data, and sort the second detection results based on the sorting method;

[0102] The sorted second detection result is divided according to the target characters included in the pagination data to obtain the paginated first detection result. The target characters included in the pagination data include the current page number to be displayed and the number of resources displayed on each page.

[0103] Optionally, the detection result in device 400 may also include resource type and data type, wherein the resource type is cloud-native resource or custom resource.

[0104] Optionally, the retrieval module 430 is used for:

[0105] In the corresponding distributed storage database, resources matching the target characters included in the field data are retrieved according to the resource type and the retrieval order of the data type, and a second detection result is obtained.

[0106] Optionally, device 400 is also used for:

[0107] The second component is invoked using a preset invocation method, and search information is entered in the invocation interface of the second component;

[0108] The preset invocation method includes at least one of a preset client and a command line, wherein the preset client has the function of invoking cluster resource objects.

[0109] Optionally, the second component of the device includes a service interface.

[0110] Optionally, device 400 is used for:

[0111] The second component is invoked through the service interface using a preset invocation method. The service interface is used to provide external access capabilities.

[0112] Figure 4 The cloud resource retrieval device shown in the embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0113] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. See below for details. Figure 5 The diagram illustrates a structural schematic suitable for implementing the electronic device 500 in the embodiments of this disclosure. The electronic device 500 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable electronic devices, etc., as well as fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0114] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503 to implement the cloud resource retrieval method as described in the embodiments of this disclosure. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing device 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0115] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0116] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts, thereby implementing the cloud resource retrieval method as described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.

[0117] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0118] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0119] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0120] Optionally, when one or more of the above-described procedures are executed by the electronic device, the electronic device may also perform other steps described in the above embodiments.

[0121] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0123] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0124] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0126] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or gateway that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or gateway. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or gateway that includes said element.

[0127] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A cloud resource retrieval method, characterized in that, The method includes: Deploy a second component that runs independently of the first component in a cloud operating system environment. The first component is used to provide low-level search capabilities for cloud resources, and the second component is used to provide high-level search capabilities for internal and external clusters. The first component refers to a component with native Kubernetes search capabilities. Obtain the input search information; The second component performs a search in the corresponding distributed storage database based on the search information to obtain a first detection result; wherein, the distributed storage database is a database composed of data pulled and cached from etcd by the second component. After the second component starts, it obtains data from etcd and caches it for easy retrieval. The step of retrieving the first detection result from the corresponding distributed storage database based on the retrieval information includes: The search information is converted into a recognizable search program statement according to a preset search formula to obtain the search data corresponding to the search information. The search data includes preset characters. By identifying the preset character from the search data, the search data is divided into multiple dimensions, and the target character included in each dimension is determined; the multiple dimensions include field data, pagination data, and sorting data, and the multiple dimensions are separated by the preset character. Based on the target characters included in each dimension of the data, the second detection result retrieved from the corresponding distributed storage database is filtered to obtain the first detection result.

2. The method according to claim 1, characterized in that, The number of search dimensions included in the first component is less than the number of search dimensions included in the second component; the search dimensions of the second component include at least one of field dimensions, pagination dimensions, and sorting dimensions.

3. The method according to claim 1, characterized in that, The first detection result is obtained by filtering the second detection result retrieved from the corresponding distributed storage database based on the target characters included in each dimension of the data, including: The resource matching the target character included in the field data is retrieved from the corresponding distributed storage database to obtain the second detection result; Determine the sorting method corresponding to the target characters included in the sorted data, and sort the second detection results based on the sorting method; The sorted second detection result is divided according to the target characters included in the pagination data to obtain the paginated first detection result. The target characters included in the pagination data include the current page number to be displayed and the number of resources displayed on each page.

4. The method according to claim 3, characterized in that, The detection result also includes resource type and data type, where the resource type is cloud-native resource or custom resource. The second detection result is obtained by retrieving resources matching the target characters included in the field data from the corresponding distributed storage database, including: In the corresponding distributed storage database, resources matching the target characters included in the field data are retrieved according to the resource type and the retrieval order of the data type, and a second detection result is obtained.

5. The method according to claim 1, characterized in that, Before obtaining the input retrieval information, the method further includes: The second component is invoked using a preset invocation method, and search information is entered in the invocation interface of the second component; The preset invocation method includes at least one of a preset client and a command line, wherein the preset client has the function of invoking cluster resource objects.

6. The method according to claim 5, characterized in that, The second component includes a service interface, and the step of invoking the second component using a preset invocation method includes: The second component is invoked through the service interface using a preset invocation method. The service interface is used to provide external access capabilities.

7. A cloud resource retrieval device, characterized in that, The device includes: The deployment module is used to deploy a second component that runs independently of the first component in a cloud operating system environment. The first component is used to provide low-level search capabilities for cloud resources, and the second component is used to provide high-level search capabilities for internal and external clusters. The first component refers to a component with native Kubernetes search capabilities. The acquisition module is used to acquire the input search information; The retrieval module is used to perform a retrieval in the corresponding distributed storage database based on the retrieval information by the second component to obtain a first detection result; wherein, the distributed storage database is a database composed of data pulled and cached by the second component from etcd, and the second component obtains data from etcd after starting and caches it for retrieval purposes; The retrieval module is used for: The search information is converted into a recognizable search program statement according to a preset search formula to obtain the search data corresponding to the search information. The search data includes preset characters. By identifying the preset character from the search data, the search data is divided into multiple dimensions, and the target character included in each dimension is determined; the multiple dimensions include field data, pagination data, and sorting data, and the multiple dimensions are separated by the preset character. Based on the target characters included in each dimension of the data, the second detection result retrieved from the corresponding distributed storage database is filtered to obtain the first detection result.

8. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the cloud resource retrieval method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the cloud resource retrieval method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Resource retrieval method and system based on uniform interface of container cloud platform

    CN115114361A