Resource adjustment method, device, computer equipment and storage medium
By generating resource adjustment microcode when the main site fails and automatically adjusting the MIPS resources of the backup site, the problems of time-consuming and high labor costs in the existing technology are solved, and fast and low-cost resource adjustment and business takeover are achieved.
Patent Information
- Application Number
- CN202310282776.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-03-22
AI Technical Summary
In the prior art, when the main site fails, the MIPS resource upgrade of the backup site is too time-consuming and labor costs are high, so it is impossible to quickly take over the core business of the main site.
By obtaining resource adjustment data of the backup site, generating resource adjustment microcodes in combination with logical code templates, and sending resource adjustment instructions to each host to be adjusted in the backup site to achieve automated local resource adjustment.
This greatly reduces resource adjustment time, saves labor costs, improves resource adjustment efficiency, and enables backup sites to quickly take over the core business of the main site.
Smart Images

Figure CN116319275B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource adjustment method, apparatus, computer equipment, and storage medium, which can be used in the field of financial technology or other related fields. Background Art
[0002] Under normal operating conditions, both remote sites in the business system are operational. The primary site runs core business operations, while the secondary site synchronizes data in real time and runs simple queries. If the primary site fails, the secondary site must quickly take over the primary site's core business operations to avoid disrupting the normal operation of the business system.
[0003] Typically, the host resource allocation at the primary and backup sites is different. Therefore, when a primary site fails, the backup site's MIPS (Million Instructions Per Second) resources need to be quickly upgraded to take over the primary site's core business. However, the current method for upgrading MIPS is to manually adjust the backup site's host MIPS one by one through the hardware console, following the instructions on the operation page. Obviously, the existing MIPS upgrade method is time-consuming and labor-intensive. Summary of the Invention
[0004] Based on this, it is necessary to provide a resource adjustment method, device, computer equipment and storage medium that can improve resource adjustment efficiency, significantly reduce time consumption and save labor costs in response to the above technical problems.
[0005] In a first aspect, the present application provides a resource adjustment method, the method comprising:
[0006] When the primary site fails, obtain resource adjustment data for the backup site;
[0007] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0008] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0009] In one embodiment, the method further comprises:
[0010] Determine resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site;
[0011] Store resource adjustment data to the backup site;
[0012] Accordingly, resource adjustment data for the secondary site is obtained, including:
[0013] Obtain resource adjustment data for the secondary site from the secondary site.
[0014] In one embodiment, determining resource adjustment data for the secondary site based on host resource data of the primary site and host resource data of the secondary site includes:
[0015] Displays the resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance personnel;
[0016] The resource adjustment data for the secondary site is determined based on the input operations performed by the operation and maintenance personnel on the resource adjustment page.
[0017] In one embodiment, sending a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode includes:
[0018] Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted at the standby site.
[0019] In one embodiment, after sending a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, the method further includes:
[0020] Scan each host to be adjusted in the standby site to obtain the stable state of the flag bit of the processor in each host to be adjusted;
[0021] Whether the resource adjustment of each host to be adjusted is successful is determined according to the stable state of the flag bit of the processor in each host to be adjusted.
[0022] In one embodiment, determining whether resource adjustment of each host to be adjusted is successful based on the stable state of a flag bit of a processor in each host to be adjusted includes:
[0023] Determining a standard state of a flag bit of a processor in each host to be adjusted according to the resource adjustment data and an original state of a flag bit of a processor in each host to be adjusted;
[0024] Whether the resource adjustment of each host to be adjusted is successful is determined based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
[0025] In one embodiment, after sending a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, the method further includes:
[0026] According to the resource weights corresponding to different services of each host at the primary site, the resource weights corresponding to different services of each host to be adjusted at the secondary site are adjusted.
[0027] In a second aspect, the present application further provides a resource adjustment device, the device comprising:
[0028] A data acquisition module is used to obtain resource adjustment data for the backup site when the primary site fails;
[0029] A microcode generation module, configured to generate resource adjustment microcode according to resource adjustment data and a logic code template;
[0030] The resource adjustment module is configured to send a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0031] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0032] When the primary site fails, obtain resource adjustment data for the backup site;
[0033] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0034] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0036] When the primary site fails, obtain resource adjustment data for the backup site;
[0037] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0038] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0039] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the following steps:
[0040] When the primary site fails, obtain resource adjustment data for the backup site;
[0041] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0042] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0043] The above-mentioned resource adjustment method, device, computer equipment and storage medium obtain the resource adjustment data of the backup site when a failure occurs at the primary site; in combination with a pre-set logical code template, a resource adjustment microcode is generated based on the resource adjustment data of the backup site obtained; further, based on the generated resource adjustment microcode, a corresponding resource adjustment instruction is sent to each host to be adjusted in the backup site to instruct each host to be adjusted to perform local resource adjustment based on the received resource adjustment instruction. Compared with the prior art method in which operation and maintenance personnel adjust the resources of each host to be adjusted in the backup site one by one, the above-mentioned scheme introduces the resource adjustment data of the backup site and combines it with the logical code template to generate the resource adjustment microcode, and then the resource adjustment microcode can realize automatic local resource adjustment of each host to be adjusted in the backup site, thereby greatly reducing time consumption, improving resource adjustment efficiency, and saving labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A diagram illustrating an application environment of a resource adjustment method in one embodiment;
[0045] Figure 2 1 is a flow chart of a resource adjustment method according to an embodiment;
[0046] Figure 3 A schematic diagram of a process for obtaining resource adjustment data for a backup site in one embodiment;
[0047] Figure 4 A schematic diagram of a process for determining whether resource adjustment of each host to be adjusted is successful in one embodiment;
[0048] Figure 5 is a flow chart of a resource adjustment method according to another embodiment;
[0049] Figure 6 is a structural block diagram of a resource adjustment device in one embodiment;
[0050] Figure 7 is a structural block diagram of a resource adjustment device in another embodiment;
[0051] Figure 8 is a structural block diagram of a resource adjustment device in yet another embodiment;
[0052] Figure 9 A structural block diagram of a resource adjustment device in yet another embodiment;
[0053] Figure 10FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0055] The resource adjustment method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Specifically, when a failure occurs at the primary site, the server 104 obtains the resource adjustment data of the backup site, and then the server 104 generates a resource adjustment microcode based on the resource adjustment data of the backup site and a pre-set logic code template; further, based on the resource adjustment microcode, the resource adjustment of each host to be adjusted in the backup site is implemented. The server can interact with the terminal 102 to feedback to the terminal 102 whether the resource adjustment of each host to be adjusted in the backup site is successful, and the terminal 102 will feedback the resource adjustment results to the operation and maintenance personnel.
[0056] Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be a server located in the computer room of the primary site and capable of remotely controlling the hosts at the backup site. This may be implemented as a standalone server or a server cluster consisting of multiple servers.
[0057] In one embodiment, Figure 2 As shown, a resource adjustment method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0058] S201 : When a primary site fails, obtain resource adjustment data for a secondary site.
[0059] In this embodiment, the primary site is a site in the business system used to process core business, and the backup site is a site in the business system used to process simple business. When a failure occurs at the primary site, resources can be adjusted at the backup site so that the backup site can replace the primary site and take over the core business. Resource adjustment data is data used to adjust resources at the backup site, and may include but is not limited to the host ID of the backup site that requires resource adjustment, the specific operation of the host that requires resource adjustment at the backup site (such as upgrade or downgrade), the processor type (such as general-purpose or dedicated) of the host in the backup site that requires resource adjustment, and an identification string used to generate resource adjustment microcode.
[0060] Specifically, when a failure occurs at the primary site, resource adjustment data of the backup site can be automatically obtained.
[0061] S202: Generate resource adjustment microcode according to the resource adjustment data and the logic code template.
[0062] In this embodiment, the logic code template is a pre-set code template used to generate resource adjustment microcode. The resource adjustment microcode is a microcode used to adjust resources of the standby station, and may be composed of multiple instructions for adjusting resources of the standby station.
[0063] Specifically, after the resource adjustment data for the standby site is obtained, the resource adjustment data may be combined with a preset logic code template based on a preset microcode generation model to generate a resource adjustment microcode.
[0064] Optionally, after generating the resource adjustment microcode, the generated resource adjustment microcode can be input into a pre-set microcode verification model, and the generated resource adjustment microcode can be verified by the microcode verification model to improve the accuracy of the resource adjustment microcode, thereby adjusting the resources of the backup site more quickly and accurately.
[0065] S203 : Sending a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0066] In this embodiment, each host to be adjusted in the standby site is a host in the standby site that requires resource adjustment. The resource adjustment instruction is an instruction for adjusting resources for each host to be adjusted, obtained based on the resource adjustment microcode. Optionally, different resource adjustment instructions may correspond to different hosts to be adjusted.
[0067] Specifically, after generating the resource adjustment microcode, the resource adjustment instructions for each host to be adjusted in the backup site can be decomposed according to the resource adjustment microcode, and then the corresponding resource adjustment instructions are sent to each host to be adjusted in the backup site; further, after each host to be adjusted in the backup site receives the resource adjustment instruction, it performs local resource adjustment based on the resource adjustment instruction.
[0068] Optionally, in order to quickly adjust the resources of the backup site, a microcode running tool can be pre-configured in the server. The resource adjustment microcode is run through the microcode running tool to send resource adjustment instructions to each host to be adjusted in the backup site.
[0069] Specifically, after the resource adjustment microcode is generated, the resource adjustment microcode can be automatically run through the pre-configured microcode running tool; in the process of running the resource adjustment microcode, the instruction of sending resource adjustment instructions to each host to be adjusted in the backup site is executed to realize sending resource adjustment instructions to each host to be adjusted, and then each host to be adjusted performs local resource adjustment based on the resource adjustment instructions.
[0070] The above-mentioned resource adjustment method obtains the resource adjustment data of the backup site when a failure occurs at the primary site; combines a pre-set logical code template, and generates a resource adjustment microcode based on the resource adjustment data of the backup site; further, based on the generated resource adjustment microcode, sends a corresponding resource adjustment instruction to each host to be adjusted in the backup site, to instruct each host to be adjusted to perform local resource adjustment based on the received resource adjustment instruction. Compared with the prior art method in which operation and maintenance personnel adjust the resources of each host to be adjusted in the backup site one by one, the above-mentioned scheme introduces the resource adjustment data of the backup site and combines it with the logical code template to generate the resource adjustment microcode, and then through the resource adjustment microcode, it is possible to automatically adjust the local resources of each host to be adjusted in the backup site, thereby significantly reducing time consumption, improving resource adjustment efficiency, and saving labor costs.
[0071] In order to quickly adjust the resources of the backup site when a failure occurs at the primary site, and to have the backup site take over the core business instead of the primary site, based on the above embodiment, in one embodiment, as Figure 3 As shown, before a failure occurs at the primary site, resource adjustment data for the secondary site can be determined, and the above S201 can be further refined, which may specifically include the following steps:
[0072] S301 : Determine resource adjustment data for the secondary site based on host resource data of the primary site and host resource data of the secondary site.
[0073] In this embodiment, the host resource data of the primary site is resource allocation data of each host in the primary site, and the host resource data of the secondary site is resource allocation data of each host in the secondary site.
[0074] Specifically, before a failure occurs at the primary site, or when resources are configured for the primary site and the backup site, the host resource data of the primary site and the host resource data of the backup site can be obtained; further, after the host resource data of the primary site and the host resource data of the backup site are obtained, one possible implementation method is to determine the resource adjustment data for the backup site based on the host resource data of the primary site and the host resource data of the backup site through a pre-set data generation model.
[0075] Another possible implementation method is to display a resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance party; and determine the resource adjustment data for the backup site based on the input operation performed by the operation and maintenance party on the resource adjustment page.
[0076] Specifically, the host resource data of the primary site and the host resource data of the backup site can be obtained before a failure occurs at the primary site, or when resources are configured for the primary site and the backup site; further, the terminal can be interacted with to display the obtained host resource data of the primary site and the host resource data of the backup site to the operation and maintenance party through the interface provided by the terminal; further, the operation and maintenance party can input resource adjustment data for the backup site on the interface provided by the terminal based on the host resource data of the primary site and the host resource data of the backup site, and then determine the resource adjustment data for the backup site.
[0077] For example, if the operation and maintenance party determines that it is necessary to upgrade the general-purpose processor under host 3 in the backup site based on the host resource data of the main site and the host resource data of the backup site, the data such as the ID of the host in the backup site is 3, the processor type under the host is general, and the specific operation on the processor under the host is upgrade can be entered in the data display page provided by the terminal; based on the input operation of the operation and maintenance party, the terminal feeds back the data input by the operation and maintenance party to the server; after receiving the resource adjustment data for the backup site input by the operation and maintenance party, the server organizes the received resource adjustment data for the backup site according to the pre-set logic and determines it as the resource adjustment data for the backup site.
[0078] Furthermore, after determining the resource adjustment data for the backup site, the determined resource adjustment data for the backup site can be verified through a pre-set data verification model, and the erroneous resource adjustment data can be modified to obtain more accurate resource adjustment data for the backup site, thereby improving the accuracy of the subsequent generation of resource adjustment microcode.
[0079] In one feasible method, the operation and maintenance party can also interact with the server through the configuration page provided by the terminal to configure a hardware console for the backup site when adjusting resources for the backup site, and predefine relevant parameters of the operating environment when adjusting resources for the backup site, such as user permissions, operating system parameters, etc., to provide guarantees for subsequent resource adjustments to the backup site.
[0080] Furthermore, after obtaining the configuration information and predefined related parameters input by the operation and maintenance party, the server can verify the user authority of the operation and maintenance party based on the obtained configuration information and predefined related parameters. If the user authority of the operation and maintenance party is verified, the resource adjustment page including the host resource data of the primary site and the host resource data of the backup site will be displayed to the operation and maintenance party, so that the operation and maintenance party can determine and input the resource adjustment data for the backup site based on the host resource data of the primary site and the host resource data of the backup site.
[0081] S302: Store the resource adjustment data in the secondary site.
[0082] Specifically, after determining the resource adjustment data for the backup site, the determined resource adjustment data can be converted into text type and stored in a pre-set folder under the backup site according to a pre-set path, so that when a failure occurs at the primary site, the resource adjustment data for the backup site can be quickly obtained, thereby realizing rapid resource adjustment for the backup site.
[0083] S303: When a failure occurs at the primary site, resource adjustment data for the secondary site is obtained from the secondary site.
[0084] Specifically, when a failure occurs at the primary site, pre-stored resource adjustment data for the secondary site can be quickly obtained from the secondary site through a pre-set path.
[0085] It can be understood that by pre-determining the resource adjustment data for the backup site and storing the determined resource adjustment data to the backup site according to a pre-set path; when a failure occurs at the primary site, the resource adjustment data can be directly obtained, which saves a lot of time in determining the resource adjustment data, improves the resource adjustment efficiency of the backup site, and enables the backup site to quickly take over the core business of the primary site.
[0086] In order to accurately determine whether the resource adjustment of each host to be adjusted in the secondary site is successful, in one embodiment, Figure 4 As shown, after sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the following steps may be implemented:
[0087] S401 : Scan each host to be adjusted in the standby site to obtain a stable state of a flag bit of a processor in each host to be adjusted.
[0088] In this embodiment, each host to be adjusted includes multiple processors, each of which has a flag bit. The success of the processor resource adjustment can be determined based on the status of the flag bit. A processor can have multiple flag bits, and the number of flag bits associated with each processor varies. If the status of each flag bit in a processor remains unchanged for a period of time, the flag bits in the processor can be determined to be in a stable state.
[0089] Specifically, after sending a resource adjustment command to each host to be adjusted, the processor flag status of each host to be adjusted is monitored at pre-set sampling times while the host executes the resource adjustment command. If the flag status of the processor does not change within a pre-set period of time, resource adjustment is determined to have been completed for that processor, and the stable status of the processor flag is collected.
[0090] For example, after sending a resource adjustment command to each host to be adjusted, the processor flag status of each host to be adjusted can be monitored every 0.5 microseconds while the host executes the resource adjustment command. If the flag status of the processor does not change within the preset 5 microseconds, resource adjustment is determined to have been completed for the processor, and the stable status of the flag status of the processor is collected.
[0091] S402 : Determine whether the resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted.
[0092] Specifically, for each host to be adjusted, if the resource adjustment of each processor in the host to be adjusted is determined to be successful based on the stable state and original state of the flag bit of each processor in the host to be adjusted and combined with the relevant data of the host to be adjusted in the resource adjustment data, then it can be determined that the resource adjustment of the host to be adjusted is successful.
[0093] Optionally, after collecting the stable state of the flag bits of the processors in each host to be adjusted, one possible implementation method is to input the stable state and original state of the flag bits of each processor in each host to be adjusted, as well as the relevant data of the host to be adjusted in the resource adjustment data, into a pre-set state determination model, and analyze the stable state of the flag bits of the processors in each host to be adjusted through the state determination model to determine whether the resource adjustment of each host to be adjusted is successful.
[0094] Another possible implementation method is to collect the stable state of the flag bits of the processors in each host to be adjusted, and then determine the standard state of the flag bits of the processors in each host to be adjusted based on the resource adjustment data and the original state of the flag bits of the processors in each host to be adjusted; and determine whether the resource adjustment of each host to be adjusted is successful based on the consistency comparison results between the stable state and the standard state of the flag bits of the processors in each host to be adjusted.
[0095] The original state of the flag bit of the processor in each host to be adjusted is the state of the flag bit of the processor in each host to be adjusted before resource adjustment is performed, and the standard state of the flag bit of the processor in each host to be adjusted is the state that the flag bit of the processor in each host to be adjusted should be after resource adjustment is successful.
[0096] Specifically, the resource adjustment data and the original state of the flag bits of the processors in each host to be adjusted can be analyzed to determine the standard state that the flag bits of the processors in each host to be adjusted should present if the resource adjustment is successful. Furthermore, after collecting the stable state of the flag bits of the processors in each host to be adjusted, the stable state of the flag bits of the processors in each host to be adjusted can be compared for consistency with the standard state of the flag bits of the processors in each host to be adjusted to obtain a consistency comparison result of the stable state and the standard state of the flag bits of the processors in each host to be adjusted; if it is determined that the consistency comparison result of the stable state and the standard state of a processor in a certain host to be adjusted is consistent, it can be determined that the resource adjustment of the processor in the host to be adjusted is successful; if it is determined that the consistency comparison result of the stable state and the standard state of the processor in a certain host to be adjusted is inconsistent, it can be determined that the resource adjustment of the processor in the host to be adjusted has failed.
[0097] Furthermore, if it is determined that the resource adjustment of each processor in each host to be adjusted is successful, then it can be determined that the resource adjustment of each host to be adjusted is successful, and then it can be determined that the resource adjustment of the standby site is successful; further, it is possible to interact with the terminal, and through the terminal pop-up dialog box, feedback to the operation and maintenance personnel that the resource adjustment of the standby site is successful. If it is determined that the resource adjustment of a processor in each host to be adjusted fails, then it can be determined that the resource adjustment of each host to be adjusted fails, and then it can be determined that the resource adjustment of the standby site fails; further, it is possible to interact with the terminal, and through the terminal feedback to the operation and maintenance party that the resource adjustment of the standby site fails, and ask the operation and maintenance party whether to re-adjust the resources of the standby site.
[0098] It can be understood that in the process of executing resource adjustment instructions on each host to be adjusted, by collecting the stable state of the flag bit of the processor in each host to be adjusted, it is judged whether the resource adjustment of each host to be adjusted is successful, thereby improving the accuracy of the judgment of the resource adjustment status of each host to be adjusted, so that the operation and maintenance party can understand the resource adjustment status of each host to be adjusted.
[0099] In order to ensure that the backup site can more accurately take over the core business of the primary site when a failure occurs at the primary site, after each host to be adjusted at the backup site executes the resource adjustment instruction, the resource weights corresponding to different businesses under each host to be adjusted at the backup site can be adjusted according to the resource weights corresponding to different businesses under each host at the primary site.
[0100] In this embodiment, the resource weights corresponding to different services of each host in the primary site may be pre-stored in the secondary site according to a preset path, so that the secondary site can obtain them at any time.
[0101] Specifically, after the resource adjustment of the backup site is completed, the resource weights corresponding to different businesses under each host in the main site can be obtained from the backup site. According to the obtained resource weights corresponding to different businesses under each host in the main site, a weight adjustment microcode for adjusting the resource weights of different businesses can be generated in combination with a pre-set logic code template; further, the generated weight adjustment microcode is run to adjust the resource weights corresponding to different businesses under each host to be adjusted in the backup site, so that the resource weights corresponding to different businesses under each host in the backup site are the same as the resource weights corresponding to different businesses of each host in the main site, thereby quickly taking over the core business of the main site.
[0102] It can be understood that by adjusting the resource weights corresponding to different businesses under each host to be adjusted in the backup site according to the resource weights corresponding to different businesses under each host in the primary site, the resource weights corresponding to different businesses under each host in the backup site are made the same as the resource weights corresponding to different businesses under each host in the primary site, thereby achieving the effect of the backup site accurately replicating the primary site and being able to quickly take over the core business of the primary site.
[0103] In one embodiment, Figure 5 As shown, a preferred example of a resource adjustment method is provided. The specific process is as follows:
[0104] S501 : Display a resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance party.
[0105] S502: Determine resource adjustment data for the secondary site according to input operations performed by the operation and maintenance party on the resource adjustment page.
[0106] S503: Store the resource adjustment data in the secondary site.
[0107] S504 , when the primary site fails, obtain resource adjustment data for the secondary site from the secondary site.
[0108] S505 , generating resource adjustment microcode according to the resource adjustment data and the logic code template.
[0109] S506: Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted in the standby site.
[0110] S507 : Scan each host to be adjusted in the standby site to obtain a stable state of a flag bit of a processor in each host to be adjusted.
[0111] S508 : Determine the standard state of the flag bit of the processor in each host to be adjusted according to the resource adjustment data and the original state of the flag bit of the processor in each host to be adjusted.
[0112] S509 , determining whether the resource adjustment of each host to be adjusted is successful based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
[0113] S510 , when it is determined that the resource adjustment of each host to be adjusted is successful, the resource weights corresponding to different services of each host to be adjusted in the standby site are adjusted according to the resource weights corresponding to different services of each host in the primary site.
[0114] The specific process of the above S501-S510 can be found in the description of the above method embodiment. The implementation principle and technical effects are similar and will not be repeated here.
[0115] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0116] Based on the same inventive concept, embodiments of the present application also provide a resource adjustment device for implementing the resource adjustment method described above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more resource adjustment device embodiments provided below can be found in the above-mentioned limitations on the resource adjustment method and will not be repeated here.
[0117] In one embodiment, Figure 6 As shown, a resource adjustment device 1 is provided, comprising: a data acquisition module 10, a microcode generation module 20 and a resource adjustment module 30, wherein:
[0118] The data acquisition module 10 is used to acquire resource adjustment data for the backup site when the primary site fails.
[0119] The microcode generation module 20 is configured to generate resource adjustment microcode according to the resource adjustment data and the logic code template.
[0120] The resource adjustment module 30 is configured to send a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0121] In one embodiment, the resource adjustment device 1 may further include:
[0122] The data determination module 40 is configured to determine resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site.
[0123] The data storage module 50 is configured to store the resource adjustment data in the backup site.
[0124] Accordingly, the data acquisition module 10 can be used to:
[0125] Obtain resource adjustment data for the secondary site from the secondary site.
[0126] In one embodiment, in the above Figure 6 or Figure 7 On the basis of Figure 8 As shown, the data determination module 40 may include:
[0127] The page display unit 41 is configured to display a resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance party.
[0128] The data determining unit 42 is configured to determine resource adjustment data for the secondary site according to input operations performed by the operation and maintenance party on the resource adjustment page.
[0129] In one embodiment, the resource adjustment module 30 may be specifically configured to:
[0130] Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted at the standby site.
[0131] In one embodiment, in the above Figure 6 、 Figure 7 or Figure 8 On the basis of Figure 9 As shown, the resource adjustment device 1 may further include:
[0132] The state acquisition module 60 is used to scan each host to be adjusted in the standby site to obtain the stable state of the flag bit of the processor in each host to be adjusted.
[0133] The state determination module 70 is used to determine whether the resource adjustment of each host to be adjusted is successful according to the stable state of the flag bit of the processor in each host to be adjusted.
[0134] In one embodiment, the state determination module 70 may be specifically configured to:
[0135] Based on the resource adjustment data and the original state of the flag bits of the processors in each host to be adjusted, the standard state of the flag bits of the processors in each host to be adjusted is determined; based on the consistency comparison results between the stable state and the standard state of the flag bits of the processors in each host to be adjusted, it is determined whether the resource adjustment of each host to be adjusted is successful.
[0136] In one embodiment, the resource adjustment device 1 may further include:
[0137] The weight adjustment module is used to adjust the resource weights corresponding to different services of each host to be adjusted in the backup site according to the resource weights corresponding to different services of each host in the primary site.
[0138] Each module in the resource adjustment device described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0139] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store resource adjustment data for the backup site, etc. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a resource adjustment method is implemented.
[0140] Those skilled in the art will understand that Figure 10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0141] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0142] When the primary site fails, obtain resource adjustment data for the backup site;
[0143] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0144] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] Determine resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site;
[0147] Store resource adjustment data to the backup site;
[0148] Accordingly, when the processor executes the computer program to obtain the logic of resource adjustment data for the backup site, the processor further implements the following steps:
[0149] Obtain resource adjustment data for the secondary site from the secondary site.
[0150] In one embodiment, when the processor executes the computer program to determine logic for adjusting resource data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site, the processor further implements the following steps:
[0151] Displays the resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance personnel;
[0152] The resource adjustment data for the secondary site is determined based on the input operations performed by the operation and maintenance personnel on the resource adjustment page.
[0153] In one embodiment, when the processor executes the logic of the computer program to send resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the processor further implements the following steps:
[0154] Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted at the standby site.
[0155] In one embodiment, after the processor executes the computer program to send resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the processor further implements the following steps:
[0156] Scan each host to be adjusted in the standby site to obtain the stable state of the flag bit of the processor in each host to be adjusted;
[0157] Whether the resource adjustment of each host to be adjusted is successful is determined according to the stable state of the flag bit of the processor in each host to be adjusted.
[0158] In one embodiment, when the processor executes the computer program to determine whether resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted, the processor further implements the following steps:
[0159] Determining a standard state of a flag bit of a processor in each host to be adjusted according to the resource adjustment data and an original state of a flag bit of a processor in each host to be adjusted;
[0160] Whether the resource adjustment of each host to be adjusted is successful is determined based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
[0161] In one embodiment, after the processor executes the computer program to send resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the processor further implements the following steps:
[0162] According to the resource weights corresponding to different services of each host at the primary site, the resource weights corresponding to different services of each host to be adjusted at the secondary site are adjusted.
[0163] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0164] When the primary site fails, obtain resource adjustment data for the backup site;
[0165] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0166] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0167] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0168] Determine resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site;
[0169] Store resource adjustment data to the backup site;
[0170] Accordingly, when the logic of the computer program for obtaining resource adjustment data for the secondary site is executed by the processor, the following steps are also implemented:
[0171] Obtain resource adjustment data for the secondary site from the secondary site.
[0172] In one embodiment, when the computer program is executed by a processor to determine logic for adjusting resource data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site, the computer program further implements the following steps:
[0173] Displays the resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance personnel;
[0174] The resource adjustment data for the secondary site is determined based on the input operations performed by the operation and maintenance personnel on the resource adjustment page.
[0175] In one embodiment, when the computer program is executed by the processor, the logic of sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode further implements the following steps:
[0176] Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted at the standby site.
[0177] In one embodiment, after the processor executes the logic of the computer program sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the computer program further implements the following steps:
[0178] Scan each host to be adjusted in the standby site to obtain the stable state of the flag bit of the processor in each host to be adjusted;
[0179] Whether the resource adjustment of each host to be adjusted is successful is determined according to the stable state of the flag bit of the processor in each host to be adjusted.
[0180] In one embodiment, when the computer program is executed by the processor, the logic for determining whether resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted further implements the following steps:
[0181] Determining a standard state of a flag bit of a processor in each host to be adjusted according to the resource adjustment data and an original state of a flag bit of a processor in each host to be adjusted;
[0182] Whether the resource adjustment of each host to be adjusted is successful is determined based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
[0183] In one embodiment, after the processor executes the logic of the computer program sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the computer program further implements the following steps:
[0184] According to the resource weights corresponding to different services of each host at the primary site, the resource weights corresponding to different services of each host to be adjusted at the secondary site are adjusted.
[0185] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0186] When the primary site fails, obtain resource adjustment data for the backup site;
[0187] Generate resource adjustment microcode according to resource adjustment data and logic code template;
[0188] According to the resource adjustment microcode, a resource adjustment instruction is sent to each host to be adjusted in the standby site, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction.
[0189] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0190] Determine resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site;
[0191] Store resource adjustment data to the backup site;
[0192] Accordingly, when the logic of the computer program for obtaining resource adjustment data for the secondary site is executed by the processor, the following steps are also implemented:
[0193] Obtain resource adjustment data for the secondary site from the secondary site.
[0194] In one embodiment, when the computer program is executed by a processor to determine logic for adjusting resource data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site, the computer program further implements the following steps:
[0195] Displays the resource adjustment page including the host resource data of the primary site and the host resource data of the backup site to the operation and maintenance personnel;
[0196] The resource adjustment data for the secondary site is determined based on the input operations performed by the operation and maintenance personnel on the resource adjustment page.
[0197] In one embodiment, when the computer program is executed by the processor, the logic of sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode further implements the following steps:
[0198] Run the resource adjustment microcode to send resource adjustment instructions to each host to be adjusted at the standby site.
[0199] In one embodiment, after the processor executes the logic of the computer program sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the computer program further implements the following steps:
[0200] Scan each host to be adjusted in the standby site to obtain the stable state of the flag bit of the processor in each host to be adjusted;
[0201] Whether the resource adjustment of each host to be adjusted is successful is determined according to the stable state of the flag bit of the processor in each host to be adjusted.
[0202] In one embodiment, when the computer program is executed by the processor, the logic for determining whether resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted further implements the following steps:
[0203] Determining a standard state of a flag bit of a processor in each host to be adjusted according to the resource adjustment data and an original state of a flag bit of a processor in each host to be adjusted;
[0204] Whether the resource adjustment of each host to be adjusted is successful is determined based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
[0205] In one embodiment, after the processor executes the logic of the computer program sending resource adjustment instructions to each host to be adjusted in the standby site according to the resource adjustment microcode, the computer program further implements the following steps:
[0206] According to the resource weights corresponding to different services of each host at the primary site, the resource weights corresponding to different services of each host to be adjusted at the secondary site are adjusted.
[0207] It should be noted that the data involved in this application (including but not limited to the host resource data of the primary site, the host resource data of the backup site, resource adjustment data for the backup site, etc.) are all authorized or fully authorized information and data by all parties.
[0208] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0209] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0210] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A resource adjustment method, characterized in that: The method comprises: When the primary site fails, obtain resource adjustment data for the backup site; generating resource adjustment microcode according to the resource adjustment data and the logic code template; Sending a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction; The method further comprises: Scanning each host to be adjusted in the standby site to obtain a stable state of a flag bit of a processor in each host to be adjusted; Determining whether resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted; The method further comprises: According to the resource weights corresponding to different businesses under each host in the main site, combined with the pre-set logical code template, a weight adjustment microcode is generated to adjust the resource weights of different businesses. The generated weight adjustment microcode is run to adjust the resource weights corresponding to different businesses under each host to be adjusted in the backup site.
2. The method according to claim 1, characterized in that The method further comprises: determining resource adjustment data for the secondary site based on the host resource data of the primary site and the host resource data of the secondary site; storing the resource adjustment data in the secondary site; Accordingly, the acquiring of resource adjustment data for the secondary site includes: Resource adjustment data for the secondary site is obtained from the secondary site.
3. The method according to claim 2, characterized in that The determining, based on the host resource data of the primary site and the host resource data of the secondary site, resource adjustment data for the secondary site includes: Displaying a resource adjustment page including the host resource data of the primary site and the host resource data of the secondary site to the operation and maintenance party; The resource adjustment data for the secondary site is determined according to the input operation performed by the operation and maintenance party on the resource adjustment page.
4. The method according to claim 1, wherein The sending of a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode includes: The resource adjustment microcode is run to send a resource adjustment instruction to each host to be adjusted in the standby site.
5. The method according to claim 1, characterized in that The step of determining whether resource adjustment of each host to be adjusted is successful based on the stable state of the flag bit of the processor in each host to be adjusted includes: Determining a standard state of a flag bit of a processor in each host to be adjusted according to the resource adjustment data and an original state of a flag bit of a processor in each host to be adjusted; Whether the resource adjustment of each host to be adjusted is successful is determined based on the consistency comparison result between the stable state and the standard state of the flag bit of the processor in each host to be adjusted.
6. A resource adjustment device, characterized in that: The device comprises: A data acquisition module is used to obtain resource adjustment data for the backup site when the primary site fails; a microcode generation module, configured to generate a resource adjustment microcode according to the resource adjustment data and a logic code template; a resource adjustment module, configured to send a resource adjustment instruction to each host to be adjusted in the standby site according to the resource adjustment microcode, so as to instruct each host to be adjusted to perform local resource adjustment based on the resource adjustment instruction; A status acquisition module is used to scan each host to be adjusted in the standby site to obtain a stable status of a flag bit of a processor in each host to be adjusted; A state determination module is used to determine whether the resource adjustment of each host to be adjusted is successful according to the stable state of the flag bit of the processor in each host to be adjusted; The weight adjustment module is used to generate weight adjustment microcode for adjusting the resource weights of different businesses based on the resource weights corresponding to different businesses under each host in the primary site, combined with a pre-set logic code template, and run the generated weight adjustment microcode to adjust the resource weights corresponding to different businesses under each host to be adjusted in the backup site.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Instance node management method and management equipment
CN104836850A
Programmable controller
US20230038919A1