CN116028132A - Mirror image file configuration method and equipment - Google Patents

Mirror image file configuration method and equipment Download PDF

Info

Publication number
CN116028132A
CN116028132A CN202211559504.8A CN202211559504A CN116028132A CN 116028132 A CN116028132 A CN 116028132A CN 202211559504 A CN202211559504 A CN 202211559504A CN 116028132 A CN116028132 A CN 116028132A
Authority
CN
China
Prior art keywords
server
image file
configuration
servers
image
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
CN202211559504.8A
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.)
Beijing Three Cloud Computing Co ltd
Original Assignee
Beijing Three Cloud Computing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Three Cloud Computing Co ltd filed Critical Beijing Three Cloud Computing Co ltd
Priority to CN202211559504.8A priority Critical patent/CN116028132A/en
Publication of CN116028132A publication Critical patent/CN116028132A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a method and equipment for configuring mirror image files, and belongs to the technical field of computers. The method comprises the following steps: when at least one first server running currently meets capacity expansion conditions, determining the type and the first quantity of image files configured by each first server, wherein the first quantity indicates the quantity of second servers to be expanded, and the image files refer to files providing service capability for the servers; determining a second number corresponding to each image file based on the first number and the type of the image file configured by each first server, wherein the second number indicates the number of second servers used for configuring the image files; according to the second quantity, configuring corresponding types of mirror image files in each second server, completing server capacity expansion operation, ensuring that the expanded server has the same service capacity as the currently operated server, further ensuring that the expanded server meets service requirements, and preventing resource waste of the expanded server.

Description

Mirror image file configuration method and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for configuring an image file.
Background
With the rapid development of internet technology, more and more services can be provided by an application program, and for the same services in the application program, at least one server can provide services for the application program.
Specifically, for each server, an image file is set in the server, so that the server has the capability of providing the service corresponding to the image file. However, for the application program, the number of users using the application program in different time periods is different, and in a time period with more users, the server needs to be additionally expanded to meet the user requirements, but how to configure the image file for the server becomes a problem to be solved.
Disclosure of Invention
The embodiment of the application provides a method and equipment for configuring image files, which ensure that a server after capacity expansion has the same service capacity as a currently operated server, further ensure that the server after capacity expansion meets service requirements, and prevent resource waste of the server after capacity expansion. The technical scheme is as follows:
in one aspect, a method for configuring an image file is provided, where the method includes:
when at least one first server running currently meets capacity expansion conditions, determining the type and the first number of image files configured by each first server, wherein the first number indicates the number of second servers to be expanded, and the image files refer to files providing service capability for the servers;
Determining a second number corresponding to each image file based on the first number and the type of the image file configured by each first server, wherein the second number indicates the number of second servers used for configuring the image file;
and configuring image files of corresponding types in each second server according to the second quantity.
In a possible implementation manner, the first number is determined as the second number in the case that the types of the image files configured by the at least one first server are the same.
In one possible implementation manner, in response to a capacity expansion operation, configuring an image file indicated by the capacity expansion operation for the second server.
In one possible implementation manner, a configuration request sent by a terminal is received, parameter configuration of the second server is determined in response to the configuration request, the terminal is used for displaying a configuration page, and the configuration request is triggered by the terminal in response to configuration options included in the configuration page.
In one aspect, a method for configuring an image file is provided, where the method includes:
the configuration interface is used for configuring an image file configuration mode for the second server extended by the at least one first server which is currently running, the configuration interface comprises at least one image file configuration mode, the image file configuration mode indicates a mode for configuring an image file for the second server extended by the at least one first server, and the image file is used for providing service capability;
And responding to the selection operation of the proportion configuration mode in the at least one image file configuration mode, sending a control command to a server, wherein the control command indicates the server to configure image files for the second server according to the proportion configuration mode, and the proportion configuration mode indicates the server to determine the types of the image files configured by the second server and the number of the second servers configured with each image file according to the number of the first servers and the types of the configured image files.
In a possible implementation manner, the configuration interface further includes at least one parameter of the second server, and the method further includes:
determining a parameter configuration of the second server in response to an adjustment operation of at least one parameter in the configuration interface;
and responding to the triggering operation of the configuration options in the configuration interface, and sending a configuration request to the server, wherein the configuration request comprises parameter configuration of the second server.
In one aspect, there is provided an image file configuration apparatus, the apparatus comprising:
the system comprises a determining module, a processing module and a processing module, wherein the determining module is used for determining the type and the first quantity of image files configured by each first server when determining that at least one first server running currently meets a capacity expansion condition, wherein the first quantity indicates the quantity of second servers to be expanded, and the image files refer to files for providing service capability for the servers;
The determining module is further configured to determine a second number corresponding to each image file based on the first number and the kind of the image file configured by each first server, where the second number indicates the number of second servers used to configure the image file;
and the configuration module is used for configuring the image files of the corresponding types in each second server according to the second quantity.
In one possible implementation manner, the determining module is configured to:
determining a first proportion of each image file to the first number based on the type of the image file configured by each first server;
and determining a second number corresponding to each image file based on the first number and a first proportion of each image file to the first number.
In one possible implementation manner, the determining module is configured to:
under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded downwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
And under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module is configured to:
sequentially increasing a first amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
or alternatively, the process may be performed,
and sequentially increasing the first amplitude value for the plurality of intermediate quantities according to the sequence from small to large of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module is configured to:
under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded upwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
And under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module is configured to:
sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
or alternatively, the process may be performed,
and sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence of the plurality of intermediate quantities from small to large until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
In a possible implementation manner, the determining module is configured to determine the first number as the second number if the types of the image files configured by the at least one first server are the same.
In one possible implementation manner, the determining module is further configured to:
Determining that the at least one first server meets the capacity expansion condition under the condition that the processor utilization rate of the at least one first server is larger than a first utilization rate;
under the condition that the memory utilization rate of the at least one first server is larger than the second utilization rate, determining that the at least one first server meets the capacity expansion condition;
and under the condition that the interface per second request number QPS of the at least one first server is determined to be larger than the preset QPS, determining that the at least one first server meets the capacity expansion condition.
In one possible implementation manner, the configuration module is further configured to configure, in response to a capacity expansion operation, an image file indicated by the capacity expansion operation for the second server.
In one possible implementation, the apparatus further includes:
the receiving module is used for receiving a configuration request sent by a terminal, responding to the configuration request, determining parameter configuration of the second server, wherein the terminal is used for displaying a configuration page, and the configuration request is triggered by the terminal responding to configuration options included in the configuration page.
In one aspect, there is provided an image file configuration apparatus, the apparatus comprising:
The system comprises a display module, a configuration interface and a service capability providing module, wherein the display module is used for displaying the configuration interface, the configuration interface is used for configuring an image file configuration mode for a second server extended by at least one first server running currently, the configuration interface comprises at least one image file configuration mode, the image file configuration mode indicates a mode for configuring an image file for the second server, and the image file is used for providing the service capability;
the sending module is used for responding to the selection operation of the proportion configuration mode in the at least one image file configuration mode and sending a control command to a server, wherein the control command indicates the server to configure image files for the second server according to the proportion configuration mode, and the proportion configuration mode indicates the server to determine the types of the image files configured by the second server and the number of the second servers for configuring each image file according to the number of the first servers and the types of the configured image files.
In a possible implementation manner, the configuration interface further includes at least one parameter of the second server, and the apparatus further includes:
a determining module, configured to determine a parameter configuration of the second server in response to an adjustment operation on the at least one parameter in the configuration interface;
The sending module is further configured to send a configuration request to the server in response to a triggering operation on a configuration option in the configuration interface, where the configuration request includes parameter configuration of the second server.
In one aspect, an electronic device is provided that includes one or more processors and one or more memories having stored therein at least one piece of program code that is loaded and executed by the one or more processors to implement operations performed by an image file configuration method as described in any of the possible implementations.
In one aspect, a computer readable storage medium having stored therein at least one piece of program code loaded and executed by a processor to implement operations performed by an image file configuration method as any one of the possible implementations described above is provided.
In one aspect, there is provided a computer program or computer program product comprising: computer program code which, when executed by an electronic device, causes the electronic device to perform the operations performed by the image file configuration method as described above for any one of the possible implementations.
The application provides a scheme for automatically expanding the capacity of a server, if the currently operated server meets the capacity expansion condition, the number of the servers for configuring each type of image files is determined according to the types of the image files configured by the currently operated server and the number of the servers to be expanded, the corresponding types of image files are configured for the server according to the determined number, the capacity expansion operation of the server is completed, the expanded server is ensured to have the same service capacity as the currently operated server, further the expanded server is ensured to meet the service requirement, and the resource waste of the expanded server is prevented.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an implementation environment provided by embodiments of the present application;
FIG. 2 is a flowchart of a method for configuring an image file according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for configuring an image file according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a kind of image files of a first server configuration according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a second type of image file configured by a second server according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for configuring an image file according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a configuration page provided in an embodiment of the present application;
FIG. 8 is a flowchart of a method for configuring an image file according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an image file configuration device according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of another image file configuration device according to an embodiment of the present disclosure;
FIG. 11 is a schematic structural diagram of an image file configuration device according to an embodiment of the present application;
FIG. 12 is a schematic structural diagram of another image file configuration device according to an embodiment of the present disclosure;
fig. 13 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application;
fig. 14 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various concepts, but are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. For example, a first server may be referred to as a second server and a second server may be referred to as a first server without departing from the scope of the present application.
As used herein, the terms "at least one", "a plurality", "each", "any" and "at least one" include one, two or more, a plurality includes two or more, and each refers to each of a corresponding plurality, any one refers to any one of a plurality, for example, a plurality of servers includes 3 servers, and each refers to each of the 3 servers, any one refers to any one of the 3 servers, either the first, the second, or the third.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to in this application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, positioning information and the like referred to in this application are acquired with sufficient authorization. And the information and the data are processed and then used in big data application scenes, and can not be identified to any natural person or generate specific association with the natural person.
In some embodiments, the image file configuration method provided in the embodiments of the present application is executed by a server. The server may be a server, a server cluster formed by a plurality of servers, or a cloud computing service center. That is, the electronic device in the embodiment of the present application is a server.
In other embodiments, the image file configuration method provided in the embodiments of the present application is performed by a terminal and a server.
It should be noted that, in the embodiment of the present application, the execution body of the image file configuration method is not limited.
Fig. 1 is a schematic diagram of an implementation environment provided in an embodiment of the present application, and as shown in fig. 1, the implementation environment includes a terminal 101 and a server 102, where the terminal 101 and the server 102 are connected through a wireless or wired network.
In some embodiments, terminal 101 may configure the operating parameters of the second server for server 102 by a configuration operation. The server 102 may monitor the operation state of the first server, and if the first server meets the capacity expansion condition, the server 102 expands the second server according to the configuration of the terminal 101, and configures an image file for the second server.
Fig. 2 is a flowchart of an image file configuration method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking an execution subject as a server, and the embodiment includes:
201. when the server determines that at least one first server running currently meets the capacity expansion condition, determining the type and the first quantity of image files configured by each first server, wherein the first quantity indicates the quantity of second servers to be expanded, and the image files refer to files providing service capability for the servers.
The server is a management platform for managing the first server and the second server, and the first server and the second server can be expanded or contracted through the server to provide service capability. The first server is a running server and can also be understood as a server providing service capabilities. The second server is a server to be expanded, and it can be understood that the second server is some or all of the candidate servers. The capacity expansion condition is a condition for judging whether the service capability provided by the running first server meets the requirement. The image file is a file configured in the first server or the second server, and is used for providing service capability for the corresponding server. Different kinds of image files provide different service capabilities for the first server or the second server.
In some embodiments, the server is managed by an elastic telescopic platform, and can adaptively expand or reduce a server providing service capability for a service processed by the elastic telescopic platform, so as to ensure that the elastic telescopic platform can normally process the service.
In some embodiments, a first server or a second server can only configure one image file, that is, a first server or a second server can only provide one service capability.
In some embodiments, the servers to which the present application relates all serve the same application. For example, the application is any type of application. For example, the application is an instant messaging application, a video recommendation application, an item recommendation application, or other applications, which embodiments of the present application are not limited to.
For example, the application program may be an item recommendation application program, and the service capability provided by the first server or the second server may be an order payment function, an item recommendation function, an capacity allocation function, or other functions of the item recommendation application program, which are not limited in the embodiments of the present application.
In this embodiment of the present application, if the server determines that the currently running at least one first server meets the capacity expansion condition, it is indicated that the currently running at least one first server cannot meet the service requirement, and the second server needs to be additionally added to provide the service capability, so that the image files configured by each first server and the first number of second servers to be expanded are determined, so that the corresponding image files are configured for the second server in the following steps, and the second server provides the service capability corresponding to the image files.
It should be noted that, in the embodiments of the present application, the server may be a first server or a second server, or may be other servers besides the first server and the second server.
202. The server determines a second number corresponding to each image file based on the first number and the types of the image files configured by each first server, wherein the second number indicates the number of the second servers used for configuring the image files.
In this embodiment of the present application, when an extension server is required, when an image file is configured for a second server to be extended, reference needs to be made to a type of an image file configured by a first server that is currently running, so that a second number corresponding to each image file may be determined according to the first number and the type of the image file configured by each first server.
203. The server configures the image files of the corresponding types at each second server according to the second quantity.
After determining the second number corresponding to the configuration files, the server may configure the second server to be extended with the corresponding kind of image files.
The application provides a scheme for automatically expanding the capacity of a server, if the currently operated server meets the capacity expansion condition, the number of the servers for configuring each type of image files is determined according to the types of the image files configured by the currently operated server and the number of the servers to be expanded, the corresponding types of image files are configured for the server according to the determined number, the capacity expansion operation of the server is completed, the expanded server is ensured to have the same service capacity as the currently operated server, further the expanded server is ensured to meet the service requirement, and the resource waste of the expanded server is prevented.
Fig. 3 is a flowchart of an image file configuration method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking an execution subject as a server, and the embodiment includes:
301. when the server determines that at least one first server running currently meets the capacity expansion condition, determining the type and the first quantity of image files configured by each first server, wherein the first quantity indicates the quantity of second servers to be expanded, and the image files refer to files providing service capability for the servers.
In some embodiments, the first number of second servers to be extended is preset. For example, the first number is 2, 4, 5, or other values, which are not limited in this embodiment.
In other embodiments, the first number of second servers to be expanded is determined from a history expansion record. Wherein the history extension record indicates the number of second servers extended for the same period of time before, and thus the number of second servers that need to be extended can be determined from the history extension record. For example, the current time period is from the morning to the afternoon, the number of the second servers expanded in the morning to the afternoon corresponding to the history expansion record is obtained, and the number is determined as the number of the second servers to be expanded. For another example, the current time period is from one of the morning to one of the afternoon, the number of second servers extended in the corresponding one of the afternoon to one of the afternoon in the history extension record for a plurality of consecutive days is obtained, and then the average value of the extended second servers for a plurality of days is determined as the number of second servers to be extended.
In some embodiments, determining that the at least one first server satisfies the capacity expansion condition comprises at least one of:
(1) And determining that the at least one first server meets the capacity expansion condition under the condition that the processor utilization rate of the at least one first server is determined to be larger than the first utilization rate.
Each first server is provided with a processor, and each first server occupies the processing capacity of the processor in the running process, if the processor utilization rate of at least one first server is larger than the first utilization rate, the load of at least one first server is too high, and at the moment, the service requirement can not be met, so that the capacity expansion condition is determined to be met, and the server needs to be expanded. For example, the first usage rate is 80%, 85%, or other values, which are not limited in this embodiment.
(2) And under the condition that the memory utilization rate of the at least one first server is determined to be larger than the second utilization rate, determining that the at least one first server meets the capacity expansion condition.
Each first server has a memory, and each first server occupies the processing capacity of the memory in the operation process, if the memory usage rate of at least one first server is greater than the second usage rate, it indicates that the load of at least one first server is too high, and at this time, the service requirement may not be met, so that it is determined that the capacity expansion condition is met, and the server needs to be expanded. For example, the second usage rate is 90%, 95%, or other values, which are not limited in this embodiment.
(3) And under the condition that the interface QPS of the at least one first server is determined to be larger than the preset QPS, determining that the at least one first server meets the capacity expansion condition.
The interface QPS (Queries Per Second, the number of requests per second) indicates the number of requests per second of the first server, that is, the higher the interface QPS, the higher the service processed by the first server, and if the interface QPS of at least one first server is greater than the preset QPS, this indicates that the first server may not meet the service requirement at this time, so it is determined that the capacity expansion condition is met, and the server needs to be expanded.
302. The server determines a first proportion of each image file to the first number based on the type of image file configured by each first server.
After determining the number of first servers corresponding to each image file, that is, determining the number of first servers configuring the image files of the same kind, determining a first ratio of the number of first servers corresponding to each image file to the total number of first servers, and determining the ratio of second servers configuring each image file in all second servers, that is, the first ratio indicates the ratio of the second servers corresponding to each image file to the first number.
For example, referring to fig. 4, the first server currently running includes 10 servers, the first server configuring image a is 6 servers, the first server configuring image B is 4 servers, and it is explained that the ratio of image a is 0.6 and the ratio of image B is 0.4.
For another example, the first server currently running includes 10 servers, and the first server of the image file a is configured to be 10 servers, which indicates that the image file a has a duty ratio of 1.
303. The server determines a second number corresponding to each image file based on a first proportion of the first number of second servers corresponding to each image file to the first number.
The first number is the number of second servers to be expanded, and the first proportion corresponding to each image file indicates the proportion of the second servers configuring the image file, and if the second number corresponding to each image file is determined according to the first number and the first proportion, each image file can be configured for the second servers with corresponding proportions according to the proportion of the first servers.
Optionally, a product of the first number and a first proportion of each image file in the first number is obtained to obtain at least one second number, where each second number is a number of image files of a corresponding type, so that the second server can be configured with the corresponding type according to the second number.
For example, as shown in fig. 5, the first server currently running includes 10 servers, the first server configured with image file a is 6 servers, the first server configured with image file B is 4 servers, which indicates that the ratio of image file a is 0.6, the ratio of image file B is 0.4, and the first number is 5, it may be determined that the second number corresponding to image file a is 3, that is, 3 second servers configure image file a, and the second number corresponding to image file B is 2, that is, 2 second servers configure image file B.
In some embodiments, under the condition that the product between the first quantity and the first proportion of each image file accounting for the first quantity is not an integer, rounding down a plurality of products corresponding to a plurality of image files to obtain a plurality of intermediate quantities corresponding to the plurality of image files; and under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the size relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
If the product between the first number and the first proportion of each image file in the first number is not an integer, the image file cannot be configured for the second server according to the integer, so that each product in the plurality of products can be rounded down to obtain an intermediate number of each product.
Optionally, the first amplitude is sequentially increased for the plurality of intermediate quantities in order of the plurality of intermediate quantities from the large to the small until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity. Wherein the first amplitude is 1, 2, 3 or other values, which are not limited in this embodiment.
For example, the first amplitude value is 1. The plurality of intermediate numbers are an intermediate number 1, an intermediate number 2 and an intermediate number 3 respectively, the intermediate number 1 is smaller than the intermediate number 2, the intermediate number 2 is smaller than the intermediate number 3, the intermediate number 3 is increased by 1 first in the order of the plurality of intermediate numbers from large to small, if the sum of the increased intermediate number 4, the intermediate number 2 and the intermediate number 1 is equal to the first number, the process is ended, if the sum is still smaller than the first number, the intermediate number 2 is increased by 1, if the sum of the increased intermediate number 4, the increased intermediate number 3 and the intermediate number 1 is equal to the first number, the process is ended, otherwise the intermediate number 1 is increased by 1 until the sum of all the increased intermediate numbers is the same as the first number.
Referring to fig. 4, the first server currently running includes 10 servers, the first server configuring the image file a is 6 servers, the first server configuring the image file B is 4 servers, the image file a is 0.6, the image file B is 0.4, the first number is 7, the product of 0.6 and 7 and the product of 0.4 and 7 are determined to be not integers, at this time, the product of 0.6 and 7 is 4.2 rounded down to obtain an intermediate number 4, the second server configuring the image file a is determined to be 4 servers, the product of 0.4 and 7 is 2.8 rounded down to obtain an intermediate number 2, the second server configuring the image file B is determined to be 2 servers, at this time, the intermediate number 4 is increased by 1 to obtain an intermediate number 5, the sum of the intermediate number 5 and the intermediate number 2 is 7, the same as the first number, the intermediate number 5 is determined to be a second number corresponding to the image file a, and the intermediate number 2 is determined to be a second number corresponding to the image file B.
Optionally, sequentially increasing the first amplitude value for the plurality of intermediate quantities according to the order of the plurality of intermediate quantities from small to large until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
For example, the first amplitude value is 1. The plurality of intermediate numbers are respectively an intermediate number 1, an intermediate number 2 and an intermediate number 3, the intermediate number 1 is smaller than the intermediate number 2, the intermediate number 2 is smaller than the intermediate number 3, the intermediate number 1 is increased by 1 according to the sequence of the plurality of intermediate numbers from small to large, if the sum of the increased intermediate number 2, the intermediate number 2 and the intermediate number 3 is equal to the first number, the process is ended, if the sum is still smaller than the first number, the intermediate number 2 is increased by 1, if the sum of the increased intermediate number 2, the increased intermediate number 3 and the intermediate number 3 is equal to the first number, the process is ended, otherwise, the intermediate number 3 is increased by 1 until the sum of all the increased intermediate numbers is the same as the first number, and a second number corresponding to each image file is obtained.
For example, the first server currently running includes 10 servers, the first server configuring the image file a is 6 servers, the first server configuring the image file B is 4 servers, the image file a is 0.6, the image file B is 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, the product 4.2 of 0.6 and 7 is rounded down to obtain an intermediate number 4, the second server configuring the image file a is determined at present, the product 2.8 of 0.4 and 7 is rounded down to obtain an intermediate number 2, the second server configuring the image file B is determined at present, the intermediate number 2 is increased by 1, the sum of the intermediate number 3 and the intermediate number 4 is 7, the same as the first number, the intermediate number 4 is determined as a second number corresponding to the image file a, and the intermediate number 3 is determined as a second number corresponding to the image file B.
In the embodiment of the present application, a plurality of products are rounded down to obtain a plurality of intermediate numbers. In yet another embodiment, the products may also be rounded up to intermediate quantities.
In some embodiments, under the condition that the product between the first quantity and the first proportion of each image file accounting for the first quantity is not an integer, rounding up a plurality of products corresponding to a plurality of image files to obtain a plurality of intermediate quantities corresponding to the plurality of image files; and under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the size relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
If the product between the first number and the first proportion of each image file in the first number is not an integer, the image file cannot be configured for the second server according to the integer, so that each product in the plurality of products can be rounded up to obtain an intermediate number of each product.
Optionally, the first amplitude is sequentially reduced for the plurality of intermediate quantities in order of the plurality of intermediate quantities from the larger to the smaller until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity. Wherein the first amplitude is 1, 2, 3 or other values, which are not limited in this embodiment.
For example, the first amplitude value is 1. The plurality of intermediate numbers are an intermediate number 1, an intermediate number 2 and an intermediate number 3, respectively, and the intermediate number 1 is smaller than the intermediate number 2, the intermediate number 2 is smaller than the intermediate number 3, the intermediate number 3 is reduced by 1 in the order of the plurality of intermediate numbers from large to small, if the sum of the reduced intermediate number 2, the intermediate number 2 and the intermediate number 1 is equal to the first number, the process is ended, if the sum is still smaller than the first number, the intermediate number 2 is reduced by 1, if the sum of the reduced intermediate number 2, the reduced intermediate number 1 and the intermediate number 1 is equal to the first number, the process is ended, otherwise the intermediate number 1 is reduced by 1, until the sum of all the intermediate numbers after the increase is the same as the first number.
For example, the first server currently running includes 10 servers, the first server configuring the image file a is 6 servers, the first server configuring the image file B is 4 servers, the image file a is 0.6, the image file B is 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at this time, the product of 0.6 and 7 is 4.2 rounded up to obtain an intermediate number 5, the second server configuring the image file a is determined at present, the product of 0.4 and 7 is 2.8 rounded up to obtain an intermediate number 3, the second server configuring the image file B is determined at present, at this time, the intermediate number 5 is reduced by 1 to obtain an intermediate number 4, the sum of the intermediate number 4 and the intermediate number 3 is 7, the same as the first number, the intermediate number 4 is determined as a second number corresponding to the image file a, and the intermediate number 3 is determined as a second number corresponding to the image file B.
Optionally, the first amplitude is sequentially reduced for the plurality of intermediate quantities in order of the plurality of intermediate quantities from small to large until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
For example, the first amplitude value is 1. The plurality of intermediate numbers are an intermediate number 1, an intermediate number 2 and an intermediate number 3 respectively, the intermediate number 1 is smaller than the intermediate number 2, the intermediate number 2 is smaller than the intermediate number 3, the intermediate number 1 is reduced by 1 according to the order of the plurality of intermediate numbers from small to large, if the sum of the increased intermediate number 0, the intermediate number 2 and the intermediate number 3 is equal to the first number, the process is ended, if the sum is still smaller than the first number, the intermediate number 2 is reduced by 1, if the sum of the reduced intermediate number 0, the reduced intermediate number 1 and the intermediate number 3 is equal to the first number, the process is ended, otherwise the intermediate number 3 is reduced by 1 until the sum of all the increased intermediate numbers is the same as the first number.
For example, the first server currently running includes 10 servers, the first server for configuring the image file a is 6 servers, the first server for configuring the image file B is 4 servers, the image file a is 0.6, the image file B is 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at this time, the product of 0.6 and 7 is 4.2 rounded up to obtain an intermediate number 5, the second server is currently determined to configure the image file a, the product of 0.4 and 7 is 2.8 rounded up to obtain an intermediate number 3, the second server is currently determined to configure the image file B, at this time, the intermediate number 3 is reduced by 1 to obtain an intermediate number 2, the sum of the intermediate number 5 and the intermediate number 2 is 7, the same as the first number, the intermediate number 5 is determined to be a second number corresponding to the image file a, and the intermediate number 2 is determined to be a second number corresponding to the image file B.
In yet another embodiment, a plurality of intermediate quantities of differences may also be obtained, at least one of the plurality of intermediate quantities being adjusted based on the differences.
Optionally, in the case that the product between the first number and the first ratio is determined not to be an integer, rounding down the plurality of products to obtain a plurality of intermediate numbers; and under the condition that the sum of the plurality of intermediate numbers is smaller than the first number, determining a difference value between the first number and the sum, and increasing the difference value for the largest intermediate number to obtain a second number corresponding to each image file.
The first server currently running comprises 10 first servers, the number of the first servers for configuring the image files A is 6, the number of the first servers for configuring the image files B is 4, the image files A are 0.6, the image files B are 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at the moment, the products of 0.6 and 7 are rounded downwards to obtain the intermediate number 4, the current determination of the 4 second server configuration image files A is performed, the products of 0.4 and 7 are rounded downwards to obtain the intermediate number 2, the current determination of the 2 second server configuration image files B is performed, at the moment, the difference value 1 is obtained, the intermediate number 4 is increased by 1, and the intermediate number 5 is obtained.
Optionally, in the case that the product between the first number and the first ratio is determined not to be an integer, rounding down the plurality of products to obtain a plurality of intermediate numbers; and under the condition that the sum of the plurality of intermediate numbers is smaller than the first number, determining a difference value between the first number and the sum, and adding the difference value to the minimum intermediate number to obtain a second number corresponding to each image file.
The first server currently running comprises 10 first servers, the number of the first servers for configuring the image files A is 6, the number of the first servers for configuring the image files B is 4, the image files A are 0.6, the image files B are 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at the moment, the products of 0.6 and 7 are rounded downwards to obtain the intermediate number 4, the current determination of the 4 second server configuration image files A is performed, the products of 0.4 and 7 are rounded downwards to obtain the intermediate number 2, the current determination of the 2 second server configuration image files B is performed, at the moment, the difference value 1 is obtained, the intermediate number 2 is increased by 1, and the intermediate number 3 is obtained.
Optionally, in the case that the product between the first number and the first ratio is determined not to be an integer, rounding up the plurality of products to obtain a plurality of intermediate numbers; and under the condition that the sum of the plurality of intermediate numbers is larger than the first number, determining a difference value between the first number and the sum, and reducing the difference value for the largest intermediate number to obtain a second number corresponding to each image file.
For example, the first server currently running includes 10 servers, the first server for configuring image file a is 6 servers, the first server for configuring image file B is 4 servers, the image file a is 0.6, the image file B is 0.4, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at this time, the product of 0.6 and 7 is 4.2 rounded up to obtain an intermediate number 5, the second server for configuring image file a is determined at present, the product of 0.4 and 7 is 2.8 rounded up to obtain an intermediate number 3, the second server for configuring image file B is determined at present, at this time, the difference is 1, the intermediate number 5 is reduced by 1, and the intermediate number 4 is obtained.
Optionally, in the case that the product between the first number and the first ratio is determined not to be an integer, rounding up the plurality of products to obtain a plurality of intermediate numbers; and under the condition that the sum of the plurality of intermediate numbers is larger than the first number, determining a difference value between the first number and the sum, and reducing the difference value for the minimum intermediate number to obtain a second number corresponding to each image file.
For example, the first server currently running includes 10 servers, the first server for configuring the image file a is 6 servers, the first server for configuring the image file B is 4 servers, the image file a is 0.6 in proportion, the image file B is 0.4 in proportion, the first number is 7, the products of 0.6 and 7 and the products of 0.4 and 7 are not integers, at this time, the product of 0.6 and 7 is 4.2 rounded up to obtain an intermediate number 5, the second server for configuring the image file a is determined at present, the product of 0.4 and 7 is 2.8 rounded up to obtain an intermediate number 3, the second server for configuring the image file B is determined at present, at this time, the difference is 1, the intermediate number 3 is reduced by 1, and the intermediate number 2 is obtained.
It should be noted that, in the case that the types of the image files configured by the at least one first server are the same, the first number is determined as the second number.
In this embodiment of the present application, there is also a case where the image files configured by the first server are only one type, in this case, it is explained that the ratio of the image files is 100%, so when the second server needs to be expanded, it is only necessary to directly determine that the second server configures the image files of the same type as the first server.
In some embodiments, for the case where the second server needs to be expanded, the user may trigger the expansion operation through the terminal, and send the expansion operation to the server, where the server responds to the expansion operation to configure an image file indicated by the expansion operation for the second server. That is, the server is manually expanded by the user, so that the user can automatically expand the server according to the service requirement, and the integrity of the function is ensured.
In other embodiments, the method further includes the step of configuring the image file marked with the stable tag for the second server when the second server is determined to need to be expanded, so as to ensure that the second server can stably operate and meet service requirements.
In some embodiments, the server receives a configuration request sent by the terminal, determines a parameter configuration of the second server in response to the configuration request, the terminal is used for displaying a configuration page, and the configuration request is triggered by the terminal in response to configuration options included in the configuration page.
In this embodiment of the present application, a terminal used by a user may display a configuration page, where the configuration page is used to configure an extended second server, and if the user performs a triggering operation on a configuration option included in the configuration page, the terminal responds to the triggering operation and sends a configuration request to the server, where the configuration request includes a parameter configuration of the second server, and the server responds to the configuration request and determines the parameter configuration of the second server.
304. The server configures the image files of the corresponding types at each second server according to the second quantity.
According to the image file configuration method, an automatic capacity expansion scheme is provided for the server, if the currently operated server meets capacity expansion conditions, the number of the servers for configuring each image file is determined according to the types of the image files configured by the currently operated server and the number of the servers to be expanded, the corresponding types of the image files are configured for the server according to the determined number, capacity expansion operation of the server is completed, the expanded server is guaranteed to have the same service capacity as the currently operated server, further the expanded server is guaranteed to meet service requirements, and resource waste of the expanded server is prevented.
And the method determines a first proportion according to the types of the image files configured by the first server, then determines the number of the second servers configured by each image file according to the first proportion, ensures that the proportion of each image file configured by the first server is the same as the proportion of each image file configured by the second server, and also shows that the service processing capacity of the expanded second server is the same as the service processing capacity of the first server, ensures that the flow ratio of the processing service is unchanged, and further ensures the stability of the processing service.
The above embodiment is described taking a server as an execution subject. And before the steps 301-304, the relevant configuration can be performed for the server through the configuration page displayed by the terminal.
Fig. 6 is a flowchart of an image file configuration method provided in an embodiment of the present application. The embodiment of the application takes an execution subject as a terminal for example for carrying out an exemplary description, and the embodiment comprises the following steps:
step 601: the terminal displays a configuration interface, wherein the configuration interface is used for configuring an image file configuration mode for a second server extended by at least one first server running currently, the configuration interface comprises at least one image file configuration mode, the image file configuration mode indicates a mode for configuring an image file for the second server, and the image file is used for providing service capability.
In this embodiment of the present application, the terminal may configure, through a configuration interface, an image file configuration manner of a second server extended by at least one first server running currently. Wherein at least one of the first server and the second server may each provide service capabilities. And the terminal can select an image file configuration mode for the second server so that at least one server can perform expansion operation according to the selected image file configuration mode.
Step 602: the terminal responds to the selection operation of the proportion configuration mode in at least one image file configuration mode, and sends a control command to the server, wherein the control command instructs the server to configure image files for the second server according to the proportion configuration mode, and the proportion configuration mode instructs the server to determine the types of the image files configured by the second server and the number of the second servers for configuring each image file according to the number of the first servers and the types of the configured image files.
That is, the server receives the control command sent by the terminal, and configures the second server by adopting the proportion configuration mode indicated by the control command. Specifically, when it is determined that at least one first server currently running meets a capacity expansion condition, determining the type and the first number of image files configured by each first server, wherein the first number indicates the number of second servers to be expanded, determining the second number corresponding to each image file based on the first number and the type of the image files configured by each first server, wherein the second number indicates the number of second servers for configuring the image files, and configuring the image files of the corresponding type at each second server according to the second number.
The steps performed by the server in the embodiments of the present application may also be understood as steps 201-203 performed by the server in the embodiments described above. In some embodiments, the server may also perform steps 301-304 described above, embodiments of the present application are not limited.
For example, as shown in fig. 7, the present application provides four image file configuration manners to complete the configuration of the image file of the second server. The first image file configuration mode is that a user manually selects an image file, the second image file configuration mode is that an image file marked with a stable label is selected, the third image file configuration mode is that an image file with the largest online duty ratio is selected to configure a second server, and the fourth image file configuration mode is that a proportion configuration mode is selected, namely that the image files are selected according to proportion. By selecting the image file configuration mode of selecting the image file with the largest online duty ratio to configure the second server in fig. 7, the terminal can send a control command indicating that the server selects the image file with the largest online duty ratio to configure the second server to the server.
In some embodiments, the present application may also complete the configuration of the image file in combination with four image file configuration modes. For example, each image file configuration mode corresponds to a priority, and the server can sequentially judge whether the configuration of the image files can be completed according to the priority.
In some embodiments, referring to fig. 8, a first image file configuration mode, a second image file configuration mode and a fourth image file configuration mode are comprehensively adopted, the priority of the first image file configuration mode is higher than that of the second image file configuration mode, the priority of the second image file configuration mode is higher than that of the fourth image file configuration mode, after determining that at least one first server meets the capacity expansion condition, whether a user manually designates an image file is first determined, if yes, the expansion flow of the server is executed, if no, whether an image file marked with a stable tag is present, the stable tag refers to that the corresponding image file can stably run, if yes, the expansion flow of the server is executed, and if no, the image file is selected in a proportional manner to execute the expansion flow of the server.
This application describes three ways of priority by way of example only. In another embodiment, the three ways may be other priorities, which is not limited in the embodiments of the present application.
In some embodiments, the configuration interface further includes at least one parameter of the second server, the terminal determines a parameter configuration of the second server in response to an adjustment operation of the at least one parameter in the configuration interface, and sends a configuration request to the server in response to a trigger operation of a configuration option in the configuration interface, the configuration request including the parameter configuration of the second server.
In this embodiment of the present application, for each second server, the terminal may control the parameter configuration of the extended second server, and if the parameter configuration of the second server needs to be adjusted, the parameter configuration of the second server may be selected through a configuration interface in the terminal, and then the configuration request is sent to the server to complete the configuration of the second server. For the server, the server receives a configuration request sent by the terminal, the parameter configuration of the second server is determined in response to the configuration request, the terminal is used for displaying a configuration page, and the configuration request is triggered by the terminal in response to configuration options included in the configuration page.
In some embodiments, the configuration parameters of the second server include parameters such as a specification of the processor, a size of the memory, and a capacity size of the hard disk. For example, the specification of the processor may include 2-core, 4-core, 8-core, or other values. The size of the memory may include 8G, 16G, or other values. The capacity of the hard disk may include 500G, 1000G, or other values.
Referring to fig. 7, the service expansion resource includes a CPU (Central Processing Unit ), a memory and a disk for user selection, where fig. 7 shows that the CPU selected by the user is 2 cores, the memory is 8G, and the disk capacity is 100GB, and then the parameters of each second server illustrating expansion are 2 cores of the CPU, 8G of the memory, and 100GB of the disk capacity.
In the scheme provided by the embodiment of the invention, the configuration mode of the mirror image file can be configured for the server through the displayed configuration interface of at least one server, so that the server can expand according to the selected proportion configuration mode, the capacity expansion condition of the server running at present is met, the number of the servers configuring each kind of mirror image file is determined according to the types of the mirror image files configured by the server running at present and the number of the servers to be expanded, the corresponding types of mirror image files are configured for the server according to the determined number, the capacity expansion operation of the server is completed, the expanded server has the same service capacity as the currently running server, the expanded server is further ensured to meet the service requirement, and the resource waste of the expanded server is prevented.
Fig. 9 is a schematic structural diagram of an image file configuration device provided in an embodiment of the present application, referring to fig. 9, the device includes:
a determining module 901, configured to determine, when it is determined that at least one first server currently running meets a capacity expansion condition, a type and a first number of image files configured by each first server, where the first number indicates a number of second servers to be expanded, and the image files are files that provide service capabilities for the servers;
The determining module 901 is further configured to determine, based on the first number and a type of the image file configured by each of the first servers, a second number corresponding to each of the image files, where the second number indicates a number of second servers used to configure the image files;
a configuration module 902, configured to configure, at each of the second servers, an image file of a corresponding category according to the second number.
In one possible implementation manner, the determining module 901 is configured to:
determining a first proportion of each image file to the first number based on the type of the image file configured by each first server;
and determining a second number corresponding to each image file based on the first number and a first proportion of each image file to the first number.
In one possible implementation manner, the determining module 901 is configured to:
under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded downwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
And under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module 901 is configured to:
sequentially increasing a first amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
or alternatively, the process may be performed,
and sequentially increasing the first amplitude value for the plurality of intermediate quantities according to the sequence from small to large of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module 901 is configured to:
under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded upwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
And under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
In one possible implementation manner, the determining module 901 is configured to:
sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
or alternatively, the process may be performed,
and sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence of the plurality of intermediate quantities from small to large until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
In a possible implementation manner, the determining module 901 is configured to determine the first number as the second number if the types of the image files configured by the at least one first server are the same.
In a possible implementation manner, the determining module 901 is further configured to:
Determining that the at least one first server meets the capacity expansion condition under the condition that the processor utilization rate of the at least one first server is larger than a first utilization rate;
under the condition that the memory utilization rate of the at least one first server is larger than the second utilization rate, determining that the at least one first server meets the capacity expansion condition;
and under the condition that the interface per second request number QPS of the at least one first server is determined to be larger than the preset QPS, determining that the at least one first server meets the capacity expansion condition.
In a possible implementation manner, the configuration module 902 is further configured to configure, in response to a capacity expansion operation, an image file indicated by the capacity expansion operation for the second server.
In one possible implementation, referring to fig. 10, the apparatus further includes:
the receiving module 903 is configured to receive a configuration request sent by a terminal, determine, in response to the configuration request, a parameter configuration of the second server, where the terminal is configured to display a configuration page, and the configuration request is triggered by the terminal in response to a configuration option included in the configuration page.
It should be noted that: in the image file configuration device provided in the above embodiment, when configuring an image file, only the division of each functional module is used for illustration, in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the image file configuration device and the image file configuration method embodiment provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not repeated herein.
Fig. 11 is a schematic structural diagram of an image file configuration device provided in an embodiment of the present application, referring to fig. 11, the device includes:
a display module 1101, configured to display a configuration interface, where the configuration interface is configured to configure an image file configuration mode for a second server that extends for at least one first server that is currently running, the configuration interface includes at least one image file configuration mode, the image file configuration mode indicates a mode in which the image file is configured for the second server, and the image file is used to provide service capability;
and the sending module 1102 is configured to send a control command to a server in response to a selection operation of a proportion configuration mode in the at least one image file configuration mode, where the control command instructs the server to configure image files for the second server according to the proportion configuration mode, and the proportion configuration mode instructs the server to determine a type of image files configured by the second server and a number of second servers configured with each image file according to the number of the first servers and the types of the configured image files.
In a possible implementation, referring to fig. 12, the configuration interface further includes at least one parameter of the second server, and the apparatus further includes:
A determining module 1103, configured to determine a parameter configuration of the second server in response to an adjustment operation on the at least one parameter in the configuration interface;
the sending module 1102 is further configured to send a configuration request to the server in response to a triggering operation on a configuration option in the configuration interface, where the configuration request includes a parameter configuration of the second server.
It should be noted that: in the image file configuration device provided in the above embodiment, when configuring an image file, only the division of each functional module is used for illustration, in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the image file configuration device and the image file configuration method embodiment provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not repeated herein.
Fig. 13 shows a block diagram of a terminal 1300 according to an exemplary embodiment of the present application. The terminal 1300 includes: a processor 1301, and a memory 1302.
Processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. Processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). Processor 1301 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and rendering of content required to be displayed by the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1302 may include one or more computer-readable storage media, which may be non-transitory. Memory 1302 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1302 is used to store at least one program code for execution by processor 1301 to implement the image file configuration method provided by the method embodiments herein.
In some embodiments, the terminal 1300 may further optionally include: a peripheral interface 1303 and at least one peripheral. The processor 1301, the memory 1302, and the peripheral interface 1303 may be connected by a bus or signal lines. The respective peripheral devices may be connected to the peripheral device interface 1303 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1304, a display screen 1305, a camera 1306, audio circuitry 1307, a positioning component 1308, and a power supply 1309.
A peripheral interface 1303 may be used to connect I/O (Input/Output) related at least one peripheral to the processor 1301 and the memory 1302. In some embodiments, processor 1301, memory 1302, and peripheral interface 1303 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 1301, the memory 1302, and the peripheral interface 1303 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1304 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1304 converts an electrical signal to an electromagnetic signal for transmission, or converts a received electromagnetic signal to an electrical signal. Optionally, the radio frequency circuit 1304 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 1304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuit 1304 may also include NFC (Near Field Communication ) related circuits, which are not limited in this application.
The display screen 1305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1305 is a touch display, the display 1305 also has the ability to capture touch signals at or above the surface of the display 1305. The touch signal may be input to the processor 1301 as a control signal for processing. At this point, the display 1305 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 1305 may be one, providing the front panel of the terminal 1300; in other embodiments, the display 1305 may be at least two, disposed on different surfaces of the terminal 1300 or in a folded configuration; in still other embodiments, the display 1305 may be a flexible display disposed on a curved surface or a folded surface of the terminal 1300. Even more, the display screen 1305 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display screen 1305 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 1306 is used to capture images or video. Optionally, camera assembly 1306 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1306 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 1307 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 1301 for processing, or inputting the electric signals to the radio frequency circuit 1304 for voice communication. For purposes of stereo acquisition or noise reduction, a plurality of microphones may be provided at different portions of the terminal 1300, respectively. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is then used to convert electrical signals from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 1307 may also comprise a headphone jack.
The location component 1308 is used to locate the current geographic location of the terminal 1300 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 1308 may be a positioning component based on the united states GPS (Global Positioning System ), the beidou system of china, the grainer system of russia, or the galileo system of the european union.
A power supply 1309 is used to power the various components in the terminal 1300. The power supply 1309 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1309 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1300 also includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: acceleration sensor 1311, gyroscope sensor 1312, pressure sensor 1313, fingerprint sensor 1314, optical sensor 1315, and proximity sensor 1316.
The acceleration sensor 1311 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 1300. For example, the acceleration sensor 1311 may be used to detect components of gravitational acceleration in three coordinate axes. Processor 1301 may control display screen 1305 to display a user interface in either a landscape view or a portrait view based on gravitational acceleration signals acquired by acceleration sensor 1311. The acceleration sensor 1311 may also be used for the acquisition of motion data of a game or user.
The gyro sensor 1312 may detect a body direction and a rotation angle of the terminal 1300, and the gyro sensor 1312 may collect a 3D motion of the user on the terminal 1300 in cooperation with the acceleration sensor 1311. Processor 1301 can implement the following functions based on the data collected by gyro sensor 1312: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
Pressure sensor 1313 may be disposed on a side frame of terminal 1300 and/or below display screen 1305. When the pressure sensor 1313 is disposed at a side frame of the terminal 1300, a grip signal of the terminal 1300 by a user may be detected, and the processor 1301 performs left-right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 1313. When the pressure sensor 1313 is disposed at the lower layer of the display screen 1305, the processor 1301 realizes control of the operability control on the UI interface according to the pressure operation of the user on the display screen 1305. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 1314 is used to collect a fingerprint of the user, and the processor 1301 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 1314, or the fingerprint sensor 1314 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by processor 1301 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 1314 may be disposed on the front, back, or side of the terminal 1300. When a physical key or vendor Logo is provided on the terminal 1300, the fingerprint sensor 1314 may be integrated with the physical key or vendor Logo.
The optical sensor 1315 is used to collect ambient light intensity. In one embodiment, processor 1301 may control the display brightness of display screen 1305 based on the intensity of ambient light collected by optical sensor 1315. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 1305 is turned up; when the ambient light intensity is low, the display brightness of the display screen 1305 is turned down. In another embodiment, processor 1301 may also dynamically adjust the shooting parameters of camera assembly 1306 based on the intensity of ambient light collected by optical sensor 1315.
A proximity sensor 1316, also referred to as a distance sensor, is provided on the front panel of the terminal 1300. The proximity sensor 1316 is used to collect the distance between the user and the front of the terminal 1300. In one embodiment, when proximity sensor 1316 detects a gradual decrease in the distance between the user and the front of terminal 1300, processor 1301 controls display screen 1305 to switch from a bright screen state to a inactive screen state; when the proximity sensor 1316 detects that the distance between the user and the front surface of the terminal 1300 gradually increases, the processor 1301 controls the display screen 1305 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 13 is not limiting of terminal 1300 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 14 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 1400 may have a relatively large difference due to configuration or performance, and may include one or more processors (Central Processing Units, CPU) 1401 and one or more memories 1402, where at least one program code is stored in the memories 1402, and the at least one program code is loaded and executed by the processors 1401 to implement the methods provided in the respective method embodiments described above. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The server 1400 is configured to perform the steps performed by the server in the method embodiments described above.
In an exemplary embodiment, a computer readable storage medium, e.g., a memory, comprising program code executable by a processor in a computer device to perform the image file configuration method of the above-described embodiments is also provided. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, a computer program or a computer program product is also provided, which comprises computer program code which, when executed by a computer, causes the computer to implement the image file configuration method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention.

Claims (10)

1. A method for configuring an image file, the method comprising:
when at least one first server running currently meets capacity expansion conditions, determining the type and the first number of image files configured by each first server, wherein the first number indicates the number of second servers to be expanded, and the image files refer to files providing service capability for the servers;
Determining a second number corresponding to each image file based on the first number and the type of the image file configured by each first server, wherein the second number indicates the number of second servers used for configuring the image file;
and configuring image files of corresponding types in each second server according to the second quantity.
2. The method of claim 1, wherein determining a second number corresponding to each of the image files based on the first number and the type of image file configured by each of the first servers comprises:
determining a first proportion of each image file to the first number based on the type of the image file configured by each first server;
and determining a second number corresponding to each image file based on the first number and a first proportion of each image file to the first number.
3. The method of claim 2, wherein determining the second number corresponding to each image file based on the first number and the first ratio of each image file to the first number comprises:
Under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded downwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
and under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
4. A method according to claim 3, wherein said adjusting at least one intermediate number of said plurality of intermediate numbers based on a size relationship between said plurality of intermediate numbers to obtain said second number for each image file comprises:
sequentially increasing a first amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
or alternatively, the process may be performed,
and sequentially increasing the first amplitude value for the plurality of intermediate quantities according to the sequence from small to large of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
5. The method of claim 2, wherein determining the second number corresponding to each image file based on the first number and the first ratio of each image file to the first number comprises:
under the condition that products between the first quantity and the first proportion of each image file accounting for the first quantity are not integers, a plurality of products corresponding to a plurality of image files are rounded upwards, and a plurality of intermediate quantities corresponding to the plurality of image files are obtained;
and under the condition that the sum of the plurality of intermediate quantities is smaller than the first quantity, adjusting at least one intermediate quantity in the plurality of intermediate quantities based on the magnitude relation among the plurality of intermediate quantities to obtain a second quantity corresponding to each image file.
6. The method of claim 5, wherein adjusting at least one intermediate quantity of the plurality of intermediate quantities based on a size relationship between the plurality of intermediate quantities to obtain the second quantity corresponding to each image file comprises:
sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence from large to small of the plurality of intermediate quantities until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file;
Or alternatively, the process may be performed,
and sequentially reducing the second amplitude value for the plurality of intermediate quantities according to the sequence of the plurality of intermediate quantities from small to large until the sum of the plurality of intermediate quantities after adjustment is the same as the first quantity, so as to obtain a second quantity corresponding to each image file.
7. The method of claim 1, further comprising at least one of:
determining that the at least one first server meets the capacity expansion condition under the condition that the processor utilization rate of the at least one first server is larger than a first utilization rate;
under the condition that the memory utilization rate of the at least one first server is larger than the second utilization rate, determining that the at least one first server meets the capacity expansion condition;
and under the condition that the interface per second request number QPS of the at least one first server is determined to be larger than the preset QPS, determining that the at least one first server meets the capacity expansion condition.
8. A method for configuring an image file, the method comprising:
displaying a configuration interface, wherein the configuration interface is used for configuring an image file configuration mode for a second server expanded by at least one first server running currently, the configuration interface comprises at least one image file configuration mode, the image file configuration mode indicates a mode for configuring an image file for the second server, and the image file is used for providing service capability;
And responding to the selection operation of the proportion configuration mode in the at least one image file configuration mode, sending a control command to a server, wherein the control command indicates the server to configure image files for the second server according to the proportion configuration mode, and the proportion configuration mode indicates the server to determine the types of the image files configured by the second server and the number of the second servers configured with each image file according to the number of the first servers and the types of the configured image files.
9. The method of claim 8, wherein the configuration interface further comprises at least one parameter of the second server, the method further comprising:
determining a parameter configuration of the second server in response to an adjustment operation of the at least one parameter in the configuration interface;
and responding to the triggering operation of the configuration options in the configuration interface, and sending a configuration request to the server, wherein the configuration request comprises parameter configuration of the second server.
10. An electronic device comprising one or more processors and one or more memories, the one or more memories having stored therein at least one piece of program code that is loaded and executed by the one or more processors to perform the operations performed by the image configuration method of any of claims 1-7.
CN202211559504.8A 2022-12-06 2022-12-06 Mirror image file configuration method and equipment Pending CN116028132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211559504.8A CN116028132A (en) 2022-12-06 2022-12-06 Mirror image file configuration method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211559504.8A CN116028132A (en) 2022-12-06 2022-12-06 Mirror image file configuration method and equipment

Publications (1)

Publication Number Publication Date
CN116028132A true CN116028132A (en) 2023-04-28

Family

ID=86080478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211559504.8A Pending CN116028132A (en) 2022-12-06 2022-12-06 Mirror image file configuration method and equipment

Country Status (1)

Country Link
CN (1) CN116028132A (en)

Similar Documents

Publication Publication Date Title
CN113204298B (en) Method and device for displaying release progress, electronic equipment and storage medium
CN110944374B (en) Communication mode selection method and device, electronic equipment and medium
CN110740340B (en) Video live broadcast method and device and storage medium
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN110659127A (en) Method, device and system for processing task
CN111131531B (en) Method and device for generating nickname in chat group and readable storage medium
CN111510482B (en) Method and device for determining failed network request and computer storage medium
CN110673944A (en) Method and device for executing task
CN111897465B (en) Popup display method, device, equipment and storage medium
CN111881423B (en) Method, device and system for authorizing restricted function use
CN111862972B (en) Voice interaction service method, device, equipment and storage medium
CN111275607A (en) Interface display method and device, computer equipment and storage medium
CN114143280B (en) Session display method and device, electronic equipment and storage medium
CN113408989B (en) Automobile data comparison method and device and computer storage medium
CN111708669B (en) Analysis method, device, equipment and storage medium for system operation
CN112988254B (en) Method, device and equipment for managing hardware equipment
CN109189525B (en) Method, device and equipment for loading sub-page and computer readable storage medium
CN116028132A (en) Mirror image file configuration method and equipment
CN111526221B (en) Domain name quality determining method, device and storage medium
CN111275561B (en) Method, device, computer equipment and storage medium for acquiring association relation
CN110764808B (en) Client upgrade detection method, device and computer readable storage medium
CN111414563B (en) Webpage interaction method, device, computer equipment and storage medium
CN111222124B (en) Method, device, equipment and storage medium for using authority distribution
CN115379274B (en) Picture-based interaction method and device, electronic equipment and storage medium
CN113064537B (en) Media resource playing method, device, equipment, medium and product

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