A load adjustment method, device, server and storage medium
By matching load data and thresholds to determine load regulation rules and updating business configurations, the problem of resource waste during peak periods of computing-intensive services in privatized deployment scenarios is solved, and automatic load regulation and service availability are guaranteed.
Patent Information
- Application Number
- CN201910967351.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-12
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2039-10-12
AI Technical Summary
In the privatized deployment scenario, the availability of CPU/GPU computing-intensive services such as computer vision applications during peak hours is difficult to ensure, resulting in frequent expansion of computer room resources, resulting in waste of resources and high costs.
By obtaining the matching of the load data of the service server and the load threshold, determine the target load regulation rules, update the service configuration to automatically adjust the load, reduce the service configuration during peak periods, and avoid expansion of the computer room.
It realizes automatic load regulation, ensures service availability, saves manpower and material resources, avoids waste of resources, and is suitable for privatized deployment scenarios.
Smart Images

Figure CN110764908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a load regulation method, device, server and storage medium. Background Art
[0002] With the development of computer technology, computers can provide more and more business services to users. Among them, some business services are computationally intensive services, which require more computing resources (such as physical machines or virtual machines), such as computer vision (CV) application services involving face recognition, identity recognition, etc. For CPU / GPU computationally intensive services such as CV application services, in order to ensure the availability of services during peak conditions such as weekends and major holidays, related technologies often use peak load estimation and deployment of computing resources (such as physical machines or virtual machines), and use elastic scheduling to pull more computing resources during peak hours.
[0003] However, in privatized deployment scenarios with restrictions such as computer room size and heat dissipation conditions, deploying machines according to load peaks to achieve service availability during peak conditions requires the transformation and expansion of privatized computer rooms, as well as the addition of various physical resources such as racks, air conditioners, switches and other equipment. This not only requires a large amount of manpower and material resources, but also because the machines in privatized deployment scenarios have a single purpose and low machine utilization during non-peak periods, resulting in a waste of resources. Summary of the invention
[0004] In order to solve the problems of the prior art, an embodiment of the present invention provides a load adjustment method, device, server and storage medium. The technical solution is as follows:
[0005] In one aspect, a load regulation method is provided, the method comprising:
[0006] Obtain the load data of the business server;
[0007] According to the matching situation between the load data and the load threshold, determining a target load adjustment rule in a load adjustment rule set that matches the load data; the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold and the service configuration data;
[0008] Obtaining target service configuration data in the target load adjustment rule;
[0009] The target service configuration data is sent to the configuration thread of the service server, so that the configuration thread of the service server updates the service configuration in the memory of the service server according to the target service configuration data.
[0010] On the other hand, a load adjustment method is provided, which is applied to a business server, wherein the business server includes a configuration thread and a working thread, and the method includes:
[0011] The configuration thread receives target service configuration data sent by the load adjustment server, and updates the service configuration in the memory according to the target service configuration data to obtain an updated service configuration;
[0012] The working thread obtains the updated service configuration from the memory, and processes the service request according to the updated service configuration.
[0013] In another aspect, a load adjustment device is provided, the device comprising:
[0014] A first acquisition module, used to acquire load data of a business server;
[0015] A first determination module is used to determine a target load adjustment rule in a load adjustment rule set that matches the load data according to a matching condition between the load data and the load threshold; the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold and the service configuration data;
[0016] A second acquisition module is used to acquire target service configuration data in the target load adjustment rule;
[0017] The sending module is used to send the target service configuration data to the configuration thread of the service server, so that the configuration thread of the service server updates the service configuration in the memory of the service server according to the target service configuration data.
[0018] In an optional implementation, the first determining module includes:
[0019] A matching module, configured to match the load data with the load thresholds in the load adjustment rules according to the priorities of the load adjustment rules in the load adjustment rule set from high to low, until a load threshold matching the load data is obtained;
[0020] The determination submodule is used to use the load adjustment rule corresponding to the load threshold matching the load data as the target load adjustment rule.
[0021] In an optional implementation, the matching module includes:
[0022] A second determination module is used to determine target load data corresponding to the load adjustment rule in the load data;
[0023] A judging module, used for judging whether the target load data exceeds the load threshold in the load adjustment rule;
[0024] The third determination module is used to determine that the load adjustment rule is a target load adjustment rule when the result of the determination module is yes.
[0025] In an optional implementation, the first acquisition module includes:
[0026] A subscription module, used to subscribe to the load data of the business server to a distributed message bus; the distributed message bus is used to receive the load data published by the business server;
[0027] The receiving module is used to receive a subscription message sent by the distributed message bus when receiving the load data published by the business server, wherein the subscription message carries the load data published by the business server.
[0028] In an optional embodiment, the device further comprises:
[0029] A third acquisition module is used to acquire input load threshold and service configuration data;
[0030] A relationship establishing module, used to establish a mapping relationship between the load threshold and the service configuration data;
[0031] A rule generation module, used to generate a load adjustment rule according to a mapping relationship between the load threshold and the service configuration data;
[0032] The fourth determination module is used to determine the priority of the load adjustment rule in the load adjustment rule set.
[0033] On the other hand, a business server is provided, including a configuration thread and a working thread, wherein:
[0034] The configuration thread is used to receive target service configuration data sent by the load adjustment server, and update the service configuration in the memory according to the target service configuration data to obtain an updated service configuration;
[0035] The working thread is used to obtain the updated service configuration from the memory and process the service request according to the updated service configuration.
[0036] On the other hand, a load regulation server is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the above-mentioned load regulation method.
[0037] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the load regulation method as described above.
[0038] The embodiment of the present invention determines the target load adjustment rule by matching the load data with the load threshold, and then obtains the target business configuration data in the target load adjustment rule, and sends the target business configuration data to the configuration thread of the business server, so that the configuration thread updates the business configuration in the memory of the business server according to the target business configuration data. In this way, the subsequent working thread of the business server can process the business request based on the updated business configuration, thereby realizing automatic adjustment of the load of the business server. During peak hours, the business configuration can be automatically reduced to ensure the availability of the service by downgrading the service. There is no need to transform and expand the computer room, which saves a lot of manpower and material resources and avoids waste of resources. It is very suitable for privatization deployment scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 is a system architecture diagram of a load regulation method provided by an embodiment of the present invention;
[0041] Figure 2 is a flow chart of a load regulation method provided by an embodiment of the present invention;
[0042] Figure 3 It is a flowchart of a specific example of determining a target load adjustment rule matching the load data in a load adjustment rule set according to a matching condition between the load data and the load threshold provided by an embodiment of the present invention;
[0043] Figure 4 is a flow chart of another load regulation method provided by an embodiment of the present invention;
[0044] Figure 5 is a flow chart of another load regulation method provided by an embodiment of the present invention;
[0045] Figure 6 is a schematic diagram of dynamic configuration loading provided by an embodiment of the present invention;
[0046] Figure 7 is a structural schematic diagram of a load regulating device provided by an embodiment of the present invention;
[0047] Figure 8 is a structural schematic diagram of another load adjustment device provided by an embodiment of the present invention;
[0048] Fig. 9 The present invention provides a hardware structure block diagram of a server. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0051] See also Figure 1 , which is a system architecture diagram of a load regulation method provided by an embodiment of the present invention. The system may include a load regulation server 110 and at least one business server 120. The load regulation server 110 and at least one business server 120 may interact with data through a distributed message bus.
[0052] At least one service server 120 may be Figure 1 At least one business server 120 can provide the same business service or different business services, which can include but are not limited to computer vision application services, such as face recognition services, identity recognition services, etc.
[0053] The load adjustment server 110 may be a server that adjusts the load of a business server. The load adjustment server 110 may be an independently operated server or a server cluster composed of multiple servers.
[0054] See also Figure 2 , which is a flow chart of a load regulation method provided by an embodiment of the present invention, which can be applied to Figure 1 The load regulating server in the embodiment. It should be noted that this specification provides method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is actually executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the drawings. Specific examples Figure 2 As shown, the method may include:
[0055] S201, obtaining load data of a business server.
[0056] The load refers to the amount of resources occupied by the service server when processing services. The load data may include various types of load data, including but not limited to CPU (Central Processing Unit) occupancy, memory usage, number of service requests, bandwidth occupancy, etc.
[0057] In the embodiments of this specification, the load regulating server can obtain the load data of each business server through a distributed message bus, and the distributed message bus is used to receive the load data published by each business server. Specifically, the load regulating server can subscribe to the load data of each business server from the distributed message bus; after receiving the load data published by the business server, the distributed message bus sends the load data to the load regulating server in the form of a subscription message, and correspondingly, the load regulating server receives the subscription message sent by the distributed message bus carrying the load data published by the business server. Among them, the distributed message bus can include but is not limited to MSMQ (MicroSoft Message Queue, Microsoft Message Queue), the publish-subscribe mechanism of the open source NServiceBus, and the like.
[0058] S203: Determine, according to a matching condition between the load data and the load threshold, a target load adjustment rule in a load adjustment rule set that matches the load data.
[0059] The load regulation rules in the load regulation rule set include a mapping relationship between the load threshold and service configuration data.
[0060] The load threshold can be set based on historical experience in actual operation, and it can be a specific value or a range of values. The business configuration data is associated with the business services provided by the business server, and can be one or more operation parameters involved in the business service process. For example, when the business service is a computer vision application service, the business operations that the business server may involve when providing the business service may include but are not limited to image attribute extraction, image feature extraction, quality score filtering, clustering, etc., then the business configuration data may include but are not limited to the number of images saved, clustering duration, quality score size, etc. In actual applications, the values of each data in the business configuration data can be set based on historical experience and can be dynamically adjusted during use.
[0061] In actual applications, the load adjustment rule set may include multiple load adjustment rules, each of which may set a mapping relationship between a corresponding load threshold and service configuration data for a type of load data, and the multiple load adjustment rules may include, but are not limited to, a first load adjustment rule (mapping relationship between CPU occupancy rate threshold and service configuration data 1), a second load adjustment rule (mapping relationship between memory usage rate threshold and service configuration data 2), a third load adjustment rule (mapping relationship between service request number threshold and service configuration data 3), a fourth load adjustment rule (mapping relationship between bandwidth occupancy rate threshold and service configuration data 4), etc. Among them, the service configuration data 1, service configuration data 2, service configuration data 3 and service configuration data 4 corresponding to each load adjustment rule may be data of service configuration set according to historical experience; each load threshold may also be set according to historical experience in actual operation, for example, the CPU occupancy rate threshold may be set to 90%, the memory usage rate threshold may be set to 90%, the service request number threshold may be set to 800qps-1000qps (Queries Per Second), and the bandwidth occupancy rate threshold may be set to 100%.
[0062] In an embodiment of the present specification, multiple load adjustment rules in the load adjustment rule set can be set with different priorities according to actual needs. When executing step S203, the load data is matched with the load threshold in the load adjustment rule according to the priority of the load adjustment rules in the load adjustment rule set from high to low until a load threshold matching the load data is obtained; the load adjustment rule corresponding to the load threshold matching the load data is used as the target load adjustment rule.
[0063] Since the type of load data targeted by each load adjustment rule in the load adjustment rule set may be different, the following steps may be included when matching the load data with the load thresholds in the load adjustment rules according to the priorities of the load adjustment rules in the load adjustment rule set from high to low until a load threshold matching the load data is obtained:
[0064] Determine the target load data corresponding to the load adjustment rule in the load data. Specifically, according to the type of load data corresponding to the load threshold in the current load adjustment rule, determine the load data consistent with the type in the load data. For example, if the current load adjustment rule is the first load adjustment rule (mapping relationship between CPU occupancy threshold and business configuration data 1), then the type of load data corresponding to the load threshold in the first load adjustment rule is CPU occupancy, and the CPU occupancy in the load data can be determined as the target load data.
[0065] Determine whether the target load data exceeds the load threshold in the load adjustment rule. Specifically, compare the target load data with the load threshold in the current load adjustment rule to determine whether the target load data exceeds the load threshold in the current load adjustment rule. For example, if the current load adjustment rule is the first load adjustment rule (mapping relationship between CPU occupancy threshold and business configuration data 1), compare the CPU occupancy in the load data with the CPU occupancy threshold to determine whether the CPU occupancy exceeds the CPU occupancy threshold.
[0066] When the result of the judgment is yes, the load adjustment rule is determined to be the target load adjustment rule. For example, if the CPU occupancy rate in the load data is greater than the CPU occupancy rate threshold, it indicates that the current first load adjustment rule is the target load adjustment rule.
[0067] The following example illustrates step S203, in which the load data includes: CPU occupancy, memory usage, number of service requests, and bandwidth occupancy; the load adjustment rules in the load adjustment rule set are ranked from high to low in priority as follows: the first load adjustment rule (mapping relationship between CPU occupancy threshold and service configuration data 1), the second load adjustment rule (mapping relationship between memory usage threshold and service configuration data 2), the third load adjustment rule (mapping relationship between service request number threshold and service configuration data 3), and the fourth load adjustment rule (mapping relationship between bandwidth occupancy threshold and service configuration data 4).
[0068] like Figure 3As shown, when executing step S203, firstly, for the first load adjustment rule, it is determined whether the CPU occupancy rate in the load data exceeds the CPU occupancy rate threshold. When the CPU occupancy rate exceeds the CPU occupancy rate threshold, the first load adjustment rule is used as the target load adjustment rule, and step S205 is executed; when the CPU occupancy rate does not exceed the CPU occupancy rate threshold, further for the second load adjustment rule, it is determined whether the memory usage rate in the load data exceeds the memory usage rate threshold. When the memory usage rate exceeds the memory usage rate threshold, the second load adjustment rule is used as the target load adjustment rule, and step S205 is executed; when the memory usage rate does not exceed the memory usage rate threshold, the third load adjustment rule is further used. The load adjustment rule is used to determine whether the number of business requests in the load data exceeds the business request number threshold. When the number of business requests exceeds the business request number threshold, the third load adjustment rule is used as the target load adjustment rule, and step S205 is executed; when the number of business requests does not exceed the business request number threshold, the fourth load adjustment rule is further used to determine whether the bandwidth occupancy rate exceeds the bandwidth occupancy rate threshold. When the bandwidth occupancy rate exceeds the bandwidth occupancy rate threshold, the fourth load adjustment rule is used as the target load adjustment rule, and step S205 is executed; when the bandwidth occupancy rate does not exceed the bandwidth occupancy rate threshold, it indicates that the load of the current business server is within the normal range, and no load adjustment is required, and the processing of the current load data is completed.
[0069] S205: Acquire target service configuration data in the target load adjustment rule.
[0070] For example, when the target load adjustment rule is the first load adjustment rule, business configuration data 1 is the target business configuration data; when the target load adjustment rule is the second load adjustment rule, business configuration data 2 is the target business configuration data; when the target load adjustment rule is the third load adjustment rule, business configuration data 3 is the target business configuration data; when the target load adjustment rule is the fourth load adjustment rule, business configuration data 4 is the target business configuration data.
[0071] S207: Send the target service configuration data to the configuration thread of the service server, so that the configuration thread of the service server updates the service configuration in the memory of the service server according to the target service configuration data.
[0072] In the embodiments of the present specification, the load adjustment server may publish the target service configuration data to the distributed message bus, and then the distributed message bus sends the target service configuration data to the configuration thread of the corresponding service server.
[0073] In actual applications, the load regulation server can provide load regulation services and configuration update services, wherein the load regulation service can implement the corresponding functions of step S203 to step S205 to obtain the target business configuration data, and the load regulation service can send the target business configuration data to the configuration update service. After receiving the target business configuration data, the configuration update service will generate a configuration update message carrying the target business configuration data, and publish the configuration update message to the distributed message bus. The configuration thread of the business server can subscribe to the configuration update message of the configuration update service from the distributed message bus, and the distributed message bus can send the configuration update message to the configuration thread of the corresponding business server after receiving the configuration update message sent by the configuration update service.
[0074] In an optional embodiment, if Figure 4 A flow chart of another load regulation method is provided. Before step S203, the method may further include:
[0075] S401, obtaining input load threshold and service configuration data.
[0076] In the embodiments of this specification, the load adjustment server may provide a load adjustment rule management interface, through which the operation and maintenance personnel may manage the load adjustment rules, and the management may include but is not limited to deletion, viewing, addition, modification, etc. In a specific implementation, the load adjustment server may obtain the input load threshold and service configuration data based on the load adjustment rule management interface.
[0077] S403: Establish a mapping relationship between the load threshold and the service configuration data.
[0078] S405: Generate a load adjustment rule according to a mapping relationship between the load threshold and the service configuration data.
[0079] S407: Determine the priority of the load adjustment rule in the load adjustment rule set.
[0080] Specifically, the priority of the currently generated load regulation rule in the load regulation rule set may be determined according to the priority order selected by the operation and maintenance personnel.
[0081] In the prior art, human intervention is required to determine whether to perform load adjustment. The operation and maintenance personnel observe the online load monitoring indicators and then decide whether to adjust based on experience, which greatly reduces the efficiency of load adjustment. The embodiment of the present invention pre-sets the load adjustment rules to automatically match the corresponding load adjustment rules under different load conditions, thereby greatly improving the efficiency of load adjustment. Moreover, since the load adjustment rules are pre-set, the accuracy of load adjustment can also be guaranteed.
[0082] It can be seen from the above technical scheme of the embodiment of the present invention that the embodiment of the present invention determines the target load adjustment rule by matching the load data with the load threshold, and then obtains the target business configuration data in the target load adjustment rule, and sends the target business configuration data to the configuration thread of the business server, so that the configuration thread updates the business configuration in the memory of the business server according to the target business configuration data. In this way, the subsequent working thread of the business server can process the business request based on the updated business configuration, thereby realizing automatic adjustment of the load of the business server. The business configuration can be automatically reduced during peak hours. For example, for computer vision application services, the number of saved images can be reduced, the clustering time can be shortened, and the quality score of filtering can be improved. The availability of the service is guaranteed by service degradation. There is no need to transform and expand the computer room, which saves a lot of manpower and material resources and avoids waste of resources. It is very suitable for privatization deployment scenarios.
[0083] In the prior art, when a business server updates the business configuration, it needs to restart the business service instance in a rolling manner. This process will cause temporary unavailability of the business service. Even with the rolling restart method, the business service instances that have not been restarted during peak hours will be overwhelmed by the new traffic, and the restart of the business service instances that are processing requests may cause data loss.
[0084] In order to avoid the service suspension phenomenon that occurs when the service server updates the service configuration, an embodiment of the present invention provides another load adjustment method, which can be applied to the service server. The service server includes a configuration thread and a working thread, such as Figure 5 As shown, the method includes:
[0085] S501, a configuration thread receives target service configuration data sent by a load adjustment server, and updates a service configuration in a memory according to the target service configuration data to obtain an updated service configuration.
[0086] Among them, the target business configuration data is obtained by the load adjustment server obtaining the load data of the business server, determining the target load adjustment rule matching the load data in the load adjustment rule set according to the matching situation between the load data and the load threshold, and then obtaining it from the target load adjustment rule.
[0087] S503, the working thread obtains the updated service configuration from the memory, and processes the service request according to the updated service configuration.
[0088] The above steps S501 and S503 of the embodiment of this specification are essentially a process of dynamic configuration loading. Figure 6As shown, the configuration thread of the business server is separated from the working thread. The configuration thread and the engineering thread share the memory for storing business configuration. The configuration thread manages the business configuration data separately. The configuration thread obtains the target business configuration data sent by the load adjustment server and updates it to the memory. Each time the working thread processes a new business request, it will obtain the updated business configuration from the memory, and then process the business request according to the updated business configuration. Generally, the business server will have multiple working threads, and all working threads will obtain the updated business configuration when processing new business requests, so that all working threads can converge to a consistent new business configuration when processing new business requests.
[0089] The embodiment of the present invention uses the above-mentioned dynamic configuration loading, so that the service server does not need to be restarted when updating the service configuration, and thus the service suspension phenomenon will not occur, thereby ensuring the reliability of load regulation.
[0090] Corresponding to the load adjustment methods provided in the above-mentioned embodiments, an embodiment of the present invention further provides a load adjustment device. Since the load adjustment device provided in the embodiment of the present invention corresponds to the load adjustment methods on the load adjustment server side provided in the above-mentioned embodiments, the implementation methods of the load adjustment methods on the aforementioned load adjustment server side are also applicable to the load adjustment device provided in this embodiment and will not be described in detail in this embodiment.
[0091] See also Figure 7 , which is a schematic diagram of the structure of a load adjustment device provided by an embodiment of the present invention, the device has the function of implementing the load adjustment method on the load adjustment server side in the above method embodiment, and the function can be implemented by hardware, or by hardware executing corresponding software. Figure 7 As shown, the device may include:
[0092] A first acquisition module 710 is used to acquire load data of a service server;
[0093] A first determination module 720 is used to determine a target load adjustment rule in a load adjustment rule set that matches the load data according to a matching condition between the load data and the load threshold; the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold and the service configuration data;
[0094] A second acquisition module 730 is used to acquire target service configuration data in the target load adjustment rule;
[0095] The sending module 740 is used to send the target service configuration data to the configuration thread of the service server, so that the configuration thread of the service server updates the service configuration in the memory of the service server according to the target service configuration data.
[0096] In an optional implementation, the first determining module 720 may include:
[0097] A matching module, configured to match the load data with the load thresholds in the load adjustment rules according to the priorities of the load adjustment rules in the load adjustment rule set from high to low, until a load threshold matching the load data is obtained;
[0098] The determination submodule is used to use the load adjustment rule corresponding to the load threshold matching the load data as the target load adjustment rule.
[0099] In an optional embodiment, the matching module may include:
[0100] A second determination module is used to determine target load data corresponding to the load adjustment rule in the load data;
[0101] A judging module, used for judging whether the target load data exceeds the load threshold in the load adjustment rule;
[0102] The third determination module is used to determine that the load adjustment rule is a target load adjustment rule when the result of the determination module is yes.
[0103] In an optional implementation, the first acquisition module 710 may include:
[0104] A subscription module, used to subscribe to the load data of the business server to a distributed message bus; the distributed message bus is used to receive the load data published by the business server;
[0105] The receiving module is used to receive a subscription message sent by the distributed message bus when receiving the load data published by the business server, wherein the subscription message carries the load data published by the business server.
[0106] In an optional embodiment, if Figure 8 A schematic diagram of the structure of another load regulating device is provided, wherein the device may further include:
[0107] The third acquisition module 750 is used to acquire input load threshold and service configuration data;
[0108] A relationship establishing module 760, configured to establish a mapping relationship between the load threshold and the service configuration data;
[0109] A rule generating module 770, configured to generate a load adjustment rule according to a mapping relationship between the load threshold and the service configuration data;
[0110] The fourth determination module 780 is used to determine the priority of the load adjustment rule in the load adjustment rule set.
[0111] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0112] The load regulation device of the embodiment of the present invention realizes automatic regulation of the load of the business server. It can automatically reduce the business configuration during peak hours. For example, for computer vision application services, it can reduce the number of saved images, shorten the clustering time, and improve the quality score of filtering. Service availability is guaranteed by service degradation. There is no need to transform and expand the computer room, which saves a lot of manpower and material resources and avoids waste of resources. It is very suitable for private deployment scenarios.
[0113] The embodiment of the present invention provides a business server, including a configuration thread and a working thread, wherein:
[0114] The configuration thread is used to receive target service configuration data sent by the load adjustment server, and update the service configuration in the memory according to the target service configuration data to obtain an updated service configuration;
[0115] The working thread is used to obtain the updated service configuration from the memory and process the service request according to the updated service configuration.
[0116] The business server of the embodiment of the present invention separates the configuration thread from the working thread, and the configuration thread manages the business configuration data independently, so that there is no need to restart when updating the business configuration, and the business service will not be suspended when the business configuration is updated, thereby ensuring the reliability of load regulation.
[0117] An embodiment of the present invention provides a load regulation server, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the load regulation method on the load regulation server side.
[0118] The memory can be used to store software programs and modules. The processor executes various functional applications and load regulation by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0119] The method embodiments provided in the embodiments of the present invention can be executed in a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig. 9 is a hardware structure block diagram of a server running a load adjustment method provided by an embodiment of the present invention, such as Fig. 9 As shown, the server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 910 (the processor 910 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 930 for storing data, and one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be short-term storage or permanent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the server 900. The server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or one or more operating systems 921, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0120] The input / output interface 940 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 900. In one example, the input / output interface 940 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 940 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0121] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.
[0122] An embodiment of the present invention also provides a computer-readable storage medium, which can be set in a server to store at least one instruction, at least one program, code set or instruction set related to implementing a load regulation method. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the load regulation method provided by the above method embodiment.
[0123] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0124] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0125] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0126] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A load regulation method, characterized in that: The method comprises: Obtaining load data of a business server; the business services provided by the business server include computer vision application services; According to the matching of the load data and the load threshold, determine the target load adjustment rule in the load adjustment rule set that matches the load data; the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold and the business configuration data, the business configuration data includes the operation parameters involved in the computer vision application service, and the operation parameters include at least one of the number of images saved, the clustering time, and the quality score; Obtaining target service configuration data in the target load adjustment rule; The target business configuration data is sent to the configuration thread of the business server, so that the configuration thread of the business server updates the business configuration in the memory of the business server according to the target business configuration data, wherein the update includes adjusting the operating parameters in the business configuration to degrade the computer vision application service.
2. The load regulation method according to claim 1, characterized in that: The step of determining, according to a matching condition between the load data and the load threshold, a target load adjustment rule in a load adjustment rule set that matches the load data comprises: According to the priorities of the load adjustment rules in the load adjustment rule set from high to low, the load data is matched with the load thresholds in the load adjustment rules until a load threshold matching the load data is obtained; The load adjustment rule corresponding to the load threshold matching the load data is used as the target load adjustment rule.
3. The load regulation method according to claim 2, characterized in that: The step of matching the load data with the load threshold in the load adjustment rule until a load threshold matching the load data is obtained includes: determining target load data corresponding to the load adjustment rule in the load data; Determining whether the target load data exceeds a load threshold in the load adjustment rule; When the result of the judgment is yes, the load adjustment rule is determined to be a target load adjustment rule.
4. The load regulation method according to claim 1, characterized in that: The acquiring of the load data of the service server comprises: Subscribing to the load data of the business server from a distributed message bus; the distributed message bus is used to receive the load data published by the business server; A subscription message is received which is sent by the distributed message bus when the load data published by the service server is received, wherein the subscription message carries the load data published by the service server.
5. The load regulation method according to claim 2, characterized in that: The method further comprises: Obtain input load threshold and business configuration data; Establishing a mapping relationship between the load threshold and the service configuration data; Generate a load adjustment rule according to a mapping relationship between the load threshold and the service configuration data; A priority of the load adjustment rule in the set of load adjustment rules is determined.
6. A load regulation method, characterized in that: Applied to a business server, the business service provided by the business server includes a computer vision application service, the business server includes a configuration thread and a working thread, and the method includes: The configuration thread receives target service configuration data sent by the load adjustment server, updates the service configuration in the memory according to the target service configuration data, and obtains an updated service configuration; the target service configuration data is the target load adjustment rule in the load adjustment rule set that matches the load data and determines the load data according to the matching situation between the load data and the load threshold value, wherein the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold value and the service configuration data, the service configuration data includes operation parameters involved in the computer vision application service, and the operation parameters include at least one of the number of images saved, the clustering time, and the quality score; the updating includes adjusting the operation parameters in the service configuration so as to downgrade the computer vision application service; The working thread obtains the updated service configuration from the memory, and processes the service request according to the updated service configuration.
7. A load adjustment device, characterized in that: The device comprises: A first acquisition module is used to acquire load data of a business server; the business service provided by the business server includes a computer vision application service; A first determination module is used to determine a target load regulation rule in a load regulation rule set that matches the load data according to a matching condition between the load data and the load threshold; the load regulation rule in the load regulation rule set includes a mapping relationship between the load threshold and the service configuration data, the service configuration data includes operation parameters involved in the computer vision application service process, and the operation parameters include at least one of the number of images saved, the clustering time, and the quality score; A second acquisition module is used to acquire target service configuration data in the target load adjustment rule; A sending module is used to send the target business configuration data to the configuration thread of the business server, so that the configuration thread of the business server updates the business configuration in the memory of the business server according to the target business configuration data, and the update includes adjusting the operating parameters in the business configuration to downgrade the computer vision application service.
8. A business server, characterized in that: The business service provided by the business server includes a computer vision application service, including a configuration thread and a working thread, wherein the configuration thread is used to receive target business configuration data sent by a load adjustment server, and update the business configuration in the memory according to the target business configuration data to obtain an updated business configuration; the target business configuration data is the load adjustment server obtaining the load data of the business server, and determining a target load adjustment rule in a load adjustment rule set that matches the load data according to a matching situation between the load data and a load threshold, wherein the load adjustment rule in the load adjustment rule set includes a mapping relationship between the load threshold and the business configuration data, and the business configuration data includes operation parameters involved in the computer vision application service process, and the operation parameters include at least one of the number of images saved, the clustering duration, and the quality score; the update includes adjusting the operation parameters in the business configuration to degrade the computer vision application service; The working thread is used to obtain the updated service configuration from the memory and process the service request according to the updated service configuration.
9. A load adjustment server, characterized in that: It comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the load regulation method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, wherein the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the load regulation method according to any one of claims 1 to 5.
