CN114146406A - Method and device for allocating operation resources, electronic equipment and storage medium - Google Patents

Method and device for allocating operation resources, electronic equipment and storage medium Download PDF

Info

Publication number
CN114146406A
CN114146406A CN202111439688.XA CN202111439688A CN114146406A CN 114146406 A CN114146406 A CN 114146406A CN 202111439688 A CN202111439688 A CN 202111439688A CN 114146406 A CN114146406 A CN 114146406A
Authority
CN
China
Prior art keywords
application
running state
frame rate
instance
instances
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.)
Pending
Application number
CN202111439688.XA
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111439688.XA priority Critical patent/CN114146406A/en
Publication of CN114146406A publication Critical patent/CN114146406A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method, a device, electronic equipment and a storage medium for allocating operation resources; for allocation of computational resources to a plurality of game clients implementing a cloud game, the method comprising: determining a currently started application instance in the cloud server; and setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state. In the application, the computing resources are uniformly distributed to each application instance in all the application instances by the server in a background running state mode, so that the problem that the computing resources distributed to a plurality of application instances running in the server are not uniform is solved.

Description

Method and device for allocating operation resources, electronic equipment and storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for allocating computational resources, an electronic device, and a storage medium.
Background
In the process of cloud games, a player sends an operation instruction of the games to a server running the games; the server responds to the operation instruction of the player, enables the game running by the server to generate a picture corresponding to the operation instruction, and then transmits the generated game picture to the terminal held by the player. A server typically can run multiple application instances, one for each player.
However, in the prior art, when a plurality of application instances run on a server, the problem of uneven allocated computing resources often occurs, so that a small number of application instances can run smoothly due to more allocated computing resources; and a large number of application examples are blocked due to the fact that less computing resources are allocated.
Disclosure of Invention
The embodiment of the application provides a method and a device for allocating computing resources, an electronic device and a storage medium, which can solve the problem that in the prior art, computing resources allocated to a plurality of application instances operated by a server are not uniform.
The embodiment of the application provides a method for allocating operation resources, which is applied to a cloud server and comprises the following steps: determining a currently started application instance in the cloud server; and setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state.
The embodiment of the present application further provides an apparatus for allocating computational resources, configured to allocate computational resources to a plurality of game clients that implement a cloud game, where the apparatus includes:
an instance determining unit, configured to determine a currently started application instance in the cloud server;
and the running state adjusting unit is used for setting the started application instances to be in a background running state so that the cloud server can uniformly distribute the operation resources to each application instance in the background running state.
In some embodiments, the apparatus further comprises:
the instance number determining unit is used for determining the number of application instances which are started currently in the cloud server;
a maximum frame rate determining unit, configured to determine a maximum frame rate of the started application instances in the cloud server according to the number of the started application instances;
and the calculation resource adjusting unit is used for adjusting the calculation resource corresponding to the started application instance according to the maximum frame rate.
In some embodiments, the maximum frame rate determining unit includes:
a frame rate range determining subunit, configured to determine a frame rate range of a preset maximum frame rate;
and the application instance frame rate subunit is configured to determine, according to the number of the started application instances and the frame rate range, a maximum frame rate of the started application instances in the cloud server.
In some embodiments, the apparatus further comprises:
the current frame rate obtaining unit is used for obtaining the current frame rate of each application instance after the cloud server uniformly distributes operation resources to each application instance in a background running state;
the operation resource adjusting unit includes:
a frame rate comparison subunit, configured to compare the current frame rate of each application instance with the maximum frame rate respectively;
and the operation resource reducing subunit is configured to reduce the operation resource of the target application instance when the current frame rate of the target application instance in the application instances is greater than the maximum frame rate.
In some embodiments, the operation state adjustment unit includes:
a window handle subunit, configured to obtain a window handle of each started application instance;
and the state modification subunit is used for modifying the running state of the corresponding application instance into a background running state through the window handle.
In some embodiments, the apparatus further comprises:
the target instance determining unit is used for responding to an application data acquisition instruction sent by a target terminal and determining a target application instance corresponding to the application data acquisition instruction;
and the application data sending unit is used for sending the application data corresponding to the target application instance to the target terminal according to the application data acquisition instruction so as to enable the target terminal to display the graphical user interface corresponding to the application data.
In some embodiments, the operation state adjustment unit includes:
a window state obtaining subunit, configured to obtain a current window state of the started application instance;
and the state changing subunit is used for changing the window state of the target application instance from the top-setting running state to the background running state when the window state of the target application instance in the started application instance is the top-setting running state.
According to the method for allocating the operation resources, all the application instances running on the server can be obtained, and then all the application instances running on the server are set to be in the background running state. Since the application programs in the background running state can equally divide the operation resources, all application instances set in the background running state can equally divide the operation resources of the server.
In the application, the computing resources are uniformly distributed to each application instance in all the application instances by the server in a mode of setting all the application instances running in the server to be in a background running state, so that the problem that the computing resources distributed to a plurality of application instances running in the server are not uniform is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1a is a schematic view of a scenario of a method for allocating computational resources according to an embodiment of the present disclosure;
FIG. 1b is a flowchart illustrating a method for computing resource allocation according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for computing resource allocation according to another embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating an embodiment of an apparatus for computing resource allocation;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The metauniverse (Metaverse) means that all people in the real world have a corresponding network Avatar, and the concept of Metaverse is becoming more popular. As more users participate in Metaverse, the servers of Metaverse face more and more computational demands, and therefore it is more and more important to improve the resource utilization of the servers.
The cloud game is an important expression form of the metasma, and a user logs in the virtual world in a cloud game mode, which is a common method. The user can log in only through the browser without additionally installing software, so that the method is convenient for the user, and the game playing cost of the user can be reduced.
For a server providing a cloud game, in order to save cost, multiple application instances are generally required to run on one server, however, for each client in the multiple application instances, the application instance in the foreground can be preferentially allocated with GPU resources, and other application instances not in the foreground are allocated with fewer GPU resources; therefore, a small amount of application examples can run smoothly due to more distributed computing resources; and a large number of application examples are blocked due to the fact that less computing resources are allocated.
The above problems were found by the inventors after they paid creative work.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method and a device for allocating operation resources, electronic equipment and a storage medium.
The device for allocating computational resources may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or the like. The terminal can be a mobile phone, a tablet Computer, an intelligent bluetooth device, a notebook Computer, or a Personal Computer (PC), and the like; the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the apparatus for calculating resource allocation may also be integrated into a plurality of electronic devices, for example, the apparatus for calculating resource allocation may be integrated into a plurality of servers, and the method for calculating resource allocation of the present application is implemented by the plurality of servers.
In some embodiments, the server may also be implemented in the form of a terminal.
For example, referring to fig. 1a, the electronic device described above may perform the following method: acquiring all application examples running on a server; and setting all the application examples to be in a background running state, so that the server uniformly distributes operation resources to each application example in the background running state.
In one embodiment of the present application, a method for calculating resource allocation may be performed in a server, and the server is cooperated with a terminal device. The terminal device may be a local terminal device. When the method for allocating computational resources runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system comprises the server and a client device.
In an optional embodiment, various cloud applications may be run under the cloud interaction system, for example: and (5) cloud games. Taking a cloud game as an example, a cloud game refers to a game mode based on cloud computing. In the cloud game operation mode, the game program operation main body and the game picture presentation main body are separated, the storage and operation of the role control method are completed on the cloud game server, and the client device is used for receiving and sending data and presenting the game picture, for example, the client device can be a display device with a data transmission function close to a user side, such as a terminal, a television, a computer, a palm computer and the like; however, the terminal device performing role control is a cloud game server in the cloud. When a game is played, a user operates the client device to send an operation instruction, such as an operation instruction of touch operation, to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as a game picture and the like are encoded and compressed and returned to the client device through a network, and finally, the client device decodes the data and outputs the game picture.
In an optional implementation manner, multiple clients can be started at the same time on the server based on Unity Render Streaming technology, so that a point-to-point peer-to-peer Streaming manner between an application instance running in the server and a user terminal is realized, and audio and video Streaming and remote control are completed.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
In this embodiment, a method for allocating computational resources is provided, as shown in fig. 1b, where the method for allocating computational resources is applied to a terminal, and a specific flow of the method may include the following steps 110 to 120:
110. and determining the currently started application instance in the cloud server.
The application instance is an instance client running in the cloud server and corresponding to the game. Optionally, when the cloud server runs, all the application instances may run in the cache of the cloud server without distinction, or may run in containers (containers) partitioned by the cloud server respectively. A container is a lightweight virtualization technology, so-called lightweight virtualization, which refers to an operating system layer virtualization technology that allows a storage space on an operating system for a user to be partitioned into a plurality of independent units to run in a kernel, and the independent units do not interfere with each other, and each independent unit can be called a container.
The cloud server can only run the application instance on the premise of running the process for maintaining the normal operation of the cloud server; on the premise, the application instance and other application programs can be operated. The operation of the application in the cloud server should not be construed as limiting the present application.
Optionally, in a specific embodiment, step 110 may include: acquiring windows of all application examples presented on a display interface; and the display interface is a display interface corresponding to the server.
In the above embodiment, all application instances running on the server may be obtained by obtaining a window of an application instance presented on the display interface, or may be obtained by obtaining a process running in a task manager corresponding to the server. The specific manner of obtaining all application instances running on the server should not be construed as limiting the application.
Optionally, in a specific embodiment, the step of: "acquiring a window of all application instances presented on a display interface" includes: and enumerating a top-level window on the display interface by using an EnumWindows function.
The EnumWindows function may enumerate all top-level windows located on the display interface and pass the window handle to the application-defined callback function. The callback function returning FALSE will stop enumeration, otherwise the EnumWindows function will continue to enumerate until all top-level windows are enumerated.
Top level windows refer to windows that can exist independently; the non-top window is a window which cannot exist independently and needs to be attached to the top window.
120. And setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state.
The background running state refers to a state which is not displayed on a display interface corresponding to the cloud server and still runs, for example, the minimized state or the hidden state of the application instance both belong to the background running state.
The operation resource may be an operation resource of an image processor (GPU), and the GPU operation resource is mainly used for performing operation work related to images and Graphics. It is to be understood that the computing resource may also be other computing resources, such as a Central Processing Unit (CPU), and the specific type of the computing resource should not be construed as a limitation to the present application.
The application examples in the background running state are uniformly distributed with the operation resources by the cloud server, so that the cloud server can uniformly distribute the operation resources in all the application examples by setting all the application examples running on the cloud server to be in the background running state.
It can be understood that the application instances described above may be application instances running the same game, or application instances running different games; whether the game corresponding to the application example is the same game or not should not be construed as limiting the application.
Optionally, in a specific embodiment, the step 120 may specifically include the following steps a1 to a 2:
a1, obtaining the window handle of each started application instance.
The window handle refers to an identification which is uniquely corresponding to the window of each application instance and is used for characterizing the identity of the window.
Alternatively, the window handle for each launched application instance may be looked up via the GetWindowThreadProcessId function.
And A2, modifying the running state of the corresponding application instance into a background running state through the window handle.
In the above embodiments, the corresponding application instance may be placed in a background running state according to the window handle. Because each application instance corresponds to a unique window handle, the application instances are set to be in a background running state by using the window handles, so that the repetition is avoided, the omission is avoided, and the running states of all the application instances are accurately and efficiently adjusted.
Alternatively, the running state of the application instance may be adjusted by the showWindow function. The function of the ShowWindow function is to set the display state of a specified window. Therefore, a state adjustment instruction indicating that the running state is adjusted to the background running state can be sent to the window of the application instance corresponding to each window handle by using the showWindow function.
Optionally, in another specific embodiment, the step 120 may specifically include the following steps B1 to B2:
and B1, acquiring the current window state of the started application instance.
B2, if the window state of the target application instance in the started application instances is the top-setting running state, changing the window state of the target application instance from the top-setting running state to the background running state.
The set-top running state refers to a foreground running state, namely: if the cloud server has a corresponding display screen, the target application instance in the top running state can be observed in a desktop task bar of the display screen.
In the above embodiment, the window state of each application instance may be determined first, and if a certain window is originally in the background running state, the running state of the window may be maintained unchanged without performing additional processing operations on the window; if a certain window is not originally in the background running state, for example, in the foreground running state, the window may be adjusted to the background running state. By the method, the window state of each application instance is determined, and then the window which is not in the background running state is placed in the background running state.
Optionally, the window that is not in the background running state may be placed in the background running state specifically by using a ShowWindow function, and the specific manner of adjusting the running state should not be construed as limiting the application.
Optionally, the embodiment of the present application may also be implemented in the following manner when the window state of the application instance is adjusted: under the condition of no matter what running state the application examples are originally in, the same state adjustment instructions are uniformly transmitted to all the application examples, so that the running state of each application example can be quickly adjusted.
Optionally, in a specific implementation manner, the method provided in the embodiment of the present application may further include the following steps 130 to 150:
130. determining the number of currently started application instances in the cloud server.
140. And determining the maximum frame rate of the started application instances in the cloud server according to the number of the started application instances.
There is a mapping relationship between the number of application instances and the maximum frame rate of the application instances. The number of application instances running in the cloud server can be obtained, and the maximum frame rate of each application instance currently running in the cloud server is determined according to the mapping relation between the running number of the application instances and the maximum frame rate of the application instances. The corresponding maximum frame rate is determined according to the actual number of the application instances running on the server, so that stable and smooth running can be maintained under the condition that the application instances are in different running numbers.
Optionally, in a specific embodiment, the step 140 may specifically include the following steps 141 to 142:
141. and determining the frame rate range of the preset maximum frame rate.
142. And determining the maximum frame rate of the started application instances in the cloud server according to the number of the started application instances and the frame rate range.
Step 142 may specifically determine the maximum frame rate according to a mapping relationship between the number of application instances and the maximum frame rate of the application instances.
The mapping relationship between the number of application instances and the maximum frame rate of the application instances may be preset. The mapping relationship may be a mapping relationship between a number interval of the running number of the application instances and the frame rate value. For example, the quantity interval of the running number of application instances may include: i number intervals of [ a1, a2), [ a2, a3), [ a3, a4), … … [ ai, ai +1), i frame rate values of b1, b2, b3, … bi, and the mapping relationship between the running number of the application instances and the running upper limit value of the frame rate may be: a1, a2) with b1, [ a2, a3) with b2, [ a3, a4) with b3, … … [ ai, ai +1) with bi.
The mapping relationship may also be a mapping relationship between a quantity value of the running number of the application instances and the frame rate value. For example, the number of applications running may include: the number of i frames c1, c2, and c3 … … ci, the frame rate values include i frame rate values b1, b2, b3, and … bi, and the mapping relationship between the running number of the application instances and the frame rate running upper limit value may be: c1 maps with b1, c2 maps with b2, c3 maps with b3, and … … ci maps with bi. The maximum frame rate may be in a range of 30 frames to 60 frames, for example, 60 frames are all corresponded without setting no more than three application instances; in the case of more than three application instances, the maximum frame rate is reduced by 5 frames for each more than one application instance. It should be understood that the specific relationship type of the mapping relationship should not be construed as limiting the application.
150. And adjusting the operation resources corresponding to the started application examples according to the maximum frame rate.
Optionally, in a specific implementation manner, before step 150, the embodiment of the present application may further include the following steps: and after the cloud server uniformly distributes the operation resources to each application instance in the background running state, acquiring the current frame rate of each application instance.
Correspondingly, step 150 may specifically include the following steps 151 to 152:
151. and respectively comparing the current frame rate of each application instance with the maximum frame rate.
152. And if the current frame rate of the target application instance in the application instances is greater than the maximum frame rate, reducing the operation resources of the target application instance.
In the above embodiment, the actual operating frame rate (i.e. the current frame rate) of each application instance and the maximum frame rate that each application instance should operate at may be obtained separately, and then the two may be compared. If the actual operation frame rate is greater than the maximum frame rate of the application operation, the operation resources of the application instance can be reduced, so that the smooth operation of all the application instances is guaranteed as much as possible.
Optionally, in a specific implementation manner, after the step 120, the embodiment of the present application may further include the following steps S1 to S2:
s1, responding to the application data acquisition instruction sent by the target terminal, and determining the target application instance corresponding to the application data acquisition instruction.
The target terminal is a terminal held by the game player, the game player can generate an application data acquisition instruction at the target terminal by executing game operation, the application data acquisition instruction can be sent to the cloud server by the target terminal, so that the cloud server can find the corresponding target application example according to the identity in the application data acquisition instruction, and then the application data acquisition instruction is sent to the target application example.
And S2, sending the application data corresponding to the target application instance to the target terminal according to the application data acquisition instruction, so that the target terminal displays a graphical user interface corresponding to the application data.
The target application instance can generate corresponding application data according to the application data acquisition instruction, and the application data can be returned to the target terminal through the cloud server. Thereby allowing a game player holding the object terminal to view the image user interface corresponding to the application data.
In the embodiment, the game player can still play the game with higher performance requirement under the condition that the performance of the terminal equipment of the game player is not strong enough, and the entertainment life of the game player is enriched.
According to the method for allocating the operation resources, all the application instances running on the server can be obtained, and then all the application instances running on the server are set to be in the background running state. Since the application programs in the background running state can equally divide the operation resources, all application instances set in the background running state can equally divide the operation resources of the server.
In the application, the computing resources are uniformly distributed to each application instance in all the application instances by the server in a mode of setting all the application instances running in the server to be in a background running state, so that the problem that the computing resources distributed to a plurality of application instances running in the server are not uniform is solved.
The method described in the above embodiments is further described in detail below.
In this embodiment, taking an example of obtaining an application instance through an enumeration window as an example, a method of the embodiment of the present application will be described in detail.
As shown in fig. 2, a specific flow of the method for allocating computing resources is as follows:
201. and enumerating a top-layer window on a display interface by using an EnumWindows function, wherein the display interface is a display interface corresponding to the server.
202. And searching a creating process corresponding to the window of each application instance by utilizing a GetWindowThreadProcessId function.
203. Acquiring an identifier of each creation process; the identifier is an identity corresponding to the window of the corresponding application instance.
204. Sending a state adjustment instruction to the window of the application example corresponding to each identity by using a ShowWindow function; the state adjusting instruction is used for adjusting the running state of the window receiving the state adjusting instruction into a background running state.
205. And acquiring the number of all application instances running on the server, wherein the number is the running number of the clients.
206. And determining the frame rate operation upper limit values of all application examples running in the server according to the mapping relation between the client running number and the frame rate operation upper limit value, wherein the frame rate operation upper limit value is the maximum value of the running frame rate of the game corresponding to the application example.
Optionally, in a specific embodiment, the foregoing steps 201 to 206 may be implemented by the following source code:
Figure BDA0003382816410000111
Figure BDA0003382816410000121
as can be seen from the above, in the method for allocating computational resources provided in the embodiment of the present application, all application instances running on the server may be acquired, and then all application instances running on the server are set to the background running state. Since the application programs in the background running state can equally divide the operation resources, all application instances set in the background running state can equally divide the operation resources of the server.
In the application, the computing resources are uniformly distributed to each application instance in all the application instances by the server in a mode of setting all the application instances running in the server to be in a background running state, so that the problem that the computing resources distributed to a plurality of application instances running in the server are not uniform is solved.
In order to better implement the method, the embodiment of the present application further provides an apparatus for allocating computational resources, where the apparatus for allocating computational resources may be specifically integrated in an electronic device, and the electronic device may be a server. The server may be a single server, or a server cluster composed of a plurality of servers.
For example, in the present embodiment, the method of the present embodiment will be described in detail by taking an example in which a device for calculating resource allocation is specifically integrated in a server.
For example, as shown in fig. 3, the device for calculating resource allocation may include:
the embodiment of the present application further provides an apparatus for allocating computational resources, configured to allocate computational resources to a plurality of game clients that implement a cloud game, where the apparatus includes:
an instance determining unit 301, configured to determine a currently started application instance in the cloud server;
the running state adjusting unit 302 is configured to set the started application instances to a background running state, so that the cloud server uniformly allocates the operation resources to each application instance in the background running state.
In some embodiments, the apparatus further comprises:
the instance number determining unit is used for determining the number of application instances which are started currently in the cloud server;
a maximum frame rate determining unit, configured to determine a maximum frame rate of the started application instances in the cloud server according to the number of the started application instances;
and the calculation resource adjusting unit is used for adjusting the calculation resource corresponding to the started application instance according to the maximum frame rate.
In some embodiments, the maximum frame rate determining unit includes:
a frame rate range determining subunit, configured to determine a frame rate range of a preset maximum frame rate;
and the application instance frame rate subunit is configured to determine, according to the number of the started application instances and the frame rate range, a maximum frame rate of the started application instances in the cloud server.
In some embodiments, the apparatus further comprises:
the current frame rate obtaining unit is used for obtaining the current frame rate of each application instance after the cloud server uniformly distributes operation resources to each application instance in a background running state;
the operation resource adjusting unit includes:
a frame rate comparison subunit, configured to compare the current frame rate of each application instance with the maximum frame rate respectively;
and the operation resource reducing subunit is configured to reduce the operation resource of the target application instance when the current frame rate of the target application instance in the application instances is greater than the maximum frame rate.
In some embodiments, the operation state adjusting unit 302 includes:
a window handle subunit, configured to obtain a window handle of each started application instance;
and the state modification subunit is used for modifying the running state of the corresponding application instance into a background running state through the window handle.
In some embodiments, the apparatus further comprises:
the target instance determining unit is used for responding to an application data acquisition instruction sent by a target terminal and determining a target application instance corresponding to the application data acquisition instruction;
and the application data sending unit is used for sending the application data corresponding to the target application instance to the target terminal according to the application data acquisition instruction so as to enable the target terminal to display the graphical user interface corresponding to the application data.
In some embodiments, the operation state adjusting unit 302 includes:
a window state obtaining subunit, configured to obtain a current window state of the started application instance;
and the state changing subunit is used for changing the window state of the target application instance from the top-setting running state to the background running state when the window state of the target application instance in the started application instance is the top-setting running state.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in the present application, all application instances running on the server may be acquired, and then all application instances running on the server are set to the background running state. Since the application programs in the background running state can equally divide the operation resources, all application instances set in the background running state can equally divide the operation resources of the server. By setting all application instances running in the server to be in a background running state, the server uniformly distributes the operation resources to each application instance in all the application instances, so that the problem of non-uniform operation resources distributed to a plurality of application instances running in the server is avoided.
In the present application, the problem of uneven allocation of computing resources to a plurality of game clients in the prior art can be solved.
The embodiment of the application also provides the electronic equipment which can be equipment such as a terminal and a server. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and the like; the server may be a single server, a server cluster composed of a plurality of servers, or the like.
In some embodiments, the apparatus for calculating resource allocation may also be integrated into a plurality of electronic devices, for example, the apparatus for calculating resource allocation may be integrated into a plurality of servers, and the method for calculating resource allocation of the present application is implemented by the plurality of servers.
In this embodiment, the electronic device of this embodiment is described in detail as an example, for example, as shown in fig. 4, it shows a schematic structural diagram of the electronic device according to the embodiment of the present application, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. In some embodiments, processor 401 may include one or more processing cores; in some embodiments, processor 401 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device also includes a power supply 403 for supplying power to the various components, and in some embodiments, the power supply 403 may be logically coupled to the processor 401 via a power management system, such that the power management system may manage charging, discharging, and power consumption. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may also include an input module 404, the input module 404 operable to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The electronic device may also include a communication module 405, and in some embodiments the communication module 405 may include a wireless module, through which the electronic device may wirelessly transmit over short distances, thereby providing wireless broadband internet access to the user. For example, the communication module 405 may be used to assist a user in sending and receiving e-mails, browsing web pages, accessing streaming media, and the like.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
determining a currently started application instance in the cloud server; and setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the methods for calculating resource allocation provided in the embodiments of the present application. For example, the instructions may perform the steps of:
determining a currently started application instance in the cloud server; and setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations provided in the embodiments described above.
Since the instructions stored in the storage medium can execute the steps in any calculation resource allocation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any calculation resource allocation method provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The foregoing describes in detail an operation resource allocation method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for allocating computing resources, applied to a cloud server, the method comprising:
determining a currently started application instance in the cloud server;
and setting the started application instances to be in a background running state, so that the cloud server uniformly distributes operation resources to each application instance in the background running state.
2. The method of claim 1, further comprising:
determining the number of currently started application instances in the cloud server;
determining the maximum frame rate of the started application instances in the cloud server according to the number of the started application instances;
and adjusting the operation resources corresponding to the started application examples according to the maximum frame rate.
3. The method of claim 2, wherein determining the maximum frame rate of the started application instances in the cloud server according to the number of the started application instances comprises:
determining a frame rate range of a preset maximum frame rate;
and determining the maximum frame rate of the started application instances in the cloud server according to the number of the started application instances and the frame rate range.
4. The method of claim 2, further comprising:
after the cloud server uniformly distributes operation resources to each application instance in a background running state, acquiring the current frame rate of each application instance;
the adjusting the operation resource corresponding to the started application instance according to the maximum frame rate includes:
respectively comparing the current frame rate of each application instance with the maximum frame rate;
and if the current frame rate of the target application instance in the application instances is greater than the maximum frame rate, reducing the operation resources of the target application instance.
5. The method of claim 1, wherein setting the started application instances to a background running state comprises:
acquiring a window handle of each started application instance;
and modifying the running state of the corresponding application instance into a background running state through the window handle.
6. The method of claim 1, wherein after the setting the started application instances to the background running state, the method further comprises:
responding to an application data acquisition instruction sent by a target terminal, and determining a target application instance corresponding to the application data acquisition instruction;
and sending the application data corresponding to the target application instance to the target terminal according to the application data acquisition instruction so as to enable the target terminal to display a graphical user interface corresponding to the application data.
7. The method of claim 1, wherein setting the started application instances to a background running state comprises:
acquiring the current window state of the started application instance;
and if the window state of the target application instance in the started application instances is the top-setting running state, changing the window state of the target application instance from the top-setting running state to the background running state.
8. An apparatus for allocating computational resources, applied to a cloud server, the apparatus comprising:
an instance determining unit, configured to determine a currently started application instance in the cloud server;
and the running state adjusting unit is used for setting the started application instances to be in a background running state so that the cloud server can uniformly distribute the operation resources to each application instance in the background running state.
9. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the method of computational resource allocation according to any one of claims 1 to 7.
10. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the method of computational resource allocation according to any one of claims 1 to 7.
CN202111439688.XA 2021-11-30 2021-11-30 Method and device for allocating operation resources, electronic equipment and storage medium Pending CN114146406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111439688.XA CN114146406A (en) 2021-11-30 2021-11-30 Method and device for allocating operation resources, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111439688.XA CN114146406A (en) 2021-11-30 2021-11-30 Method and device for allocating operation resources, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114146406A true CN114146406A (en) 2022-03-08

Family

ID=80455021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111439688.XA Pending CN114146406A (en) 2021-11-30 2021-11-30 Method and device for allocating operation resources, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114146406A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114844872A (en) * 2022-03-30 2022-08-02 广东悦伍纪网络技术有限公司 Cloud mobile phone dynamic code stream adjusting method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114844872A (en) * 2022-03-30 2022-08-02 广东悦伍纪网络技术有限公司 Cloud mobile phone dynamic code stream adjusting method and system
CN114844872B (en) * 2022-03-30 2023-08-15 广东悦伍纪网络技术有限公司 Cloud mobile phone dynamic code stream adjustment method and system

Similar Documents

Publication Publication Date Title
US9455931B2 (en) Load balancing between processors
CN106687923B (en) Presentation of computing environments on multiple devices
US20110141123A1 (en) Push Pull Adaptive Capture
US20230215076A1 (en) Image frame display method, apparatus, device, storage medium, and program product
US20110022993A1 (en) Screen saver control apparatus and method
CN107948731B (en) Video stream merging method, server and computer-readable storage medium
WO2022048677A1 (en) Vr application design method and system based on cloud mobile phone
CN112245904A (en) Method, system, storage medium and computer device for supporting cross-server game
CN112221127B (en) Multi-point control method and device for cloud game
CN113350782A (en) Method, device, storage medium and computer equipment for processing online game abnormity
CN112169310A (en) Game resource loading method and device, computer equipment and storage medium
CN114146406A (en) Method and device for allocating operation resources, electronic equipment and storage medium
CN114748873A (en) Interface rendering method, device, equipment and storage medium
WO2024051148A1 (en) Cloud game control method and apparatus, electronic device, and storage medium
Li et al. The implementation of a GPU-accelerated virtual desktop infrastructure platform
CN116546228A (en) Plug flow method, device, equipment and storage medium for virtual scene
CN116510312A (en) Cloud game multi-opening implementation method, device, equipment and storage medium
CN114885199B (en) Real-time interaction method, device, electronic equipment, storage medium and system
CN114296916B (en) Method, device and medium for improving RDMA release performance
JP2021522721A (en) Screen capture method, terminal and storage medium
US8972479B2 (en) Methods and apparatus for online program application execution between servers
CN109669913B (en) Storage space distribution method and device based on display interface
WO2024007710A1 (en) Animation playing method and apparatus, and electronic device and computer-readable storage medium
CN118093083A (en) Page processing method, page processing device, computer equipment and computer readable storage medium
CN114210050A (en) Cloud game running method and system and cloud game server

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