Resource configuration method and device of cloud platform and computer readable storage medium
By collecting and processing hardware parameters in the cloud platform, generating appropriate deployment roles and running deployment programs, the problem of inefficient resource allocation of cloud platforms is solved, efficient and accurate resource allocation and cost reduction.
Patent Information
- Application Number
- CN202311616023.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
In the cloud platform, when deploying new systems or application services, tedious manual operations and complex setting processes are required, resulting in inefficient resource allocation and increased costs.
By collecting the initial hardware parameters of the electronic device, performing vector processing, traversing the vector database to calculate the similarity, determining the target reference vector data, generating appropriate deployment roles, and calling and running the corresponding deployment program.
Improve the efficiency and accuracy of resource allocation, reduce resource allocation costs, and reduce the risk of errors during deployment.
Smart Images

Figure CN120075039A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of cloud platforms, and more particularly to a resource configuration method, apparatus, and computer-readable storage medium for a cloud platform. Background Art
[0002] In the application scenarios of cloud platform resource configuration and hardware resource management, deploying a new system or application service often involves cumbersome manual operations and complex setting processes. These processes may involve operating system installation, network setting, and installation and configuration of software applications. Traditional deployment methods usually require engineers to invest a large amount of time and effort in manual configuration and repeat similar work in each deployment. Due to the diversity and complexity of hardware devices, this increases the difficulty and risk of deployment. Summary of the Invention
[0003] In view of this, the embodiments of the present application provide a resource configuration method, apparatus, and computer-readable storage medium for a cloud platform, aiming to solve the problem of how to improve resource configuration efficiency.
[0004] In the first aspect of the embodiments of the present application, a resource configuration method for a cloud platform is provided, which is applied to a resource configuration apparatus for configuring resources of a cloud platform. The resource configuration method for the cloud platform includes: collecting initial hardware parameters of an electronic device based on the access of the electronic device to the cloud platform; performing vectorization processing on the initial hardware parameters to obtain basic vector data; traversing a vector database and calculating the similarity between the basic vector data and each reference vector data in the vector database in turn; determining target reference vector data based on the maximum similarity; generating a deployment role according to the target reference vector data, and invoking and running a corresponding deployment program.
[0005] In the above embodiment, the resource configuration apparatus generates a suitable deployment role according to the hardware parameters of the electronic device, and invokes and runs a corresponding deployment program, thereby improving resource configuration efficiency and reducing resource configuration costs.
[0006] In the second aspect of the embodiments of the present application, a resource configuration apparatus is provided. The resource configuration apparatus includes a processor and a memory. The processor runs a computer program stored in the memory and executes the resource configuration method for the cloud platform in the embodiments of the present application.
[0007] In the third aspect of the embodiments of the present application, a computer-readable storage medium is provided for storing a computer program, which, when run on a computer, executes the resource configuration method for the cloud platform in the embodiments of the present application.
[0008] It can be understood that the specific implementation manners and beneficial effects of the resource allocation device provided in the second aspect of the embodiments of the present application and the computer-readable storage medium provided in the third aspect are substantially the same as those of the resource allocation method of the cloud platform provided in the first aspect, and will not be elaborated herein. Description of the Drawings
[0009] Figure 1 It is a schematic structural diagram of the resource allocation device provided in the embodiments of the present application.
[0010] Figure 2 It is a flowchart of the resource allocation method of the cloud platform provided in the embodiments of the present application. Detailed Implementation Manner
[0011] It should be noted that in the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. Terms such as "first", "second", "third", etc. (if any) in the specification, claims, and drawings of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0012] In addition, it should be noted that the methods shown in the methods or flowcharts disclosed in the embodiments of the present application include one or more steps for implementing the methods. Without departing from the scope of the claims, the execution orders of multiple steps may be interchanged with each other, and some steps may also be deleted.
[0013] In the application scenarios of cloud platform resource configuration and hardware resource management, deploying new systems or application services is often accompanied by cumbersome manual operations and complex setting processes. These processes may involve operating system installation, network setting, and installation and configuration of software applications. Traditional deployment methods usually require engineers to invest a lot of time and effort in manual configuration and repeat similar work in each deployment. Due to the diversity and complexity of hardware devices, this increases the difficulty and risk of deployment. In recent years, although some automated deployment tools, such as Ansible, have emerged to simplify the deployment process, these tools still have obvious limitations. First of all, they usually require manual writing of deployment programs, such as Ansible's Playbook or YAML deployment programs, which not only requires in-depth understanding of the target system but also takes a lot of time to maintain these programs. Secondly, these tools usually lack detection of the performance or characteristics of hardware resources, so it is difficult to ensure that the deployment program has a better match. For enterprises that need to quickly deploy cloud services on multiple devices, the above limitations may lead to a rather time-consuming and inefficient deployment process and increase the risk of deployment program mismatch or error.
[0014] Based on this, the embodiments of the present application provide a resource configuration method, device, and computer-readable storage medium for a cloud platform, aiming to solve the problem of how to improve the efficiency of resource configuration.
[0015] Figure 1 It is a schematic structural diagram of the resource configuration device provided by the embodiments of the present application.
[0016] As Figure 1 shown, the resource configuration device 100 is applied to a cloud platform and includes a processor 110 and a memory 120. Among them, the processor 110 can run the computer program stored in the memory 120 and execute the resource configuration method of the cloud platform in the embodiments of the present application.
[0017] The processor 110 may include one or more processing units. For example, the processor 110 may include, but is not limited to, an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, a Neural-Network Processing Unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0018] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the said memory.
[0019] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include, but are not limited to, an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, a Universal Serial Bus (USB) interface, etc.
[0020] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only illustrative and do not constitute a structural limitation on the resource configuration device 100. In other embodiments, the resource configuration device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0021] The memory 120 may include an external memory interface and an internal memory. Among them, the external memory interface can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the resource configuration device 100. The external memory card communicates with the processor 110 through the external memory interface to implement the data storage function. The internal memory can be used to store computer-executable program codes, and the executable program codes include instructions. The internal memory may include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.), etc. The data storage area can store the data created during the use of the resource configuration device 100 (such as audio data, image data, etc.), etc. In addition, the internal memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or a Universal Flash Storage (UFS), etc. The processor 110 executes various functional applications and data processing of the resource configuration device 100 by running the instructions stored in the internal memory, and / or the instructions stored in the memory provided in the processor 110, such as executing the resource configuration method of the cloud platform in the embodiments of the present application.
[0022] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the resource configuration device 100. In other embodiments, the resource configuration device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0023] Figure 2 It is a flowchart of the resource configuration method of the cloud platform provided by the embodiments of the present application.
[0024] The resource configuration method of the cloud platform is applied to a resource configuration device, such as Figure 1 the illustrated resource configuration device 100. As Figure 2 shown, the resource configuration method of the cloud platform includes the following steps:
[0025] S101, based on the access of the electronic device to the cloud platform, collect the initial hardware parameters of the electronic device.
[0026] Among them, the hardware parameters of the electronic device may include, but are not limited to, processor parameters, memory parameters, input / output (I / O) parameters, network parameters, etc. The electronic device may include, but is not limited to, a smart phone, a tablet computer, a personal computer (PC), a workstation, a server, a personal digital assistant (PDA), etc.
[0027] In this embodiment, the resource allocation device can collect the initial hardware parameters of the electronic device by querying the factory data of the electronic device. The factory data is used to record the initial hardware parameters of the electronic device when it leaves the factory. The factory data of the electronic device is usually stored in the memory of the electronic device.
[0028] In other embodiments, the resource allocation device can deploy a lightweight operating system on the electronic device to collect the hardware parameters of the electronic device. A lightweight operating system refers to an operating system with less dependence on the hardware environment. For example, it supports viewing hardware parameters through a web page of a browser.
[0029] S102. Perform vectorization processing on the initial hardware parameters to obtain basic vector data.
[0030] In this embodiment, the resource allocation device can perform vectorization processing based on an Artificial Intelligence (AI) model. Specifically, the AI model converts the hardware parameters into the form of mathematical vectors. The vectorization processing can include steps such as feature selection, feature extraction, numerical processing, and constructing feature vectors.
[0031] S103. Traverse the vector database and calculate the similarity between the basic vector data and each reference vector data in turn.
[0032] Among them, the vector database is used to store the device identifier, deployment role, and vector data corresponding to the electronic devices that have accessed the cloud platform. The device identifier can include, but is not limited to, device name, device type, device serial number, device identification code, etc. One device identifier corresponds to one reference vector data. The deployment roles can include control nodes, computing nodes, network nodes, and storage nodes. Among them, the control node is used to manage and coordinate various services of the cloud platform, including user authentication, image management, network management, virtual machine scheduling, resource allocation, etc. The computing node is used to provide computing resources for virtual machines. The network node is used to provide network resources for virtual machines. The storage node is used to provide storage resources for virtual machines. The functional characteristics of each deployment role determine their different requirements for the hardware environment. For example, the control node has relatively high requirements for all aspects of the hardware parameters of the electronic device, the computing node has relatively high requirements for the processor parameters of the electronic device, the network node has relatively high requirements for the network parameters of the electronic device, and the storage node has relatively high requirements for the memory parameters of the electronic device.
[0033] In this embodiment, the similarity can be calculated using algorithms such as the K-Nearest Neighbor (KNN) algorithm or the Approximate Nearest Neighbor (ANN) algorithm. The larger the value of the similarity, the more similar the two vectors are.
[0034] S104. Determine the target reference vector data based on the maximum similarity.
[0035] In this embodiment, the resource configuration device compares the similarities corresponding to each reference vector data and determines the target reference vector data corresponding to the maximum similarity from each reference vector data.
[0036] S105. Generate a deployment role according to the target reference vector data and retrieve the corresponding deployment program.
[0037] In this embodiment, each reference vector data stored in the vector database has a corresponding deployment role and deployment program. The resource configuration device can retrieve the corresponding deployment role according to the target reference vector data and then retrieve the corresponding deployment program based on the deployment role.
[0038] S106. Generate a performance analysis report based on the deployment role.
[0039] In this embodiment, the performance analysis report may include whether the initial hardware parameters meet the performance requirements of the deployment role. For example, the performance requirements of the control node may include that the processor parameter is greater than or equal to the first processing threshold, the memory parameter is greater than or equal to the first storage threshold, the I / O parameter is greater than or equal to the first I / O threshold, and the network parameter is greater than or equal to the first network threshold. The performance requirements of the computing node may include that the processor parameter is greater than or equal to the second processing threshold. The performance requirements of the network node may include that the network parameter is greater than or equal to the second network threshold. The performance requirements of the storage node may include that the memory parameter is greater than or equal to the second storage threshold. Among them, each parameter threshold can be set as needed.
[0040] S107. Determine whether the performance analysis report is approved.
[0041] In this embodiment, to avoid inconsistency between the deployment role and the user requirements, the performance analysis report needs to be audited. The audit can be manual or matched with the stored user requirement report. The user requirement report may include the hardware parameters required by the user. When the audit is passed, an audit passed command is triggered, and the audit passed command is used to instruct the resource configuration device to run the corresponding deployment program. When the audit fails, an audit failed command is triggered, and the audit failed command is used to instruct the resource configuration device to adjust the similarity weight according to the preset rules.
[0042] If so, execute step S108; if not, execute step S109.
[0043] S108. Run the corresponding deployment program.
[0044] In this embodiment, the deployment role is associated with the deployment program. The deployment program can be stored in the cloud platform database.
[0045] S109, adjust the similarity weight according to the preset rules.
[0046] In this embodiment, each deployment role has a different level of importance. A more important deployment role is assigned a larger weight value, and vice versa. Therefore, the resource configuration device can, according to the priority order of each deployment role, assign a higher weight value to the deployment role with a higher priority when adjusting the similarity weight, so that the calculated similarity can more accurately reflect the user's needs.
[0047] After executing step S109, return to execute step S103.
[0048] S110, collect the current hardware parameters of the electronic device.
[0049] Among them, the current hardware parameters are used to reflect the actual operating state of the electronic device. The current hardware parameters are associated with the deployment role. For example, when the deployment role of the electronic device is a control node, the current hardware parameters may include processor parameters, memory parameters, I / O parameters, and network parameters. When the deployment role of the electronic device is a computing node, the current hardware parameters may include processor parameters. When the deployment role of the electronic device is a network node, the current hardware parameters may include network parameters. When the deployment role of the electronic device is a storage node, the current hardware parameters may include memory parameters.
[0050] In this embodiment, the resource configuration device can use a lightweight operating system to collect the current hardware parameters.
[0051] After executing step S108, execute steps S110 to S111.
[0052] S111, determine whether the current hardware parameters meet the performance requirements of the deployment role.
[0053] In this embodiment, affected by factors such as the usage environment and device durability, the current hardware parameters of the electronic device will deviate from the initial hardware parameters. Therefore, evaluating whether the current hardware parameters meet the performance requirements of the deployment role can more accurately reflect whether the electronic device is suitable for the current deployment role. When the current hardware parameters meet the performance requirements of the deployment role, the resource configuration device maintains the current deployment role of the electronic device unchanged and stores the measured vector data corresponding to the current hardware parameters. When the current hardware parameters do not meet the performance requirements of the deployment role, the resource configuration device adjusts the similarity weight according to the preset rules and then re-matches the deployment role suitable for the current hardware parameters.
[0054] If it is satisfied, execute steps S112 to S119; if it is not satisfied, return to execute step S109.
[0055] S112. Vectorize the current hardware parameters to obtain measured vector data.
[0056] Among them, for the vectorization process, refer to the relevant description in step S102 and it will not be elaborated here.
[0057] S113. Store the device identifier, deployment role, and measured vector data corresponding to the electronic device in the vector database.
[0058] In this embodiment, the more associated data of each electronic device stored in the vector database, the higher the accuracy of matching the deployment role, but the higher the requirement for the storage capacity of the vector database. Since the storage capacity of the vector database is limited, a corresponding storage management mechanism can be set. For example, when the storage capacity of the vector database exceeds the capacity threshold, the resource configuration device can delete some data according to preset rules such as data importance and storage time sequence.
[0059] S114. Calculate the similarity between the measured vector data and the target reference vector data.
[0060] Among them, for calculating the similarity, refer to the relevant description in step S103 and it will not be elaborated here.
[0061] S115. Based on the similarity being less than the similarity threshold, adjust the deployment role or add a new electronic device, and retrieve the corresponding deployment program.
[0062] In this embodiment, if the similarity between the measured vector data and the target reference vector data is less than the similarity threshold, it indicates that the deviation between the measured vector data and the target reference vector data is large, that is, the measured vector data does not match the current deployment role. Therefore, the resource configuration device needs to adjust the deployment role to re-match the deployment role suitable for the measured vector data. When the measured vector data does not match all deployment roles, it means the electronic device is unavailable, and the resource configuration device needs to add a new electronic device.
[0063] S116. Run the corresponding deployment program.
[0064] In this embodiment, adjusting the deployment role or adding a new electronic device will both result in an update of the deployment program.
[0065] S117. Collect the current hardware parameters of the electronic device.
[0066] Among them, for collecting the current hardware parameters, refer to the relevant description in step S110 and it will not be elaborated here.
[0067] S118. Generate a health report based on the current hardware parameters.
[0068] In this embodiment, the health report may include the actual operating state of the electronic device. The actual operating state may include a normal state or an abnormal state. When the current hardware parameters meet the performance requirements of the deployment role, the actual operating state is the normal state. When the current hardware parameters do not meet the performance requirements of the deployment role, the actual operating state is the abnormal state.
[0069] S119, determine whether there is an abnormality in the health report.
[0070] In this embodiment, when the actual operating state of the electronic device is in an abnormal state, the resource configuration device may generate an abnormal value in the health report. Among them, the abnormal value can be set as needed. Thus, the resource configuration device determines whether there is an abnormality in the health report by querying whether there is an abnormal value in the health report. If there is an abnormality in the health report, it means that the current hardware parameters do not match the current deployment role, and the resource configuration device needs to adjust the deployment role or add an electronic device. If there is no abnormality in the health report, it means that the current hardware parameters are suitable for the current deployment role, and the resource configuration device maintains the current deployment role of the electronic device unchanged and continues to collect the current hardware parameters.
[0071] If so, execute step S120; if not, return to execute step S117.
[0072] S120, adjust the deployment role or add an electronic device, and retrieve the corresponding deployment program.
[0073] In this embodiment, the adjustment of the deployment role or the addition of an electronic device can refer to the relevant description in step S115, which will not be elaborated here.
[0074] After executing step S120, return to execute step S116.
[0075] In the above embodiment, the resource configuration device generates a suitable deployment role according to the hardware parameters of the electronic device, retrieves and runs the corresponding deployment program, thereby improving the resource configuration efficiency and reducing the resource configuration cost. In addition, the performance analysis report is used to check whether the deployment role meets the user requirements, thereby improving the accuracy of resource configuration. Moreover, considering that the hardware parameters may deviate due to factors such as the use environment and device durability, it is checked whether the current hardware parameters meet the performance requirements of the deployment role, thereby ensuring the matching of the electronic device and the current deployment role. Also, when the deviation between the measured vector data corresponding to the current hardware parameters and the target reference vector data is large, the deployment role is adjusted or an electronic device is added, thereby ensuring the accuracy of resource configuration. And, the health report is used to check whether there is an abnormality in the actual operating state of the electronic device, thereby determining whether to adjust the deployment role or add an electronic device, so as to optimize the resource configuration.
[0076] In one embodiment, the resource allocation device may execute steps S101 to S105 and S108, and may not execute other steps.
[0077] In another embodiment, in addition to executing steps S101 to S105 and S108, the resource allocation device may also execute steps S106 to S107 and S109.
[0078] In another embodiment, in addition to executing steps S101 to S105 and S108, the resource allocation device may also execute steps S110 to S113 and S109.
[0079] In another embodiment, in addition to executing steps S101 to S105 and S108, the resource allocation device may also execute steps S110 to S112, S109, and S114 to S116.
[0080] In another embodiment, in addition to executing steps S101 to S105 and S108, the resource allocation device may also execute steps S117 to S118.
[0081] In another embodiment, in addition to executing steps S101 to S105 and S108, the resource allocation device may also execute steps S117 to S120.
[0082] It can be understood that in other embodiments, the above-mentioned multiple embodiments may be combined with each other.
[0083] The embodiment of the present application further provides a computer-readable storage medium for storing a computer program, which, when run on a computer, executes the resource allocation method of the cloud platform in the embodiment of the present application.
[0084] A computer-readable storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. The computer-readable storage medium includes, but is not limited to, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage device, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0085] The embodiments of the present application have been described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the above embodiments, and various changes can be made without departing from the spirit of the present application within the scope of knowledge possessed by those of ordinary skill in the art.
Claims
1. A resource configuration method for a cloud platform, applied to a resource configuration device for configuring the resources of the cloud platform. Characterized in that, The method includes: Based on the access of an electronic device to the cloud platform, collect the initial hardware parameters of the electronic device; Perform vectorization processing on the initial hardware parameters to obtain basic vector data; Traverse the vector database and calculate the similarity between the basic vector data and each reference vector data in the vector database in turn; Determine the target reference vector data based on the maximum similarity; Generate a deployment role according to the target reference vector data, and retrieve and run the corresponding deployment program.
2. The resource configuration method for a cloud platform according to claim 1, Characterized in that, Before running the deployment program, the method further includes: Generate a performance analysis report based on the deployment role, and the performance analysis report includes whether the initial hardware parameters meet the performance requirements of the deployment role; Based on the performance analysis report being approved, run the deployment program.
3. The resource configuration method for a cloud platform according to claim 2, Characterized in that, The method further includes: Based on the performance analysis report not being approved, adjust the similarity weight according to a preset rule to re-determine the target reference vector data corresponding to the maximum similarity.
4. The resource configuration method for a cloud platform according to claim 1, Characterized in that, After running the deployment program, the method further includes: Collect the current hardware parameters of the electronic device; Determine whether the current hardware parameters meet the performance requirements of the deployment role; Based on the current hardware parameters meeting the performance requirements of the deployment role, perform vectorization processing on the current hardware parameters to obtain measured vector data; Store the device identifier corresponding to the electronic device, the deployment role, and the measured vector data in the vector database.
5. The resource configuration method for a cloud platform according to claim 4, Characterized in that, The method further includes: Based on the current hardware parameters not meeting the performance requirements of the deployment role, adjust the similarity weight according to a preset rule to re-determine the target reference vector data corresponding to the maximum similarity.
6. The resource configuration method for a cloud platform according to claim 4, Characterized in that, The method further includes: Calculate the similarity between the measured vector data and the target reference vector data; Based on the similarity being less than the similarity threshold, adjust the deployment role or add the electronic device, and retrieve and run the corresponding deployment program.
7. The resource configuration method for a cloud platform according to claim 1, Characterized in that, The method further includes: Collect the current hardware parameters of the electronic device; Generate a health report according to the current hardware parameters, and the health report includes the actual operating state of the electronic device, and the actual operating state includes a normal state or an abnormal state.
8. The resource configuration method for a cloud platform according to claim 7, Characterized in that, The method further includes: Based on the abnormality in the health report, adjust the deployment role or add the electronic device, and retrieve and run the corresponding deployment program.
9. A resource configuration device, comprising a processor and a memory, wherein, the processor runs a computer program stored in the memory and executes the resource configuration method of the cloud platform according to any one of claims 1 to 8.
10. A computer-readable storage medium for storing a computer program, wherein, when the computer program is run by a computer, it executes the resource configuration method of the cloud platform according to any one of claims 1 to 8.