Method, device and server for service flexible allocation based on cloud resources
By introducing flexible allocation methods into cloud resource services and dynamically adjusting server resources, the problems of waste of resources and difficulty in load adjustment in traditional deployment methods are solved, and on-demand deployment and stable access of servers are achieved.
Patent Information
- Application Number
- CN202311866407.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
Traditional server deployment methods lead to waste of resources during off-peak hours and cannot dynamically adjust the load, resulting in users being unable to access when the load is too high.
Provide a flexible allocation method based on cloud resource services, which dynamically adjusts server resources by obtaining user operation requests, realizing dynamic deployment and release of servers. Specific measures include connecting or disconnecting the server based on user requests, determining whether the number of deployed servers is greater than the preset threshold, and creating or releasing the server if necessary.
It realizes the deployment of servers on demand, dynamically adjusts server resources, and reasonably releases idle resources, avoids resource waste, and ensures stable access when load changes.
Smart Images

Figure CN120238537A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of cloud resources, and particularly to a method, device, and server for elastic allocation of cloud resource services. Background Art
[0002] With the continuous development of technology, the demand for servers is increasing. Since the number of loads supported by a single server is small, in order to meet the requirements of multiple people accessing simultaneously, it is necessary to complete the task by integrating multiple servers.
[0003] The traditional method is to deploy all the required servers at once according to the set number of loads, and users can directly access them later.
[0004] Deploying all the required servers at once results in most servers being idle or under low load during off-peak hours, leading to a great waste of resources and the inability to dynamically increase the load. When the load exceeds the predetermined value, users will be unable to access. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method, device, and server for elastic allocation of cloud resource services, which can dynamically adjust server resources and achieve dynamic deployment and release of servers.
[0006] In a first aspect, an embodiment of this application provides a method for elastic allocation of cloud resource services, and the method includes:
[0007] Obtain a user operation request;
[0008] Determine to connect to or disconnect from a server according to the operation request;
[0009] When the user requests to disconnect from the server, release the server;
[0010] When the user requests to connect to the server, allocate a connection.
[0011] In some embodiments, the step of when the user requests to connect to the server, allocate a connection, includes:
[0012] When the user requests to connect to the server, determine whether the number of deployed servers is greater than a preset threshold;
[0013] If the number of deployed servers is greater than the preset threshold, allocate a connection;
[0014] If the number of deployed servers is less than or equal to the preset threshold, create a new server.
[0015] In some embodiments, the step of when the user requests to disconnect from the server, release the server, includes:
[0016] When the user applies to disconnect the server, the connection is released and the load number of the server is decreased by 1;
[0017] When the load number of the server is equal to 0, the server is released.
[0018] In some embodiments, after the connection is released when the user applies to disconnect the server, the method further includes:
[0019] Sending a prompt message indicating successful disconnection to the user.
[0020] In some embodiments, after the connection is allocated when the number of deployed servers is greater than a preset threshold, the method further includes:
[0021] Sending a prompt message indicating successful connection to the user.
[0022] In a second aspect, an embodiment of the present application further provides a device for elastic allocation based on cloud resource services, including:
[0023] An acquisition module, configured to acquire a user operation request;
[0024] A determination module, configured to determine whether to connect to or disconnect from the server according to the operation request;
[0025] A release module, configured to release the server when the user applies to disconnect the server;
[0026] An allocation module, configured to allocate a connection when the user applies to connect to the server.
[0027] In some embodiments, the allocation module is specifically configured to:
[0028] When the user applies to connect to the server, determine whether the number of deployed servers is greater than a preset threshold;
[0029] If the number of deployed servers is greater than the preset threshold, allocate a connection;
[0030] If the number of deployed servers is less than or equal to the preset threshold, create a new server.
[0031] In some embodiments, the release module is specifically configured to:
[0032] When the user applies to disconnect the server, release the connection and decrease the load number of the server by 1;
[0033] When the load number of the server is equal to 0, release the server.
[0034] In a third aspect, an embodiment of the present application further provides a server, including:
[0035] At least one processor; and,
[0036] A memory communicatively connected to the at least one processor; wherein,
[0037] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method of the first aspect above.
[0038] In a fourth aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the processor is caused to execute the method described in the first aspect above.
[0039] Compared with the prior art, the beneficial effects of the present application are as follows: Different from the prior art, the method for elastic allocation of cloud resource services provided by the embodiments of the present application obtains a user operation request, and then determines to connect to or disconnect from a server according to the user operation request. When the user applies to disconnect from the server, the server is released, and when the user applies to connect to the server, a connection is allocated. Thus, it is possible to achieve on-demand deployment of servers, realize dynamic deployment and release of services, dynamically adjust server resources, and reasonably release idle resources. Description of the Drawings
[0040] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplary illustrations do not limit the embodiments. Elements with the same reference numerals in the drawings represent similar elements, unless otherwise stated, and the drawings in the drawings do not constitute a proportional limitation.
[0041] Figure 1 It is a schematic flowchart of a method for elastic allocation of cloud resource services provided by an embodiment of the present application;
[0042] Figure 2 It is a schematic diagram of an apparatus for elastic allocation of cloud resource services provided by an embodiment of the present application;
[0043] Figure 3 It is a schematic hardware structure diagram of a server provided by an embodiment of the present application. Detailed Embodiments
[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts fall within the scope of protection of this application.
[0045] It should be noted that if there is no conflict, the various features in the embodiments of this application can be combined with each other and all fall within the scope of protection of this application. In addition, although functional module division is performed in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the flowchart. Furthermore, the terms "first", "second", "third", etc. used in this application do not limit the data and execution order, but are only used to distinguish the same items or similar items with basically the same functions and roles.
[0046] As Figure 1 shown, the embodiments of this application provide a method for elastic allocation of cloud resource services, and the method includes:
[0047] Step 110, obtaining a user operation request;
[0048] Step 120, determining to connect to a server or disconnect from a server according to the operation request;
[0049] Step 130, when the user applies to disconnect from the server, releasing the server;
[0050] Step 140, when the user applies to connect to the server, allocating a connection.
[0051] In the embodiments of this application, by obtaining a user operation request, the user operation request includes a request to connect to a server or a request to disconnect from a server. After receiving the user operation request, the server determines whether the user wants to connect to the server or disconnect from the server according to the operation request. When the user applies to disconnect from the server, the server is released; when the user applies to connect to the server, a connection is allocated.
[0052] In some embodiments, as an implementation manner of step 140, the method includes:
[0053] When the user applies to connect to the server, it is determined whether the number of deployed servers is greater than a preset threshold; if the number of deployed servers is greater than the preset threshold, a connection is allocated; if the number of deployed servers is less than or equal to the preset threshold, a new server is created.
[0054] Specifically, when a user applies to connect to the server, first determine whether the number of deployed servers is greater than a preset threshold, where the preset threshold can be set according to the actual scenario. If the number of deployed servers is greater than the preset threshold, then allocate a connection. On the contrary, if the number of deployed servers is less than or equal to the preset threshold, then create a new server and then allocate a connection. After the user connects, a connection success prompt message can also be sent to the user.
[0055] In some embodiments, as an implementation manner of step 130, the method includes:
[0056] When a user applies to disconnect from the server, then release the connection and decrement the load count of the server by 1; when the load count of the server is equal to 0, then release the server.
[0057] Specifically, when a user applies to disconnect from the server, then release the connection, and at the same time decrement the load count of the server by 1, and then determine whether the load count of the server is equal to 0. If the load count of the server is equal to 0, it means that there is no user accessing the server, then release the server. After the user disconnects from the server, a disconnection success prompt message is sent to the user.
[0058] In some other embodiments, during the process of using cloud resources, there will be a process from peak to idle periods, which will cause the current online users to be dispersed among multiple servers. For example, the current N online users are dispersed on N servers, resulting in waste of server resources. Through a preset integration mechanism, these N users can be allocated to N / M servers. Assuming that each server supports M users, then N - N / M servers can be released. When M and N are large enough, the number of servers that can be released is infinitely close to N, achieving cost reduction and efficiency improvement, and being more flexible to cope with different load scenarios.
[0059] Correspondingly, an embodiment of the present application further provides a device 200 for elastic allocation of cloud resource services, as Figure 2 shown, the device 200 includes:
[0060] An acquisition module 210, configured to acquire a user operation request;
[0061] A determination module 220, configured to determine to connect to the server or disconnect from the server according to the operation request;
[0062] A release module 230, configured to release the server when a user applies to disconnect from the server;
[0063] An allocation module 240, configured to allocate a connection when a user applies to connect to the server.
[0064] The device for elastic allocation of cloud resource services provided by the embodiments of the present application obtains a user operation request through an acquisition module, and then determines whether to connect to or disconnect from a server according to the operation request through a judgment module. When the user applies to disconnect from the server, the server is released through a release module. When the user applies to connect to the server, a connection is allocated through an allocation module. Thus, on-demand deployment of the server can be achieved, dynamic deployment and release of services can be realized, server resources can be dynamically adjusted, and idle resources can be reasonably released.
[0065] Optionally, in other embodiments of the device, the allocation module 240 is specifically configured to:
[0066] When the user applies to connect to the server, it is determined whether the number of deployed servers is greater than a preset threshold;
[0067] If the number of deployed servers is greater than the preset threshold, a connection is allocated;
[0068] If the number of deployed servers is less than or equal to the preset threshold, a new server is created.
[0069] Optionally, in other embodiments of the device, the release module 230 is specifically configured to:
[0070] When the user applies to disconnect from the server, the connection is released, and the load number of the server is decreased by 1;
[0071] When the load number of the server is equal to 0, the server is released.
[0072] It should be noted that the above device for elastic allocation of cloud resource services can execute a method for elastic allocation of cloud resource services provided by the embodiments of the present application, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the embodiments of the device for elastic allocation of cloud resource services, reference can be made to the method for elastic allocation of cloud resource services provided by the embodiments of the present application.
[0073] Figure 3 is a schematic hardware structure diagram of a server provided by the embodiments of the present application. As Figure 3 shown, the server 300 includes:
[0074] One or more processors 301 and a memory 302, Figure 3 Taking one processor as an example.
[0075] The processor 301 and the memory 302 can be connected through a bus or other means. Figure 3 Taking connection through a bus as an example.
[0076] The memory 302, being a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for elastic allocation of cloud resource services in the embodiments of the present application. The processor 301 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 302, thereby implementing the method for elastic allocation of cloud resource services in the above method embodiments.
[0077] The memory 302 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the display device of the monitoring screen, etc. In addition, the memory 302 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 302 optionally includes a memory remotely provided relative to the processor 301, and these remote memories can be connected to the device for elastic allocation of cloud resource services through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0078] The embodiments of the present application also provide a non-volatile computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the method for elastic allocation of cloud resource services in any of the above method embodiments.
[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] Through the description of the above embodiments, those of ordinary skill in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; under the idea of the present application, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above. For the sake of brevity, they are not provided in detail; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for elastic allocation of cloud resource services, characterized in that, The method includes: Obtaining a user operation request; Determining to connect to or disconnect from the server according to the operation request; When the user applies to disconnect from the server, releasing the server; When the user applies to connect to the server, allocating a connection.
2. The method according to claim 1, wherein The step of when the user applies to connect to the server and allocating a connection includes: When the user applies to connect to the server, determining whether the number of deployed servers is greater than a preset threshold; If the number of deployed servers is greater than the preset threshold, allocating a connection; If the number of deployed servers is less than or equal to the preset threshold, creating a new server.
3. The method according to claim 1, characterized in that, The step of when the user applies to disconnect from the server and releasing the server includes: When the user applies to disconnect from the server, releasing the connection and decrementing the load count of the server by 1; When the load count of the server equals 0, releasing the server.
4. The method according to claim 2, wherein After the step of when the user applies to disconnect from the server and releasing the connection, the method further includes: Sending a prompt message indicating successful disconnection to the user.
5. The method according to claim 3, wherein After the step of if the number of deployed servers is greater than the preset threshold and allocating a connection, the method further includes: Sending a prompt message indicating successful connection to the user.
6. An apparatus based on elastic allocation of cloud resource services, characterized in that It includes: An obtaining module for obtaining a user operation request; A determination module for determining to connect to or disconnect from the server according to the operation request; A release module for releasing the server when the user applies to disconnect from the server; An allocation module for allocating a connection when the user applies to connect to the server.
7. The device according to claim 6, characterized in that, The allocation module is specifically configured to: When the user applies to connect to the server, determine whether the number of deployed servers is greater than a preset threshold; If the number of deployed servers is greater than the preset threshold, allocate a connection; If the number of deployed servers is less than or equal to the preset threshold, create a new server.
8. The device according to claim 6, characterized in that, The release module is specifically configured to: When the user applies to disconnect from the server, release the connection and decrement the load count of the server by 1; When the load count of the server equals 0, release the server.
9. A server, characterized in that, It includes: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of claims 1-5.
10. A non-volatile computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the processor executes the method according to any one of claims 1-5.