CN111861446A - Charging control method, charging control device, electronic equipment, server and storage medium - Google Patents

Charging control method, charging control device, electronic equipment, server and storage medium Download PDF

Info

Publication number
CN111861446A
CN111861446A CN202010699620.4A CN202010699620A CN111861446A CN 111861446 A CN111861446 A CN 111861446A CN 202010699620 A CN202010699620 A CN 202010699620A CN 111861446 A CN111861446 A CN 111861446A
Authority
CN
China
Prior art keywords
virtual machine
state
resource
server
charging
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.)
Granted
Application number
CN202010699620.4A
Other languages
Chinese (zh)
Other versions
CN111861446B (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 Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010699620.4A priority Critical patent/CN111861446B/en
Publication of CN111861446A publication Critical patent/CN111861446A/en
Application granted granted Critical
Publication of CN111861446B publication Critical patent/CN111861446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/14Payment architectures specially adapted for billing systems
    • 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/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • 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/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Power Sources (AREA)

Abstract

The application relates to a charging control method, a charging control device, electronic equipment, a server and a storage medium, and relates to the field of cloud computing. The method releases related resources at the server side according to charging indication information triggered by the client side based on the first state of the virtual machine of the client side, and stops the virtual machine from charging the use of the resources. Because the power consumption of the virtual machine in the first state is lower than that in the second state, the release and the stop of the charging of the related resources of the service end are realized when the virtual machine of the client end is in the low power consumption state (such as shutdown and suspension), and the deletion of the virtual machine of the client end is not required, so that the client end can start the virtual machine for using the resources at any time through simple virtual machine state switching operation (switching to the high power consumption state), and the virtual machine does not need to be re-established, thereby flexibly meeting different requirements of the client end on the charging of the resources at different time, reducing the user cost, facilitating the user to start the virtual machine for using the resources at any time, and simultaneously avoiding the waste of resources of the service end.

Description

Charging control method, charging control device, electronic equipment, server and storage medium
Technical Field
The present application belongs to the technical field of resource charging, and in particular, to a charging control method, apparatus, electronic device, server, and storage medium.
Background
At present, users such as enterprises or individuals often rely on business by purchasing charging resources from a service end, typically, the service end may be a cloud service, wherein the cloud service is an increase, use and interaction mode of related services based on the internet, and provides dynamic and easily expandable and often virtualized resources to users such as enterprises or individuals through the internet.
The server generally charges based on service resources purchased by a user and the occupied duration of the resources, when the user wants to stop charging of certain supported resources, the charging is usually realized by deleting a client virtual machine (such as a cloud host created on a client physical machine by relying on cloud resources), and when the user has a demand for the service resources of the server again, the user needs to reapply the resources and create a virtual machine on the client again by using a virtual machine mirror image, which consumes time and labor, and is difficult to flexibly deal with different demands for the resource charging caused by different demands of client services for the resources of the server at different times, and accordingly, the problems of high user cost, inconvenience for starting the resources to use the virtual machine at any time by the user, waste of the service resources and the like easily occur.
Disclosure of Invention
In view of this, the present application provides a charging control method, an apparatus, an electronic device, a server, and a storage medium, which achieve the purposes of saving user cost, facilitating a user to start a server resource to use a virtual machine at any time, and not causing waste of the server resource by providing a charging stop function for a corresponding resource under the condition of low power consumption (such as shutdown and suspension) of a client virtual machine.
The specific technical scheme is as follows:
a charging control method is applied to a server of a server side, and the method comprises the following steps:
acquiring first charging indication information of a client, wherein the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
determining a second resource which is not needed to be used by the first virtual machine in the first state from first resources of a server side on which the creation and the operation of the first virtual machine depend;
releasing the second resource of the server and controlling the second resource to be in a redistributable state;
and stopping the charging of the first virtual machine for the use of the second resource.
Optionally, the obtaining the first charging indication information of the client includes:
receiving first charging indication information triggered and sent by the first virtual machine in the process of entering a first low-power-consumption state or entering a second low-power-consumption state;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
Optionally, the first resource of the server on which the creation and operation of the first virtual machine depend includes a computing resource and a storage resource;
in the first low power consumption state, the second resources that the first virtual machine does not need to use include all of the first resources that the first virtual machine relies on;
in the second low power consumption state, the second resource that the first virtual machine does not need to use includes a portion of the first resource that the first virtual machine relies on.
Optionally, after the stopping charging for the use of the second resource by the first virtual machine, the method further includes:
Acquiring second charging indication information of the client;
determining whether the first physical machine has sufficient of the second resource; the first physical machine is a host machine where the second resource is located before the second resource is released;
if yes, allocating the second resource from the first physical machine to the first virtual machine, and locking the second resource;
if the resource is determined not to be owned, allocating the second resource from a second physical machine to the first virtual machine, and locking the second resource;
charging for use of the second resource by the first virtual machine;
the second charging indication information is information triggered by an event that the client enters a second state based on the first virtual machine; and in the second state, the first virtual machine runs a system process and a business process.
Optionally, after releasing the second resource of the server, the method further includes:
allocating the released second resource to a second virtual machine based on a resource allocation policy;
the second virtual machine and the first virtual machine are virtual machines created on the same client or different clients.
Optionally, the method further comprises:
Acquiring configuration change indication information sent by a client under the condition that the first virtual machine is in a first state;
recording the configuration change indication information;
and adjusting the first resource on which the first virtual machine depends at the server side to be a third resource based on the event that the first virtual machine enters the second state.
A charging control method is applied to a client, and comprises the following steps:
acquiring the state of a first virtual machine established on the client;
triggering first charging indication information based on the event that the first virtual machine enters the first state; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
sending the first charging indication information to a server of a server to indicate the server to release a second resource of the server and stop charging for the first virtual machine to use the second resource; wherein the released second resource is in a re-assignable state;
the second resource is a resource which is determined by the server from a server-side first resource which is depended on by the creation and the operation of the first virtual machine and is not needed to be used by the first virtual machine in the first state.
Optionally, the triggering, based on the event that the first virtual machine enters the first state, first charging indication information includes:
the first virtual machine triggers the first charging indication information in the process of entering a first low-power consumption state or entering a second low-power consumption state;
the sending the first charging indication information to a server of a server includes:
the first virtual machine sends the first charging indication information to the server;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
Optionally, after sending the first charging indication information to a server at a server side, the method further includes:
the first virtual machine triggers second charging indication information in the process of entering the second state or after entering the second state;
sending the second charging indication information to the server to indicate the server to allocate the second resource to the first virtual machine from a server;
And in the second state, the first virtual machine runs a system process and a business process.
Optionally, the method further comprises:
sending configuration change indication information to the server when the first virtual machine is in the first state so as to indicate the server to record the configuration change indication information, and adjusting the first resource depended by the first virtual machine at the server side to be a third resource based on the event that the first virtual machine enters the second state.
A charging control device is applied to a server of a server side, and the method comprises the following steps:
the system comprises a first obtaining unit, a second obtaining unit and a processing unit, wherein the first obtaining unit is used for obtaining first charging indication information of a client, and the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a determining unit, configured to determine, from first resources of a server on which creation and operation of the first virtual machine depend, second resources that are not needed to be used by the first virtual machine in the first state;
a releasing unit, configured to release the second resource of the server and control the second resource to be in a re-assignable state;
And the charging control unit is used for stopping the charging of the first virtual machine for the use of the second resource.
A charging control device is applied to a client, and comprises:
a second obtaining unit, configured to obtain a state of a first virtual machine created in the client;
the triggering unit is used for triggering first charging indication information based on the event that the first virtual machine enters the first state; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a sending unit, configured to send the first charging indication information to a server at a server, so as to indicate the server to release a second resource at the server and stop charging for the use of the second resource by the first virtual machine; wherein the released second resource is in a re-assignable state;
the second resource is a resource which is determined by the server from a first resource of the server side and is not needed to be used by the first virtual machine in the first state, wherein the first resource is depended on by the creation and the operation of the first virtual machine.
A server, comprising:
a first memory for storing a first set of computer instructions;
the first processor is used for implementing the charging control method applied to the server by executing the instruction set stored on the first memory.
An electronic device, comprising:
a second memory for storing a second set of computer instructions;
and the second processor is used for implementing the charging control method applied to the client side by executing the instruction set stored on the second memory.
A computer readable storage medium having stored therein a first set of computer instructions which, when executed by a processor, implement a charging control method applied to a server as claimed in any one of the preceding claims.
A computer readable storage medium having stored therein a second set of computer instructions which, when executed by a processor, implement a charging control method applied to a client as claimed in any one of the preceding claims.
According to the charging control method, the charging control device, the electronic equipment, the server and the storage medium, relevant resources are released at the server side according to charging indication information triggered by the client side based on the first state of the virtual machine, and the virtual machine stops charging for using the resources. Because the power consumption of the virtual machine in the first state is lower than that in the second state, the release and the stop of the charging of the related resources of the service end are realized when the virtual machine of the client end is in the low power consumption state (such as shutdown and suspension), and the deletion of the virtual machine of the client end is not required, so that the client end can start the virtual machine for using the resources at any time through simple virtual machine state switching operation (switching to the high power consumption state), and the virtual machine does not need to be re-established, thereby flexibly meeting different requirements of the client end on the charging of the resources at different time, reducing the user cost, facilitating the user to start the virtual machine for using the resources at any time, and simultaneously avoiding the waste of resources of the service end.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a charging control method applied to a server according to an embodiment of the present application;
fig. 2 is a diagram of a cloud resource service architecture provided in an embodiment of the present application;
fig. 3 is another schematic flowchart of a charging control method applied to a server according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another charging control method applied to a server according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another charging control method applied to a server according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a charging control method applied to a client according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another charging control method applied to a client according to an embodiment of the present application;
Fig. 8 is a schematic flowchart of another charging control method applied to a client according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a charging control apparatus applied to a server according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of another charging control apparatus applied to a server according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a charging control apparatus applied to a server according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a charging control apparatus applied to a client according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a server provided in an embodiment of the present application;
fig. 14 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
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.
At present, for a majority of users of server resources such as cloud service resources, the service of the users may periodically have a peak-to-peak phenomenon in one day, which accordingly leads to different requirements for using the server resources at different times, the users usually want to stop charging the back-end service resources of at least part of the virtual machines of the clients at the time of the peak of the service, and can conveniently start the resource coping service at the time of the peak of the service, however, if the users want to stop charging the server resources, the charging can only be realized by deleting the client virtual machines (such as client cloud hosts), after the deletion, once the user service meets the peak of the traffic, the users can only use the virtual machine images to recreate the virtual machines, which consumes time and labor, and is difficult to flexibly cope with different requirements for charging the resources caused by different requirements for the server resources at different times due to the change of the user service, meanwhile, the problems of high user cost, inconvenience for starting the resource using virtual machine by the user at any time, waste of service resources and the like easily occur.
In order to solve the problem, the present application provides a charging control method, an apparatus, an electronic device, a server, and a storage medium, where a typical application scenario is charging control of cloud service resources, and the charging control method, the apparatus, the electronic device, the server, and the storage medium of the present application are described in detail through a plurality of embodiments based on the application scenario.
First, a charging control method provided in an embodiment of the present application is introduced, and referring to fig. 1, a flowchart of the charging control method applied to a server is shown, where the method may include the following steps:
step 101, acquiring first charging indication information of a client, wherein the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state.
In practical application, one client physical machine (such as a notebook, a desktop, etc.) may create and operate one or more virtual machines depending on service resources purchased from a server, such as one or more cloud hosts depending on cloud service resources purchased from a cloud. The first virtual machine of the client is a general virtual machine, and is not used for representing a specific virtual machine, but is only used for distinguishing the first virtual machine from other virtual machines which do not enter the first state on the same client or different clients.
The first state is a low power consumption state of the client virtual machine, including but not limited to a first low power consumption state and a second low power consumption state, wherein in the first low power consumption state, both a service process and a system process of the virtual machine stop running, and the state is also a shutdown state of the virtual machine; in the second low power consumption state, the service process of the virtual machine stops running and is suspended, and the system process (the most basic system process capable of maintaining the system running) is maintained running, which is also the suspended state of the virtual machine.
The second state is a high power consumption state of the virtual machine, and in this state, both the system process and the service process of the virtual machine operate normally, so this state can also be understood as a normal operating state of the virtual machine.
The client may trigger first charging indication information corresponding to the first virtual machine by monitoring a state of the virtual machine, and based on an event that the monitored first virtual machine enters the first state, and send the first charging indication information to a server of the server, for example, send the first charging indication information to a certain server in the cloud service resource management platform.
The first charging indication information is used for informing the server that the first virtual machine currently enters the first state, and indicating the server to release the service-related resources and stop charging according to the event that the first virtual machine enters the first state.
In implementation, the server may specifically receive first charging indication information triggered and sent by the first virtual machine in the process of entering the first low power consumption state or entering the second low power consumption state; more specifically, the server may receive the first charging indication information triggered and sent by the first virtual machine during shutdown or suspension of the first virtual machine.
Optionally, in this embodiment, a metadata tag enable _ track _ resource is newly added to the virtual machine, and different values of the metadata tag are used to indicate information of different states, different charging requirements, and the like of the virtual machine. Illustratively, for example, the value of the metadata tag is 0, that is, enable _ track _ resource is 00 (assuming that 2 bits are occupied), which indicates that the virtual machine enters a shutdown state and requires shutdown without charge (for resources that are not needed to be used, the virtual machine does not charge in the shutdown state); the value of the metadata tag is 1, that is, enable _ track _ resource is 01, which indicates that the virtual machine enters a boot state and needs normal charging; the value of the metadata tag is 2, i.e., enable _ track _ resource is 10, which indicates that the virtual machine enters the suspended state and requires suspension without charging (without charging in the suspended state for resources that are not needed). In this example, the first charging indication information is a tag value with enable _ track _ resource being "0" or "2". And adding the metadata tag and value logic thereof aiming at different states into a processing code of a shutdown processing flow or a suspension processing flow of the virtual machine so as to support that corresponding assignment corresponding to the current state is automatically carried out on the metadata tag in the shutdown or suspension process of the virtual machine, and first charging indication information at least carrying the value information of the metadata tag is generated and further sent to a server.
After receiving the first charging indication information of the client virtual machine, the server extracts a corresponding value of the metadata tag from the first charging indication information, and executes a matched operation based on the value, for example, based on the condition that the received metadata tag value is 0 or 2, the server releases related resources occupied by the virtual machine, stops charging of the virtual machine on the released resources, and the like. A detailed description of this process will be provided below.
And 102, determining a second resource which is not needed to be used by the first virtual machine in the first state from first resources of a server side which is depended on by the creation and the operation of the first virtual machine.
In this step, the first resource of the server, on which the creation and operation of the first virtual machine depend, is essentially a resource that the first virtual machine of the client depends on at the server, and the creation and operation of the virtual machine usually requires at least two types of resources, i.e., storage resources such as a disk and computing resources such as a Central Processing Unit (CPU) and a memory.
In a first low power consumption state in the first state, namely in a shutdown state, the service process and the system process of the first virtual machine both stop running without using any computing resources such as a CPU, a memory and the like, and the server determines all computing resources such as the CPU, the memory and the like from all resources supported by the first virtual machine at the server based on the condition that the first virtual machine is in the first low power consumption state, and uses the all computing resources as the second resources to be released and stop charging.
Similarly, in a second low power consumption state in the first state, that is, in a suspended state, the service process of the first virtual machine is stopped, the system process is maintained to operate, and partial resources of the CPU, the memory and other computing resources are not needed to be used.
In implementation, the unused computing resource (i.e., the second resource) in the first resource occupied by the server of the first virtual machine may be further determined by detecting the computing resource actually consumed by the system process that maintains the first virtual machine in the suspended state.
Taking charging control of cloud service resources as an example, as shown in fig. 2, optionally, the cloud maintains a computing resource cluster, a storage resource cluster and a cloud management platform, where the computing resource cluster includes a plurality of computing nodes, each computing node is composed of one or more physical machines (such as servers) for providing computing resources such as CPUs and memories, the storage resource cluster includes a plurality of storage nodes, each storage node is composed of one or more physical machines (such as cloud disk servers) for providing storage resources such as disks, and the computing resources and the storage resources are logically separated. The cloud management platform is composed of a plurality of servers for managing the computing and storage node cluster, mapping relationship information of the client virtual machine and service resources in the cloud physical node is recorded and maintained in the servers of the cloud management platform, and the recorded and maintained mapping relationship information specifically includes a corresponding relationship between "client ID (such as client address) -ID of the virtual machine on the client" and "intranet IP address/virtual IP address-resource identification (such as CPU number and address interval of the memory area) corresponding to the resource on the cloud physical node-node".
Wherein, for the virtual machine created on the client, after the cloud management platform allocates the corresponding computing resources such as CPU, memory and the like to the virtual machine from a certain computing node, the allocated computing resources can be logically understood as cloud virtual machines corresponding to the client virtual machine, in order to facilitate management, the cloud management platform allocates an intranet IP address/virtual IP address to each cloud virtual machine, one physical machine of the cloud computing node can be divided and run one or more cloud virtual machines, in addition to the computing resources, the client virtual machine usually purchases a corresponding storage resource (such as a cloud disk) from a service end such as a cloud end to store relevant data thereof so as to support normal operation of a service, and in view of this, the cloud management platform also hangs the storage resource purchased by a user under the intranet IP address/virtual IP address corresponding to the computing resource applied by the client virtual machine, and forms a complete cloud virtual machine based on the associated computing resources and storage resources.
After obtaining the first charging indication information of the client, the cloud management platform may determine, based on the maintained mapping relationship information, that the first virtual machine does not need to use all the computing resources in the shutdown state, or may determine, in combination with the mapping relationship information and the detected computing resources actually consumed by the system process of the first virtual machine in the suspension state, that the first virtual machine does not need to use part of the computing resources in the suspension state.
Step 103, releasing the second resource of the server, and controlling the second resource to be in a re-assignable state.
After determining that the second resource is not needed to be used by the first virtual machine in the first state, the server releases the second resource from the first resource occupied by the first virtual machine at the server side, so as to release the occupation of the second resource at the server side by the first virtual machine and control the second resource to be in a redistributable state.
Based on a first low power consumption state, namely a shutdown state, of the first virtual machine at the client, the server releases all computing resources in the first resources (storage resources + computing resources) occupied by the server, such as all computing resources occupied by the server, such as all CPUs, memories and the like.
Based on the second low-power state, namely the suspended state, of the first virtual machine at the client, the server releases part of the computing resources in the first resources (storage resources + computing resources) occupied by the server, such as part of the computing resources occupied by the server, such as a CPU, a memory and the like.
The second resource of the server is released, so that the first virtual machine can release the occupation of the second resource of the server, and meanwhile, the first virtual machine does not need to use the second resource in a first state (such as shutdown and suspension), so that the (operation of the) first virtual machine is not influenced. And the released part of resources can be uniformly managed by the server, and can be distributed and sold to other client users when in need.
After all or part of computing resources occupied by the first virtual machine at the cloud end are released, the cloud management platform still reserves the intranet IP address/virtual IP address of the cloud end virtual machine for the first virtual machine.
And 104, stopping the charging of the first virtual machine for the second resource.
Meanwhile, the server stops the charging of the first virtual machine for the use of the second resource released by the server, so that the purpose of stopping charging of the first virtual machine of the client for the resource which is not required to be used in the low power consumption state such as shutdown/suspension is achieved.
Optionally, a server, such as a corresponding server in the cloud management platform, may give the first charging indication information (e.g., a metadata tag having a corresponding value) to the order service line through the message queue, and the order service line stops charging for the second resource of the first virtual machine based on the information.
In the implementation, the client or the virtual machine thereof can automatically execute the operations of triggering and sending (sending) the first charging indication information to the server and the like based on the event that the virtual machine enters the first state, so that for a client user, when the service flow is in a low peak, the purpose of non-charging of corresponding resources can be achieved by closing or hanging at least part of the virtual machine, the virtual machine does not need to be deleted, the user cost is reduced, the user can conveniently start the resource to use the virtual machine at any time, and in addition, the server can continuously sell the released computing resources to other client users, thereby avoiding the waste of server resources.
In the prior art, when a client virtual machine (such as a cloud host) executes shutdown operation, occupied computing resources of a server are also released, but resource reporting is performed during the release, so that the server locks the part of resources released in the host to realize logical occupation of the server, and is guaranteed not to be occupied by other users (certainly, the locked part of resources are continuously charged for use), and subsequently, when the client virtual machine is started from a shutdown state, the locked resources in the original host of the server are started to the virtual machine; in the application, when the client virtual machine executes shutdown (normal shutdown or forced shutdown) or suspend operation, physical computing resources occupied by the client virtual machine at the server side are also released, but resource reporting is not performed, so that the resources are not locked, logical occupation of the virtual machine on the part of the resources in a shutdown/suspend state is not formed, and the part of the resources can be continuously sold to other users.
In this embodiment, according to the charging indication information triggered by the client based on the first state of the virtual machine, the client releases the relevant resource at the server, and stops the virtual machine from charging for the use of the resource. Because the power consumption of the virtual machine in the first state is lower than that in the second state, the release and the stop of the charging of the related resources of the service end are realized when the virtual machine of the client end is in the low power consumption state (such as shutdown and suspension), and the deletion of the virtual machine of the client end is not required, so that the client end can start the virtual machine for using the resources at any time through simple virtual machine state switching operation (switching to the high power consumption state), and the virtual machine does not need to be re-established, thereby flexibly meeting different requirements of the client end on the charging of the resources at different time, reducing the user cost, facilitating the user to start the virtual machine for using the resources at any time, and simultaneously avoiding the waste of resources of the service end.
In an alternative embodiment of the present application, as shown in fig. 3, the charging control method applied to the server may further include, after the step 104, the following processing steps:
and 105, acquiring second charging indication information of the client.
The second charging indication information is information triggered by the first virtual machine in the process of entering the second state or after entering the second state.
As described above, the second state is a state in which the first virtual machine normally operates, and after the first virtual machine is started from the first state such as shutdown or suspension to enter the second state, it is easy to understand that the resource that is released in the first state before the first virtual machine is started from the server side is the second resource, so as to maintain normal operation of the system process and the service process of the first virtual machine in the second state.
In order to solve the problem, the first virtual machine triggers the second charging indication information in the process of entering the second state or after entering the second state, so as to indicate the server to perform resource allocation, starting and charging control on the first virtual machine.
The server correspondingly acquires the second charging indication information of the client, and executes the following processing based on the second charging indication information, so as to realize the required resource allocation, starting and charging control of the first virtual machine. The second charging indication information obtained by the server may specifically include the relevant value of the metadata tag enable _ track _ resource described above.
Step 106, determining whether the first physical machine has enough second resources;
and the first physical machine is a host machine where the second resource is located before the second resource is released, namely an original host machine of the second resource. The first physical machine may be a server with a cloud end for providing computing resources such as a CPU and a memory.
And 107, if the resource is determined to be owned, allocating the second resource from the first physical machine to the first virtual machine.
And 108, when the resource allocation request is determined not to be provided, allocating the second resource from the second physical machine to the first virtual machine.
After the first virtual machine is started, preferentially judging whether enough second resources (such as computing resources of a CPU (central processing unit), a memory and the like) are provided from an original host of the released second resources, further preferentially judging whether the released original second resources in the original host are occupied by other virtual machines, and if the released original second resources are not occupied, directly starting the original second resources to allocate the resources to the first virtual machine; and if the second resource is not occupied, the second physical machine with sufficient resources is allocated to the first virtual machine.
Specifically, in a situation that the original host does not have enough second resources, offline migration may be performed on the cloud virtual machine, and the cloud virtual machine is migrated from the original host to a physical machine with sufficient resources, that is, the second physical machine.
The migration of the cloud virtual machine from the original host machine to the physical machine with sufficient resources, namely the second physical machine, is as follows: and dividing second resources (such as computing resources of a CPU (central processing unit), a memory and the like) from the second physical machine, binding the divided second resources with an intranet IP address/virtual IP address reserved by the cloud for the first virtual machine, and updating new binding information into mapping relation information maintained by the cloud platform.
The cloud computing resources and the storage resources (such as cloud disk resources) bound to the intranet IP address/virtual IP address jointly form a cloud virtual machine, which is supported by the first virtual machine at the cloud and used for providing service resources. In addition, as for the client, the intranet IP address/virtual IP address of the corresponding cloud virtual machine is not changed in the migration process, so that the state switching (e.g., from normal operation → shutdown and suspension, from shutdown, suspension → normal operation) of the client virtual machine does not cause the change of the cloud virtual machine, the client virtual machine does not need to perform any adaptive processing (e.g., connection adjustment and the like), and the user cost is reduced.
It should be noted that, when the original released second resource on the original host is already occupied by other virtual machines and the partition of the second resource is continued from other resources of the original host, the newly partitioned second resource also needs to be bound with the intranet IP address/virtual IP address reserved by the server for the cloud virtual machine of the first virtual machine, and the new binding information is updated to the mapping relationship information maintained by the cloud platform.
Step 109, charging the first virtual machine for the use of the second resource.
And after the virtual machine is started and the second resource is started, the first virtual machine starts to charge the use of the second resource.
In implementation, a server, such as a corresponding server in the cloud management platform, may send the second charging indication information (e.g., a metadata tag having a corresponding value) to the order service line through the message queue, and the order service line starts charging the second resource of the first virtual machine based on the information.
The embodiment supports the user to execute shutdown or suspend operation on the virtual machine on the physical device to release the computing resource of the server, without deleting the virtual machine by the user; on the premise of saving the user cost, the user can more flexibly deal with the change of the service flow; meanwhile, the resources in the shutdown/suspended non-charging state can be sold to other users, and the idle and waste of server resources can not be caused.
In an alternative embodiment of the present application, as shown in fig. 4, the charging control method applied to the server may further include, after the step 104, the following processing steps:
and step 110, allocating the released second resource to a second virtual machine based on a resource allocation strategy.
The second virtual machine and the first virtual machine may be virtual machines created on the same client or different clients, which is not limited thereto.
As described above, the second resource of the server released for the first virtual machine may be sold to other users because the resource is not reported and the first virtual machine does not logically occupy the second resource, and the server may allocate the second resource released for the first virtual machine to the second virtual machine based on the resource allocation policy of the server.
Optionally, the resource allocation policy may be: and preferentially distributing the required computing resources for the virtual machine from the physical machine of the computing node with less occupied resources.
In this embodiment, the released service resources are not reported, so that the virtual machine does not logically occupy the released resources any longer in the first state, and accordingly flexible management of the released resources (for example, selling the released resources to other users) can be supported, thereby improving management flexibility of the service resources of the server and reducing waste of the service resources.
In an alternative embodiment of the present application, as shown in fig. 5, the charging control method applied to the server may further include the following processing steps after the step 104:
and step 111, obtaining configuration change indication information sent by the client under the condition that the first virtual machine is in the first state.
Optionally, the configuration change indication information includes resource configuration information for performing resource allocation up or resource allocation down on the first virtual machine, and is used to indicate the server to perform allocation up or resource allocation down on the server resources occupied by the first virtual machine.
And step 112, recording the configuration change indication information.
After the server obtains the indication information, the configuration change indication information is recorded, for example, the obtained resource configuration information for upgrade or downgrade is recorded in a configuration information database of the cloud management platform, and the like.
Step 113, based on the event that the first virtual machine enters the second state, adjusting the first resource that the first virtual machine depends on at the server side to a third resource.
When the server obtains the above configuration change indication information of the client when the first virtual machine is in the first state, because the first virtual machine does not actually occupy the resource that the first virtual machine does not need to use (certainly, the server does not charge the resource) in the first state, in this state, the server only records the configuration change indication information, and does not need to perform the operation of allocating or allocating the back-end resource of the first virtual machine in the first state, and then, after the first virtual machine switches from the first state to the second state, for example, after the first virtual machine is started from the shutdown or suspend state, the back-end service resource of the first virtual machine is allocated or allocated according to the relevant configuration information in the indication information, for example, the memory occupied by the original SIZE of SIZE1 is increased to the memory of SIZE2(SIZE2 > SIZE 1).
In synchronization with this, the maintained mapping relationship information needs to be updated in the case of upgrade or downgrade.
It should be noted that, in the conventional technology, no matter what state (e.g., the first state) the configuration change indication information of the client is received, a server, such as a corresponding server of the cloud management platform, directly executes the virtual machine upgrade or upgrade processing based on the information, so as to implement the real-time upgrade or upgrade of the backend service resources of the virtual machine.
In match with the above charging control method applied to the server, the present application also discloses a charging control method applied to the client, and referring to the flowchart of the charging control method shown in fig. 6, the method may include the following processing steps:
step 601, acquiring the state of the first virtual machine created in the client.
In this embodiment, optionally, the first virtual machine may obtain its own state information based on detection of events such as shutdown, suspension, and startup of its virtual machine system.
In practical application, the client device, such as a notebook of a user, may also perform event detection, such as shutdown, suspension, and startup, on the virtual machine created on the device, so as to realize that the client knows the state of the virtual machine created by the client device.
In this embodiment, the former implementation mode is preferably adopted, that is, the first virtual machine detects the on-off and suspend events of its own system, and learns its own state accordingly.
Step 602, triggering a first charging indication message based on a first state of the first virtual machine; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state.
The first state includes a first low power consumption state (shutdown) and a second low power consumption state (suspend), the second state is a normal running state of the virtual machine, and for more detailed contents of the first state and the second state, reference may be specifically made to the description of the above related embodiments, and details are not repeated here.
Optionally, the first virtual machine may trigger the first charging indication information during entering the first low power consumption state (shutdown state) or entering the second low power consumption state (suspend state).
As described above, in this embodiment, a metadata tag enable _ track _ resource is added to the virtual machine, and different values of the metadata tag are used to indicate information such as different states and different charging requirements of the virtual machine. And adding the metadata tag and value logic thereof aiming at different states into a processing code of a shutdown processing flow or a suspension processing flow of the virtual machine so as to support that corresponding assignment corresponding to the current state is automatically carried out on the metadata tag in the shutdown or suspension process of the virtual machine and first charging indication information at least carrying the value information of the metadata tag is generated.
Step 603, sending the first charging indication information to a server at a server to indicate the server to release a second resource at the server and stop charging for the use of the second resource by the first virtual machine; wherein the released second resource is in a re-assignable state.
The second resource is a resource which is determined by the server from the first resource of the server side and is not needed to be used by the first virtual machine in the first state, wherein the first resource is depended on by the creation and the operation of the first virtual machine.
After the first virtual machine generates the first charging indication information in the shutdown or suspension process, the first charging indication information is further sent to a server, such as a corresponding server of the cloud management platform, and after the server receives the information, the server releases a second resource that is not needed to be used by the first virtual machine in the first state (shutdown or suspension) based on the information, and stops the first virtual machine from charging for using the second resource. And meanwhile, the server does not report and lock the second resource any more, so that the second resource can be sold to other users.
The processing of the server may specifically refer to the description of the charging control method applied to the server, and is not described again.
According to the embodiment, the release and the stop of the charging of the related resources of the server are realized when the virtual machine of the client is in a low-power consumption state (such as shutdown and suspension), and the client does not need to rely on the deletion of the virtual machine of the client, so that the client can start the virtual machine for resource use at any time through simple virtual machine state switching operation (switching to a high-power consumption state), and does not need to establish the virtual machine again, thereby flexibly meeting different requirements of the client on the resource charging at different times, reducing the user cost, facilitating the user to start the virtual machine for resource use at any time, and avoiding the waste of resources of the server.
In an alternative embodiment of the present application, as shown in fig. 7, after the step 603, the charging control method applied to the client may further include the following processing steps:
step 604, the first virtual machine triggers the second charging indication information in the process of entering the second state or after entering the second state.
Optionally, when the first virtual machine is started from the shutdown/suspend state to switch to the normal operation state, the first virtual machine may check and modify a value of the metadata tag enable _ track _ resource during a starting process or at a time when the starting is finished, modify the value from a value indicating "shutdown/suspend non-charging" (e.g., "0" or "2") to a value indicating "startup charging" (e.g., "1"), and further generate second charging indication information including the metadata tag information.
Step 605, sending the second charging indication information to the server to indicate the server to allocate the second resource to the first virtual machine from the server; and in the second state, the system process and the business process of the first virtual machine run normally.
And then, the first virtual machine sends the second charging indication information to a server, for example, to a corresponding server of the cloud management platform, so that the server allocates and enables a required second resource to the first virtual machine based on the second charging indication information, so as to support normal operation of a system process and a service process of the first virtual machine.
Similarly, in implementation, the metadata tag enable _ track _ resource and the assignment logic thereof in the corresponding state may be added in the boot process of the virtual machine, so as to support triggering and sending the second charging indication information to the server during the boot process of the virtual machine or at the time of completing the boot.
In addition, when the client executes the operation of the reloading system for the virtual machine with the function of no charge for shutdown/suspension, and starts the virtual machine after reloading is completed, the starting logic is similar to the process of starting the virtual machine system from the shutdown state, and also assigns the value of the metadata tag enable _ track _ resource carried in the starting process as the value marked as 'boot charge' (such as '1'), further generates second charging indication information containing the metadata tag information, and sends the second charging indication information to the server, and the server starts corresponding resources for the server (such as allocating the original released resources of the original host to start or executing resource reallocation and starting on the basis of offline migration) and carries out the charging of the use of the resources,
The processing of the server may specifically refer to the above description of the charging control method applied to the server, and is not described again.
In this embodiment, the client can start the resource using virtual machine at any time through simple virtual machine state switching operations (for example, switching to a high power consumption state), without re-creating the virtual machine, so that different requirements of the client on resource charging at different times can be flexibly met, the user cost is reduced, the user can conveniently start the resource using virtual machine at any time, and meanwhile, the resource waste of the server is avoided.
In an alternative embodiment of the present application, as shown in fig. 8, after the step 603, the charging control method applied to the client may further include the following processing steps:
step 606, sending configuration change indication information to the server when the first virtual machine is in the first state, so as to indicate the server to record the configuration change indication information, and adjusting the first resource, which the first virtual machine depends on at the server, to be a third resource based on an event that the first virtual machine enters the second state.
In implementation, a user may perform configuration management such as upgrade or downgrade on a virtual machine created on a client based on virtual machine management software running on the client, and accordingly, by executing a relevant configuration operation based on an interface or a dialog box on the virtual machine management software, the above configuration change indication information may be sent to the server when the first virtual machine is in the first state.
The configuration change indication information includes resource configuration information for performing ascending or descending configuration on the first virtual machine, and is used for indicating the server to perform ascending or descending configuration on the server resources occupied by the first virtual machine.
After the server obtains the indication information, only recording the configuration change indication information when the first virtual machine is in the first state, and subsequently, after the first virtual machine is switched from the first state to the second state, for example, after the first virtual machine is started from a shutdown or suspension state, performing upgrade or downgrade configuration on the back-end service resources of the first virtual machine according to the relevant configuration information in the indication information.
In this embodiment, when the virtual machine is in the first state and the configuration change indication information for the upgrade or the downgrade is sent to the server, the server performs recording processing on only the indication information in the first state, and then executes the matched upgrade and downgrade processing after waiting until the first virtual machine enters the second state, which can effectively save user cost and avoid waste of service resources of the server.
Corresponding to the above charging control method applied to the server, the embodiment of the present application further discloses a charging control device applied to the server, as shown in fig. 9, the charging control device includes:
A first obtaining unit 901, configured to obtain first charging indication information of a client, where the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a determining unit 902, configured to determine, from first resources of a server on which the first virtual machine is created and operated, second resources that are not needed to be used by the first virtual machine in the first state;
a releasing unit 903, configured to release the second resource of the server and control the second resource to be in a re-assignable state;
a charging control unit 904, configured to stop charging for the use of the second resource by the first virtual machine.
In an optional implementation manner of the embodiment of the present application, the first obtaining unit 901 is specifically configured to:
receiving first charging indication information triggered and sent by the first virtual machine in the process of entering a first low-power-consumption state or entering a second low-power-consumption state;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
In an optional implementation manner of the embodiment of the present application, the first resource of the server on which the creation and the operation of the first virtual machine depend includes a computing resource and a storage resource;
in the first low power consumption state, the second resources that the first virtual machine does not need to use include all of the first resources that the first virtual machine relies on;
in the second low power consumption state, the second resource that the first virtual machine does not need to use includes a portion of the first resource that the first virtual machine relies on.
In an optional implementation manner of the embodiment of the present application, as shown in fig. 10, the charging control apparatus may further include:
an assigning unit 905 for: acquiring second charging indication information of the client; determining whether the first physical machine has sufficient of the second resource; the first physical machine is a host machine where the second resource is located before the second resource is released; if yes, allocating the second resource from the first physical machine to the first virtual machine, and locking the second resource; if the resource is determined not to be owned, allocating the second resource from a second physical machine to the first virtual machine, and locking the second resource; and triggers the charging control unit 904 to start charging the usage of the second resource by the first virtual machine;
The second charging indication information is information triggered by an event that the client enters a second state based on the first virtual machine; and in the second state, the first virtual machine runs a system process and a business process.
In an optional implementation manner of the embodiment of the present application, the allocating unit 905 may be further configured to: allocating the released second resource to a second virtual machine based on a resource allocation policy;
the second virtual machine and the first virtual machine are virtual machines created on the same client or different clients.
In an optional implementation manner of the embodiment of the present application, as shown in fig. 11, the charging control apparatus may further include: a change configuration unit 906 for: acquiring configuration change indication information sent by a client under the condition that the first virtual machine is in a first state; recording the configuration change indication information; and adjusting the first resource on which the first virtual machine depends at the server side to be a third resource based on the event that the first virtual machine enters the second state.
The charging control device applied to the server disclosed in the embodiments of the present application is relatively simple in description because it corresponds to the charging control method applied to the server disclosed in the respective embodiments above, and for the relevant similarities, please refer to the description of the charging control method applied to the server in the respective embodiments above, and details are not described here.
Corresponding to the above charging control method applied to the client, the embodiment of the present application further discloses a charging control device applied to the client, as shown in fig. 12, the charging control device includes:
a second obtaining unit 1201, configured to obtain a state of a first virtual machine created in the client;
a triggering unit 1202, configured to trigger first charging indication information based on an event that the first virtual machine enters a first state; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a sending unit 1203, configured to send the first charging indication information to a server at a server, so as to indicate the server to release a second resource at the server and stop charging for use of the second resource by the first virtual machine; wherein the released second resource is in a re-assignable state;
the second resource is a resource which is determined by the server from a first resource of the server side and is not needed to be used by the first virtual machine in the first state, wherein the first resource is depended on by the creation and the operation of the first virtual machine.
In an optional implementation manner of the embodiment of the present application, the triggering unit 1202 is specifically configured to:
Triggering the first charging indication information by the first virtual machine in the process of entering a first low-power consumption state or entering a second low-power consumption state;
the sending the first charging indication information to a server of a server includes:
the first virtual machine sends the first charging indication information to the server;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
In an optional implementation manner of the embodiment of the present application, the triggering unit 1202 may further be configured to: triggering second charging indication information by the first virtual machine in the process of entering the second state or after entering the second state;
the sending unit 1203 may be further configured to: sending the second charging indication information to the server to indicate the server to allocate the second resource to the first virtual machine from a server;
and in the second state, the first virtual machine runs a system process and a business process.
In an optional implementation manner of the embodiment of the present application, the sending unit 1203 may be further configured to:
sending configuration change indication information to the server when the first virtual machine is in the first state so as to indicate the server to record the configuration change indication information, and adjusting the first resource depended by the first virtual machine at the server side to be a third resource based on the event that the first virtual machine enters the second state.
The charging control device applied to the client disclosed in the embodiments of the present application is relatively simple in description because it corresponds to the charging control method applied to the client disclosed in the respective embodiments above, and for the relevant similarities, please refer to the description of the charging control method applied to the client in the respective embodiments above, and details are not described here.
In addition, an embodiment of the present application further provides a server, as shown in fig. 13, where the server at least includes:
a first memory 1301 for storing a first set of computer instructions;
the first set of computer instructions may specifically be implemented in the form of a computer program.
The first memory 1301 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.
A first processor 1302, configured to implement any of the charging control methods applied to the server as provided in the above embodiments by executing the instruction set stored in the first memory.
The first processor 1302 may be a Central Processing Unit (CPU), an application-specific integrated circuit (ASIC), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device.
Besides, the server may further include a communication interface, a communication bus, and the like. The first memory, the first processor and the communication interface are communicated with each other through a communication bus.
The communication interface is used for communication between the server and other devices (such as a device corresponding to the CDN root node). The communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like, and may be divided into an address bus, a data bus, a control bus, and the like.
In this embodiment, when executing the first computer instruction set stored in the first memory, the first processor in the server releases the relevant resource at the server according to the charging indication information triggered by the client based on the first state of the virtual machine, and stops the virtual machine from charging for the use of the resource. Because the power consumption of the virtual machine in the first state is lower than that in the second state, the release and the stop of the charging of the related resources of the service end are realized when the virtual machine of the client end is in the low power consumption state (such as shutdown and suspension), and the deletion of the virtual machine of the client end is not required, so that the client end can start the virtual machine for using the resources at any time through simple virtual machine state switching operation (switching to the high power consumption state), and the virtual machine does not need to be re-established, thereby flexibly meeting different requirements of the client end on the charging of the resources at different time, reducing the user cost, facilitating the user to start the virtual machine for using the resources at any time, and simultaneously avoiding the waste of resources of the service end.
An embodiment of the present application further discloses an electronic device, as shown in fig. 14, the electronic device at least includes:
a second memory 1401 for storing a second set of computer instructions;
the second set of computer instructions may also be embodied in the form of a computer program.
A second processor 1402, configured to implement any of the charging control methods applied to the client as disclosed in the above embodiments by executing the instruction set stored in the second memory.
Besides, the electronic device may further include a communication interface, a communication bus, and the like. The second memory, the second processor and the communication interface are communicated with each other through a communication bus.
The hardware structures of the second memory, the second processor, the communication bus and the communication interface in the electronic device are similar to the hardware structures of the first memory, the first processor, the communication bus and the communication interface in the server in the above embodiments, and related similar parts may refer to the description of the server embodiment, and are not described in detail here.
In addition, the embodiment of the present application also discloses a computer readable storage medium, in which a first computer instruction set is stored, and when being executed by a processor, the first computer instruction set implements any one of the charging control methods applied to a server, as provided in the above embodiments.
The embodiment of the application also discloses another computer-readable storage medium, wherein a second computer instruction set is stored in the another computer-readable storage medium, and when being executed by a processor, the second computer instruction set realizes any charging control method applied to the client as provided by the above embodiment.
When the instruction sets stored in the two computer-readable storage media run, the service-related resource release and the stop of charging can be realized when the client virtual machine is in a low-power consumption state (such as shutdown and suspension), without depending on deletion of the client virtual machine, so that the client can start the resource-using virtual machine at any time through simple virtual machine state switching operation (switching to a high-power consumption state) without re-creating the virtual machine, different requirements of the client on resource charging at different times can be flexibly met, the user cost is reduced, convenience is brought to the user to start the resource-using virtual machine at any time, and meanwhile, resource waste of the server is avoided.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
For convenience of description, the above system or apparatus is described as being divided into various modules or units by function, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that, herein, relational terms such as first, second, third, fourth, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (16)

1. A charging control method is applied to a server of a server side, and the method comprises the following steps:
acquiring first charging indication information of a client, wherein the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
determining a second resource which is not needed to be used by the first virtual machine in the first state from first resources of a server side on which the creation and the operation of the first virtual machine depend;
releasing the second resource of the server and controlling the second resource to be in a redistributable state;
and stopping the charging of the first virtual machine for the use of the second resource.
2. The method of claim 1, wherein the obtaining the first charging indication information of the client comprises:
Receiving first charging indication information triggered and sent by the first virtual machine in the process of entering a first low-power-consumption state or entering a second low-power-consumption state;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
3. The method of claim 2, wherein the first resources of the server on which the creation and operation of the first virtual machine depends comprise computing resources and storage resources;
in the first low power consumption state, the second resources that the first virtual machine does not need to use include all of the first resources that the first virtual machine relies on;
in the second low power consumption state, the second resource that the first virtual machine does not need to use includes a portion of the first resource that the first virtual machine relies on.
4. The method of claim 1, further comprising, after said ceasing the billing for the use of the second resource by the first virtual machine:
Acquiring second charging indication information of the client;
determining whether the first physical machine has sufficient of the second resource; the first physical machine is a host machine where the second resource is located before the second resource is released;
if yes, allocating the second resource from the first physical machine to the first virtual machine, and locking the second resource;
if the resource is determined not to be owned, allocating the second resource from a second physical machine to the first virtual machine, and locking the second resource;
charging for use of the second resource by the first virtual machine;
the second charging indication information is information triggered by an event that the client enters a second state based on the first virtual machine; and in the second state, the first virtual machine runs a system process and a business process.
5. The method of claim 1, further comprising, after releasing the second resource of the server:
allocating the released second resource to a second virtual machine based on a resource allocation policy;
the second virtual machine and the first virtual machine are virtual machines created on the same client or different clients.
6. The method of claim 1, further comprising:
acquiring configuration change indication information sent by a client under the condition that the first virtual machine is in a first state;
recording the configuration change indication information;
and adjusting the first resource on which the first virtual machine depends at the server side to be a third resource based on the event that the first virtual machine enters the second state.
7. A charging control method is applied to a client, and the method comprises the following steps:
acquiring the state of a first virtual machine established on the client;
triggering first charging indication information based on the event that the first virtual machine enters the first state; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
sending the first charging indication information to a server of a server to indicate the server to release a second resource of the server and stop charging for the first virtual machine to use the second resource; wherein the released second resource is in a re-assignable state;
the second resource is a resource which is determined by the server from a server-side first resource which is depended on by the creation and the operation of the first virtual machine and is not needed to be used by the first virtual machine in the first state.
8. The method of claim 7, wherein triggering the first charging indication information based on the event that the first virtual machine enters the first state comprises:
the first virtual machine triggers the first charging indication information in the process of entering a first low-power consumption state or entering a second low-power consumption state;
the sending the first charging indication information to a server of a server includes:
the first virtual machine sends the first charging indication information to the server;
wherein the first state comprises the first low power consumption state and the second low power consumption state;
in the first low power consumption state, the service process and the system process of the first virtual machine stop running; and in the second low power consumption state, the service process of the first virtual machine stops running and the system process keeps running.
9. The method of claim 8, further comprising, after sending the first charging indication information to a server of a server side:
the first virtual machine triggers second charging indication information in the process of entering the second state or after entering the second state;
sending the second charging indication information to the server to indicate the server to allocate the second resource to the first virtual machine from a server;
And in the second state, the first virtual machine runs a system process and a business process.
10. The method of claim 7, further comprising:
sending configuration change indication information to the server when the first virtual machine is in the first state so as to indicate the server to record the configuration change indication information, and adjusting the first resource depended by the first virtual machine at the server side to be a third resource based on the event that the first virtual machine enters the second state.
11. A charging control device is applied to a server of a server, and the method comprises the following steps:
the system comprises a first obtaining unit, a second obtaining unit and a processing unit, wherein the first obtaining unit is used for obtaining first charging indication information of a client, and the first charging indication information is information triggered by an event that the client enters a first state based on a first virtual machine on the client; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a determining unit, configured to determine, from first resources of a server on which creation and operation of the first virtual machine depend, second resources that are not needed to be used by the first virtual machine in the first state;
A releasing unit, configured to release the second resource of the server and control the second resource to be in a re-assignable state;
and the charging control unit is used for stopping the charging of the first virtual machine for the use of the second resource.
12. A charging control apparatus, applied to a client, the apparatus comprising:
a second obtaining unit, configured to obtain a state of a first virtual machine created in the client;
the triggering unit is used for triggering first charging indication information based on the event that the first virtual machine enters the first state; the power consumption of the first virtual machine in the first state is lower than the power consumption in the second state;
a sending unit, configured to send the first charging indication information to a server at a server, so as to indicate the server to release a second resource at the server and stop charging for the use of the second resource by the first virtual machine; wherein the released second resource is in a re-assignable state;
the second resource is a resource which is determined by the server from a first resource of the server side and is not needed to be used by the first virtual machine in the first state, wherein the first resource is depended on by the creation and the operation of the first virtual machine.
13. A server, comprising:
a first memory for storing a first set of computer instructions;
a first processor for implementing a charging control method as claimed in any one of claims 1 to 6 by executing a set of instructions stored on said first memory.
14. An electronic device, comprising:
a second memory for storing a second set of computer instructions;
a second processor for implementing the charging control method according to any one of claims 7 to 10 by executing a set of instructions stored on said second memory.
15. A computer-readable storage medium having stored therein a first set of computer instructions which, when executed by a processor, implement the charging control method of any of claims 1-6.
16. A computer-readable storage medium having stored therein a second set of computer instructions which, when executed by a processor, implement the charging control method of any of claims 7-10.
CN202010699620.4A 2020-07-20 2020-07-20 Charging control method, charging control device, electronic equipment, server and storage medium Active CN111861446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010699620.4A CN111861446B (en) 2020-07-20 2020-07-20 Charging control method, charging control device, electronic equipment, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010699620.4A CN111861446B (en) 2020-07-20 2020-07-20 Charging control method, charging control device, electronic equipment, server and storage medium

Publications (2)

Publication Number Publication Date
CN111861446A true CN111861446A (en) 2020-10-30
CN111861446B CN111861446B (en) 2024-09-20

Family

ID=73000688

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010699620.4A Active CN111861446B (en) 2020-07-20 2020-07-20 Charging control method, charging control device, electronic equipment, server and storage medium

Country Status (1)

Country Link
CN (1) CN111861446B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946433A (en) * 2012-11-22 2013-02-27 合肥华云通信技术有限公司 Large-scale computer resource monitoring and dispatching method under cloud public service platform
CN103095471A (en) * 2013-01-25 2013-05-08 浪潮电子信息产业股份有限公司 Charging method based on usage amount in cloud operating system (OS)
US20130219390A1 (en) * 2012-02-21 2013-08-22 Hon Hai Precision Industry Co., Ltd. Cloud server and method for creating virtual machines
CN103294552A (en) * 2012-02-22 2013-09-11 鸿富锦精密工业(深圳)有限公司 Method for increasing configuration quantity of virtual machines of server
CN104104521A (en) * 2014-08-08 2014-10-15 成都致云科技有限公司 Cloud computing service flexible billing method based on actual usage
JP2017215884A (en) * 2016-06-02 2017-12-07 日本電信電話株式会社 Virtual machine arrangement device and resource management method
CN109101315A (en) * 2018-07-04 2018-12-28 上海理工大学 Cloud data center resource allocation algorithm based on packet cluster frame
CN109412841A (en) * 2018-09-30 2019-03-01 北京金山云网络技术有限公司 Method of adjustment, device and the cloud platform of resources of virtual machine
CN109743183A (en) * 2019-01-07 2019-05-10 北京云基数技术有限公司 A kind of cloud charging method and system
CN110875888A (en) * 2018-08-30 2020-03-10 中国电信股份有限公司 Method and device for realizing on-demand processing of network resources and cloud management system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130219390A1 (en) * 2012-02-21 2013-08-22 Hon Hai Precision Industry Co., Ltd. Cloud server and method for creating virtual machines
CN103294552A (en) * 2012-02-22 2013-09-11 鸿富锦精密工业(深圳)有限公司 Method for increasing configuration quantity of virtual machines of server
CN102946433A (en) * 2012-11-22 2013-02-27 合肥华云通信技术有限公司 Large-scale computer resource monitoring and dispatching method under cloud public service platform
CN103095471A (en) * 2013-01-25 2013-05-08 浪潮电子信息产业股份有限公司 Charging method based on usage amount in cloud operating system (OS)
CN104104521A (en) * 2014-08-08 2014-10-15 成都致云科技有限公司 Cloud computing service flexible billing method based on actual usage
JP2017215884A (en) * 2016-06-02 2017-12-07 日本電信電話株式会社 Virtual machine arrangement device and resource management method
CN109101315A (en) * 2018-07-04 2018-12-28 上海理工大学 Cloud data center resource allocation algorithm based on packet cluster frame
CN110875888A (en) * 2018-08-30 2020-03-10 中国电信股份有限公司 Method and device for realizing on-demand processing of network resources and cloud management system
CN109412841A (en) * 2018-09-30 2019-03-01 北京金山云网络技术有限公司 Method of adjustment, device and the cloud platform of resources of virtual machine
CN109743183A (en) * 2019-01-07 2019-05-10 北京云基数技术有限公司 A kind of cloud charging method and system

Also Published As

Publication number Publication date
CN111861446B (en) 2024-09-20

Similar Documents

Publication Publication Date Title
US11553034B2 (en) Server computer management system for supporting highly available virtual desktops of multiple different tenants
JP5510556B2 (en) Method and system for managing virtual machine storage space and physical hosts
US20200081731A1 (en) Method, system and apparatus for creating virtual machine
US9588789B2 (en) Management apparatus and workload distribution management method
US8639816B2 (en) Distributed computing based on multiple nodes with determined capacity selectively joining resource groups having resource requirements
WO2021227999A1 (en) Cloud computing service system and method
US20150363238A1 (en) Resource management in a virtualized computing environment
JP2012058815A (en) Computer system and control method of computer system
US10379834B2 (en) Tenant allocation in multi-tenant software applications
US20240354149A1 (en) Rightsizing virtual machine deployments in a cloud computing environment
CN109800261B (en) Dynamic control method and device for double-database connection pool and related equipment
CN107786680B (en) Method and device for managing IP address resources
CN110647392A (en) Intelligent elastic expansion method based on container cluster
CN111338786A (en) Quota management method and device for cloud platform resources and computer equipment
CN111464589A (en) Intelligent contract processing method, computer equipment and storage medium
US20180150246A1 (en) Managing of Storage Resources
CN115617468A (en) Tenant resource management method and tenant management system
CN111274022A (en) Server resource allocation method and system
CN116010019A (en) Memory resource allocation method, related device and equipment
WO2024148864A1 (en) Virtual machine memory adjustment method and device, non-volatile readable storage medium, and electronic device
CN111861446A (en) Charging control method, charging control device, electronic equipment, server and storage medium
EP4300892A1 (en) Resource scheduling method and apparatus, computer device, system, and storage medium
CN110399216B (en) Method, system and device for distributing power consumption of whole machine box and readable storage medium
CN112398668B (en) IaaS cluster-based cloud platform and node switching method
CN110750464A (en) Computer node storage pooling method, device and system

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