Device scheduling method, device, equipment and storage medium
Equipment scheduling is performed by predicting the number of visits, which solves the problem of high server pressure in the existing technology and achieves equipment load balancing and efficiency improvement.
Patent Information
- Application Number
- CN202111221767.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-10-20
AI Technical Summary
In the existing cluster management solution, products with a large number of visits will increase the pressure on the server, resulting in low access efficiency, and products with a small number of visits will occupy resources, resulting in reduced efficiency.
By obtaining the historical visits of the service object, a prediction model is established, the predicted visits are calculated, the device is expanded or reduced based on the predicted visits, and the service objects are migrated in a timely manner to ensure device load balancing.
It improves the average utilization of execution equipment, avoids equipment overload and frequent migration, improves the execution efficiency of service objects, and ensures improved access efficiency.
Smart Images

Figure CN113918341B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a device scheduling method, apparatus, device and storage medium. Background Art
[0002] Existing cluster management solutions are usually based on machines. The services deployed and products loaded on each machine are consistent. Therefore, if several products with high traffic are deployed on the same machine at the same time, the service pressure of the machine will be greatly increased, and the products with less traffic on the machine will be squeezed out by products with more traffic, resulting in low access efficiency. Summary of the invention
[0003] The main purpose of the present application is to provide a device scheduling method, apparatus, device and storage medium, aiming to solve the problem of low access efficiency to the server in the prior art.
[0004] In order to achieve the above-mentioned invention object, the present application proposes a device scheduling method, the method comprising:
[0005] Obtaining historical visits received by different service objects within a preset statistical time period, obtaining a prediction model based on the historical visits, and calculating the predicted visits of each service object based on the prediction model;
[0006] When the total amount of the predicted access volume is less than the preset capacity reduction threshold, the service object is migrated according to the predicted access volume, and the idle execution device is removed after the migration is completed; when the total amount of the predicted access volume is greater than the preset capacity expansion threshold, a new execution device is added according to the predicted access volume, and the service object is migrated according to the predicted access volume;
[0007] Obtaining resource information reported by each of the execution devices at preset time intervals;
[0008] Receive a request message of an access request, identify the service object corresponding to the request message, obtain the real-time access volume of the service object, obtain the current load state of each of the execution devices according to the resource information, and calculate the predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state;
[0009] The execution device whose predicted load status meets the preset migration condition is used as the first migration device, and the service objects in the first migration device are migrated according to the real-time access volume and the current load status.
[0010] Furthermore, the migrating the service object in the first migration device according to the real-time access volume and the current load state includes:
[0011] Obtain a migration solution library, wherein the migration solution library includes a plurality of preset migration solutions, each of which corresponds to at least one set of real-time access volume and the current load status;
[0012] According to the real-time access volume and the current load status, a corresponding migration solution is selected from the migration solution library, and the service object in the first migration device is migrated according to the selected migration solution.
[0013] Further, after obtaining the resource information reported by each of the execution devices at a preset time interval, the method further includes:
[0014] When the resource information is received, delay timing of the execution device corresponding to the resource information;
[0015] When the delay time is greater than the preset reporting time threshold, the execution device is tested for network access, and if the network access status of the execution device is normal, a maintenance instruction is sent to the control center;
[0016] If the network access status of the execution device is abnormal, determine whether the execution device is in a removed state, and if not, send a maintenance instruction to the control center.
[0017] Furthermore, the migrating the service object in the first migration device according to the real-time access volume and the current load status also includes:
[0018] Determine whether there is a service object with real-time access volume greater than a preset load upper limit in the first migration device, and if so, split the service object with real-time access volume greater than the preset load upper limit into a plurality of service fragments;
[0019] A plurality of execution devices are selected as second migration devices according to the real-time access volume, and the service fragments are respectively migrated to different second migration devices.
[0020] Further, the migrating the service object in the first migration device includes:
[0021] The priority parameter of each of the service objects that need to be migrated in the first migration device is obtained, and the service objects are migrated in descending order of the priority parameters.
[0022] Further, removing the idle execution device includes:
[0023] The rack information corresponding to each idle execution device is identified, and the idle execution devices are grouped and removed according to the rack information.
[0024] The present application also proposes a device scheduling apparatus, comprising:
[0025] The visit volume calculation module is used to obtain the historical visit volumes received by different service objects within a preset statistical time period, and use a preset prediction model to calculate the predicted visit volume of each service object according to the prediction model;
[0026] A device adjustment module, used for, when the total amount of the predicted access volume is less than a preset capacity reduction threshold, migrating the service object according to the predicted access volume, and removing idle execution devices after the migration is completed; when the total amount of the predicted access volume is greater than a preset capacity expansion threshold, adding new execution devices according to the predicted access volume, and migrating the service object according to the predicted access volume;
[0027] A resource information acquisition module, used to acquire resource information reported by each of the execution devices at preset time intervals;
[0028] A load state prediction module, configured to receive a request message of an access request, identify a service object corresponding to the request message, obtain a real-time access volume of the service object, obtain a current load state of each of the execution devices according to the resource information, and calculate a predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state;
[0029] The object migration module is used to use the execution device whose predicted load status meets the preset migration condition as the first migration device, and migrate the service objects in the first migration device according to the real-time access volume and the current load status.
[0030] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0031] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0032] The device scheduling method, apparatus, equipment and storage medium of the present application calculate the predicted access volume of each service object according to the prediction model, and can obtain the predicted access volume result with high accuracy; expand or reduce the execution device by predicting the total amount of access, thereby improving the average utilization rate of the execution device, while avoiding the overload of the execution device, and avoiding the situation that some execution devices frequently meet the migration conditions, thereby causing the scheduling center to need to frequently schedule the service objects repeatedly, affecting the execution efficiency of the service objects; by obtaining the resource information reported by each execution device at intervals, so as to calculate the load of each currently connected execution device, so as to facilitate the device scheduling Provide parameter support; obtain the service object corresponding to the access request, calculate the real-time access volume of different service objects respectively, so as to distinguish the resource requirements of different service objects, and calculate the predicted load state of each execution device according to the real-time access volume and the current load state, so as to determine whether the execution device can continue to bear the current service object; determine whether migration is needed according to the predicted load state, and migrate the service object according to the real-time access volume and the current load state when the migration conditions are met, so as to make the load between each execution device more balanced, and avoid the problem that the service objects with less access volume are squeezed by the service objects with more access volume to occupy the machine resources, resulting in reduced access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a flow chart of a device scheduling method according to an embodiment of the present application;
[0034] Figure 2 A schematic diagram of a flow chart of a device scheduling method according to a specific implementation mode of the present application;
[0035] Figure 3 This is a schematic block diagram of the structure of a device scheduling device according to an embodiment of the present application;
[0036] Figure 4 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0037] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] Reference Figure 1 In order to achieve the above-mentioned invention object, the present application proposes a device scheduling method, which includes:
[0040] S1: Obtain the historical visits received by different service objects within a preset statistical time period, obtain a prediction model based on the historical visits, and calculate the predicted visits of each service object based on the prediction model;
[0041] S2: when the total amount of the predicted access volume is less than the preset capacity reduction threshold, the service object is migrated according to the predicted access volume, and the idle execution device is removed after the migration is completed; when the total amount of the predicted access volume is greater than the preset capacity expansion threshold, a new execution device is added according to the predicted access volume, and the service object is migrated according to the predicted access volume;
[0042] S3: Obtain resource information reported by each of the execution devices at preset time intervals;
[0043] S4: receiving a request message of an access request, identifying a service object corresponding to the request message, obtaining a real-time access volume of the service object, obtaining a current load state of each of the execution devices according to the resource information, and calculating a predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state;
[0044] S5: taking the execution device whose predicted load status meets the preset migration condition as the first migration device, and migrating the service objects in the first migration device according to the real-time access volume and the current load status.
[0045] This embodiment calculates the predicted access volume of each service object according to the prediction model, and can obtain a predicted access volume result with a high accuracy rate; the execution device is expanded or reduced according to the total amount of predicted access volume, thereby improving the average utilization rate of the execution device, avoiding overload of the execution device, and avoiding the situation that some execution devices frequently meet the migration conditions, thereby causing the dispatch center to frequently schedule the service object repeatedly, affecting the execution efficiency of the service object; by obtaining the resource information reported by each execution device at intervals, so as to facilitate the load calculation of each currently connected execution device, thereby providing parameter support for device scheduling; by obtaining the service object corresponding to the access request, the real-time access volume of different service objects is calculated respectively, thereby distinguishing the resource requirements of different service objects, and the predicted load state of each execution device is calculated according to the real-time access volume and the current load state, thereby determining whether the execution device can continue to bear the current service object; determining whether migration is required according to the predicted load state, and migrating the service object according to the real-time access volume and the current load state when the migration conditions are met, thereby making the load between each execution device more balanced, and avoiding the problem that the service object with less access volume is squeezed by the service object with more access volume to occupy machine resources, resulting in reduced access efficiency.
[0046] For step S1, this embodiment is applied to resource allocation, especially in the application of equipment scheduling. With the development of machine intelligence, the scenario of using robots to answer customer requests is becoming more and more popular. In order to avoid the problem of load imbalance between robots, it is necessary to dynamically schedule the tasks handled by each robot. The number of visits to the service objects carried by each robot is often closely related to the behavior of the users. When the number of users visiting is large enough, the number of visits will often show a certain pattern. For example, under normal circumstances, the number of visits at 1 a.m. is often much lower than that at 11 a.m.; therefore, a statistical time period can be set, such as taking one hour as a statistical time period, and counting the number of access requests received by each service object in different time periods, and finally the law of the number of visits to each service object can be obtained; in addition to time, weekdays or holidays, external weather conditions, etc. may all affect the number of visits, so this embodiment pre-trains a prediction model. Specifically, the training method of the model is as follows: through a processor such as a computer, based on The algorithm of simulated annealing and binary search is used to generate an initial neural network model for predicting future visit volume based on relevant historical features such as date attributes and weather conditions. The historical visit volume received by different service objects within a preset statistical time period is received, and the historical features such as date and weather corresponding to the historical visit volume are input into the initial model to obtain the output result, and the loss value between the output result and the above historical visit volume is calculated. The constraint parameters in the initial model are adjusted and improved according to the loss value until the loss value of the output result of the initial model is less than the preset threshold value; the real-time date, weather and other data are input into the trained prediction model, and the predicted visit volume in the future time period of each service object is calculated, which can obtain a predicted visit volume result with a higher accuracy rate.
[0047] For step S2, as the real-time access volume changes, it is possible that some execution devices frequently meet the migration conditions, which in turn causes the dispatch center to frequently and repeatedly dispatch the service objects, which in turn affects the execution efficiency of the service objects; therefore, this embodiment scales the execution device cluster based on the above-mentioned predicted access volume, that is, expands or shrinks the capacity; specifically, when the total amount of predicted access volume of the service object is greater than the preset maximum value, it means that the current number of execution devices is insufficient to support the access requests that are about to be connected, so it is necessary to add new execution devices according to the proportion exceeding the threshold; when the total amount of predicted access volume of the service object is less than the preset minimum value, it means that the current number of execution devices is in excess of the total number of access requests that are about to be connected, so it is necessary to It is necessary to remove some execution devices according to the proportion of the difference to avoid wasting equipment resources. For example, it can be set that when the total number of predicted visits to the service object reaches 1.2 times of the maximum value, one execution device is added, and when it reaches 1.4 times of the maximum value, two execution devices are added. In addition, it can be set that when the total number of predicted visits to the service object reaches 0.8 times of the minimum value, one execution device is removed. The present invention expands or shrinks the execution device by predicting the total number of visits, thereby improving the average utilization rate of the execution device, avoiding overloading of the execution device, and avoiding the situation where some execution devices frequently meet the migration conditions, which leads to the dispatch center needing to frequently schedule the service object repeatedly, affecting the execution efficiency of the service object.
[0048] For step S3, the above-mentioned execution device is usually a machine that can be equipped with different intelligent reply programs, etc., and is an intelligent machine device used to feedback corresponding behaviors according to the user's access request. The above-mentioned resource information includes the IP of the execution device, the CPU of the execution device, the service category and quantity loaded by the execution device, etc., which can be used to locate the parameters of the load status of each execution device. The above-mentioned preset time interval can be 2s, that is, each execution device reports a heartbeat to the scheduling center every 2S, and the content of the report includes the machine IP, the CPU of the machine, the service category and quantity loaded by the machine, etc. Through the heartbeat report, the scheduling center can save the machine resources of the entire cluster and the products loaded on each machine for maintaining a list. In the present invention, by obtaining the resource information reported by each execution device at intervals, it is convenient to calculate the load of each execution device, thereby providing parameter support for device scheduling.
[0049] For step S4, when the gateway center receives an access request message of an access request, it first determines whether the message is legal. If it is a legal message, it further identifies the corresponding service object. If it is an illegal message, the message is discarded and a warning is issued to the management center. The above-mentioned service objects can be intelligent response programs of robots such as interview robots, supervisory robots, outbound call robots, and customer service robots. The intelligent response programs of robots such as interview robots, supervisory robots, outbound call robots, and customer service robots can be respectively installed in different execution devices or in the same execution device. Therefore, it is necessary to distinguish the resource requirements of different service objects according to the real-time access volume. For example, if the interview robot, the supervisory robot, the outbound call robot, the customer service robot, etc. The interview robot and supervisor robot programs are executed in execution device A, and the outbound call robot and customer service robot programs are executed in execution device B. The real-time access volume of the interview robot is 10,000, and the real-time access volume of the supervisor robot, outbound call robot and customer service robot is 100 respectively. At this time, the current load state of execution device A is 90% of the full load state, and the current load state of execution device B is 20% of the full load state. If the real-time access request of the interview robot is calculated based on the CPU and current load state of execution device A, the predicted load state of execution device A is 110% of the full load state. Obviously, this load state is unreasonable without device scheduling. In the present invention, by obtaining the service object corresponding to the access request, the real-time access volume of different service objects is calculated respectively, so as to distinguish the resource requirements of different service objects, and the predicted load state of each execution device is calculated according to the real-time access volume and the current load state, so as to determine whether the execution device can continue to bear the current service object.
[0050] For step S5, when the predicted load state of at least one execution device meets the preset migration condition, the execution device is used as the first migration device, and the service objects in the first migration device are migrated to avoid the situation where the working state balance between different execution devices is poor; the above migration condition can be that the predicted load state of the execution device is greater than the preset threshold, for example, greater than 80% of the full load state, or the difference between the predicted load state of the execution device and the average predicted load state of each execution device is greater than the preset threshold, for example, greater than 30% of the average predicted load state, etc., which is a load imbalance. In the above situation, it often leads to low access efficiency of some execution devices, and causes the service objects with less access volume to be squeezed by the service objects with more access volume to occupy machine resources, resulting in reduced access efficiency. Therefore, when the predicted load state of at least one execution device meets the preset migration condition, according to the real-time access volume of different service objects and the current load state of different execution devices, the migrationable device is selected in the execution device, so that the predicted load state of the execution device is not greater than the preset threshold, and the difference between the predicted load state of the execution device and the average predicted load state of each execution device is not greater than the preset threshold. In the present invention, whether migration is needed is determined based on the predicted load status, and when the migration conditions are met, the service object is migrated based on the real-time access volume and the current load status, so that the load between each execution device is more balanced, and it is avoided that the service objects with less access volume are squeezed out by the service objects with more access volume, resulting in reduced access efficiency.
[0051] In one embodiment, the migrating the service object in the first migration device according to the real-time access volume and the current load status S5 includes:
[0052] S51: Acquire a migration solution library, wherein the migration solution library includes a plurality of preset migration solutions, each of which corresponds to at least one set of real-time access volume and the current load status;
[0053] S52: Select a corresponding migration solution from the migration solution library according to the real-time access volume and the current load status, and migrate the service object in the first migration device according to the selected migration solution.
[0054] This embodiment establishes a migration solution library, selects a corresponding migration solution from the migration solution library according to the real-time access volume and the current load status, and migrates the service object according to the selected migration solution, thereby improving migration efficiency and migration stability.
[0055] For step S51, when the number of execution devices is large, temporarily calculating and generating a migration plan may take a long time, resulting in low migration efficiency, thereby affecting the response efficiency of the service object. Therefore, a migration plan corresponding to the pre-established real-time access volume range of each service object and the current load state range of each execution device can be obtained.
[0056] For step S52, exemplarily, when the number of service objects with real-time access volume greater than 10,000 is less than 50% of the total number of service objects, and the number of execution devices whose current load state is less than 20% of the full load state is greater than 50% of the total number of service objects, then the migration plan can be to migrate the service objects with real-time access volume greater than 10,000 to the execution devices whose current load state is less than 20% of the full load state in sequence, and an execution device whose current load state is less than 20% of the full load state only carries one service object with real-time access volume greater than 10,000; when the number of service objects with real-time access volume greater than 10,000 is less than 10% of the total number of service objects, but the current load state of more than 80% of the execution devices is greater than 50% of the full load state, then the migration plan can be to aggregate every three service objects with real-time access volume less than 1,000 to the same execution server, and after the aggregation is completed, migrate the service objects with real-time access volume greater than 10,000 to the execution devices with the smallest current load state respectively, so as to realize the allocation of service objects to machines with less loaded services, idle CPUs, and not in the same rack. In the specific application process, different migration plans can be preset according to actual conditions to improve migration efficiency and stability.
[0057] In one embodiment, referring to Figure 2 After obtaining the resource information S3 reported by each execution device at a preset time interval, the method further includes:
[0058] S31: when receiving the resource information, performing delay timing on the execution device corresponding to the resource information;
[0059] S32: When the delay timing time is greater than the preset reporting time threshold, perform network access detection on the execution device, and if the network access status of the execution device is normal, send a maintenance instruction to the control center;
[0060] S33: If the network access status of the execution device is abnormal, determine whether the execution device is in a removed state, and if not, send a maintenance instruction to the control center.
[0061] This embodiment performs delay timing on the execution device corresponding to the resource information after receiving the resource information, and detects the network access status of each execution device according to the delay timing situation, thereby identifying whether the working status of each execution device is abnormal, thereby improving the timeliness of maintenance.
[0062] For step S32, since the heartbeat reporting is set for the execution device in advance, if a certain execution device fails to complete the resource information reporting according to the heartbeat time, it may be that a device failure has occurred; however, this embodiment will scale down the execution device, so after the network access status of the execution device is abnormal, it is also necessary to determine whether the execution device is an execution device removed during the scaling down process. If so, it is considered that there is no abnormality in the execution device, if not, it is considered that there is a network access abnormality in the execution device.
[0063] In one embodiment, the migrating the service object in the first migration device according to the real-time access volume and the current load status S5 further includes:
[0064] S53: Determine whether there is a service object with a real-time access volume greater than a preset load upper limit in the first migration device, and if so, split the service object with a real-time access volume greater than the preset load upper limit into a plurality of service segments;
[0065] S54: Selecting a plurality of execution devices as second migration devices according to the real-time access volume, and migrating the service fragments to different second migration devices respectively.
[0066] This embodiment determines whether there is a service object with real-time access volume greater than a preset load limit, selects several execution devices as second migration devices according to the real-time access volume, and migrates the service fragments to different second migration devices respectively, thereby avoiding the problem of execution device overload and improving the stability of device scheduling.
[0067] For step S53, if the real-time access volume of a service object in the first migration device is greater than the upper limit of the load that each individual execution device can bear, it can be split.
[0068] For step S54, when the real-time access volume is greater than the load limit that a single execution device can bear, the service object is split and the resulting service fragments are migrated to different second migration devices respectively, to avoid the problem of overloading a certain execution device and improve the stability of device scheduling.
[0069] In one embodiment, after calculating the predicted visit volume S1 of each service object according to the prediction model, the method includes:
[0070] S11: selecting the service object whose predicted visit volume fluctuation value is not greater than a preset fluctuation range as a stable object;
[0071] S12: Grouping the stable objects into a plurality of stable object groups, and respectively migrating the stable object groups to preset stable devices.
[0072] This embodiment determines stable objects according to the fluctuation value of the predicted access volume, and migrates the stable object groups to preset stable devices respectively, thereby reducing the total number of migrations and improving the migration efficiency.
[0073] For step S11, some service objects may change over time, and the number of visits may fluctuate greatly, while the number of visits to some service objects may remain basically stable in each time period.
[0074] For step S12, such long-term stable service objects that meet the conditions of step S11 can be grouped into stable object groups and designated to handle them on some stable devices. Normally, the stable object groups in the stable devices are not migrated, thereby reducing the total number of migrations and improving migration efficiency.
[0075] In one embodiment, the step of migrating the service object S5 includes:
[0076] S55: Obtain a priority parameter of each of the service objects that need to be migrated, and migrate the service objects in descending order of priority parameters.
[0077] This embodiment determines the migration of service objects by using priority parameters, thereby improving the orderliness of processing service objects of different priorities and avoiding the problem of execution order disorder caused by migration.
[0078] For step S55, migrating service objects with higher priority parameters can enable service objects with higher priority parameters to complete migration earlier, thereby completing migration earlier, so that the newly migrated execution device can start execution earlier, improving the orderliness of processing service objects with different priorities and avoiding the problem of confusion in execution order caused by migration.
[0079] In one embodiment, removing the idle execution device S2 includes:
[0080] S21: Identify rack information corresponding to each idle execution device, and group and remove the idle execution devices according to the rack information.
[0081] This embodiment removes the execution devices in groups based on the rack information, thereby improving the monitorability of the execution devices.
[0082] For step S21, in a specific implementation, unused execution devices may be connected to the same rack through the same backplane, or may be connected to the same rack control system through a communication line. In order to improve the orderliness of the removal of the execution devices, the execution devices belonging to the same rack can be divided into a group according to the rack information, and the execution devices of each group are removed in turn. After all the execution devices in a group are removed, the rack to which the group belongs is closed, thereby saving rack control system resources during the removal process.
[0083] Reference Figure 3 , the present application also proposes a device scheduling apparatus, comprising:
[0084] The visit volume calculation module 100 is used to obtain the historical visit volumes received by different service objects within a preset statistical time period, and use a preset prediction model to calculate the predicted visit volume of each service object according to the prediction model;
[0085] The device adjustment module 200 is used to migrate the service object according to the predicted access volume when the total amount of the predicted access volume is less than the preset capacity reduction threshold, and remove the idle execution device after the migration is completed; when the total amount of the predicted access volume is greater than the preset capacity expansion threshold, add a new execution device according to the predicted access volume, and migrate the service object according to the predicted access volume;
[0086] The resource information acquisition module 300 is used to acquire the resource information reported by each of the execution devices at a preset time interval;
[0087] The load state prediction module 400 is used to receive a request message of an access request, identify the service object corresponding to the request message, obtain the real-time access volume of the service object, obtain the current load state of each of the execution devices according to the resource information, and calculate the predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state;
[0088] The object migration module 500 is used to use the execution device whose predicted load status meets the preset migration condition as the first migration device, and migrate the service objects in the first migration device according to the real-time access volume and the current load status.
[0089] This embodiment calculates the predicted access volume of each service object according to the prediction model, and can obtain a predicted access volume result with a high accuracy rate; the execution device is expanded or reduced according to the total amount of predicted access volume, thereby improving the average utilization rate of the execution device, avoiding overload of the execution device, and avoiding the situation that some execution devices frequently meet the migration conditions, thereby causing the dispatch center to frequently schedule the service object repeatedly, affecting the execution efficiency of the service object; by obtaining the resource information reported by each execution device at intervals, so as to facilitate the load calculation of each currently connected execution device, thereby providing parameter support for device scheduling; by obtaining the service object corresponding to the access request, the real-time access volume of different service objects is calculated respectively, thereby distinguishing the resource requirements of different service objects, and the predicted load state of each execution device is calculated according to the real-time access volume and the current load state, thereby determining whether the execution device can continue to bear the current service object; determining whether migration is required according to the predicted load state, and migrating the service object according to the real-time access volume and the current load state when the migration conditions are met, thereby making the load between each execution device more balanced, and avoiding the problem that the service object with less access volume is squeezed by the service object with more access volume to occupy machine resources, resulting in reduced access efficiency.
[0090] In one embodiment, the object migration module 500 is further used to:
[0091] Obtain a migration solution library, wherein the migration solution library includes a plurality of preset migration solutions, each of which corresponds to at least one set of real-time access volume and the current load status;
[0092] According to the real-time access volume and the current load status, a corresponding migration solution is selected from the migration solution library, and the service object is migrated according to the selected migration solution.
[0093] In one embodiment, the resource information acquisition module 300 is further used to:
[0094] When the resource information is received, delay timing of the execution device corresponding to the resource information;
[0095] When the delay time is greater than the preset reporting time threshold, the execution device is tested for network access, and if the network access status of the execution device is normal, a maintenance instruction is sent to the control center;
[0096] If the network access status of the execution device is abnormal, determine whether the execution device is in a removed state, and if not, send a maintenance instruction to the control center.
[0097] In one embodiment, the object migration module 500 is further used to:
[0098] Determine whether there is a service object with real-time access volume greater than a preset load upper limit in the first migration device, and if so, split the service object with real-time access volume greater than the preset load upper limit into a plurality of service fragments;
[0099] A plurality of execution devices are selected as second migration devices according to the real-time access volume, and the service fragments are respectively migrated to different second migration devices.
[0100] In one embodiment, a stable object selection module 600 is further included, which is used to:
[0101] Selecting the service object whose predicted visit volume fluctuation value is not greater than a preset fluctuation range as a stable object;
[0102] The stable objects are grouped into a plurality of stable object groups, and the stable object groups are respectively migrated to preset stable devices.
[0103] In one embodiment, the second migration module 500 is further configured to:
[0104] The priority parameter of each of the service objects that need to be migrated in the first migration device is obtained, and the service objects are migrated in descending order of the priority parameters.
[0105] In one embodiment, the device adjustment module 200 is further used to:
[0106] The rack information corresponding to each idle execution device is identified, and the idle execution devices are grouped and removed according to the rack information.
[0107] Reference Figure 4 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a device scheduling method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a device scheduling method is implemented. The device scheduling method includes: obtaining the historical access volume received by different service objects within a preset statistical time period, obtaining a prediction model based on the historical access volume, and calculating the predicted access volume of each service object based on the prediction model; when the total amount of the predicted access volume is less than a preset capacity reduction threshold, migrating the service objects according to the predicted access volume, and removing idle execution devices after the migration is completed; when the total amount of the predicted access volume is greater than a preset capacity expansion threshold, adding new execution devices according to the predicted access volume, and migrating the service objects according to the predicted access volume; obtaining resource information reported by each of the execution devices at preset time intervals; receiving a request message of an access request, identifying the service object corresponding to the request message, obtaining the real-time access volume of the service object, obtaining the current load status of each of the execution devices according to the resource information, and calculating the predicted load status of the execution device where the service object is located according to the real-time access volume and the current load status; using the execution device whose predicted load status meets the preset migration condition as the first migration device, and migrating the service objects in the first migration device according to the real-time access volume and the current load status.
[0108] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a device scheduling method is implemented, including the steps of: obtaining the historical access volume received by different service objects within a preset statistical time period, obtaining a prediction model based on the historical access volume, and calculating the predicted access volume of each of the service objects based on the prediction model; when the total amount of the predicted access volume is less than a preset shrinking threshold, migrating the service objects according to the predicted access volume, and removing idle execution devices after the migration is completed; when the total amount of the predicted access volume is greater than a preset expansion threshold, adding new execution devices according to the predicted access volume equipment, and migrate the service object according to the predicted access volume; obtain the resource information reported by each of the execution devices at a preset time interval; receive a request message of an access request, identify the service object corresponding to the request message, obtain the real-time access volume of the service object, obtain the current load state of each of the execution devices according to the resource information, and calculate the predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state; use the execution device whose predicted load state meets the preset migration condition as the first migration device, and migrate the service object in the first migration device according to the real-time access volume and the current load state.
[0109] In the device scheduling method executed above, this embodiment calculates the predicted access volume of each service object according to the prediction model, and can obtain a predicted access volume result with a high accuracy rate; the execution device is expanded or reduced according to the total amount of predicted access volume, thereby improving the average utilization rate of the execution device, avoiding overload of the execution device, and avoiding the situation that some execution devices frequently meet the migration conditions, thereby causing the scheduling center to need to frequently schedule the service object repeatedly, affecting the execution efficiency of the service object; by obtaining the resource information reported by each execution device at intervals, so as to facilitate the load calculation of each currently connected execution device, thereby providing parameter support for device scheduling; by obtaining the service object corresponding to the access request, the real-time access volume of different service objects is calculated respectively, thereby distinguishing the resource requirements of different service objects, and the predicted load state of each execution device is calculated according to the real-time access volume and the current load state, thereby determining whether the execution device can continue to bear the current service object; determining whether migration is required according to the predicted load state, and migrating the service object according to the real-time access volume and the current load state when the migration conditions are met, thereby making the load between each execution device more balanced, and avoiding the problem that the service object with less access volume is squeezed by the service object with more access volume to occupy the machine resources, resulting in reduced access efficiency.
[0110] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0111] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0112] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A device scheduling method, characterized in that: The method comprises: Obtaining historical visits received by different service objects within a preset statistical time period, obtaining a prediction model based on the historical visits, and calculating the predicted visits of each service object based on the prediction model; When the total amount of the predicted access volume is less than the preset capacity reduction threshold, the service object is migrated according to the predicted access volume, and the idle execution device is removed after the migration is completed; when the total amount of the predicted access volume is greater than the preset capacity expansion threshold, a new execution device is added according to the predicted access volume, and the service object is migrated according to the predicted access volume; Obtaining resource information reported by each of the execution devices at preset time intervals; Receive a request message of an access request, identify the service object corresponding to the request message, obtain the real-time access volume of the service object, obtain the current load state of each of the execution devices according to the resource information, and calculate the predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state; The execution device whose predicted load state meets the preset migration condition is used as the first migration device, and the service objects in the first migration device are migrated according to the real-time access volume and the current load state; After obtaining the resource information reported by each execution device at a preset time interval, the method further includes: When the resource information is received, delay timing of the execution device corresponding to the resource information; When the delay time is greater than the preset reporting time threshold, the execution device is tested for network access, and if the network access status of the execution device is normal, a maintenance instruction is sent to the control center; If the network access status of the execution device is abnormal, determine whether the execution device is in a removed state, and if not, send a maintenance instruction to the control center; After calculating the predicted visit volume of each service object according to the prediction model, the method includes: Selecting the service object whose fluctuation value of the predicted visit volume is not greater than a preset fluctuation range as a stable object; The stable objects are grouped into a plurality of stable object groups, and the stable object groups are respectively migrated to preset stable devices.
2. The device scheduling method according to claim 1, characterized in that: The migrating the service object in the first migration device according to the real-time access volume and the current load state includes: Obtain a migration solution library, wherein the migration solution library includes a plurality of preset migration solutions, each of which corresponds to at least one set of real-time access volume and the current load status; According to the real-time access volume and the current load status, a corresponding migration solution is selected from the migration solution library, and the service object in the first migration device is migrated according to the selected migration solution.
3. The device scheduling method according to claim 1, characterized in that: The step of migrating the service object in the first migration device according to the real-time access volume and the current load state further includes: Determine whether there is a service object with real-time access volume greater than a preset load upper limit in the first migration device, and if so, split the service object with real-time access volume greater than the preset load upper limit into a plurality of service fragments; A plurality of execution devices are selected as second migration devices according to the real-time access volume, and the service fragments are respectively migrated to different second migration devices.
4. The device scheduling method according to claim 1, characterized in that: The migrating the service object in the first migration device includes: The priority parameter of each of the service objects that need to be migrated in the first migration device is obtained, and the service objects are migrated in descending order of the priority parameters.
5. The device scheduling method according to claim 1, characterized in that: The removing of the idle execution device comprises: The rack information corresponding to each idle execution device is identified, and the idle execution devices are grouped and removed according to the rack information.
6. A device scheduling device, characterized in that: The device is used to implement the device scheduling method according to any one of claims 1 to 5, including: The visit volume calculation module is used to obtain the historical visit volumes received by different service objects within a preset statistical time period, and use a preset prediction model to calculate the predicted visit volume of each service object according to the prediction model; A device adjustment module, used for, when the total amount of the predicted access volume is less than a preset capacity reduction threshold, migrating the service object according to the predicted access volume, and removing idle execution devices after the migration is completed; when the total amount of the predicted access volume is greater than a preset capacity expansion threshold, adding new execution devices according to the predicted access volume, and migrating the service object according to the predicted access volume; A resource information acquisition module, used to acquire resource information reported by each of the execution devices at preset time intervals; A load state prediction module, configured to receive a request message of an access request, identify a service object corresponding to the request message, obtain a real-time access volume of the service object, obtain a current load state of each of the execution devices according to the resource information, and calculate a predicted load state of the execution device where the service object is located according to the real-time access volume and the current load state; The object migration module is used to use the execution device whose predicted load status meets the preset migration condition as the first migration device, and migrate the service objects in the first migration device according to the real-time access volume and the current load status.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Two-stage service system load forecast and balancing method integrating service forecast and real-time load
CN102664812A
Load balancing method and system facing mixed cloud application
CN104850450A
Intelligent resource optimization method of container cloud platform based on load prediction
CN108829494A
Method and system for expanding and shrinking capacity of virtual network functions
CN109189552A
Prediction and region partition-based dynamic load balancing method for P2P network
CN109218441A
