Disclosure of Invention
The embodiment of the application provides an information synchronization method and device for a configuration server.
In a first aspect, an embodiment of the present application provides an information synchronization method for a configuration server, where the configuration server is in communication connection with a resource management server, the resource management server includes at least one resource pool and resource configuration information corresponding to the resource pool, and the method includes: receiving a request for modifying resource configuration information, wherein the request comprises target resource pool identification information and resource configuration mode information; selecting resource pool information containing target resource pool identification information from a resource pool information set, wherein the resource pool information of the resource pool comprises resource pool identification information and resource configuration information; modifying the resource configuration information in the selected resource pool information according to the resource configuration mode information; checking the modified resource configuration information; and responding to the successful verification, and synchronizing the modified resource configuration information to the resource management server.
In some embodiments, the method further comprises: receiving synchronous information returned by the resource management server; in response to determining that the synchronization information characterizes a synchronization failure, determining whether an interface protocol with the resource management server is consistent; and resetting the modified resource configuration information in response to determining that the interface protocols are consistent.
In some embodiments, the task queue corresponds to a resource pool and the required resources are allocated by the resource management server, and the resource configuration information includes information on the number of resources occupied by the task queue.
In some embodiments, the resource configuration information includes resource allocation information of the task queue; and according to the resource configuration mode information, modifying the resource configuration information in the selected resource pool information, wherein the modifying comprises the following steps: determining the total amount of resources in the target resource pool corresponding to the identification information of the target resource pool based on the resource configuration information in the selected resource pool information; and modifying the resource number information occupied by the task queue according to the total resource number and the resource ratio information of the task queue corresponding to the target resource pool.
In some embodiments, checking the modified resource configuration information includes: determining the resource quota of the target resource pool in the resource management server according to the preset resource sum in the resource management server and the preset weight of the target resource pool in the resource management server; and checking the modified resource configuration information based on the resource quota.
In some embodiments, checking the modified resource configuration information based on the resource quota includes: determining whether the maximum resource number occupied by the task queue is greater than a resource quota; it is determined whether the sum of the maximum number of resources occupied by the task queue exceeds the resource quota.
In a second aspect, an embodiment of the present application provides an information synchronization apparatus for a configuration server, where the configuration server is in communication connection with a resource management server, the resource management server includes at least one resource pool and resource configuration information corresponding to the resource pool, and the apparatus includes: the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is configured to receive a request for modifying resource configuration information, and the request comprises target resource pool identification information and resource configuration mode information; the device comprises a selection unit and a resource pool information acquisition unit, wherein the selection unit is configured to select resource pool information containing target resource pool identification information from a resource pool information set, and the resource pool information of a resource pool comprises the resource pool identification information and resource configuration information; the modification unit is configured to modify the resource configuration information in the selected resource pool information according to the resource configuration mode information; the checking unit is configured to check the modified resource configuration information; and the synchronization unit is configured to respond to successful verification and synchronize the modified resource configuration information to the resource management server.
In some embodiments, the apparatus further comprises: the synchronous information returning unit is configured for receiving the synchronous information returned by the resource management server; a determining unit configured to determine whether an interface protocol between the resource management server and the resource management server is consistent in response to determining that the synchronization information represents a synchronization failure; and the resetting unit is configured to reset the modified resource configuration information in response to the fact that the interface protocols are determined to be consistent.
In some embodiments, the task queue corresponds to a resource pool and the required resources are allocated by the resource management server, and the resource configuration information includes information on the number of resources occupied by the task queue.
In some embodiments, the resource configuration information includes resource allocation information of the task queue; and the modification unit is further configured to: determining the total amount of resources in the target resource pool corresponding to the identification information of the target resource pool based on the resource configuration information in the selected resource pool information; and modifying the resource number information occupied by the task queue according to the total resource number and the resource matching information of the task queue corresponding to the target resource pool.
In some embodiments, the verification unit includes: the determining subunit is configured to determine a resource quota of the target resource pool in the resource management server according to a preset total resource amount in the resource management server and a preset weight of the target resource pool in the resource management server; and the checking subunit is configured to check the modified resource configuration information based on the resource quota.
In some embodiments, the syndrome unit is further configured to: determining whether the maximum resource number occupied by the task queue is greater than the resource quota; it is determined whether the sum of the maximum number of resources occupied by the task queue exceeds the resource quota.
In a third aspect, the present application provides a server, comprising: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the information synchronization method and device for the configuration server, after the request for modifying the resource configuration information is received, the resource pool information containing the target resource pool identification information is selected from the resource pool information set, then the resource configuration information in the selected resource pool information is modified according to the resource configuration mode information, then the modified resource configuration information is verified, and finally the modified resource configuration information is synchronized to the resource management server after the verification is successful. The resource configuration information in the resource management server is proxied by the configuration server, so that the management efficiency of the resource configuration information in the resource management server is improved, and the utilization rate of the resources managed by the resource management server is improved.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 shows anexemplary system architecture 100 to which embodiments of the test method for a proxy server or the test apparatus for a proxy server of the present application may be applied.
As shown in fig. 1, thesystem architecture 100 may includeterminal devices 101, 102, 103,networks 104, 106, aconfiguration server 105, andresource management servers 107, 108, 109. Thenetwork 104 is used to provide a communication link medium between theterminal devices 101, 102, 103 and theconfiguration server 105; thenetwork 106 serves as a medium for providing communication links between theconfiguration server 105 and theresource management servers 107, 108, 109. Thenetworks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use theterminal devices 101, 102, 103 to interact with theconfiguration server 105 via thenetwork 104 to receive or send messages or the like. Theterminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, an instant messaging tool, a mailbox client, social platform software, an application for managing resource configuration information in a resource management server, and the like.
Theterminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, sending information, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
Theconfiguration server 105 may be a server that receives a request for setting resource configuration information in a resource server sent by theterminal devices 101, 102, 103. After setting the resource allocation information in theresource management servers 107, 108, and 109, theconfiguration server 105 synchronizes the set information to theresource management servers 107, 108, and 109.
Theresource management servers 107, 108, and 109 may be servers that receive the resource allocation information transmitted by theserver 105, and theresource management servers 107, 108, and 109 perform resource allocation based on the received resource allocation information.
It should be noted that the information synchronization method for the configuration server provided in the embodiment of the present application is generally performed by theserver 105, and accordingly, the information synchronization apparatus for the configuration server is generally disposed in theconfiguration server 105. Meanwhile, theconfiguration server 105 may also receive a request for modifying resource configuration information sent locally, and in this case, theterminal devices 101, 102, and 103 do not need to be set.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of end devices, networks, and servers, and the servers may be replaced with a distributed server cluster, as desired for implementation.
With continued reference to FIG. 2, aflow 200 of one embodiment of an information synchronization method for a configuration server according to the present application is shown. The information synchronization method for the configuration server comprises the following steps:
step 201, a request for modifying resource configuration information is received.
In this embodiment, an electronic device (e.g., theconfiguration server 105 shown in fig. 1) on which the information synchronization method for the configuration server operates may receive a request to modify resource configuration information. Here, the request for modifying the resource configuration information may be sent by the user through the terminal device, or may be sent by the user directly through local. When the request for modifying the resource configuration information is sent by a user through a terminal device, the electronic device may receive the request from the terminal device through a wired connection or a wireless connection.
In this embodiment, the electronic device may be communicatively connected to at least one resource management server. Each of the at least one resource management server may include at least one resource pool therein and resource configuration information corresponding to the resource pool. The resource pool may include a collection of various hardware and software running in the resource management server, and may include computing resources, storage resources, and the like. The server cluster generally includes a resource management server, execution servers, and the like, where the resource management server is configured to distribute received task requests to the execution servers according to the number of resources and the number of queues in each execution server, and schedule tasks in each execution server, so that the server cluster achieves load balancing. Meanwhile, the resource management server is responsible for managing various resources in the server cluster, such as the number of memories, cores, task queues and the like. And the resource management server stores the resource partition in the server cluster in the resource pool, and manages the resources in the server cluster through the resource configuration information corresponding to the resource pool. When executing the task instance, each execution server can apply for the required resource from the resource management server. Here, the resource configuration information corresponding to each resource pool may be manually modified.
In this embodiment, the electronic device may store resource configuration information corresponding to each resource pool. The user can achieve the purpose of changing the resource configuration information corresponding to the resource pool in the resource management server by changing the resource configuration information stored in the electronic equipment.
In this embodiment, the electronic device may store resource configuration information of a resource pool in one resource management service, or may store resource configuration information of resource pools in a plurality of resource management servers. By storing the resource configuration information of the resource pool in the plurality of resource management servers in the electronic device, the configuration server can proxy the resource configuration information in the plurality of resource management servers without setting the resource configuration information in each resource management server, so that the flexibility of managing the resource configuration information in the resource management servers is improved, and the speed of updating the resource configuration information in the resource management servers is increased.
In this embodiment, when the electronic device receives a request for modifying resource configuration information, target resource pool identification information and resource configuration mode information included in the request may be further determined. Here, the target resource pool identification information is used to query resource configuration information of the target resource pool corresponding to the target resource pool identification information, and the resource configuration mode information is how to configure resources in the resource pool. Here, the resource configuration information may include task queue number information corresponding to the resource pool, concurrency number information of the task queues, and the like. The task queue corresponds to the resource pool, and the required resources are distributed by the resource management server. The resource allocation mode information may be, for example, how to set the number information of the task queues corresponding to the resource pool, how to set the concurrency number information of the task queues, and the like. As an example, the task queues may be used to process different kinds of tasks, and since different kinds of tasks require different times, the number-of-task-queues information corresponding to each kind of task, the number-of-concurrency information per one-time task-queue, and the like may be set according to the times. For example, task a has a larger number of requests within a time period of 8.
Step 202, selecting resource pool information containing target resource pool identification information from the resource pool information set.
In this embodiment, the electronic device stores a resource pool information set. And each resource pool information in the resource pool information set corresponds to a resource pool in the resource management server one by one. The resource pool information of the resource pool includes resource pool identification information and resource configuration information. By querying the resource pool identification information from the resource pool information set, the resource configuration information of the resource pool corresponding to the resource pool identification information can be found. The electronic device selects resource pool information including the target resource pool identification information from the resource pool information set according to the target resource pool identification information received instep 201. The resource pool identification information may include a resource management server to which the resource pool belongs and a location in the resource management server.
Step 203, according to the resource configuration mode information, modifying the resource configuration information in the selected resource pool information.
In this embodiment, according to the resource pool information including the target resource pool identification information determined instep 202, the electronic device may modify the resource configuration information in the selected resource pool information according to the resource configuration mode information received instep 201.
Continuing with the example instep 201, when the resource configuration mode information received by the electronic device is to modify the resource configuration information corresponding to the task a and the resource configuration information corresponding to the task B according to the time period, the electronic device may modify the number of task queues corresponding to the resource pools for processing the task a and the task B.
In some optional implementation manners of this embodiment, the resource configuration information further includes resource number information occupied by the task queue, and the resource configuration manner information includes resource matching information of the task queue. The electronic device may determine, based on the resource configuration information in the selected resource pool information, a total amount of resources in the target resource pool corresponding to the target resource pool identification information. Here, the total number of resources corresponding to the resource pool may be stored in the resource pool information. For example, the total number of memories, the total number of cores, the total number of task queues corresponding to the resource pool, and the like. And then, according to the total amount of the resources and the resource ratio of the task queue corresponding to the target resource pool, modifying the resource number information occupied by the task queue. For example, the maximum memory information, the minimum memory information, the maximum kernel number information, the minimum kernel number information, and the like of the task queue corresponding to the target resource pool are modified.
And step 204, checking the modified resource configuration information.
In this embodiment, according to the resource configuration information modified instep 203, the electronic device may check the modified resource configuration information.
As an example, the electronic device may check whether a sum of the modified number of task queues for processing task a and the modified number of task queues for processing task B exceeds a total number of task queues of the resource pool.
In some optional implementation manners of this embodiment, the electronic device may further determine the resource quota of the target resource pool according to a preset total amount of resources in the resource management server and a preset weight of the target resource pool corresponding to the target resource pool identification information in the resource management server to which the target resource pool belongs. And then, checking the modified resource configuration information according to the resource quota.
As an example, the modified resource configuration information may be checked by determining whether a maximum number of resources occupied by a task queue corresponding to the target resource pool is greater than the resource configuration and determining whether a sum of the maximum number of resources occupied by the task queue exceeds the resource quota.
Step 205, in response to the successful verification, synchronizing the modified resource configuration information to the resource management server.
In this embodiment, after the electronic device successfully verifies the modified resource configuration information, the modified resource configuration information may be synchronized to the resource management server to which the resource pool belongs. Here, the electronic device may determine, according to the resource pool identification information, a resource management server to which the resource pool corresponding to the resource pool information belongs.
In this embodiment, the modified resource configuration information may also be stored in the configuration server, or may also be stored in a storage device communicatively connected to the configuration server.
In some optional implementation manners of this embodiment, after the electronic device synchronizes the modified resource configuration information to the resource management server, the electronic device may further receive synchronization information returned by the resource management server. And responding to the returned synchronization information to represent synchronization failure, and further determining whether the interface protocol between the electronic equipment and the resource management server is consistent. And resetting the modified resource configuration information in response to determining that the interface protocols are consistent.
With continued reference to fig. 3, fig. 3 is an application scenario 300 corresponding to the embodiment shown in fig. 2. In the application scenario of fig. 3, a user first sends a request for modifying resource configuration information to theconfiguration server 301 by using amobile phone 302, where the request includes target resource pool identification information "resource pool B" and resource configuration mode information "to modify the number of task queues corresponding to the resource pool B to 5". Next, theconfiguration server 301 selects resource pool information including "resource pool B" from the resource pool information set 304, and then modifies the resource configuration information in the resource pool information from "the number of task queues corresponding to resource pool B4" to "the number of task queues corresponding to resource pool B5". Then, theconfiguration server 301 compares the modified number of task queues corresponding to the "resource pool B" with a pre-stored threshold value of the number of task queues corresponding to the "resource pool B", and determines whether the modified number of task queues corresponding to the "resource pool B" exceeds a preset threshold value. In response to determining that the modified number of task queues corresponding to the "resource pool B" does not exceed the maximum preset threshold, in response to determining that the verification is successful, synchronizing the modified resource configuration information to theresource management server 303.
According to the information synchronization method for the configuration server, after a request for modifying the resource configuration information is received, the resource pool information containing the target resource pool identification information is selected from the resource pool information set, then the resource configuration information in the selected resource pool information is modified according to the resource configuration mode information, then the modified resource configuration information is verified, and finally the modified resource configuration information is synchronized to the resource management server after the verification is successful. The resource configuration information in the resource management server is proxied by the configuration server, so that the management efficiency of the resource configuration information in the resource management server is improved, and the utilization rate of the resources managed by the resource management server is improved.
With further reference to fig. 4, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of an information synchronization apparatus for a configuration server, where the apparatus embodiment corresponds to the method embodiment shown in fig. 2, and the apparatus may be applied to various electronic devices in particular.
As shown in fig. 4, in the information synchronization apparatus for a configuration server according to this embodiment, the configuration server is in communication connection with a resource management server, the resource management server includes at least one resource pool and resource configuration information corresponding to the resource pool, and theapparatus 400 includes a receivingunit 401, a selectingunit 402, a modifyingunit 403, a verifyingunit 404, and asynchronizing unit 405. The receivingunit 401 is configured to receive a request for modifying resource configuration information, where the request includes target resource pool identification information and resource configuration mode information; a selectingunit 402, configured to select resource pool information including target resource pool identification information from a resource pool information set, where the resource pool information of a resource pool includes resource pool identification information and resource configuration information; a modifyingunit 403, configured to modify the resource configuration information in the selected resource pool information according to the resource configuration mode information; achecking unit 404 configured to check the modified resource configuration information; and thesynchronization unit 405 is configured to synchronize the modified resource configuration information to the resource management server in response to a successful verification.
In this embodiment, specific processing of the receivingunit 401, the selectingunit 402, the modifyingunit 403, the verifyingunit 404 and the synchronizingunit 405 and technical effects thereof may refer to related descriptions ofstep 201,step 202,step 203,step 204 and step 205 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, theapparatus 400 further includes: a synchronization information returning unit (not shown) configured to receive the synchronization information returned by the resource management server; a determining unit (not shown) configured to determine whether an interface protocol with the resource management server is consistent in response to determining that the synchronization information characterizes a synchronization failure; a reset unit (not shown) configured to reset the modified resource configuration information in response to determining that the interface protocol is consistent.
In some optional implementation manners of this embodiment, the task queue corresponds to the resource pool, the required resources are allocated by the resource management server, and the resource configuration information includes information of the number of resources occupied by the task queue.
In some optional implementation manners of this embodiment, the resource configuration manner information includes resource matching information of the task queue; and the modifyingunit 403 is further configured to: determining the total amount of resources in the target resource pool corresponding to the identification information of the target resource pool based on the resource configuration information in the selected resource pool information; and modifying the resource number information occupied by the task queue according to the total resource number and the resource matching information of the task queue corresponding to the target resource pool.
In some optional implementations of this embodiment, thechecking unit 404 includes: a determining subunit (not shown) configured to determine a resource quota of the target resource pool in the resource management server according to a preset resource total in the resource management server and a preset weight of the target resource pool in the resource management server; and a checking subunit (not shown) configured to check the modified resource configuration information based on the resource quota.
In some optional implementations of this embodiment, the checking subunit (not shown) is further configured to: determining whether the maximum resource number occupied by the task queue is greater than the resource quota; it is determined whether the sum of the maximum number of resources occupied by the task queue exceeds the resource quota.
In the apparatus provided by the above embodiment of the application, theinput unit 402 inputs the to-be-processed image acquired by theacquisition unit 401 and captured under the condition of the non-positive uniform light source to the pre-trained image generation model, so as to obtain the optimized image after performing the light ray adjustment on the to-be-processed image, thereby performing the light ray adjustment on the image captured under the condition of the non-positive uniform light source to obtain the image under the condition of the positive uniform light source, and improving the flexibility of image processing.
Referring now to FIG. 5, shown is a block diagram of acomputer system 500 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present application.
As shown in fig. 5, thecomputer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from astorage section 508 into a Random Access Memory (RAM) 503. In theRAM 503, various programs and data necessary for the operation of thesystem 500 are also stored. TheCPU 501,ROM 502, andRAM 503 are connected to each other through abus 504. An input/output (I/O)interface 505 is also connected tobus 504.
The following components are connected to the I/O interface 505: aninput portion 506 including a touch screen, a touch panel, and the like; anoutput portion 507 including a display such as a Liquid Crystal Display (LCD) and a speaker; astorage portion 508 including a hard disk and the like; and acommunication section 509 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 509 performs communication processing via a network such as the internet. Thedriver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a semiconductor memory or the like is mounted on thedrive 510 as needed, so that a computer program read out therefrom is mounted into thestorage portion 508 as needed.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through thecommunication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a selecting unit, a modifying unit, a verifying unit, and a synchronizing unit. Where the names of the units do not in some cases constitute a limitation of the units themselves, for example, a receiving unit may also be described as a "unit that receives a request to modify resource configuration information".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: receiving a request for modifying resource configuration information, wherein the request comprises target resource pool identification information and resource configuration mode information; selecting resource pool information containing target resource pool identification information from a resource pool information set, wherein the resource pool information of a resource pool comprises resource pool identification information and resource configuration information; according to the resource configuration mode information, modifying the resource configuration information in the selected resource pool information; checking the modified resource configuration information; and synchronizing the modified resource configuration information to the resource management server in response to successful verification.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements in which any combination of the features described above or their equivalents does not depart from the spirit of the invention disclosed above. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.