CN113296931A - Resource control method, system, computing device and storage medium - Google Patents

Resource control method, system, computing device and storage medium Download PDF

Info

Publication number
CN113296931A
CN113296931A CN202010676632.5A CN202010676632A CN113296931A CN 113296931 A CN113296931 A CN 113296931A CN 202010676632 A CN202010676632 A CN 202010676632A CN 113296931 A CN113296931 A CN 113296931A
Authority
CN
China
Prior art keywords
deployed
equipment
devices
flow
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010676632.5A
Other languages
Chinese (zh)
Inventor
周礼
田六合
张美平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010676632.5A priority Critical patent/CN113296931A/en
Publication of CN113296931A publication Critical patent/CN113296931A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

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

Abstract

The embodiment of the application provides a resource control method, a resource control system, a computing device and a storage medium. In the embodiment of the application, the current flow corresponding to the deployed equipment is obtained; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and according to the required quantity, creating a corresponding quantity of equipment to be deployed for deployment. Therefore, when the traffic is burst, the device to be deployed can be automatically created to carry the burst traffic. Due to the fact that the equipment to be deployed is created in an automatic mode, compared with a manual mode, the method is quicker, and service instability caused by burst flow is reduced. Meanwhile, because the equipment to be deployed is automatically created, redundant equipment does not need to be preset in advance, so that the utilization rate of resources is improved, and excessive resources are not wasted.

Description

Resource control method, system, computing device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, a system, a computing device, and a storage medium for controlling resources.
Background
With the rapid development of the internet, compared with the traditional computing service, the cloud service has the advantages of low price, easy expansion, scalability, easy management, high availability and the like, and therefore, the cloud service occupies an increasingly critical position in the information internet era.
After entering the cloud-native era, the cloud Service provides a BaaS (back as a Service) Service, and pay users who use the services as needed do not care whether the Service capacity used by the pay users is sufficient, so that one BaaS Service may face a burst traffic at any time. According to the original operation and maintenance mode, if the capacity is manually expanded after the flow burst, the capacity may be insufficient, and the stability of the service is affected. Conversely, if the online machines are deployed too much, a large amount of resources are wasted.
Disclosure of Invention
Aspects of the present disclosure provide a method, system, computing device, and storage medium for controlling resources, which can automatically and quickly improve resource utilization.
An embodiment of the present application provides a method for controlling resources, including: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and creating a corresponding number of devices to be deployed according to the required number so as to perform deployment.
An embodiment of the present application further provides a method for controlling resources, including: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value; destroying the corresponding number of deployed devices from the deployed devices according to the required number.
An embodiment of the present application further provides a method for controlling resources, including: aiming at the same message equipment cluster, acquiring current flows corresponding to a plurality of deployed message equipment in the cluster; determining whether the current flow is greater than a flow threshold value, and determining the required number of message devices for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
An embodiment of the present application further provides a resource control system, including: a control device and a management device; the control device is used for acquiring the current flow corresponding to the deployed device; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; determining the corresponding number of the devices to be deployed according to the required number, and sending the corresponding number to the management device; the management device is configured to create the device to be deployed according to the corresponding number.
An embodiment of the present application further provides a computing device, including: a memory and a processor; the memory for storing a computer program; the processor to execute the computer program to: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and creating a corresponding number of devices to be deployed according to the required number so as to perform deployment.
An embodiment of the present application further provides a computing device, including: a memory and a processor; the memory for storing a computer program; the processor to execute the computer program to: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value; destroying the corresponding number of deployed devices from the deployed devices according to the required number.
An embodiment of the present application further provides a computing device, including: a memory and a processor; the memory for storing a computer program; the processor to execute the computer program to: aiming at the same message equipment cluster, acquiring current flows corresponding to a plurality of deployed message equipment in the cluster; determining whether the current flow is greater than a flow threshold value, and determining the required number of message devices for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
An embodiment of the present application further provides a resource management method, including: acquiring flow data corresponding to deployed equipment; determining whether the flow data meet preset conditions or not, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions; and deploying the equipment according to the determined number of the equipment to be processed.
An embodiment of the present application further provides a computing device, including: a memory and a processor; the memory for storing a computer program; the processor to execute the computer program to: acquiring flow data corresponding to deployed equipment; determining whether the flow data meet preset conditions or not, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions; and deploying the equipment according to the determined number of the equipment to be processed.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by one or more processors causes the one or more processors to implement the steps of the above-mentioned method.
In the embodiment of the application, the current flow corresponding to the deployed equipment is obtained; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and according to the required quantity, creating a corresponding quantity of equipment to be deployed for deployment. Therefore, when the traffic is burst, the device to be deployed can be automatically created to carry the burst traffic. Due to the fact that the equipment to be deployed is created in an automatic mode, compared with a manual mode, the method is quicker, and service instability caused by burst flow is reduced. Meanwhile, because the equipment to be deployed is automatically created, redundant equipment does not need to be preset in advance, so that the utilization rate of resources is improved, and excessive resources are not wasted.
In contrast, when the flow rate is reduced, the waste of resources can be reduced by destroying the excessive equipment.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1A is a schematic diagram of a resource control system according to an exemplary embodiment of the present application;
FIG. 1B is a schematic diagram of a resource control system according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart illustrating a resource control method according to an exemplary embodiment of the present application;
FIG. 3 is a schematic illustration of flow collection in yet another exemplary implementation of the present application;
FIG. 4 is a schematic illustration of creating a device to be deployed in accordance with yet another exemplary implementation of the present application;
fig. 5 is a schematic view of a device for destroying devices to be destroyed according to an exemplary embodiment of the present application;
FIG. 6 is a diagram illustrating a distributed file system corresponding to a deployed device according to an exemplary embodiment of the present application;
FIG. 7 is a schematic flow chart of another broker acquiring data according to an exemplary embodiment of the present application;
FIG. 8 is a flowchart illustrating a method for controlling resources according to an exemplary embodiment of the present application;
FIG. 9 is a flowchart illustrating a method for controlling resources according to an exemplary embodiment of the present application;
fig. 10 is a schematic structural diagram of a resource control determination apparatus according to another exemplary embodiment of the present application;
fig. 11 is a schematic structural diagram of a resource control apparatus according to another exemplary embodiment of the present application;
fig. 12 is a schematic structural diagram of a resource control apparatus according to another exemplary embodiment of the present application;
FIG. 13 is a schematic block diagram of a computing device provided in an exemplary embodiment of the present application;
FIG. 14 is a schematic block diagram of a computing device provided in an exemplary embodiment of the present application;
fig. 15 is a schematic structural diagram of a computing device according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The traditional distributed message queue is deployed according to cluster dimensions, a cluster can deploy multiple groups of brokers (middleware, also called message devices) due to disaster tolerance and capacity considerations, each group of brokers keeps a master node (master) and a standby (slave), the standby does not provide services at ordinary times and only performs data backup, and when the master crashes, the standby takes over the role of the master to provide services.
After entering the cloud-native era, a message queue is a typical BaaS service, and the facing scene changes. Pay-as-you-go users do not care whether the service capacity they use is sufficient any more, so a BaaS service may face a burst of traffic at any time. According to the traditional deployment and operation and maintenance means, the number of the on-line cluster is generally controlled within 50% from the perspective of resource utilization rate and disaster tolerance. If sudden increase of user service occurs, the flow of the cluster is greatly increased, and when the capacity needs to be expanded by 2 times, 3 times or more, according to the traditional scheme, manual application of a machine, application deployment, configuration file deployment, system parameter modification and the like are needed, and finally the application is operated in batches, so that the on-line cluster is possibly crushed before the capacity expansion is completed. Also if too many resources are deployed, there is a significant waste of resources. In particular, the peak and trough of the traffic of the users are very different, and in order to support the peak traffic of the users, a plurality of machines need to be deployed, but when the peak traffic of the users arrives, a great deal of resource waste occurs.
Therefore, the embodiment of the application provides a method which can efficiently and quickly utilize resources.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1A is a schematic structural diagram of a resource control system according to an exemplary embodiment of the present application. As shown in fig. 1A, the system 100A may include: the first device may also be referred to as a control device 101 and the second device may also be referred to as a management device 102.
Here, the first device, i.e., the control device 101, may be a device that can provide a computing processing service in a network virtual environment, and may be a device that performs resource control using a network. The function of sending data to the second device can be realized, and response data can be acquired from the second device. In physical implementation, the control device 101 may be any device capable of providing computing services, responding to service requests, and returning data processing results, and may be, for example, a cloud server, a cloud host, a virtual center, a conventional server, and the like. The control device 101 mainly includes a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture.
The second device, i.e., the management device 102, refers to a device that can provide computing processing services in a network virtual environment, and device creation can be performed using a network. The data sent by the first device can be received, and the response data of the first device is returned. In physical implementation, the management device 102 may be any device capable of providing computing services, responding to service requests, and returning data processing results, and may be, for example, a cloud server, a cloud host, a virtual center, a conventional server, and the like. The management device 102 mainly includes a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture.
In this embodiment of the present application, the control device 101 is configured to obtain a current flow corresponding to the deployed device 106; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; determining the corresponding number of the devices 107 to be deployed according to the required number, and sending the corresponding number to the management device 102; the management device 102 is configured to create the device to be deployed 107 according to the corresponding number.
The system 100A may further include: the device 103 is scheduled. Here, the architecture of the scheduling device 103 is similar to that of the control device 101, and is not described here again. The scheduling device 103 is configured to receive registration information sent by the device to be deployed 107 after the management device 102 creates the device to be deployed 107, and register the device to be deployed 107; sending registration information to the writing device 104, so that the writing device 104 writes data into the created to-be-deployed device 107 according to the registration information; the registration information is sent to the reading device 105, so that the reading device 105 reads data from the created to-be-deployed device 107 according to the registration information.
It should be noted that, for the system 100A, a deployed device 106 may also be included, and the deployed device may exist in a cluster form, such as the deployed device cluster 1061. Likewise, the scheduling device 103 may also exist in the form of a cluster, such as scheduling device cluster 1031, and also the writing device 104 may also exist in the form of a cluster, such as writing device cluster 1041, and the reading device 105 may also exist in the form of a cluster, such as reading device cluster 1051. In addition, the control apparatus 101 may exist in a multi-node form, prevent any node from having a problem, and may continue control through other nodes.
Further, the control system 100A may be changed to the control system 100B shown in fig. 1B when the current flow rate is smaller than the flow rate threshold value. In this control system 100B, the devices in the control system 100A are also included, but the specific processing procedure is as follows:
the control device 101 is configured to determine, when the current traffic is smaller than a traffic threshold, a required number of devices for carrying traffic according to the current traffic; the corresponding number of deployed devices 106 are destroyed from the deployed devices 106 according to the required number.
The control device 101 selects a corresponding number of devices to be destroyed 108 from the deployed devices 106, and sends destruction information to the devices to be destroyed 108, so that the devices to be destroyed 108 send destruction information to the scheduling device 103 after receiving the destruction information.
It should be noted that, no matter whether the device to be destroyed 107 is selected from the deployed devices 106, the device to be destroyed originally belongs to the deployed devices 106, and the deployed devices 106 may include the created device to be deployed 107.
In addition, the control system 100B may further include: a file storage device; a file storage device for storing data of the deployed devices 106; the control device 101 is configured to send destruction information to the device to be destroyed 108, and receive a data storage location sent by the deployed device 106, where the data storage location is a storage location in the file storage platform; determining the identity of the deployed device 106 according to the data storage location, and determining whether the deployed device 106 is a device to be destroyed 108 according to the identity; if so, the data storage location is sent to other deployed devices 106, so that the other deployed devices 106 acquire corresponding data according to the data storage location.
In an application scenario of the embodiment of the present application, the control device 101, such as a controller, may monitor traffic of the deployed device 106, such as a message device, in a timed manner or in real time. When the controller receives the current flow of each message device and the current total flow is greater than the flow threshold, the number of the required message devices is determined according to the current total flow, and the number of the message devices to be deployed which need to be created is determined according to the number. The controller sends the required number to the management device 102, such as a device management platform, to create a corresponding number of message devices. The message device may be created by a container device. The created message device sends registration information to the scheduling device 103 for registration. After the scheduling device 103 finishes registering the created message device, it waits for the writing device 104, such as a message producer device, to obtain the registration information, and writes the message into the created message device according to the registration information. Meanwhile, the reading device 105, such as a message consumer device, may also obtain the registration information from the scheduling device 103, and read the message to the created message device according to the registration information.
In addition, when the controller monitors that the current total flow is smaller than the flow threshold, the number of the required message devices is determined according to the current total flow, and the number of the message devices to be destroyed is determined according to the number. The controller selects a corresponding number of message devices to be destroyed from the deployed devices 106, and sends the destruction information to the message devices to be destroyed. After receiving the information, the message device to be destroyed may send destruction information to the scheduling device 103, and after receiving the destruction information, the scheduling device 103 regards that the message device to be destroyed is unavailable, and then the scheduling device 103 may send the destruction information to the write device 104 and the read device 105, so that the write device 104 does not write a message from the message device to be destroyed. The reading device 105 no longer reads messages from the message device to be destroyed. In addition, after receiving the destruction information, the message device to be destroyed sends the storage location of the data to the controller. The controller assigns the storage location to other message devices and retrieves the corresponding data from the storage location by the other message devices, so that the reading device 105 reads the data from the other message devices. And after other message equipment successfully acquires the data, returning a message indicating that the data is successfully acquired to the controller, returning the message indicating that the data is successfully acquired to the message equipment to be destroyed by the controller, and destroying the message equipment to be destroyed.
It should also be noted that writing and reading can be performed by corresponding instant messaging for the writing device 104 and the reading device 105. Or a write and read of a push message.
In the present embodiment, the devices may all perform network connection, and the network connection may be wireless connection. If the above devices are in communication connection, the network format of the mobile network may be any one of 2G (gsm), 2.5G (gprs), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G + (LTE +), WiMax, 5G, and the like.
The following describes the control process of resources in detail with reference to the method embodiment.
Fig. 2 is a flowchart illustrating a resource control method according to an exemplary embodiment of the present application. The method 200 provided by the embodiment of the present application is performed by a control device, such as a controller, which may be disposed in a cloud server. The method 200 comprises the steps of:
201: and acquiring the current flow corresponding to the deployed equipment.
202: and determining whether the current flow is greater than a flow threshold value, and determining the required number of the equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value.
203: and according to the required quantity, creating a corresponding quantity of equipment to be deployed for deployment.
The following is detailed for the above steps:
201: and acquiring the current flow corresponding to the deployed equipment.
The deployed device may refer to a device deployed for providing a service, such as a message device spoke, which may be deployed in units of a cluster. The brokers in each cluster are identical. Each spoke may have a queue therein for storing message data.
The current traffic is a condition that characterizes the current access volume of the device and can be measured in terms of tps (Transactions Per Second). I.e. to determine tps on the order of the current second. By tps is meant the process of sending a request to a server by a client, and the server then reacting. The client starts timing when sending the request, and finishes timing after receiving the response of the server, so as to calculate the used time and the number of completed transactions. In the embodiment of the application, the client can send to the browser. The broker may be in a container disposed on the cloud server. That is, the cluster may be configured by a plurality of containers provided on the same cloud server.
The method for obtaining the current traffic corresponding to the deployed device may include: and receiving the current flow of each deployed device, determining the current total flow of the deployed devices, and acquiring the current total flow as the current flow corresponding to the deployed devices.
For example, the controller may directly perform a second tps acquisition on the brooker in the cluster, as described above. The seconds tps for each spoke in the cluster is collected. And determines the total traffic for that cluster, i.e., the total seconds tps.
It should be noted that, in addition to direct acquisition by the controller, acquisition may be performed by other devices on the cloud server. Therein, fig. 3 shows a second level tps acquisition for brooker. In fig. 3, an acquisition module, a second-level tps acquisition module, which may also be referred to as a second-level tps acquisition 302, is provided for acquiring the second-level tps of each brooker 303 in the cluster. The module aggregates the collected seconds tps and then sends it to the controller 301.
It should be noted that, under the condition that resources of the same cloud server are sufficient, a plurality of different broker clusters can be set. And the controller or the acquisition module can be responsible for carrying out traffic acquisition on the different clusters, and meanwhile, traffic statistics can be carried out by taking the clusters as units.
Further, for a cluster on a cloud server to receive traffic for a client, the client may be a producer message producer client, which may also be referred to as a message producer device. It can write a message to the spoke cluster. After receiving the write-in message, the cloud server may perform load balancing on the corresponding traffic, and then write the traffic into the corresponding spoke, so that the traffic borne by each spoke in the same cluster is balanced.
202: and determining whether the current flow is greater than a flow threshold value, and determining the required number of the equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value.
For example, according to the foregoing, after the controller receives or directly acquires the total traffic of the cluster, the controller compares the total traffic with a traffic threshold to determine whether the total traffic is greater than the traffic threshold, and when the total traffic is greater than the traffic threshold, it indicates that the current traffic is bursty, and if the cluster load is greater, new equipment needs to be deployed. The controller may obtain the number of brookers that should be available for a cluster, for example, 50, by dividing the total flow by the threshold of flow that a brooker can tolerate. It should be understood that the flow threshold that each brooker can withstand is the same.
It should be noted that the controller may further determine, according to the comparison result, an excess flow rate at which the current total flow rate exceeds the flow rate threshold, and divide the excess flow rate by a flow rate threshold that can be borne by a brooker to obtain how many devices, such as 20 devices, are needed.
203: and according to the required quantity, creating a corresponding quantity of equipment to be deployed for deployment.
Wherein, according to the required quantity, creating a corresponding quantity of devices to be deployed, including: determining the number of the devices to be deployed according to the required number and the number of the deployed devices; and creating a corresponding number of devices to be deployed according to the number of the devices to be deployed.
The device to be deployed refers to a newly added device in the corresponding cluster, such as a newly added broker in the cluster.
For example, as described above, the controller determines that 50 brookers are needed for the current total flow, and if 30 brookers are deployed in the cluster, 20 brookers are to be deployed again. The controller may directly create 20 container devices as new brookers in the cluster. And the applications deployed in the 20 container devices are the same as the applications in the brooker in the cluster.
Or according to the foregoing, it is directly determined that 20 brokers need to be deployed, so that the controller can directly create the new broker.
In addition, besides the controller directly creating the device to be deployed, other devices can also create:
specifically, creating a corresponding number of devices to be deployed according to the number of the devices to be deployed includes: and establishing a corresponding number of devices to be deployed through a preset device management platform.
The preset device management platform may be a management device arranged on the cloud server, such as kubernets (may be abbreviated as K8S), and is configured to manage a container on the cloud server, or may be arranged on the cloud server.
For example, as described above, after determining that 20 brokers need to be added, the controller sends an automatic expansion request to kubernets, where the request represents that a device to be deployed is created and carries the number 20 of devices to be deployed. After receiving the request, Kubernets adds new containers according to the number, and configures the broker application for each new container.
In which figure 4 shows a diagram of the newly added containers. When the controller 301 monitors that the capacity is insufficient, that is, the volume is suddenly decreased, an automatic volume expansion request is initiated to K8S, and K8S is set in the cloud-native-based resource management and control platform 401. The K8S, upon receiving the request, creates a new brooker 402 for the cluster.
It should be noted that, in addition to K8S, other devices that can implement the function of K8S may create the new brooker 402. Therefore, other devices capable of realizing K8S are within the scope of the embodiments of the present application.
In addition, according to the embodiment of the application, the scaling logic can be realized through corresponding application arrangement in K8S, and manual scaling can be converted into automatic scaling. As long as the physical host of the cloud server is ensured to have enough hardware resources, the K8S can complete the creation of the container within several tens of seconds, and a newly added container can also ensure that the quick start can be completed within seconds, and then the service can be provided to the outside through quick registration and service discovery. The specific implementation of registration and service discovery is as follows:
specifically, the method 200 further includes: after the equipment to be deployed is created, receiving registration information of the equipment to be deployed through an equipment scheduling platform so as to register the equipment to be deployed; the method comprises the steps that a device scheduling platform is used for enabling a writing device to obtain registration information so as to write data; and enabling the reading equipment to acquire the registration information through an equipment scheduling platform so as to read data.
The scheduling platform, which may also be referred to as a service discovery component, refers to a device for registering a device to be deployed and making a client (which may also be referred to as a client) aware of the device to write and read data. The scheduling platform can be a Name Server (Name Server) and is used for recording and maintaining information of the browser, monitoring the running state of the browser and providing routing capability for the client.
A writing device is a device, i.e. a client, for writing data into a deployed device. Which in the present embodiment may be a producer message producer client.
A reading device is a device, i.e. a client, for reading data into a deployed device. Which in embodiments of the present application may be a consumer client of a consumer message.
The registration information refers to information for introducing and searching a deployed device or a created device to be deployed, and the information may include an identifier of the device, such as an ID, description information of the device, information about what the device is used to store, a cluster to which the device belongs, a network address of the device, and the like.
For example, as described above, as shown in fig. 4, after the new broker402 is created, a registration request is automatically sent to the Name Server, i.e., the service discovery component 403, where the registration request carries registration information. The Name Server thus stores the corresponding registration information. The producer message producer client can regularly acquire the registration information of the available broker from the Name Server and write the message data into the corresponding broker according to the registration information. Thereby enabling the new spoke 402 to be used to solve the bursty traffic problem.
Similarly, the consumer client of the consumer message may also periodically obtain the registration information of the available broker from the Name Server, and read the message data from the corresponding broker according to the registration information. Thereby enabling the new spoke 402 to be used to solve the bursty traffic problem.
As shown in fig. 4, the client 404 is only illustrated by a producer message producer client. After the client 404 regularly acquires the registration information of the new brooker 402 from the service discovery component 403, the client can sense the new brooker 402, and after sensing the new brooker 402, the client starts to write data to the new brooker 402.
In addition, the method 200 further comprises: aiming at the equipment of the same cluster, executing the step of acquiring the current flow corresponding to the deployed equipment; wherein the created device to be deployed is the same as the deployed device. Since the foregoing has been set forth, further description is omitted herein.
Similarly, when the controller finds that resources on the cloud server are excessive, that is, the flow is reduced, an offline brooker operation is initiated, at this time, the flow needs to be quickly switched to other non-offline machines, and after the write-in flow drops to 0, the offline brooker to be offline (that is, the device to be destroyed) is destroyed. The specific implementation mode is as follows:
specifically, the method 200 further includes: when the current flow is smaller than the flow threshold, determining the required number of equipment for bearing the flow according to the current flow; destroying a corresponding number of deployed devices from the deployed devices according to the required number.
For example, as described above, the controller determines the desired number, e.g., 20, in a manner described above when it determines that the current total flow is less than the flow threshold. If there are 30 brokers deployed, 10 brokers need to be destroyed.
Wherein destroying a corresponding number of deployed devices from the deployed devices according to the required number comprises: selecting equipment to be destroyed from the deployed equipment according to the required quantity; and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
The method for selecting the devices to be destroyed may be to randomly select the corresponding number of devices to be destroyed, select the corresponding number of devices to be destroyed with the minimum bearing flow, or select the corresponding number of devices to be destroyed with the minimum stored message data.
For example, according to the foregoing, the controller may first obtain registration information of deployed brokers in a corresponding cluster from the Name Server, and randomly select a corresponding number of brokers according to IDs of the deployed brokers. And sending a destroy request to the K8S, wherein the destroy request can carry the ID of the corresponding breaker and the cluster to which the ID belongs, so that the K8S sends destroy information to the corresponding breaker, and after the corresponding breaker receives the destroy information, the corresponding breaker operates the destroy code to destroy the code.
Fig. 5 shows a diagram of the offline brooker, in fig. 5, when the controller 301 monitors that the capacity is excessive, that is, the resources are excessive, the offline operation is initiated through K8S, for example, a destroy request is sent to K8S in the cloud-based native resource management and control platform 401, where the destroy request may carry an ID of the device to be destroyed, a cluster to which the device belongs, and the like. The K8S sends the destruction information to the corresponding broker, so that the offline broker501 (i.e. the device to be destroyed, which may also be referred to as a broker to be destroyed) runs the destruction code to destroy itself.
Except for destroying the device to be destroyed, the device for writing data into or reading data from the device to be destroyed needs to know, so that the flow transfer is realized. The specific implementation mode is as follows:
specifically, the method 200 further includes: after the device to be destroyed receives the destruction information, the device scheduling platform receives the destruction information sent by the device to be destroyed so as to send the destruction information to the write-in device, and therefore the write-in device writes data according to the registration information of other deployed devices; and sending the destruction information to the reading equipment through the equipment scheduling platform, so that the reading equipment reads data according to the registration information of other deployed equipment.
For example, as described above, as shown in fig. 5, after the offline browser 501 receives the destruction information, it may send the destruction information to the service discovery component 401, i.e., the Name Server. Therefore, the Name Server sends the destruction information to the corresponding producer message producer client, namely the client 404, and the information can carry the ID of the offline brooker 501, the cluster to which the client belongs, and the like, so that the client 404 does not write message data into the offline brooker 501 any more, namely the client 404 senses that the brooker is offline and starts to write the data into other brookers.
Similarly, for the concurer message consumer client, the Name Server may also send the destruction information to the corresponding concurer message consumer client, where the destruction information may carry the ID of the offline broker501, the cluster to which the information belongs, and so on, so that the concurer message consumer client no longer reads message data from the offline broker501,
however, for some scenarios, especially for a broker scenario, when an offline broker operation is to be performed, and after traffic is cut away, if data that a user has not consumed completely still exists on the offline broker, the offline broker is forced to be offline, which may result in loss of the data, and cause a huge loss to the user.
Specifically, the method 200 further includes: and storing the data in the deployed equipment through the file storage platform.
The file storage platform refers to a device for storing data, and the device and the broker do not belong to the same device. May be a distributed file storage system.
Fig. 6 shows a forwarding diagram of the storage method, in fig. 6, the original broker is cached in 24C (memory model) 128G (gigabyte) memory, and is stored in hard by 1T (terabyte) SSD (Solid State Disk). In the embodiment of the application, the hard storage of the broker is set as a distributed file system. Namely, the deployed broker performs data hard storage to the distributed file system.
Therefore, the embodiment of the application realizes the separation of the storage and the calculation of the brokers, the distributed file system is introduced, the files originally responsible for writing of each broker are stored on the remote distributed file system, when the capacity reduction operation (namely the offline broker operation) is executed, the flow is cut away, the offline operation of the brokers can be directly executed, and the storage files corresponding to the offline brokers have other still-alive brokers to be responsible for reloading.
Specifically, the method 200 further includes: sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform; determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
The data storage location refers to a storage location of data written into the deployed device, such as a storage location of a message in a spoke, and may refer to a partition of a database in the distributed file system.
Wherein sending the data storage path to other deployed devices comprises: and acquiring the equipment information of the living deployed equipment, selecting one living deployed equipment, and sending the data storage path to the selected deployed equipment according to the equipment information of the selected deployed equipment.
The method for acquiring the device information of the living deployed devices may include: acquiring from a Name Server by sending an acquisition request; it may also be obtained from K8S by sending an acquisition request. The device information may include a device ID, the device cluster, and the like.
After the controller acquires the device information, a surviving broker is selected from the device information, and the data storage path partition is sent to the selected broker.
It should be noted that, when the controller receives a destroy request, it may select a surviving broker from a plurality of surviving brokers.
Fig. 7 shows a flow chart of other brokers to obtain data. For example, according to the foregoing, after receiving the destruction information, the device to be destroyed, such as a broker to be destroyed, executes step 701: and sending a destroy request to the controller node. May be performed by a node: the controller 1 receives, either the controller 2 or the controller 3. It should be understood that when one of the control nodes fails to use due to an error, the other control node can be quickly switched to, so that the operations performed by each control node are the same, and the stored data are the same. The destroy request may carry a data storage location partition. The controller may query a database in the distributed storage system, determine the ID of the broker corresponding to the data storage location partition, and determine whether the broker is a broker to be destroyed, if so, the controller 1 executes step 702: the data storage location partition is sent to the selected broker, i.e. the deployed device. Otherwise it may not be performed. Meanwhile, the controller 1 updates the allocation result (e.g., the broker process acquisition process with ID "01") to the database, that is, executes step 703: and modifying the state of the database into processing, wherein a broker reloads the data storage position partition. After receiving the data storage position partition, the selected spoke reloads the message data to its own memory according to the data storage position partition, and then step 704 is executed: data is acquired. After the data is acquired, step 705 is executed: a message indicating successful acquisition of the data is sent to the controller 1. After receiving the message, the controller 1 modifies the state of the database, and executes step 706: and the state of the database is successfully modified, namely the selected broker successfully acquires the message data. Meanwhile, the database may also record which broker has obtained the data storage location partition.
It should be further noted that after the selected broker acquires the data, it is also necessary to send description information of the broker itself to the Name Server to inform the Name Server of which data is currently stored in the selected broker, so that the Name Server informs the description information to the consumer client of the consumer message, and at the same time, the registration information of the broker is also informed to the consumer client of the consumer message, so that the consumer client of the consumer message acquires the corresponding message data according to the registration information.
In addition, the method 200 further comprises: receiving messages sent by other deployed equipment, wherein the messages indicate that data is acquired successfully; and modifying the database state corresponding to the data storage position to ensure that the other deployed equipment successfully acquires the data.
Since the foregoing has been set forth, further description is omitted herein.
In addition, the method 200 further comprises: and sending a message of successfully acquiring the data to the device to be destroyed so as to destroy the device to be destroyed.
For example, as described above, as shown in fig. 7, after receiving the message indicating that the data acquisition is successful, the controller 1 further responds to the destroy request, and executes step 707: and sending the message indicating that the data is successfully acquired to the broker to be destroyed (namely the device to be destroyed). And after receiving the message, the broker to be destroyed destroys the broker per se according to the code.
In addition to the foregoing broker scenario, the embodiments of the present application are also applicable to other scenarios in a container built on a cloud server. Other virtual devices on the cloud server, such as virtual machines, may also be used.
Based on the similar inventive concept, fig. 8 shows a flowchart of a resource control method according to another exemplary embodiment of the present application. The method 800 provided by the embodiment of the present application is performed by a control device, such as a controller, which may be disposed in a cloud server. The method 800 includes the steps of:
801: and acquiring the current flow corresponding to the deployed equipment.
802: and determining whether the current flow is greater than a flow threshold value, and determining the required number of the equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value.
803: destroying a corresponding number of deployed devices from the deployed devices according to the required number.
Since the detailed description of the steps 801-803 has been given above, the detailed description is omitted here.
Wherein destroying a corresponding number of deployed devices from the deployed devices according to the required number comprises: selecting equipment to be destroyed from the deployed equipment according to the required quantity; and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
In addition, the method 800 further includes: sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform; determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
Since the foregoing has described in detail the above embodiments, further description is omitted.
In addition, the method 800 may refer to the steps of the method 200, which are not described in detail.
Based on the similar inventive concept, fig. 9 shows a flowchart of a resource control method according to another exemplary embodiment of the present application. The method 900 provided by the embodiment of the present application is executed by a control device, such as a controller, which may be disposed in a cloud server. The method 900 includes the steps of:
901: and aiming at the same message equipment cluster, acquiring current flow corresponding to a plurality of deployed message equipment in the cluster.
902: and determining whether the current flow is greater than a flow threshold value, and determining the required number of the message devices for bearing the flow according to the current flow when the current flow is greater than the flow threshold value.
903: and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
Since the detailed description of the specific implementation of steps 901-903 has been described above, it is not repeated here.
Wherein the deployed message device is created by the container device.
Since the foregoing has described in detail the above embodiments, further description is omitted.
In addition, reference may also be made to the above-mentioned steps of the method 200 for details of the method 900 that are not described in detail.
Fig. 10 is a schematic structural framework diagram of a resource control device according to an exemplary embodiment of the present application. The apparatus 1000 may be applied to a control device, such as a controller, which may be disposed in a cloud server. The apparatus 1000 comprises: an acquisition module 1001, a determination module 1002, and a creation module 1003; the following detailed description is directed to the functions of the various modules:
an obtaining module 1001 is configured to obtain a current flow corresponding to a deployed device.
The determining module 1002 is configured to determine whether the current traffic is greater than a traffic threshold, and when the current traffic is greater than the traffic threshold, determine the required number of devices for carrying the traffic according to the current traffic.
A creating module 1003, configured to create, according to the required number, a corresponding number of devices to be deployed for deployment.
The obtaining module 1001 is specifically configured to: and receiving the current flow of each deployed device, determining the current total flow of the deployed devices, and acquiring the current total flow as the current flow corresponding to the deployed devices.
The creating module 1003 includes: the determining unit is used for determining the number of the equipment to be deployed according to the required number and the number of the deployed equipment; and the creating unit is used for creating the corresponding number of the devices to be deployed according to the number of the devices to be deployed.
The creating module 1003 is specifically configured to: and establishing a corresponding number of devices to be deployed through a preset device management platform.
Furthermore, the determining module 1002 is further configured to: when the current flow is smaller than the flow threshold, determining the required number of equipment for bearing the flow according to the current flow; the apparatus 1000 further comprises: and the destruction module is used for destroying the corresponding number of the deployed equipment from the deployed equipment according to the required number.
In addition, the obtaining module 1001 is further configured to execute, for the devices in the same cluster, a step of obtaining a current traffic corresponding to the deployed device; wherein the created device to be deployed is the same as the deployed device.
In addition, the apparatus 1000 further comprises: the device scheduling platform is used for establishing a device to be deployed, and registering the device to be deployed; the method comprises the steps that a device scheduling platform is used for enabling a writing device to obtain registration information so as to write data; and the reading equipment acquires the registration information through the equipment scheduling platform so as to read the data.
Wherein, destroy the module, specifically be used for: selecting equipment to be destroyed from the deployed equipment according to the required quantity; and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
In addition, the receiving module is further configured to: after the device to be destroyed receives the destruction information, the device scheduling platform receives the destruction information sent by the device to be destroyed, so that the destruction information is sent to the write-in device, and the write-in device writes data according to the registration information of other deployed devices; and sending the destruction information to the reading equipment through the equipment scheduling platform, so that the reading equipment reads data according to the registration information of other deployed equipment.
In addition, the apparatus 1000 further comprises: and the storage module is used for storing the data in the deployed equipment through the file storage platform.
In addition, the apparatus 1000 further comprises: the device comprises a sending module, a data storage module and a data storage module, wherein the sending module is used for sending destruction information to the device to be destroyed through a preset device management platform and receiving a data storage position sent by deployed devices, and the data storage position refers to a storage position in a file storage platform; the determining module 1002 is further configured to: determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; if so, the sending module is used for sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
The sending module is specifically configured to: and acquiring the equipment information of the living deployed equipment, selecting one living deployed equipment, and sending the data storage path to the selected deployed equipment according to the equipment information of the selected deployed equipment.
In addition, the receiving module is further configured to: receiving messages sent by other deployed equipment, wherein the messages indicate that data is acquired successfully; the apparatus 1000 further comprises: and the modification module is used for modifying the state of the database corresponding to the data storage position to enable the other deployed equipment to successfully acquire data.
In addition, the sending module is further configured to: and sending a message of successfully acquiring the data to the device to be destroyed so as to destroy the device to be destroyed.
Wherein the device to be deployed is created by the container device.
Fig. 11 is a schematic structural framework diagram illustrating a control apparatus for resources according to another exemplary embodiment of the present application. The apparatus 1100 may be applied to a control device, such as a controller, which may be provided in a cloud server. The apparatus 1100 comprises: the acquisition module 1101, the determination module 1102 and the destruction module 1103 are described in detail below with respect to the functions of the respective modules:
an obtaining module 1101 is configured to obtain a current flow corresponding to a deployed device.
A determining module 1102, configured to determine whether the current traffic is greater than a traffic threshold, and when the current traffic is less than the traffic threshold, determine, according to the current traffic, a required number of devices for carrying the traffic.
A destroying module 1103, configured to destroy, according to the required number, the corresponding number of deployed devices from the deployed devices.
Wherein, destroy module 1103, include: the selecting unit is used for selecting the equipment to be destroyed from the deployed equipment according to the required quantity; and the sending unit is used for sending destruction information to the device to be destroyed through the preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
In addition, the apparatus 1104 further comprises: the device comprises a sending module, a data storage module and a data storage module, wherein the sending module is used for sending destruction information to the device to be destroyed through a preset device management platform and receiving a data storage position sent by deployed devices, and the data storage position refers to a storage position in a file storage platform; the determining module 1102 is further configured to: determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; if so, the sending module is used for sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
For parts of the content that cannot be mentioned by the apparatus 1100, reference may be made to the content of the apparatus 1000 described above.
Fig. 12 is a schematic structural framework diagram illustrating a control apparatus for resources according to another exemplary embodiment of the present application. The apparatus 1200 may be applied to a control device, such as a controller, which may be disposed in a cloud server. The apparatus 1200 includes: the obtaining module 1201, the determining module 1202, and the creating module 1203 are described in detail below with respect to functions of the respective modules:
an obtaining module 1201, configured to obtain, for a same message device cluster, current traffic corresponding to multiple deployed message devices in the cluster.
A determining module 1202, configured to determine whether the current traffic is greater than a traffic threshold, and when the current traffic is greater than the traffic threshold, determine, according to the current traffic, a required number of message devices for carrying the traffic.
A creating module 1203, configured to create, according to the required number, a corresponding number of message devices to be deployed for deployment.
Wherein the deployed message device is created by the container device.
For some contents that cannot be mentioned in the apparatus 1200, the contents of the apparatus 1000 described above may be referred to.
Having described the internal functionality and structure of the apparatus 1000 shown in FIG. 10, in one possible design, the structure of the apparatus 1000 shown in FIG. 10 may be implemented as a computing device, such as a server. As shown in fig. 13, the apparatus 1300 may include: a memory 1301 and a processor 1302;
a memory 1301 for storing a computer program.
A processor 1302 for executing a computer program for: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and according to the required quantity, creating a corresponding quantity of equipment to be deployed for deployment.
Specifically, the processor 1302 is specifically configured to: and receiving the current flow of each deployed device, determining the current total flow of the deployed devices, and acquiring the current total flow as the current flow corresponding to the deployed devices.
Specifically, the processor 1302 is specifically configured to: determining the number of the devices to be deployed according to the required number and the number of the deployed devices; and creating a corresponding number of devices to be deployed according to the number of the devices to be deployed.
Specifically, the processor 1302 is specifically configured to: and establishing a corresponding number of devices to be deployed through a preset device management platform.
Further, processor 1302 is further configured to: when the current flow is smaller than the flow threshold, determining the required number of equipment for bearing the flow according to the current flow; the apparatus 1000 further comprises: and the destruction module is used for destroying the corresponding number of the deployed equipment from the deployed equipment according to the required number.
Further, processor 1302 is further configured to: aiming at the equipment of the same cluster, executing the step of acquiring the current flow corresponding to the deployed equipment; wherein the created device to be deployed is the same as the deployed device.
Further, processor 1302 is further configured to: after the equipment to be deployed is created, receiving registration information of the equipment to be deployed through an equipment scheduling platform so as to register the equipment to be deployed; the method comprises the steps that a device scheduling platform is used for enabling a writing device to obtain registration information so as to write data; and the reading equipment acquires the registration information through the equipment scheduling platform so as to read the data.
Specifically, the processor 1302 is specifically configured to: selecting equipment to be destroyed from the deployed equipment according to the required quantity; and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
Further, processor 1302 is further configured to: after the device to be destroyed receives the destruction information, the device scheduling platform receives the destruction information sent by the device to be destroyed, so that the destruction information is sent to the write-in device, and the write-in device writes data according to the registration information of other deployed devices; and sending the destruction information to the reading equipment through the equipment scheduling platform, so that the reading equipment reads data according to the registration information of other deployed equipment.
Further, processor 1302 is further configured to: and storing the data in the deployed equipment through the file storage platform.
Further, processor 1302 is further configured to: sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform; determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
The processor 1302 is specifically configured to: and acquiring the equipment information of the living deployed equipment, selecting one living deployed equipment, and sending the data storage path to the selected deployed equipment according to the equipment information of the selected deployed equipment.
Further, processor 1302 is further configured to: receiving messages sent by other deployed equipment, wherein the messages indicate that data is acquired successfully; and modifying the database state corresponding to the data storage position to ensure that the other deployed equipment successfully acquires the data.
Further, processor 1302 is further configured to: and sending a message of successfully acquiring the data to the device to be destroyed so as to destroy the device to be destroyed.
Wherein the device to be deployed is created by the container device.
In addition, embodiments of the present invention provide a computer storage medium, and when executed by one or more processors, cause the one or more processors to implement the steps of a method for controlling resources in the method embodiment of fig. 2.
While the internal functionality and structure of the apparatus 1100 shown in FIG. 11 are described above, in one possible design, the structure of the apparatus 1100 shown in FIG. 11 may be implemented as a computing device, such as a server. As shown in fig. 14, the apparatus 1400 may include: a memory 1401 and a processor 1402;
a memory 1401 for storing a computer program;
a processor 1402 for executing a computer program for: acquiring current flow corresponding to deployed equipment; determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value; destroying a corresponding number of deployed devices from the deployed devices according to the required number.
Specifically, the processor 1402 is specifically configured to: selecting equipment to be destroyed from the deployed equipment according to the required quantity; and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys the information after receiving the destruction information.
Further, the processor 1402 is further configured to: sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform; determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier; and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
It should be noted that, for some contents that the apparatus 1400 fails to mention, reference may be made to the contents of the apparatus 1300 described above.
In addition, an embodiment of the present invention provides a computer storage medium, and the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of a method for controlling resources in the method embodiment of fig. 8.
While the internal functionality and structure of the apparatus 1200 shown in FIG. 12 are described above, in one possible design, the structure of the apparatus 1200 shown in FIG. 12 may be implemented as a computing device, such as a server. As shown in fig. 15, the apparatus 1500 may include: a memory 1501 and a processor 1502;
a memory 1501 for storing a computer program;
a processor 1502 for executing a computer program for: aiming at the same message equipment cluster, acquiring current flows corresponding to a plurality of deployed message equipment in the cluster; determining whether the current flow is greater than a flow threshold value, and determining the required number of message equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value; and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
Wherein the deployed message device is created by the container device.
For some contents that cannot be mentioned by the apparatus 1500, the contents of the apparatus 1300 described above may be referred to.
In addition, an embodiment of the present invention provides a computer storage medium, and the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of a method for controlling resources in the method embodiment of fig. 9.
Based on the similar inventive concept, another exemplary embodiment of the present application provides a resource management method. The method 1600 provided by the embodiment of the present application is executed by a control device, such as a controller, which may be disposed in a cloud server. The method 1600 includes the steps of:
1601: and acquiring flow data corresponding to the deployed equipment.
1602: and determining whether the flow data meet preset conditions, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions.
1603: and according to the determined number of the devices to be processed, deploying the devices.
Since the detailed description of the embodiment of step 1601-1603 has been described in detail above, it is not repeated here. Only the description is as follows: the preset condition may be that the flow data is greater than a flow threshold, or less than the flow threshold, etc. The flow data is the flow as described above. The equipment to be treated is equipment which needs to be increased or reduced.
Specifically, according to the determined number of the devices to be processed, the device deployment includes: creating new devices corresponding to the number; or delete deployed devices corresponding to the number.
Since the foregoing has described in detail the above embodiments, further description is omitted. Only the description is as follows: the newly added device is a device to be deployed.
In addition, reference may also be made to various steps in the method 200 described above, where the method 1600 is not described in detail.
An exemplary embodiment of the present application provides a device for controlling resources. The apparatus 1700 may be applied to a control device, such as a controller, which may be disposed in a cloud server. The apparatus 1700 includes: an acquisition module 1701, a determination module 1702 and a deployment module 1703; the following detailed description is directed to the functions of the various modules:
the obtaining module 1701 is configured to obtain traffic data corresponding to the deployed device.
A determining module 1702, configured to determine whether the flow data meets a preset condition, and when the flow data does not meet the preset condition, determine the number of the devices to be processed according to the flow data and the preset condition.
A deployment module 1703, configured to perform device deployment according to the determined number of the devices to be processed.
Specifically, the deployment module 1703 is configured to: creating a corresponding number of newly added devices; or delete a corresponding number of deployed devices.
For some contents that cannot be mentioned in the apparatus 1700, reference may be made to the contents of the apparatus 1000 described above.
While the internal functionality and structure of the apparatus 1700 are described above, in one possible design, the structure of the apparatus 1700 may be implemented as a computing device, such as a server. The apparatus 1800 may include: a memory 1801 and a processor 1802;
a memory 1801 for storing a computer program;
a processor 1802 for executing a computer program for: acquiring flow data corresponding to deployed equipment; determining whether the flow data meet preset conditions, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions; and according to the determined number of the devices to be processed, deploying the devices.
Specifically, the processor 1802 is specifically configured to: creating a corresponding number of newly added devices; or delete a corresponding number of deployed devices.
It should be noted that, for some contents that cannot be mentioned by the apparatus 1800, reference may be made to the contents of the apparatus 1300 described above.
Additionally, embodiments of the present invention provide a computer storage medium, where a computer program, when executed by one or more processors, causes the one or more processors to implement the steps of a method for managing resources in method 1600 embodiment.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 201, 202, 203, etc., are merely used for distinguishing different operations, and the sequence numbers themselves do not represent any execution order. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described aspects and portions of the present technology which contribute substantially or in part to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including without limitation disk storage, CD-ROM, optical storage, and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable multimedia data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable multimedia data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable multimedia data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable multimedia data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (32)

1. A method for controlling resources, comprising:
acquiring current flow corresponding to deployed equipment;
determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value;
and creating a corresponding number of devices to be deployed according to the required number so as to perform deployment.
2. The method according to claim 1, wherein the obtaining of the current traffic corresponding to the deployed device comprises:
and receiving the current flow of each deployed device, determining the current total flow of the deployed devices, and acquiring the current total flow as the current flow corresponding to the deployed devices.
3. The method according to claim 1, wherein the creating a corresponding number of devices to be deployed according to the required number comprises:
determining the number of the devices to be deployed according to the required number and the number of the deployed devices;
and creating a corresponding number of devices to be deployed according to the number of the devices to be deployed.
4. The method according to claim 1, wherein the creating a corresponding number of devices to be deployed according to the number of devices to be deployed comprises:
and establishing a corresponding number of devices to be deployed through a preset device management platform.
5. The method of claim 1, further comprising:
when the current flow is smaller than a flow threshold value, determining the required number of equipment for bearing the flow according to the current flow;
destroying the corresponding number of deployed devices from the deployed devices according to the required number.
6. The method of claim 1, further comprising:
aiming at the equipment of the same cluster, executing the step of acquiring the current flow corresponding to the deployed equipment; wherein the created device to be deployed is the same as the deployed device.
7. The method of claim 1, further comprising:
after the equipment to be deployed is created, receiving registration information of the equipment to be deployed through an equipment scheduling platform so as to register the equipment to be deployed;
through the equipment scheduling platform, the writing equipment acquires the registration information to write data;
and through the equipment scheduling platform, the reading equipment acquires the registration information to read data.
8. The method of claim 5, wherein destroying a corresponding number of deployed devices from the deployed devices according to the required number comprises:
selecting equipment to be destroyed from the deployed equipment according to the required quantity;
and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys after receiving the destruction information.
9. The method of claim 8, further comprising:
after the device to be destroyed receives the destruction information, the device scheduling platform receives the destruction information sent by the device to be destroyed, so that the destruction information is sent to the write-in device, and the write-in device writes data according to the registration information of other deployed devices;
and sending the destruction information to the reading equipment through the equipment scheduling platform, so that the reading equipment reads data according to the registration information of other deployed equipment.
10. The method of claim 1, further comprising:
and storing the data in the deployed equipment through a file storage platform.
11. The method of claim 5, further comprising:
sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform;
determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier;
and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
12. The method of claim 11, wherein sending the data storage path to other deployed devices comprises:
and acquiring the equipment information of the living deployed equipment, selecting one living deployed equipment, and sending the data storage path to the selected deployed equipment according to the equipment information of the selected deployed equipment.
13. The method of claim 11, further comprising:
receiving messages sent by other deployed equipment, wherein the messages indicate that data is acquired successfully;
and modifying the state of the database corresponding to the data storage position to ensure that the other deployed equipment successfully acquires data.
14. The method of claim 13, further comprising:
and sending a message of successfully acquiring data to the device to be destroyed so as to destroy the device to be destroyed.
15. The method according to any one of claims 1-14, wherein the device to be deployed is created by a container device.
16. A method for controlling resources, comprising:
acquiring current flow corresponding to deployed equipment;
determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value;
destroying the corresponding number of deployed devices from the deployed devices according to the required number.
17. The method of claim 16, wherein destroying a corresponding number of deployed devices from the deployed devices according to the required number comprises:
selecting equipment to be destroyed from the deployed equipment according to the required quantity;
and sending destruction information to the device to be destroyed through a preset device management platform, so that the device to be destroyed destroys after receiving the destruction information.
18. The method of claim 16, further comprising:
sending destruction information to the device to be destroyed through a preset device management platform, and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform;
determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier;
and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
19. A method for controlling resources, comprising:
aiming at the same message equipment cluster, acquiring current flows corresponding to a plurality of deployed message equipment in the cluster;
determining whether the current flow is greater than a flow threshold value, and determining the required number of message devices for bearing the flow according to the current flow when the current flow is greater than the flow threshold value;
and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
20. The method of claim 19, wherein the deployed message device is created by a container device.
21. A system for controlling resources, comprising: a control device and a management device;
the control device is used for acquiring the current flow corresponding to the deployed device;
determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value;
determining the corresponding number of the devices to be deployed according to the required number, and sending the corresponding number to the management device;
the management device is configured to create the device to be deployed according to the corresponding number.
22. The system of claim 21, further comprising: scheduling equipment;
the scheduling device is configured to receive registration information sent by the device to be deployed after the management device has created the device to be deployed, and register the device to be deployed;
sending the registration information to a writing device so that the writing device writes data into the created to-be-deployed device according to the registration information;
and sending the registration information to reading equipment so that the reading equipment reads data from the created equipment to be deployed according to the registration information.
23. The system of claim 21,
the control device is configured to determine, when the current traffic is smaller than a traffic threshold, a required number of devices for carrying traffic according to the current traffic;
destroying the corresponding number of deployed devices from the deployed devices according to the required number.
24. The system of claim 23,
the control device selects a corresponding number of devices to be destroyed from the deployed devices, and sends destruction information to the devices to be destroyed through a preset device management platform, so that the devices to be destroyed send the destruction information to the scheduling device after receiving the destruction information.
25. The system of claim 23, further comprising: a file storage device;
the file storage device is used for storing data of the deployed equipment;
the control device is used for sending destruction information to the device to be destroyed through a preset device management platform and receiving a data storage position sent by deployed devices, wherein the data storage position refers to a storage position in a file storage platform;
determining the identifier of the deployed equipment according to the data storage position, and determining whether the deployed equipment is equipment to be destroyed according to the identifier;
and if so, sending the data storage position to other deployed equipment, so that the other deployed equipment acquires corresponding data according to the data storage position.
26. A computing device, comprising: a memory and a processor;
the memory for storing a computer program;
the processor to execute the computer program to:
acquiring current flow corresponding to deployed equipment;
determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is greater than the flow threshold value;
and creating a corresponding number of devices to be deployed according to the required number so as to perform deployment.
27. A computing device, comprising: a memory and a processor;
the memory for storing a computer program;
the processor to execute the computer program to:
acquiring current flow corresponding to deployed equipment;
determining whether the current flow is greater than a flow threshold value, and determining the required number of equipment for bearing the flow according to the current flow when the current flow is less than the flow threshold value;
destroying the corresponding number of deployed devices from the deployed devices according to the required number.
28. A computing device, comprising: a memory and a processor;
the memory for storing a computer program;
the processor to execute the computer program to:
aiming at the same message equipment cluster, acquiring current flows corresponding to a plurality of deployed message equipment in the cluster;
determining whether the current flow is greater than a flow threshold value, and determining the required number of message devices for bearing the flow according to the current flow when the current flow is greater than the flow threshold value;
and creating a corresponding number of message devices to be deployed according to the required number so as to deploy.
29. A method for resource management, comprising:
acquiring flow data corresponding to deployed equipment;
determining whether the flow data meet preset conditions or not, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions;
and deploying the equipment according to the determined number of the equipment to be processed.
30. The method according to claim 29, wherein said deploying devices according to the determined number of the devices to be processed comprises:
creating new devices corresponding to the number; or delete deployed devices corresponding to the number.
31. A computing device, comprising: a memory and a processor;
the memory for storing a computer program;
the processor to execute the computer program to:
acquiring flow data corresponding to deployed equipment;
determining whether the flow data meet preset conditions or not, and determining the number of the devices to be processed according to the flow data and the preset conditions when the flow data do not meet the preset conditions;
and deploying the equipment according to the determined number of the equipment to be processed.
32. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by one or more processors, causes the one or more processors to perform the steps of the method of any one of claims 1-20, 29-30.
CN202010676632.5A 2020-07-14 2020-07-14 Resource control method, system, computing device and storage medium Pending CN113296931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010676632.5A CN113296931A (en) 2020-07-14 2020-07-14 Resource control method, system, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010676632.5A CN113296931A (en) 2020-07-14 2020-07-14 Resource control method, system, computing device and storage medium

Publications (1)

Publication Number Publication Date
CN113296931A true CN113296931A (en) 2021-08-24

Family

ID=77318148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010676632.5A Pending CN113296931A (en) 2020-07-14 2020-07-14 Resource control method, system, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN113296931A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system
CN113778681A (en) * 2021-09-10 2021-12-10 施麟 Data processing method and device based on cloud computing and storage medium
CN115309400A (en) * 2022-10-10 2022-11-08 阿里巴巴(中国)有限公司 Task deployment method, service platform, deployment platform, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6560204B1 (en) * 1998-05-13 2003-05-06 Telcordia Technologies, Inc. Method of estimating call level traffic intensity based on channel link measurements
CN103957246A (en) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 Dynamic load balancing method and system based on tenant sensing
CN106227582A (en) * 2016-08-10 2016-12-14 华为技术有限公司 Elastic telescopic method and system
CN108769100A (en) * 2018-04-03 2018-11-06 郑州云海信息技术有限公司 A kind of implementation method and its device based on kubernetes number of containers elastic telescopics

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6560204B1 (en) * 1998-05-13 2003-05-06 Telcordia Technologies, Inc. Method of estimating call level traffic intensity based on channel link measurements
CN103957246A (en) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 Dynamic load balancing method and system based on tenant sensing
CN106227582A (en) * 2016-08-10 2016-12-14 华为技术有限公司 Elastic telescopic method and system
CN108769100A (en) * 2018-04-03 2018-11-06 郑州云海信息技术有限公司 A kind of implementation method and its device based on kubernetes number of containers elastic telescopics

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system
CN113448757B (en) * 2021-08-30 2022-02-01 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system
CN113778681A (en) * 2021-09-10 2021-12-10 施麟 Data processing method and device based on cloud computing and storage medium
CN113778681B (en) * 2021-09-10 2024-05-03 施麟 Data processing method and device based on cloud computing and storage medium
CN115309400A (en) * 2022-10-10 2022-11-08 阿里巴巴(中国)有限公司 Task deployment method, service platform, deployment platform, device and storage medium
CN115309400B (en) * 2022-10-10 2023-03-31 阿里巴巴(中国)有限公司 Task deployment method, service platform, deployment platform, device and storage medium

Similar Documents

Publication Publication Date Title
CN107807796B (en) Data layering method, terminal and system based on super-fusion storage system
CN113296931A (en) Resource control method, system, computing device and storage medium
CN105955824B (en) A kind of virtual resource configuration method and device
CN111182067B (en) Data writing method and device based on interplanetary file system IPFS
CN111475483B (en) Database migration method and device and computing equipment
CN107087031B (en) Storage resource load balancing method and device
CN111522636A (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
US20130031221A1 (en) Distributed data storage system and method
JP2021524104A (en) Master / Standby Container System Switching
CN114089926B (en) Management method of distributed storage space, computing equipment and storage medium
CN111784329A (en) Service data processing method and device, storage medium and electronic device
CN108462756B (en) Data writing method and device
CN107948229B (en) Distributed storage method, device and system
CN113032134A (en) Method and device for realizing cloud computing resource allocation and cloud management server
US11301436B2 (en) File storage method and storage apparatus
CN110298031B (en) Dictionary service system and model version consistency distribution method
CN111414240B (en) Kernel state process copying method and device, container expanding method and device
CN114296891A (en) Task scheduling method, system, computing device, storage medium and program product
CN112817543B (en) Data storage method, system, device, equipment and medium
CN115080309A (en) Data backup system, method, storage medium, and electronic device
CN115827745A (en) Memory database cluster and implementation method and device thereof
CN109151016B (en) Flow forwarding method and device, service system, computing device and storage medium
CN111431951B (en) Data processing method, node equipment, system and storage medium
CN112685130A (en) Virtual machine backup method and device in distributed storage environment and storage medium
CN113691465A (en) Data transmission method, intelligent network card, computing device and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210824

RJ01 Rejection of invention patent application after publication