CN109783236B - Method and apparatus for outputting information - Google Patents

Method and apparatus for outputting information Download PDF

Info

Publication number
CN109783236B
CN109783236B CN201910040979.8A CN201910040979A CN109783236B CN 109783236 B CN109783236 B CN 109783236B CN 201910040979 A CN201910040979 A CN 201910040979A CN 109783236 B CN109783236 B CN 109783236B
Authority
CN
China
Prior art keywords
client
weight
resources
information
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910040979.8A
Other languages
Chinese (zh)
Other versions
CN109783236A (en
Inventor
刘纬
张慕华
张佐玮
刘子旭
辛文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910040979.8A priority Critical patent/CN109783236B/en
Publication of CN109783236A publication Critical patent/CN109783236A/en
Application granted granted Critical
Publication of CN109783236B publication Critical patent/CN109783236B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method and a device for outputting information. One embodiment of the method comprises: acquiring the total amount of resources to be distributed and client information and resource occupation information of at least one client; for a client in at least one client, determining the current weight of the client according to the total amount of resources and the resource occupation information of the client, acquiring the historical weight of the client, and determining the final weight of the client according to the historical weight of the client and the current weight of the client; and outputting the client information of the client according to the final weight from small to large. The implementation method has good explanatory and predictive performance, can greatly reduce the occurrence of 'starvation' caused by the conventional resource allocation method, and obviously improves the operation quality of cluster jobs.

Description

Method and apparatus for outputting information
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for outputting information.
Background
The resource borrowing means that in a distributed environment, the total amount of resources of a tenant is not enough to meet the resource requirement of operation, and idle resources can be borrowed from a distributed cluster to meet the operation requirement of a user. When a plurality of tenants simultaneously request the last free resource from the cluster, the cluster responds to the resource requests to ensure fairness among users as follows:
1) a random borrowing scheme: when a plurality of users simultaneously request resource borrowing, the system randomly selects one user from the users to obtain the corresponding resource. The rest users enter a waiting state until the cluster has enough resources to respond next time.
2) User-based weighting scheme: the cluster preferentially allocates resources to those users with a greater "weight". Common definitions of these weights are: the size of the user's own resources (considering the user's own resource occupancy in the cluster), the user's own ID (considering the user's speaking weight in reality), etc.
3) A fair sharing scheme: the cluster distributes the rest free resources to all other users according to a certain rule (such as even distribution), and each user only uses a small resource of a large resource.
Disclosure of Invention
Embodiments of the present disclosure propose methods and apparatuses for outputting information.
In a first aspect, an embodiment of the present disclosure provides a method for outputting information, including: acquiring the total amount of resources to be distributed and client information and resource occupation information of at least one client; for a client in at least one client, determining the current weight of the client according to the total amount of resources and the resource occupation information of the client, acquiring the historical weight of the client, and determining the final weight of the client according to the historical weight of the client and the current weight of the client; and outputting the client information of the client according to the final weight from small to large.
In some embodiments, the resources include at least one of the following types: the system comprises a disk, a CPU, a GPU and a memory, wherein the resource occupation information comprises the occupation amount of at least one type of resources of a client; and determining the current weight of the client according to the total amount of the resources and the resource occupation information of the client, wherein the method comprises the following steps: for the resources in at least one type of resources, determining the ratio of the occupation amount of the type of resources of the client to the total amount of the type of resources of the client as the occupation rate of the type of resources of the client; and determining the weighted sum of the occupancy rates of the various types of resources of the client as the current weight of the client.
In some embodiments, determining the final weight of the client based on the historical weight of the client and the current weight of the client comprises: and determining the average value of the historical weight of the client and the current weight of the client in a preset time period before the current time as the final weight of the client.
In some embodiments, determining the final weight of the client based on the historical weight of the client and the current weight of the client comprises: and determining the weighted sum of the historical weight of the client when the client is scheduled in the previous round and the current weight of the client as the final weight of the client.
In some embodiments, the method further comprises: in response to receiving a priority allocation request including an occupancy duration for the target client, setting a final weight within the occupancy duration for the target client to a predetermined minimum value.
In some embodiments, the method further comprises: and in response to receiving a priority allocation request including the scheduling times of the target client, setting the final weight in the scheduling times of the target client to be a preset minimum value.
In some embodiments, the method further comprises: and allocating resources to at least one client according to the sequence of the final weight from small to large.
In a second aspect, an embodiment of the present disclosure provides an apparatus for outputting information, including: an acquisition unit configured to acquire a total amount of resources to be allocated and client information and resource occupancy information of at least one client; the determining unit is configured to determine, for a client of at least one client, a current weight of the client according to a total amount of resources and resource occupation information of the client, obtain a historical weight of the client, and determine a final weight of the client according to the historical weight of the client and the current weight of the client; and the output unit is configured to output the client information of the client according to the sequence of the final weight from small to large.
In some embodiments, the resources include at least one of the following types: the system comprises a disk, a CPU, a GPU and a memory, wherein the resource occupation information comprises the occupation amount of at least one type of resources of a client; and the determining unit is further configured to: for the resources in at least one type of resources, determining the ratio of the occupation amount of the type of resources of the client to the total amount of the type of resources of the client as the occupation rate of the type of resources of the client; and determining the weighted sum of the occupancy rates of the various types of resources of the client as the current weight of the client.
In some embodiments, the determining unit is further configured to: and determining the average value of the historical weight of the client and the current weight of the client in a preset time period before the current time as the final weight of the client.
In some embodiments, the determining unit is further configured to: and determining the weighted sum of the historical weight of the client when the client is scheduled in the previous round and the current weight of the client as the final weight of the client.
In some embodiments, the apparatus further comprises a first set-top unit configured to: in response to receiving a priority allocation request including an occupancy duration for the target client, setting a final weight within the occupancy duration for the target client to a predetermined minimum value.
In some embodiments, the apparatus further comprises a second set-top unit configured to: and in response to receiving a priority allocation request including the scheduling times of the target client, setting the final weight in the scheduling times of the target client to be a preset minimum value.
In some embodiments, the apparatus further comprises an allocation unit configured to: and allocating resources to at least one client according to the sequence of the final weight from small to large.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the first aspects.
In a fourth aspect, embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as in any one of the first aspect.
According to the method and the device for outputting the information, the weight of the client is determined according to the resource occupation information of the client, and then the client is selected to distribute the resources according to the sequence of the weights from small to large. The method has good interpretability and predictability, can greatly reduce the occurrence of 'starvation' caused by the conventional resource allocation method, and obviously improves the operation quality of cluster jobs.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for outputting information, according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for outputting information according to the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for outputting information in accordance with the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for outputting information according to the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use with an electronic device implementing embodiments of the present disclosure.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the disclosed method for outputting information or apparatus for outputting information may be applied.
As shown in fig. 1, the system architecture 100 may include a client 101, a resource manager 102, a scheduler 103, and a node 104. The network serves as a medium for providing communication links between clients 101, resource manager 102, and scheduler 103. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the client 101 to receive or send messages or the like over a network with the resource manager 102 and interaction scheduler 103. Various messaging client applications, such as a web browser application, a shopping-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the client 101.
The client 101 may be a terminal device of a tenant in a multi-tenant technology. A tenant (tenant) refers to a client using a system or a computer computing resource, but in the multi-tenant technology, the tenant includes all data that can be identified as a designated user in the system, including account and statistical information (accounting data), various data established by the user in the system, and a customized application environment of the user, and the like, and all belong to the scope of the tenant.
The resource manager 102 is responsible for receiving job requests submitted by clients, and performing global resource management and allocation. The resource manager 102 sends client information and resource occupation information of the client to which the resource is to be allocated and resource total amount information of all nodes in the distributed system to the scheduler 103. And the scheduler sorts the clients according to the total amount of the resources and the occupation condition of each client to the resources, and sequentially schedules the clients to each node in the system for execution according to the sorting result of the clients.
The resource manager 102 and the scheduler 103 may be located on the same server or may be located on different servers.
Node 104 may be a common physical PC or virtual machine.
It should be noted that the method for outputting information provided by the embodiments of the present disclosure is generally performed by the scheduler 103, and accordingly, the apparatus for outputting information is generally disposed in the scheduler 103.
It should be understood that the number of clients, resource managers, schedulers, nodes in fig. 1 is merely illustrative. There may be any number of clients, resource managers, schedulers, nodes, as desired for the implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for outputting information in accordance with the present disclosure is shown. The method for outputting information comprises the following steps:
step 201, obtaining the total amount of resources to be allocated and the client information and resource occupation information of at least one client.
In this embodiment, an execution subject (e.g., a scheduler shown in fig. 1) of the method for outputting information may obtain the total amount of resources to be allocated and the client information and the resource occupation information of at least one client from the resource manager through a wired connection manner or a wireless connection manner. The resources may include at least one of the following types: magnetic disk, CPU, GPU, memory. Information on the total amount of various types of resources can be obtained without concern for which nodes these resources are specifically located on. The resource occupation information is also reported in a classified manner, for example, the client 1 occupies a 20G hard disk, 512M memory and occupies the CPU10 ms. The client information may include client identification, location, etc. The acquisition process is performed periodically, for example, every 2 seconds, the resource-related information and the client-related information are acquired for scheduling.
Step 202, for a client of at least one client, determining a current weight of the client according to the total amount of resources and the resource occupation information of the client, obtaining a historical weight of the client, and determining a final weight of the client according to the historical weight of the client and the current weight of the client.
In this embodiment, the current weight is determined according to the resource occupation information obtained in the current round of scheduling. The current weight used at the time of previous scheduling is determined as the historical weight. The idea of the scheduling algorithm of the present application is mainly to calculate the weight of each user in real time, rather than a static configuration. The definition of the weight introduces the historical condition factor of the use of each user resource, and the fairness defined by the user in the dimension is as follows: the satisfaction degree of the resources of the users in a period of time is lower when the satisfaction degree is higher, and higher when the satisfaction degree is lower, the priority of the users is higher. The resource occupancy rate of the client can be calculated through the resource occupancy information of the client, and the resource occupancy rate is used as the current weight.
In some optional implementation manners of this embodiment, the main considerations are CPU usage, memory usage, disk usage, GPU usage, and the like of the user. For different resource types, the corresponding weights are applied to the clusters of different job types. For example, for those cluster jobs that are IO intensive, the weight of the disk usage factor will typically be a little higher. Therefore, the formula for obtaining the weight of the current resource of the user is as follows:
Figure BDA0001947529730000061
among them, WeightcurrentIndicating the current weight, the type of resource indicated by the letter i, usedi/totali/weightiRespectively representing the resource usage of the user on the resource type/the total amount of the type resource/the weight of the resource type. n is the total number of resource types.
The application designs two sets of weight updating algorithms which can describe the weights of the users in a near period of time. One is an update algorithm based on a time window, and the other is an update algorithm based on a learning factor.
The time window based update algorithm mainly splits a recent period of time into several N time slices (several scheduling rounds). We consider the weights in the last time slice as the sum of the weights of the previous N-1 time slices and the weight value of the current time slice. And updating the weight of the current time window only in each updating process, and circularly and sequentially updating the next time slice after the time slice is finished. The update formula is:
Figure BDA0001947529730000071
among them, WeightcurrentThe current weight, Count, is the number of time slices N-1, calculated for equation 1. WeightoldRefers to the average of the historical weights calculated for the previous N-1 time slices, i.e., the historical weight. WeightfinalIs the final weight. The final weight adopted by the scheduling in the current round is taken as the historical weight in the subsequent scheduling.
The purpose of equation 2 is to determine the average of the client's historical weight and the client's current weight in a predetermined time period before the current time as the final weight of the client.
Alternatively, the current weight calculated by the previous N-1 time slices and the historical weight calculated by the Nth time slice can be directly calculated to be the weight average value as the final end weight.
Updating algorithm based on learning factor: the method mainly introduces the concept of learning rate, can quickly ignore factors too long from the current, and can maximally retain the influence of recent use conditions. The formula is as follows:
Weightfinal=Weightold*α+(1-α)*Weightcurrent(formula 3)
Where α is a number between (0,1), for example 0.75, so that the weights of the first few rounds are reduced due to the learning factor in each round of scheduling. WeightcurrentThe current weight calculated for equation 1. WeightoldRefers to the historical weight of the previous round of scheduling, i.e., the historical weight. WeightfinalIs the final weight.
The purpose of equation 3 is to determine the weighted sum of the historical weight of the client when it was last scheduled and the current weight of the client as the final weight of the client.
And step 203, outputting the client information of the client according to the final weight from small to large.
In this embodiment, the clients are sorted according to the order of the final weight from small to large, and the priority is higher when the final weight is smaller, and the priority is higher when the satisfaction is lower, so that priority scheduling is needed to ensure fairness. The client information may also include the amount of resources requested to be allocated. The scheduler may output the results of the ordering to the resource manager, which determines which resources on the nodes are allocated to the client. And updating the resource occupation information after the resource allocation.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for outputting information according to the present embodiment. In the application scenario of fig. 3, clients 301, 302, 303 respectively request allocation of 60G hard disk resources. The resource manager 304 sends resource occupancy information and total amount of resources information (total amount 60G, client 1 used 0G, client used 20G, client 3 used 30G) for the clients 301, 302, 303 to the scheduler 305. The scheduler 305 determines the current weight of each client according to the total amount of resources and the resource occupation information of each client, and obtains the final weight according to the historical weight of each client. Then, outputting the resource allocation sequence from small to large according to the final weight as follows: client 1, client 2, client 3 ".
The method provided by the above embodiment of the present disclosure determines the weight of the client according to the usage of the resource of different clients, so that the higher the satisfaction degree, the lower the priority of the client is, and the lower the satisfaction degree, the higher the priority of the client is. Thereby maintaining the fairness of the satisfaction degree of the resources of each client in a period of time.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for outputting information is shown. The process 400 of the method for outputting information includes the steps of:
step 401, obtaining the total amount of resources to be allocated and the client information and resource occupation information of at least one client.
Step 401 is substantially the same as step 201, and therefore is not described again.
Step 402, for a client of at least one client, determining a current weight of the client according to a total amount of resources and resource occupation information of the client, obtaining a historical weight of the client, and determining a final weight of the client according to the historical weight of the client and the current weight of the client.
Step 402 is substantially the same as step 202 and therefore will not be described in detail.
Step 403, in response to receiving the priority assignment request of the target client, setting the final weight of the target client to a predetermined minimum value.
In this embodiment, a state called "set top" is introduced for the emergency user (target client), and the user in this state is preferentially allocated with resources by the cluster. For the time window algorithm, we define the size of a time slice for the set-top time unit, the occupation duration is included in the priority allocation request sent by the target client, and the scheduler may set the final weight of the target client within the occupation duration to a predetermined minimum value (e.g., 0). For example, if the emergency user requests the priority scheduling in 10s, the final weight of the emergency user is set to 0 in 10s, and after 10s, the current weight is updated again according to the occupied resource information, and then the final weight is calculated again. For the algorithm based on the learning factor, we define the time unit as a scheduling turn, and the priority allocation request sent by the target client includes the scheduling number, the scheduler may set the final weight of the target client within the scheduling number to a predetermined minimum value (e.g. 0). For example, if the emergency user requests 10 sub-optimal scheduling, the final weight of the emergency user is set to 0 in 10 consecutive scheduling, and after 10 consecutive scheduling, the current weight is updated again according to the occupied resource information, and then the final weight is recalculated. The set-top status of each user contains a time period (several time units), and when the user is in the set-top status, the weight is 0 (lowest), and thus the scheduling is most prioritized. When the set-top state is triggered to be overtime, the user automatically releases the state without manual intervention again.
And step 404, allocating resources to at least one client according to the sequence of the final weight from small to large.
In this embodiment, resources are sequentially allocated to the clients according to the final weight ranking result. The client ranked ahead is satisfied preferentially. For example, when the client 1, the client 2, and the client 3 simultaneously request a Memory of 60G, if the cluster divides the resources equally, and each user divides the Memory into 20G, the jobs of the three users may fail due to OOM (Out-of-Memory), which not only affects the service quality, but also causes a certain waste of resources. By adopting the method, the priority can be discharged, and if the final weight of the client 1 is the minimum, the 60G memory is preferentially allocated to the client 1. In the scheduling round, resources are not allocated to the client 2 and the client 3. However, since the client 2 and the client 3 occupy less resources and have lower weights, the priority is increased.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for outputting information in the present embodiment represents a process of borrowing resources preferentially for emergency users. Thus, the scheme described in this embodiment may control how long resources are lent to an emergency user. After the time is over, without interfering with the normal operation of the system.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for outputting information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 5, the apparatus 500 for outputting information of the present embodiment includes: an acquisition unit 501, a determination unit 502, and an output unit 503. The acquiring unit 501 is configured to acquire a total amount of resources to be allocated and client information and resource occupation information of at least one client; a determining unit 502 configured to determine, for a client of at least one client, a current weight of the client according to a total amount of resources and resource occupancy information of the client, obtain a historical weight of the client, and determine a final weight of the client according to the historical weight of the client and the current weight of the client; an output unit 503 configured to output the client information of the clients in order of smaller final weight to larger final weight.
In this embodiment, specific processing of the acquiring unit 501, the determining unit 502 and the outputting unit 503 of the apparatus 500 for outputting information may refer to step 201, step 202 and step 203 in the corresponding embodiment of fig. 2.
In some optional implementations of this embodiment, the resource includes at least one of the following types: the system comprises a disk, a CPU, a GPU and a memory, wherein the resource occupation information comprises the occupation amount of at least one type of resources of a client; and the determining unit 502 is further configured to: for the resources in at least one type of resources, determining the ratio of the occupation amount of the type of resources of the client to the total amount of the type of resources of the client as the occupation rate of the type of resources of the client; and determining the weighted sum of the occupancy rates of the various types of resources of the client as the current weight of the client.
In some optional implementations of the present embodiment, the determining unit 502 is further configured to: and determining the average value of the historical weight of the client and the current weight of the client in a preset time period before the current time as the final weight of the client.
In some optional implementations of the present embodiment, the determining unit 502 is further configured to: and determining the weighted sum of the historical weight of the client when the client is scheduled in the previous round and the current weight of the client as the final weight of the client.
In some optional implementations of this embodiment, the apparatus 500 further comprises a first set-top unit (not shown in the drawings) configured to: in response to receiving a priority allocation request including an occupancy duration for the target client, setting a final weight within the occupancy duration for the target client to a predetermined minimum value.
In some optional implementations of this embodiment, the apparatus 500 further comprises a second set-top unit (not shown in the drawings) configured to: and in response to receiving a priority allocation request including the scheduling times of the target client, setting the final weight in the scheduling times of the target client to be a preset minimum value.
In some optional implementations of this embodiment, the apparatus 500 further comprises an allocation unit (not shown in the drawings) configured to: and allocating resources to at least one client according to the sequence of the final weight from small to large.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., the scheduler of fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The scheduler shown in fig. 6 is only an example, and should not bring any limitation to the function and the range of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring the total amount of resources to be distributed and client information and resource occupation information of at least one client; for a client in at least one client, determining the current weight of the client according to the total amount of resources and the resource occupation information of the client, acquiring the historical weight of the client, and determining the final weight of the client according to the historical weight of the client and the current weight of the client; and outputting the client information of the client according to the final weight from small to large.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a receiving unit, an analyzing unit, an information selecting unit and a generating unit. Where the names of these elements do not in some cases constitute a limitation on the elements themselves, for example, a receiving element may also be described as an "element that receives a user's web browsing request".
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for outputting information, comprising:
acquiring the total amount of resources to be distributed and client information and resource occupation information of at least one client;
for a client in the at least one client, determining the current weight of the client according to the total amount of the resources and the resource occupation information of the client, acquiring the historical weight of the client, and determining the final weight of the client according to the historical weight of the client and the current weight of the client, wherein the current weight used in the previous scheduling is determined as the historical weight;
outputting client information of the client according to the sequence of the final weight from small to large, wherein the priority is higher when the final weight is smaller;
wherein, the determining the current weight of the client according to the total amount of the resources and the resource occupation information of the client comprises:
and calculating the resource occupancy rate of the client according to the total amount of the resources and the resource occupancy information of the client, and taking the resource occupancy rate as the current weight of the client.
2. The method of claim 1, wherein the resources comprise at least one of the following types: the system comprises a disk, a CPU, a GPU and a memory, wherein the resource occupation information comprises the occupation amount of at least one type of resources of a client; and
the determining the current weight of the client according to the total amount of the resources and the resource occupation information of the client comprises:
for the resources in the at least one type of resources, determining the ratio of the occupation rate of the resources of the type of the client to the total amount of the resources of the type as the occupation rate of the resources of the type of the client;
and determining the weighted sum of the occupancy rates of the various types of resources of the client as the current weight of the client.
3. The method of claim 1, wherein determining the final weight of the client according to the historical weight of the client and the current weight of the client comprises:
and determining the average value of the historical weight of the client and the current weight of the client in a preset time period before the current time as the final weight of the client.
4. The method of claim 1, wherein determining the final weight of the client according to the historical weight of the client and the current weight of the client comprises:
and determining the weighted sum of the historical weight of the client when the client is scheduled in the previous round and the current weight of the client as the final weight of the client.
5. The method of claim 3, wherein the method further comprises:
in response to receiving a priority allocation request including an occupancy duration for a target client, setting a final weight within the occupancy duration for the target client to a predetermined minimum value.
6. The method of claim 4, wherein the method further comprises:
in response to receiving a priority allocation request including a scheduling number of a target client, setting a final weight within the scheduling number of the target client to a predetermined minimum value.
7. The method according to one of claims 1-6, wherein the method further comprises:
and allocating resources to the at least one client according to the sequence of the final weight from small to large.
8. An apparatus for outputting information, comprising:
an acquisition unit configured to acquire a total amount of resources to be allocated and client information and resource occupancy information of at least one client;
a determining unit configured to, for a client of the at least one client, determine a current weight of the client according to the total amount of the resource and the resource occupation information of the client, obtain a historical weight of the client, and determine a final weight of the client according to the historical weight of the client and the current weight of the client, wherein the current weight used in previous scheduling is determined as the historical weight, wherein the determining the current weight of the client according to the total amount of the resource and the resource occupation information of the client includes: calculating the resource occupancy rate of the client according to the total amount of the resources and the resource occupancy information of the client, and taking the resource occupancy rate as the current weight of the client;
and the output unit is configured to output the client information of the clients in the order of the final weight from small to large, wherein the smaller the final weight is, the higher the priority is.
9. The apparatus of claim 8, wherein the resources comprise at least one of the following types: the system comprises a disk, a CPU, a GPU and a memory, wherein the resource occupation information comprises the occupation amount of at least one type of resources of a client; and
the determination unit is further configured to:
for the resources in the at least one type of resources, determining the ratio of the occupation rate of the resources of the type of the client to the total amount of the resources of the type as the occupation rate of the resources of the type of the client;
and determining the weighted sum of the occupancy rates of the various types of resources of the client as the current weight of the client.
10. The apparatus of claim 8, wherein the determination unit is further configured to:
and determining the average value of the historical weight of the client and the current weight of the client in a preset time period before the current time as the final weight of the client.
11. The apparatus of claim 8, wherein the determination unit is further configured to:
and determining the weighted sum of the historical weight of the client when the client is scheduled in the previous round and the current weight of the client as the final weight of the client.
12. The apparatus of claim 10, wherein the apparatus further comprises a first set top unit configured to:
in response to receiving a priority allocation request including an occupancy duration for a target client, setting a final weight within the occupancy duration for the target client to a predetermined minimum value.
13. The apparatus of claim 11, wherein the apparatus further comprises a second set-top unit configured to:
in response to receiving a priority allocation request including a scheduling number of a target client, setting a final weight within the scheduling number of the target client to a predetermined minimum value.
14. The apparatus according to one of claims 8-13, wherein the apparatus further comprises an allocation unit configured to:
and allocating resources to the at least one client according to the sequence of the final weight from small to large.
15. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN201910040979.8A 2019-01-16 2019-01-16 Method and apparatus for outputting information Active CN109783236B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910040979.8A CN109783236B (en) 2019-01-16 2019-01-16 Method and apparatus for outputting information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910040979.8A CN109783236B (en) 2019-01-16 2019-01-16 Method and apparatus for outputting information

Publications (2)

Publication Number Publication Date
CN109783236A CN109783236A (en) 2019-05-21
CN109783236B true CN109783236B (en) 2021-08-24

Family

ID=66500735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910040979.8A Active CN109783236B (en) 2019-01-16 2019-01-16 Method and apparatus for outputting information

Country Status (1)

Country Link
CN (1) CN109783236B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112149863A (en) * 2019-06-28 2020-12-29 傲基科技股份有限公司 Method, apparatus, and computer storage medium for determining resource consumption
CN111552569B (en) * 2020-04-28 2023-10-20 咪咕文化科技有限公司 System resource scheduling method, device and storage medium
CN113765949A (en) * 2020-06-02 2021-12-07 华为技术有限公司 Resource allocation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577267A (en) * 2012-08-03 2014-02-12 上海博泰悦臻电子设备制造有限公司 Resource distribution method and resource distribution device of vehicle-mounted device
CN104168318A (en) * 2014-08-18 2014-11-26 中国联合网络通信集团有限公司 Resource service system and resource distribution method thereof
CN104270459A (en) * 2014-10-20 2015-01-07 山东省计算中心(国家超级计算济南中心) Method for enhancing fair cloud computing user resource quota allocation
CN107133096A (en) * 2017-04-13 2017-09-05 新华三技术有限公司 A kind of resource allocation methods and device
CN108429704A (en) * 2017-02-14 2018-08-21 中国移动通信集团吉林有限公司 A kind of node resource distribution method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335229B (en) * 2014-07-25 2020-07-07 新华三技术有限公司 Scheduling method and device of service resources
CN108629611A (en) * 2017-03-24 2018-10-09 北京京东尚科信息技术有限公司 Method and apparatus for distributing resource

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577267A (en) * 2012-08-03 2014-02-12 上海博泰悦臻电子设备制造有限公司 Resource distribution method and resource distribution device of vehicle-mounted device
CN104168318A (en) * 2014-08-18 2014-11-26 中国联合网络通信集团有限公司 Resource service system and resource distribution method thereof
CN104270459A (en) * 2014-10-20 2015-01-07 山东省计算中心(国家超级计算济南中心) Method for enhancing fair cloud computing user resource quota allocation
CN108429704A (en) * 2017-02-14 2018-08-21 中国移动通信集团吉林有限公司 A kind of node resource distribution method and device
CN107133096A (en) * 2017-04-13 2017-09-05 新华三技术有限公司 A kind of resource allocation methods and device

Also Published As

Publication number Publication date
CN109783236A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
US11275609B2 (en) Job distribution within a grid environment
CN106020966B (en) System and method for intelligently distributing tasks among multiple labor resources
US9141432B2 (en) Dynamic pending job queue length for job distribution within a grid environment
CN112363813A (en) Resource scheduling method and device, electronic equipment and computer readable medium
US8434085B2 (en) Scalable scheduling of tasks in heterogeneous systems
CN109783236B (en) Method and apparatus for outputting information
CN111400022A (en) Resource scheduling method and device and electronic equipment
US9304817B2 (en) Method and apparatus for a user-driven priority based job scheduling in a data processing platform
CN112380020A (en) Computing power resource allocation method, device, equipment and storage medium
CN111464659A (en) Node scheduling method, node pre-selection processing method, device, equipment and medium
CN112559147B (en) Dynamic matching method, system and equipment based on GPU (graphics processing Unit) occupied resource characteristics
CN113765949A (en) Resource allocation method and device
CN113722056A (en) Task scheduling method and device, electronic equipment and computer readable medium
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN111776896B (en) Elevator dispatching method and device
CN109614236B (en) Cluster resource dynamic adjustment method, device and equipment and readable storage medium
CN114327894A (en) Resource allocation method, device, electronic equipment and storage medium
CN112156453B (en) Example adaptive adjustment method, apparatus, computer readable storage medium and device
CN115002049A (en) Resource allocation method and device
Sun et al. Quality of service of grid computing: resource sharing
CN111063405B (en) Task scheduling method, device, equipment and storage medium
JP7384214B2 (en) Analysis processing device, system, method and program
CN115357401B (en) Task scheduling and visualization method and system based on multiple data centers
CN114443258B (en) Resource scheduling method, device, equipment and storage medium for virtual machine
CN114253716A (en) Weighted load balancing method and system based on container cluster performance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant