Instruction sending method, server, communication device and system
A second operation instruction is generated by the target server and pre-executed on the slave server to obtain parameters and alarm information. After ensuring the operation result is correct, it is sent to the main server. This solves the problem of low security of configuration and change operations in the existing technology and improves the security and business continuity of the main server.
Patent Information
- Application Number
- CN202111283529.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-11-01
AI Technical Summary
In the existing technology, the security of configuration and change operations is low, which can easily lead to host service errors and business interruptions.
The target server generates a second operation instruction, instructing the slave server to execute the target operation and script, obtain parameter information and alarm information to determine the operation result, and then send it to the main server for execution after ensuring the result is correct.
Improves the security and business continuity of primary server operations and avoids service errors and interruptions caused by misconfiguration.
Smart Images

Figure CN116074193B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network and information security technology, and in particular to an instruction sending method, server, communication equipment and system. Background Art
[0002] Conventional configuration and change operations involve logging into a cloud host, virtual machine, or server device, entering commands in a command window based on the configuration and change requirements. The syntax checker in the operating system verifies the command syntax, and once the command passes verification, the host executes the corresponding configuration and change operation. However, incorrect configuration and change content in the command can lead to service errors and business interruptions on the host after the configuration and change operation is executed, resulting in low security. Summary of the Invention
[0003] The present application provides a command sending method, a slave server, a communication device and a system to solve the problem of low security of host execution of configuration and change operations.
[0004] In a first aspect, an embodiment of the present application provides a method for sending an instruction, comprising:
[0005] The target server obtains the first operation instruction;
[0006] The target server generates a second operation instruction based on the first operation instruction;
[0007] The target server instructs the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, and second parameter information of the target operation object after the slave server performs the target operation, and alarm information;
[0008] The target server obtains the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the target operation is correct;
[0009] When the execution result is correct, the target server sends the first operation instruction to the main server, where the first operation instruction is used to instruct the main server to perform the target operation on the target operation object.
[0010] In a second aspect, an embodiment of the present application further provides a server, which is a target server and includes:
[0011] A first acquisition module, configured to acquire a first operation instruction;
[0012] a generating module, configured to generate a second operating instruction based on the first operating instruction;
[0013] an instruction module, configured to instruct the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, second parameter information of the target operation object after the slave server performs the target operation, and alarm information;
[0014] a second acquisition module, configured to acquire the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the operation instruction is correct;
[0015] The sending module is used to send the first operation instruction to the main server when the execution result is correct, and the first operation instruction is used to instruct the main server to perform the target operation on the target operation object.
[0016] In the third aspect, an embodiment of the present application also provides a communication device, including: a transceiver, a memory, a processor, and a program stored on the memory and runnable on the processor; the processor is used to read the program in the memory to implement the steps in the method described in the first aspect of the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the method described in the first aspect of the embodiment of the present application.
[0018] In a fifth aspect, an embodiment of the present application further provides an instruction sending system, characterized by comprising:
[0019] Target server, slave server and master server;
[0020] Wherein, the target server is used to obtain a first operation instruction; generate a second operation instruction based on the first operation instruction; instruct the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, and second parameter information and alarm information of the target operation object after the slave server performs the target operation; obtain the first parameter information, the second parameter information and the alarm information, wherein the first parameter information, the second parameter information and the alarm information are used to determine whether the execution result of the target operation is correct; if the execution result is correct, send the first operation instruction to the master server, and the first operation instruction is used to instruct the master server to perform the target operation on the target operation object;
[0021] The slave server is configured to execute the second operation instruction;
[0022] The main server is used to execute the first operation instruction.
[0023] In an embodiment of the present application, the target server obtains a first operation instruction; generates a second operation instruction based on the first operation instruction; instructs the slave server to perform a target operation and a script on the target operation object based on the second operation instruction, so as to obtain the first parameter information of the target operation object before the slave server performs the target operation, and the second parameter information and alarm information of the target operation object after the slave server performs the target operation; obtains the first parameter information, the second parameter information and the alarm information, wherein the first parameter information, the second parameter information and the alarm information are used to determine whether the execution result of the target operation is correct; if the execution result is correct, sends the first operation instruction to the master The first operation instruction is used to instruct the main server to perform the target operation on the target operation object; that is, the target operation performed by the main server is pre-executed by the slave server, and when the target server determines that the execution result of the target operation is correct, the target server sends it to the main server to realize the main server's execution of the first operation instruction. The first operation instruction can be executed in the slave server to obtain the execution result of the target operation, which can avoid the first operation instruction with erroneous configuration and change content from being executed by the main server, thereby improving the correctness of the service and business continuity in the main server, and improving the security of the main server in executing the operation instruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0025] Figure 1 This is a flowchart of a method for sending instructions provided in an embodiment of the present application;
[0026] Figure 2 is a schematic diagram of a configuration and change error protection system provided by an embodiment of the present application;
[0027] Figure 3 This is a flowchart of a configuration and change error protection method provided in an embodiment of the present application;
[0028] Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of the present application;
[0029] Figure 5 This is a schematic diagram of the structure of an instruction sending system provided in an embodiment of the present application;
[0030] Figure 6 It is a structural diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0032] The terms "first", "second" etc. in the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. In addition, the terms "comprise" and "have" and any deformation thereof are intended to cover non-exclusive inclusions, such as, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or that are intrinsic to these processes, methods, products or equipment. In addition, "and / or" is used in the present application to represent at least one of connected objects, such as A and / or B and / or C, and represents comprising independent A, independent B, independent C, and A and B all exist, B and C all exist, A and C all exist, and 7 situations that A, B and C all exist.
[0033] See also Figure 1 , Figure 1 This is a flow chart of a method for sending instructions provided by an embodiment of the present application. Figure 1 As shown, the following steps are included:
[0034] Step 101: The target server obtains a first operation instruction.
[0035] The first operation instruction may be an operation instruction input by an operator based on configuration and change requirements. For example, the first operation instruction may instruct an operation such as adding, deleting, or modifying an operation object. It is understood that after receiving the first operation instruction, the target server may first invoke a syntax check function to perform a syntax check on the first operation instruction. After the syntax check passes, subsequent steps may be executed to ensure the correctness of the syntax of the first operation instruction.
[0036] Step 102: The target server generates a second operation instruction based on the first operation instruction.
[0037] It is understood that the second operation instruction may include the first operation instruction, that is, the second operation instruction may instruct to perform an operation such as addition, deletion, or modification consistent with the first operation instruction. The second operation instruction may be generated based on the first operation instruction by directly adding the content of the first operation instruction to the second operation instruction, or by generating an instruction including the content of the first operation instruction as the second operation instruction.
[0038] Optionally, in step 102, the target server generates a second operation instruction based on the first operation instruction, which may specifically include the following steps:
[0039] The target server obtains the execution status of the script;
[0040] Based on the execution state of the script, the target server generates the second operation instruction using the first operation instruction;
[0041] The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order.
[0042] Among them, the above-mentioned script can be the script that the above-mentioned second operation instruction instructs the above-mentioned slave server to execute, and the above-mentioned script can be included in the above-mentioned second operation instruction. If the above-mentioned slave server is instructed to execute the above-mentioned script before executing the above-mentioned target operation, the first parameter information of the above-mentioned target operation object can be obtained; if the above-mentioned slave server is instructed to execute the above-mentioned script after executing the above-mentioned target operation, the second parameter information and alarm information of the above-mentioned target operation object can be obtained.
[0043] It can be understood that the above-mentioned slave server can be a slave in a master-slave hot standby mechanism established between the master server and the slave server, and data synchronization between the slave server and the master server is achieved through the master-slave hot standby mechanism.
[0044] Among them, the execution state of the above-mentioned script can be a certain execution state confirmed in the pre-set execution state. For example, the execution states of multiple scripts can be pre-set, and the conditions to be met can be pre-set for each execution state. The above-mentioned slave server determines the current execution state of the above-mentioned script by judging the pre-set conditions to be met. Based on the execution state of the above-mentioned script, the current operating state of the above-mentioned slave server can be obtained, and the master-slave hot standby mechanism is formed between the above-mentioned slave server and the master server. The current operating state of the above-mentioned slave server is the operating state of the above-mentioned master server. For different execution states of the scripts in the above-mentioned slave server, the order between the execution of the above-mentioned target operation and the above-mentioned script by the above-mentioned slave server, as well as the number of times the above-mentioned script is executed, can be adjusted accordingly to obtain the above-mentioned first parameter information, the above-mentioned second parameter information and the above-mentioned alarm information.
[0045] In this embodiment, based on the execution status of the script, the target server uses the first operation instruction to generate the second operation instruction, wherein the second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object the number of times and the order. The number of times and the order in which the slave server executes the target operation and the script on the target operation object can be adjusted accordingly according to the different execution statuses of the script to obtain the first parameter information, the second parameter information and the alarm information under different execution statuses.
[0046] Optionally, the target server obtains the execution status of the script, which may specifically include:
[0047] The target server obtains the execution times of the script and the change information of the control right of the main server;
[0048] The target server determines the execution status of the script based on the number of executions of the script and the change information of the control right of the main server.
[0049] Specifically, taking the execution status of the above-mentioned script as an example, which is pre-divided into three states: initial operation state, system migration state and normal operation state, the conditions that need to be met in the above-mentioned initial operation state can be set as: the number of executions of the above-mentioned script is 0 and the control right of the above-mentioned main server has not changed, that is, in the initial operation state, the above-mentioned script has not been executed and the system has not migrated; the conditions that need to be met in the above-mentioned system migration state are set as: the control right of the above-mentioned main server has changed, that is, the above-mentioned system has migrated; the conditions that need to be met in the above-mentioned normal operation state are set as: the number of executions of the above-mentioned script is greater than 0 and the control right of the above-mentioned main server has not changed, that is, the system has not migrated and the above-mentioned script has been executed.
[0050] In this embodiment, the slave server can determine the execution status of the script based on the number of executions of the script and the change information of the control right of the master server, thereby adjusting the number and order of the slave server executing the target operation and the script on the target operation object accordingly.
[0051] Step 103: The target server instructs the slave server to perform a target operation and a script on the target operation object based on the second operation instruction, so as to obtain the first parameter information of the target operation object before the slave server performs the target operation, and the second parameter information and alarm information of the target operation object after the slave server performs the target operation.
[0052] In some embodiments, the target server and the slave server may be two independent servers. After obtaining the first operation instruction, the target server generates a second operation instruction and sends it to the slave server to instruct the slave server to perform the target operation and script on the target operation object, and then determines whether to send the first operation instruction to the master server based on the execution result of the target operation in the slave server.
[0053] As another embodiment, the target server and the slave server may be the same server. For example, in the case of resource scarcity, the slave server may act as the target server to execute the instruction sending method. The slave server directly obtains the first operation instruction, generates the second operation instruction, and executes the second operation instruction, thereby obtaining the execution result of the target operation in the slave server. It can be understood that the process of instructing the slave server to indicate the target operation and the script to the target operation object is to execute the code implementation inside the slave server.
[0054] Determine whether to send the first operation instruction to the main server to improve resource utilization.
[0055] It can be understood that the above-mentioned second operation instruction can be used to instruct the execution of the target operation on the above-mentioned target operation object, and the above-mentioned script can be used to obtain the parameter information of the above-mentioned target operation object. For example: before the above-mentioned slave server executes the above-mentioned target operation on the above-mentioned target operation object, the above-mentioned script is executed to obtain the first parameter information of the above-mentioned target operation object before executing the target operation; after the above-mentioned slave server executes the above-mentioned target operation object, the above-mentioned script is executed to obtain the second parameter information and alarm information of the above-mentioned target operation object after executing the target operation.
[0056] Optionally, the field content of the warning information is determined based on the operation type of the target operation;
[0057] Before the target server instructs the slave server to perform the target operation and the script on the target operation object based on the second operation instruction in step 103, the method further includes:
[0058] The target server obtains the operation type of the target operation.
[0059] Among them, the above-mentioned alarm information can correspond one-to-one to the operation type of the above-mentioned target operation. For example: when the above-mentioned target operation is to add data, the field content of the above-mentioned alarm information can include "add data"; when the above-mentioned target operation is to delete data, the field content of the above-mentioned alarm information can include "delete data"; when the above-mentioned target operation is to modify data, the field content of the above-mentioned alarm information can include "modify data".
[0060] In this embodiment, the field content of the alarm information is determined based on the operation type of the target operation. In this way, when judging the execution result of the operation instruction, the operation type of the target operation can be used as a judgment criterion to determine the operation type of the target operation in the form of alarm information.
[0061] Step 104: The target server obtains the first parameter information, the second parameter information, and the alarm information, wherein the first parameter information, the second parameter information, and the alarm information are used to determine whether the execution result of the target operation is correct.
[0062] The execution result of the target operation can be obtained based on the first parameter information, the second parameter information, and the alarm information. Specifically, by comparing the changes between the first parameter information and the second parameter information, the impact of the execution of the operation instruction on the execution of the business in the server can also be judged based on the alarm information, thereby comprehensively judging whether the execution result of the operation instruction is correct. In addition, the judgment on whether the execution result of the operation instruction is correct can be judged by the operator. After the operator determines, the judgment on whether the execution result of the operation instruction is correct is input to the target server; alternatively, the target server or other device can also judge whether the execution result of the target operation is correct based on the first parameter information, the second parameter information, and the alarm information. The target server executes corresponding steps to judge whether the execution result of the operation instruction is correct.
[0063] Step 105: If the execution result is correct, the target server sends the first operation instruction to the main server, where the first operation instruction is used to instruct the main server to perform the target operation on the target operation object.
[0064] By determining whether the execution result of the target operation is correct, it can be determined whether the operation instruction contains incorrect configuration or changes. If the operation instruction contains incorrect configuration or changes, it may cause service errors and business interruptions on the master server. If the execution result is correct, executing the operation instruction can reduce service errors and business interruptions. After the master server completes execution of the operation instruction, the master server's data can be backed up to the slave server through the master-slave hot standby mechanism, achieving synchronous update of the slave server's data environment.
[0065] Furthermore, if the execution result is incorrect, the first operation instruction may be deemed to contain incorrect configuration and change content, and a new operation instruction may need to be obtained to implement the target operation on the target operation object. Specifically, the target server will not send the first operation instruction to the master server, and the master server will not execute the first operation instruction. Furthermore, the slave server may back up the data on the master server to the slave server according to the master-slave hot standby mechanism, restoring the data environment of the slave server to the state before the second operation instruction was executed.
[0066] In an embodiment of the present application, the target server obtains a first operation instruction; generates a second operation instruction based on the first operation instruction; instructs the slave server to perform a target operation and a script on the target operation object based on the second operation instruction, so as to obtain the first parameter information of the target operation object before the slave server performs the target operation, and the second parameter information and alarm information of the target operation object after the slave server performs the target operation; obtains the first parameter information, the second parameter information and the alarm information, wherein the first parameter information, the second parameter information and the alarm information are used to determine whether the execution result of the target operation is correct; if the execution result is correct, sends the first operation instruction to the master The first operation instruction is used to instruct the main server to perform the target operation on the target operation object; that is, the target operation performed by the main server is pre-executed by the slave server, and when the target server determines that the execution result of the target operation is correct, the target server sends it to the main server to realize the main server's execution of the first operation instruction. The first operation instruction can be executed in the slave server to obtain the execution result of the target operation, which can avoid the first operation instruction with erroneous configuration and change content from being executed by the main server, thereby improving the correctness of the service and business continuity in the main server, and improving the security of the main server in executing the operation instruction.
[0067] Optionally, the execution state of the script includes a first state, a second state and a third state;
[0068] When the execution state of the script is the first state, the second operation instruction is used to instruct the slave server to execute the script, the target operation, and the script in sequence;
[0069] In step 104, the target server obtains the first parameter information, the second parameter information, and the alarm information, which may specifically include the following steps:
[0070] The target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation;
[0071] The target server writes the first parameter information into a first data table;
[0072] The target server obtains the second parameter information and the alarm information obtained by the slave server executing the script after executing the target operation;
[0073] The target server updates the second data table based on the first parameter information in the first data table;
[0074] The target server updates the first data table based on the second parameter information and the alarm information.
[0075] In some embodiments, the first data table may store parameter information and alarm information for the target operation object in the current state, and the second data table may store parameter information for the target operation object in the state before the current state. That is, the parameter information for the target operation object may be updated in real time via the second data table and the first data table. Furthermore, each operation object in the resource library of the target server corresponds to a second data table and a first data table to store changes in parameter information for each operation object between the current state and the previous state, as well as alarm information corresponding to the parameter information in the current state.
[0076] Among them, the above-mentioned first state may correspond to the above-mentioned initial operation state, the above-mentioned second state may correspond to the system migration state, and the above-mentioned third state may correspond to the normal operation state. The process of judging the execution state of the script is not repeated here.
[0077] When the execution state of the script is the first state, before executing the target operation, the slave server can be instructed to execute the script first, so that the first parameter information of the target operation object before executing the target operation can be obtained. Before executing the target operation, the first parameter information is the current state data, and thus the first data table can be used for storage. Then, the slave server can execute the target operation and the script in sequence, and the second parameter information and the corresponding warning information of the target operation object after executing the target operation are obtained by executing the script. After executing the target operation, the second parameter information is the current state data, and the first parameter information is the previous state data. The first parameter information in the first data table can be written to the second data table, and then the second parameter information and the corresponding warning information can be used to update the first data table. It can be understood that the first state is the initial operation state. When the execution state of the script is the first state, the script has not been executed, and the second data table and the first data table are both empty tables.
[0078] In this embodiment, when the script execution state is the first state, the target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation; the target server updates the first data table based on the first parameter information and deletes information in the second data table; the target server obtains the second parameter information and the warning information obtained by the slave server executing the script before executing the target operation; the target server updates the second data table based on the first parameter information in the first data table; and the target server updates the first data table based on the second parameter information and the warning information. Thus, when the script execution state is the first state, the first parameter information, the second parameter information, and the warning information are obtained.
[0079] Optionally, when the execution state of the script is the second state, the second operation instruction is used to instruct the slave server to execute the script, the target operation and the script in sequence;
[0080] In step 104, the target server obtains the first parameter information, the second parameter information, and the alarm information, which may specifically include the following steps:
[0081] The target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation;
[0082] The target server updates the first data table based on the first parameter information and deletes the information in the second data table;
[0083] The target server obtains the second parameter information and the warning information obtained by the slave server executing the script before executing the target operation;
[0084] The target server updates the second data table based on the first parameter information in the first data table;
[0085] The target server updates the first data table based on the second parameter information and the alarm information.
[0086] When the execution state of the script is the second state, before executing the target operation, the slave server can first execute the script, so that the first parameter information of the target operation object before executing the target operation can be obtained. Before executing the target operation, the first parameter information is the current state data, so the first parameter information can be used to update the first data table. However, since the control right of the master server changes in the second state, the information in the second data table is not the previous state data, and the information in the second data table can be deleted. Then, the slave server can execute the target operation and the script in sequence, and the second parameter information and corresponding alarm information of the target operation object after executing the script are obtained. After executing the target operation, the second parameter information is the current state data and the first parameter information is the previous state data. The first parameter information in the first data table can be written to the second data table, and then the second parameter information and the corresponding alarm information can be used to update the first data table.
[0087] In this embodiment, when the script execution state is the second state, the target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation; the target server updates the first data table based on the first parameter information and deletes information in the second data table; the target server obtains the second parameter information and the warning information obtained by the slave server executing the script before executing the target operation; the target server updates the second data table based on the first parameter information in the first data table; and the target server updates the first data table based on the second parameter information and the warning information. Thus, when the script execution state is the second state, the first parameter information, the second parameter information, and the warning information are obtained.
[0088] Optionally, when the execution state of the script is the third state, the second operation instruction is used to instruct the slave server to execute the target operation and the script in sequence;
[0089] In step 104, the target server obtains the first parameter information, the second parameter information, and the alarm information, which may specifically include the following steps:
[0090] The target server obtains the first parameter information based on the first data table;
[0091] The target server updates the second data table based on the first parameter information;
[0092] The target server obtains the second parameter information and the alarm information obtained by the slave server executing the script after executing the target operation;
[0093] The target server updates the first data table based on the second parameter information and the alarm information.
[0094] When the execution state of the script is the third state, the slave server is in a normal operating state, and thus both the second data table and the first data table store the previous state data and the current state data under the current normal operating state. The slave server can sequentially execute the target operation and the script, and what is obtained by executing the script is the second parameter information and the corresponding alarm information of the target operation object after the target operation is executed. After the target operation is executed, the second parameter information is the current state data, and the information in the first data table is the first parameter information. The first parameter information in the first data table can be used to update the second data table, and then the second parameter information and the corresponding alarm information can be used to update the first data table.
[0095] In this embodiment, when the script execution state is the third state, the target server obtains the first parameter information based on the first data table; the target server updates the second data table based on the first parameter information; the target server obtains the second parameter information and the warning information obtained by the slave server executing the script after performing the target operation; and the target server updates the first data table based on the second parameter information and the warning information. Thus, when the script execution state is the second state, the first parameter information, the second parameter information, and the warning information are obtained.
[0096] Optionally, in step 105, if the execution result is correct, before the target server sends the first operation instruction to the main server, the method may further include the following steps:
[0097] The target server outputs the first parameter information, the second parameter information and the alarm information based on the updated first data table and the second data table;
[0098] The target server obtains a confirmation instruction confirming that the execution result is correct, where the confirmation instruction is obtained based on the first parameter information, the second parameter information and the alarm information;
[0099] If the first parameter information and the second parameter information are inconsistent, the target server performs visually enhanced display on the first parameter information and the second parameter information.
[0100] In some embodiments, the above-mentioned confirmation instruction may be an instruction input by an operator, and the instruction input by the above-mentioned operator may be a judgment instruction on whether the above-mentioned execution result is correct based on the above-mentioned first parameter information, the above-mentioned second parameter information and the above-mentioned alarm information output from the server; or, the above-mentioned confirmation instruction may also be a judgment instruction obtained by the above-mentioned target server after judging whether the above-mentioned execution result is correct based on the above-mentioned first parameter information, the above-mentioned second parameter information and the above-mentioned alarm information.
[0101] Among them, the above-mentioned visual enhancement display can be the inconsistent parts of the above-mentioned first parameter information and the above-mentioned second parameter information, that is, the changes in the target operation object before and after the execution of the above-mentioned target operation are visually enhanced. For example: different colors of text are used to output the inconsistent parts of the above-mentioned first parameter information and the above-mentioned second parameter information. Furthermore, different colors of text can also be used for the operation types of the above-mentioned target operation. Taking the operation types of the above-mentioned target operation including "add", "delete" and "modify" as an example, when the target operation is of the add type, the inconsistent parts of the above-mentioned first parameter information and the above-mentioned second parameter information are displayed in blue; when the target operation is of the delete type, the inconsistent parts of the above-mentioned first parameter information and the above-mentioned second parameter information are displayed in red; when the target operation is of the modify type, the inconsistent parts of the above-mentioned first parameter information and the above-mentioned second parameter information are displayed in yellow. The above-mentioned visual enhancement display can also include the use of bold text display, adding a markup box display, enlarging text, etc., and this application does not impose any restrictions on this.
[0102] In this implementation, the target server outputs the first parameter information, the second parameter information and the alarm information based on the updated first data table and the second data table; the target server obtains a confirmation instruction to confirm that the execution result is correct, and the confirmation instruction is obtained based on the first parameter information, the second parameter information and the alarm information; in this way, the target server can store the first parameter information, the second parameter information and the alarm information through the first data table and the second data table, and can output the first parameter information, the second parameter information and the alarm information, so as to realize the judgment of whether the execution result of the target operation is correct.
[0103] In addition, when the target server outputs the first parameter information, the second parameter information and the alarm information based on the updated first data table and the second data table, if the first parameter information and the second parameter information are inconsistent, the slave server performs visually enhanced display of the first parameter information and the second parameter information. When the operator is required to judge whether the execution result of the target operation is correct based on the output first parameter information, the second parameter information and the alarm information, a visual enhancement effect can be achieved.
[0104] For ease of understanding, the following examples are provided:
[0105] The embodiment of the present application also provides a configuration and change error protection system based on dynamic operation prediction, including a master and a slave, and the master and the slave are set up based on a master-slave hot standby mechanism, such as Figure 2 As shown, the configuration and change error protection system can specifically include six functional modules: a unified operation module, an execution status determination module, a script execution module, an operation prediction module, an operation response module, and a resource library.
[0106] Among them, based on the master-slave hot standby mechanism of the operation object, the operator selects the required operation type from the three operation types of "add, delete, and modify" in the unified operation module according to the configuration and change requirements, and then enters the operation instruction and calls the syntax verification function of the operating system to perform syntax verification on the operation instruction; after the operation syntax verification is completed, the execution status determination module and the script execution module are used to determine the current execution status among the three execution states of initial operation status, system migration status, and normal operation status, and perform configuration and change operations on the "slave machine", as well as execute the script file, and update the corresponding data of the resource library according to the script execution results; then, in the operation prediction module, according to the updated resource library, the resource map and prediction alarm information are obtained, and the operation results are visually predicted; finally, in the operation response module, the operator confirms the configuration and change operations based on the obtained operation prediction results; after confirmation, the configuration and change operations are directly performed on the "master machine", and master-slave hot machine backup is performed. After the above series of execution processes, effective protection against configuration and change operation errors can be achieved, the correctness of configuration and change operations can be ensured, and security issues such as service errors and business interruptions caused by configuration and change errors can be prevented.
[0107] The embodiment of the present application also provides a configuration and change error protection method based on dynamic operation prediction, such as Figure 3 As shown, the following steps may be specifically included:
[0108] Step 1: Based on the configuration and change requirements, the operator selects the required operation type from the three types of "add, delete, and modify" in the unified operation module, and then enters the operation instruction;
[0109] Step 2: Call the syntax check function of the operating system to perform syntax check on the input operation instruction: if the operation syntax is "wrong", return to step 1 and repeat the operation; if the operation syntax is "correct", execute the next step.
[0110] Step 3: In the execution status determination module, the execution status of the script is determined by the number of times the script has been executed and the change of the host control right. Specifically, if the host control right of the operating environment has not changed and the number of script executions is 0, it means that the system has not been migrated and the script has not been executed. At this time, the execution status is the initial operation state (Status=INIT); if the host control right of the operating environment has not changed and the number of script executions is greater than 0, it means that the system has not been migrated and the script has been executed. At this time, the execution status is the normal operation state (Status=NORMAL); if the host control right of the operating environment has changed, it means that the system has been migrated. At this time, the execution status is the system migration state (Status=TRANSFER).
[0111] Step 4: Based on the output result of the execution status determination module, in the script execution module, execute the script on the "slave machine", obtain the resource map element value and pre-judgment alarm information defined according to the requirements, and update the resource library according to the script execution result. Specifically, it can include three situations: (1) If the execution status is the initial operation status (Status = INIT), execute the script on the "slave machine", and update the table table (current status table) in the resource library according to the element value of the resource map and pre-judgment alarm information obtained after the script execution. Do not update the pre-table table (previous status table). At this time, the pre-table table is an empty table. Then, perform the "configuration and change operation" on the "slave machine", and then execute the script on the "slave machine". After the script is executed, the resource map field contents of the operation object table are first copied to the pre-table table, and then the table table in the resource library is updated according to the element values of the resource map and the predicted alarm information obtained after the script is executed; (2) If the execution status is the system migration status (Status = TRANSFER), the script is executed on the "slave", and according to the element values of the resource map and the predicted alarm information obtained after the script is executed, the table table in the resource library is updated and the pre-table table is cleared. Then, the "configuration and change operation" is performed on the "slave", and then the script is executed on the "slave". After the script is executed, the resource map field contents of the operation object table are first copied to the pre-table table, and then the table table in the resource library is updated according to the element values of the resource map and the predicted alarm information obtained after the script is executed; (3) If the execution status is the normal operation status (Status = NORMAL), the "configuration and change operation" is performed on the "slave", and then the script is executed on the "slave". After the script is executed, the resource map field contents of the table being operated on are copied to the pre-table table. Then, based on the resource map element values and predicted alarm information obtained after the script is executed, the table in the resource library is updated. Then, proceed to the next step.
[0112] Specifically, different script execution states will result in different updates to the resource library. The script execution state is indicated by "Status," the initial operation state is indicated by "INIT," the system migration state is indicated by "TRANSFER," and the normal operation state is indicated by "NORMAL."
[0113] The resource library consists of data tables of operation objects. Each operation object has two corresponding data tables, namely the pre-table table (previous state table) and the table table (current state table) of the operation object. The pre-table table fields are composed of resource map fields, and the table table fields are composed of resource map fields and prejudgment alarm information fields. The specific contents of the resource map fields and prejudgment alarm information fields can be flexibly defined according to different usage scenarios. For example, the commonly used operation objects "process files, iptables (IP packet filtering system), ACL files (Access Control List), key files, system logs, databases" can be stored in the resource library as follows (assuming that system x exists):
[0114] Process files: The pre-table and table tables of process files are stored in the resource library.
[0115] Pre-table table fields: resource map fields (process name, process path, process number, port number, service name, system x name associated with the process).
[0116] Table fields: resource map fields (process name, process path, process number, port number, service name, system x name associated with the process), and predicted alarm information fields.
[0117] Predicted Alarm Information Field: Depending on the type of operation selected in the "Uniform Operation Module," the value of the Predicted Alarm Information field will be different. (1) If it is an "Add" operation, the value of the Predicted Alarm Information field will be "You added process [process name], which will affect the business of system x. Please operate with caution!"; (2) If it is a "Delete" operation, when the current process is a business system process, the content of the Predicted Alarm Information field will be "You killed (deleted) process [process name], which will interrupt the business of system x. Please operate with caution!"; If the current process is not a business system process, the content of the Predicted Alarm Information field will be "You killed process [process name], which will affect the business of system x. Please operate with caution!"; (3) If it is a "Modify" operation, the content of the Predicted Alarm Information field will be "You modified the process [modification object], which may affect the business of system x. Please operate with caution!".
[0118] iptables: The iptables pre-table and table tables are stored in the resource library.
[0119] Pre-table table fields: resource map fields (host name, host IP, [IP allowed to access: port number], [IP prohibited to access: port number], [IP allowed to access: port number], [IP prohibited to access: port number]);
[0120] Table fields: resource map fields (host name, host IP, [IP allowed to access: port number], [IP prohibited to access: port number], [IP allowed to access: port number], [IP prohibited to access: port number]), prediction alarm information field;
[0121] Predicted Alarm Information Field: Depending on the type of operation selected in the "Uniform Operation Module," the value of the Predicted Alarm Information field will be different. (1) If it is an "Add" operation, the value of the Predicted Alarm Information field will be "You have added a rule [added rule], which will change the access permissions of system x / accessibility. Please proceed with caution!"; (2) If it is a "Delete" operation, the value of the Predicted Alarm Information field will be "You have deleted a rule [deleted rule], which will change the access permissions of system x / accessibility. Please proceed with caution!"; (3) If it is a "Modify" operation, the value of the Predicted Alarm Information field will be "You have modified a rule [modified rule], which will change the access permissions of system x / accessibility. Please proceed with caution!".
[0122] ACL file: The pre-table and table tables that store ACL files are stored in the resource library.
[0123] Pre-table table fields: resource map fields (ACL name, ACL path, accessed system x name, accounts allowed to access, accounts prohibited to access);
[0124] Table fields: resource map fields (ACL name, ACL path, accessed system x name, accounts allowed to access, accounts prohibited to access), and predicted alarm information fields;
[0125] Predictive Alarm Information Field: Depending on the type of operation selected in the "Uniform Operation Module," the value of the Predictive Alarm Information field will be different. (1) If it is an "Add" operation, the value of the Predictive Alarm Information field will be "You added ACL [added rules], which will restrict the access rights of system x. Please operate with caution!"; (2) If it is a "Delete" operation, the content of the Predictive Alarm Information field will be "You deleted ACL [deleted rules], which will expand the access rights of system x. Please operate with caution!"; (3) If it is a "Modify" operation, the content of the Predictive Alarm Information field will be "You modified ACL [modified rules], which will affect the access rights of system x. Please operate with caution!".
[0126] Key file: The pre-table and table tables that store key files are stored in the resource library.
[0127] Pre-table table fields: resource map fields (file name, file path, user name, key HASH value, system x name associated with the key file);
[0128] Table fields: resource map fields (file name, file path, user name, system x name associated with the key file), and prediction alarm information fields;
[0129] Predicted Alarm Information Field: Depending on the type of operation selected in the "Uniform Operation Module," the value of the Predicted Alarm Information field will be different. (1) If it is an "Add" operation, the value of the Predicted Alarm Information field will be "You have added the login account [user name], which will increase the number of users accessing system x. Please proceed with caution!"; (2) If it is a "Delete" operation, the value of the Predicted Alarm Information field will be "You have deleted the login account [user name], which will reduce the number of users accessing system x. Please proceed with caution!"; (3) If it is a "Modify" operation, the value of the Predicted Alarm Information field will be "You have modified the login account [user name], which will change the access credential information of system x. Please proceed with caution!".
[0130] System log: The pre-table and table tables of the system log are stored in the resource library.
[0131] Pre-table table fields: resource map fields (log name, log path, system x name associated with the log);
[0132] Table fields: resource map fields (log name, log path, system x name associated with the log), and predicted alarm information fields;
[0133] Predicted Alarm Information Field: The value of the Predicted Alarm Information field varies depending on the type of operation selected in the "Uniform Operation Module". (1) If it is an "Add" operation, the value of the Predicted Alarm Information field is "You have added log information [log path], which will affect the business of system x. Please operate with caution!"; (2) If it is a "Delete" operation, the content of the Predicted Alarm Information field is "You have deleted log information [log path], which will affect the business of system x. Please operate with caution!"; (3) If it is a "Modify" operation, the content of the Predicted Alarm Information field is "You have modified log information [log path], which will affect the business of system x. Please operate with caution!".
[0134] Database: The database pre-table and table tables are stored in the resource library.
[0135] Pre-table table fields: resource map fields (database name, database path, access account, system x name associated with the database);
[0136] Table fields: resource map fields (database name, database path, access account, system x name associated with the database), and predicted alarm information fields;
[0137] Predicted Alarm Information Field: Depending on the type of operation selected in the "Uniform Operation Module," the value of the Predicted Alarm Information field will be different. When operating on the access rights of a database, (1) if it is an "add" operation, the value of the Predicted Alarm Information field will be "You have added access account [access account], which will increase the number of users accessing the database [database name]. Please proceed with caution!"; (2) if it is a "delete" operation, the value of the Predicted Alarm Information field will be "You have deleted access account [access account], which will reduce the number of users accessing the database [database name]. Please proceed with caution!"; (3) if it is a "modify" operation, the value of the Predicted Alarm Information field will be "You have modified access account [access account], which will change the visitor credential information of the database [database name]. Please proceed with caution!". When operating the stored content of the database, (1) if it is an "add" operation, the value of the predicted alarm information field is "You added data [added content], which will affect the business of system x, please operate with caution!"; (2) if it is a "delete" operation, the content of the predicted alarm information field is "You deleted data [deleted content], which will affect the business of system x, please operate with caution!"; (3) if it is a "modify" operation, the content of the predicted alarm information field is "You modified data [modified content], which will affect the business of system x, please operate with caution!".
[0138] Step 5: Based on the updated resource library, visualize the resource map and predicted alarm information for the operation target in the Operation Prediction module. Changes to the resource map before and after configuration and modification operations are marked with different colors, with distinct colors used for the three operation types of "add," "delete," and "modify." Then, proceed to the next step.
[0139] Step 6: Based on the output of the operation prediction module, the configuration and change operation is confirmed in the operation response module. (1) If the configuration and change operation is "wrong", the master-slave hot machine backup is first performed to restore the data environment of the "slave" before the configuration and change operation, and then return to step 1 and repeat the operation; (2) If the configuration and change operation is "correct", the configuration and change operation is directly performed on the "master", and then the master-slave hot machine backup is performed to synchronously update the data environment of the "slave".
[0140] See also Figure 4 , Figure 4This is a schematic diagram of the structure of a server provided in an embodiment of the present application. Figure 4 As shown, the server is a target server, and the server 400 includes:
[0141] A first acquisition module 401 is used to acquire a first operation instruction;
[0142] A generating module 402, configured to generate a second operating instruction based on the first operating instruction;
[0143] an instruction module 403, configured to instruct the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before performing the target operation, second parameter information of the target operation object after performing the target operation, and alarm information;
[0144] A second acquisition module 404 is configured to acquire the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the operation instruction is correct;
[0145] The sending module 405 is used to send the first operation instruction to the main server if the execution result is correct, and the first operation instruction is used to instruct the main server to perform the target operation on the target operation object.
[0146] Optionally, the generating module 402 may specifically include:
[0147] A first acquiring unit, configured to acquire the execution status of the script;
[0148] a generating unit, configured to generate the second operating instruction using the first operating instruction based on an execution state of the script;
[0149] The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order.
[0150] Optionally, the first acquiring unit may specifically include:
[0151] A first acquisition subunit is used to acquire the execution times of the script and the change information of the control right of the main server;
[0152] The determination subunit is configured to determine the execution status of the script based on the number of executions of the script and the change information of the control right of the main server.
[0153] Optionally, the execution state of the script includes a first state, a second state and a third state;
[0154] When the execution state of the script is the first state, the second operation instruction is used to instruct the slave server to execute the script, the target operation, and the script in sequence;
[0155] The second acquisition module 404 may specifically include:
[0156] a second acquiring unit, configured to acquire the first parameter information obtained by executing the script from the server before executing the target operation;
[0157] a writing unit, configured to write the first parameter information into a first data table;
[0158] a third acquiring unit, configured to acquire the second parameter information and the alarm information obtained by executing the script from the server after executing the target operation;
[0159] a first updating unit, configured to update a second data table based on the first parameter information in the first data table;
[0160] A second updating unit is configured to update the first data table based on the second parameter information and the alarm information.
[0161] Optionally, when the execution state of the script is the second state, the second operation instruction is used to instruct the slave server to execute the script, the target operation and the script in sequence;
[0162] The second acquisition module 404 may specifically include:
[0163] A fourth acquiring unit, configured to acquire the first parameter information obtained by the slave server executing the script before executing the target operation;
[0164] a third updating unit, configured to update the first data table based on the first parameter information and delete information in the second data table;
[0165] a fifth acquiring unit, configured to acquire the second parameter information and the warning information obtained by the slave server executing the script after executing the target operation;
[0166] a fourth updating unit, configured to update the second data table based on the first parameter information in the first data table;
[0167] A fifth updating unit is configured to update the first data table based on the second parameter information and the alarm information.
[0168] Optionally, when the execution state of the script is the third state, the second operation instruction is used to instruct the slave server to execute the target operation and the script in sequence;
[0169] The second acquisition module 404 may specifically include:
[0170] a sixth acquiring unit, configured to acquire the first parameter information based on the first data table;
[0171] a sixth updating unit, configured to update the second data table based on the first parameter information;
[0172] a seventh obtaining unit, configured to obtain the second parameter information and the warning information obtained by the slave server executing the script after executing the target operation;
[0173] A seventh updating unit is configured to update the first data table based on the second parameter information and the alarm information.
[0174] Optionally, the server 400 may further include:
[0175] an output module, configured to output the first parameter information, the second parameter information, and the alarm information based on the updated first data table and the second data table;
[0176] a third acquisition module, configured for the target server to acquire a confirmation instruction confirming that the execution result is correct, wherein the confirmation instruction is obtained based on the first parameter information, the second parameter information, and the alarm information;
[0177] If the first parameter information and the second parameter information are inconsistent, the target server performs visually enhanced display on the first parameter information and the second parameter information.
[0178] Optionally, the field content of the warning information is determined based on the operation type of the target operation;
[0179] The server 400 may further include:
[0180] The fourth acquisition module is used to acquire the operation type of the target operation.
[0181] The server 400 can implement the embodiment of the present application Figure 1 The various processes of the method embodiment and the achievement of the same beneficial effects are not described again here to avoid repetition.
[0182] See also Figure 5 , Figure 5 This is a structural diagram of a command sending system provided by an embodiment of the present application. Figure 5 As shown, including:
[0183] Target server 501, slave server 502 and master server 503;
[0184] The target server 501 is configured to obtain a first operation instruction; generate a second operation instruction based on the first operation instruction; instruct the slave server 502 to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server 502 performs the target operation, and second parameter information and alarm information of the target operation object after the slave server 502 performs the target operation; obtain the first parameter information, the second parameter information and the alarm information, wherein the first parameter information, the second parameter information and the alarm information are used to determine whether the execution result of the target operation is correct; if the execution result is correct, send the first operation instruction to the master server 503, and the first operation instruction is used to instruct the master server 503 to perform the target operation on the target operation object;
[0185] The slave server 502 is configured to execute the second operation instruction;
[0186] The main server 503 is used to execute the first operation instruction.
[0187] It should be noted that this embodiment is similar to the above Figure 1 The specific implementation of the system side corresponding to the embodiment can be found in the above Figure 1 The relevant introduction in the embodiments can achieve the same technical effects, so to avoid repetition, they will not be repeated here.
[0188] The embodiment of the present application also provides a communication device. Figure 1 The instruction sending method shown is similar, so the implementation of the communication device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 6 As shown, the communication device of the embodiment of the present application includes: a processor 600, which is used to read the program in the memory 620 and perform the following process:
[0189] Obtaining a first operation instruction;
[0190] generating a second operation instruction based on the first operation instruction;
[0191] instructing the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, and second parameter information of the target operation object after the slave server performs the target operation, and alarm information;
[0192] Acquire the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the target operation is correct;
[0193] When the execution result is correct, the first operation instruction is sent to the main server via the transceiver 610 , where the first operation instruction is used to instruct the main server to perform the target operation on the target operation object.
[0194] The transceiver 610 is configured to receive and send data under the control of the processor 600 .
[0195] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 600 and memory represented by memory 620. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are all well known in the art and, therefore, will not be described further herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, i.e., a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations.
[0196] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0197] Obtaining the execution status of the script;
[0198] generating the second operation instruction using the first operation instruction based on the execution state of the script;
[0199] The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order.
[0200] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0201] Obtaining the number of executions of the script and change information of the control right of the master server;
[0202] The execution status of the script is determined based on the number of executions of the script and the change information of the control right of the main server.
[0203] Optionally, the execution state of the script includes a first state, a second state and a third state;
[0204] When the execution state of the script is the first state, the second operation instruction is used to instruct the slave server to execute the script, the target operation, and the script in sequence;
[0205] The processor 600 is further configured to read the program in the memory 620 and execute the following steps:
[0206] Obtaining the first parameter information obtained by executing the script from the server before executing the target operation;
[0207] Writing the first parameter information into a first data table;
[0208] Obtaining the second parameter information and the alarm information obtained by executing the script from the server after executing the target operation;
[0209] updating a second data table based on the first parameter information in the first data table;
[0210] The first data table is updated based on the second parameter information and the alarm information.
[0211] Optionally, when the execution state of the script is the second state, the second operation instruction is used to instruct the slave server to execute the script, the target operation and the script in sequence;
[0212] The processor 600 is further configured to read the program in the memory 620 and execute the following steps:
[0213] The first parameter information obtained by executing the script before executing the target operation;
[0214] Update the first data table based on the first parameter information, and delete the information in the second data table;
[0215] Obtaining the second parameter information and the warning information obtained by executing the script from the server before executing the target operation;
[0216] updating the second data table based on the first parameter information in the first data table;
[0217] The first data table is updated based on the second parameter information and the alarm information.
[0218] Optionally, when the execution state of the script is the third state, the second operation instruction is used to instruct the slave server to execute the target operation and the script in sequence;
[0219] The processor 600 is further configured to read the program in the memory 620 and execute the following steps:
[0220] Acquire the first parameter information based on the first data table;
[0221] Updating the second data table based on the first parameter information;
[0222] Obtaining the second parameter information and the alarm information obtained by executing the script from the server after executing the target operation;
[0223] The first data table is updated based on the second parameter information and the alarm information.
[0224] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0225] outputting the first parameter information, the second parameter information, and the alarm information based on the updated first data table and the second data table;
[0226] Obtaining a confirmation instruction confirming that the execution result is correct, the confirmation instruction being obtained based on the first parameter information, the second parameter information, and the alarm information;
[0227] If the first parameter information and the second parameter information are inconsistent, the first parameter information and the second parameter information are displayed in a visually enhanced manner.
[0228] Optionally, the field content of the warning information is determined based on the operation type of the target operation;
[0229] The processor 600 is further configured to read the program in the memory 620 and execute the following steps:
[0230] Gets the operation type of the target operation.
[0231] The communication device provided in the embodiment of the present application can perform the above Figure 1 The implementation principle and technical effects of the method embodiment shown are similar, and will not be described in detail in this embodiment.
[0232] The present application also provides a readable storage medium for storing a program, which is executed by a processor to implement the following Figure 1 The various processes of the method embodiments are similar and can achieve the same technical effects. To avoid repetition, they will not be described here.
[0233] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0234] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may be physically included separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0235] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute some steps of the sending and receiving methods described in various embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.
[0236] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for sending an instruction, characterized in that: include: The target server obtains the first operation instruction; The target server generates a second operation instruction based on the first operation instruction; The target server instructs the slave server to perform a target operation and a script on the target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, and second parameter information of the target operation object after the slave server performs the target operation, and alarm information; The target server obtains the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the target operation is correct; If the execution result is correct, the target server sends the first operation instruction to the main server, where the first operation instruction is used to instruct the main server to perform the target operation on the target operation object; The target server generates a second operation instruction based on the first operation instruction, including: The target server obtains the execution status of the script; Based on the execution state of the script, the target server generates the second operation instruction using the first operation instruction; The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order; The target server obtains the execution status of the script, including: The target server obtains the execution times of the script and the change information of the control right of the main server; The target server determines the execution status of the script based on the number of executions of the script and the change information of the control right of the main server.
2. The method according to claim 1, wherein The execution state of the script includes a first state, a second state and a third state; When the execution state of the script is the first state, the second operation instruction is used to instruct the slave server to execute the script, the target operation, and the script in sequence; The target server obtains the first parameter information, the second parameter information, and the alarm information, including: The target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation; The target server writes the first parameter information into a first data table; The target server obtains the second parameter information and the alarm information obtained by the slave server executing the script after executing the target operation; The target server updates the second data table based on the first parameter information in the first data table; The target server updates the first data table based on the second parameter information and the alarm information.
3. The method according to claim 2, wherein When the execution state of the script is the second state, the second operation instruction is used to instruct the slave server to execute the script, the target operation, and the script in sequence; The target server obtains the first parameter information, the second parameter information, and the alarm information, including: The target server obtains the first parameter information obtained by the slave server executing the script before executing the target operation; The target server updates the first data table based on the first parameter information and deletes the information in the second data table; The target server obtains the second parameter information and the alarm information obtained by the slave server executing the script after executing the target operation; The target server updates the second data table based on the first parameter information in the first data table; The target server updates the first data table based on the second parameter information and the alarm information.
4. The method according to claim 2, wherein When the execution state of the script is the third state, the second operation instruction is used to instruct the slave server to execute the target operation and the script in sequence; The target server obtains the first parameter information, the second parameter information, and the alarm information, including: The target server obtains the first parameter information based on the first data table; The target server updates the second data table based on the first parameter information; The target server obtains the second parameter information and the alarm information obtained by the slave server executing the script after executing the target operation; The target server updates the first data table based on the second parameter information and the alarm information.
5. The method according to any one of claims 2 to 4, characterized in that When the execution result is correct, before the target server sends the first operation instruction to the main server, the method further includes: The target server outputs the first parameter information, the second parameter information and the alarm information based on the updated first data table and the second data table; The target server obtains a confirmation instruction confirming that the execution result is correct, where the confirmation instruction is obtained based on the first parameter information, the second parameter information and the alarm information; If the first parameter information and the second parameter information are inconsistent, the target server performs visually enhanced display on the first parameter information and the second parameter information.
6. The method according to claim 1, wherein The field content of the warning information is determined based on the operation type of the target operation; Before the target server instructs the slave server to perform the target operation and the script on the target operation object based on the second operation instruction, the method further includes: The target server obtains the operation type of the target operation.
7. A server, the server being a target server, characterized in that: include: A first acquisition module, configured to acquire a first operation instruction; a generating module, configured to generate a second operating instruction based on the first operating instruction; an instruction module, configured to instruct the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, second parameter information of the target operation object after the slave server performs the target operation, and alarm information; a second acquisition module, configured to acquire the first parameter information, the second parameter information, and the warning information, wherein the first parameter information, the second parameter information, and the warning information are used to determine whether the execution result of the operation instruction is correct; a sending module, configured to send the first operation instruction to the main server if the execution result is correct, wherein the first operation instruction is used to instruct the main server to perform the target operation on the target operation object; The generation module specifically includes: A first acquiring unit, configured to acquire the execution status of the script; a generating unit, configured to generate the second operating instruction using the first operating instruction based on an execution state of the script; The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order; The first acquiring unit specifically includes: A first acquisition subunit is used to acquire the execution times of the script and the change information of the control right of the main server; The determination subunit is configured to determine the execution status of the script based on the number of executions of the script and the change information of the control right of the main server.
8. A communication device comprising: A transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that: The processor is configured to read a program in a memory to implement the steps in the method according to any one of claims 1 to 6.
9. A computer-readable storage medium for storing 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 6 are implemented.
10. A command sending system, characterized in that: include: Target server, slave server and master server; Wherein, the target server is used to obtain a first operation instruction; generate a second operation instruction based on the first operation instruction; instruct the slave server to perform a target operation and a script on a target operation object based on the second operation instruction, so as to obtain first parameter information of the target operation object before the slave server performs the target operation, and second parameter information and alarm information of the target operation object after the slave server performs the target operation; obtain the first parameter information, the second parameter information and the alarm information, wherein the first parameter information, the second parameter information and the alarm information are used to determine whether the execution result of the target operation is correct; if the execution result is correct, send the first operation instruction to the master server, and the first operation instruction is used to instruct the master server to perform the target operation on the target operation object; The slave server is configured to execute the second operation instruction; The main server is configured to execute the first operation instruction; The target server generates a second operation instruction based on the first operation instruction, including: The target server obtains the execution status of the script; Based on the execution state of the script, the target server generates the second operation instruction using the first operation instruction; The second operation instruction is used to instruct the slave server to execute the target operation and the script on the target operation object for a certain number of times and in a certain order; The target server obtains the execution status of the script, including: The target server obtains the execution times of the script and the change information of the control right of the main server; The target server determines the execution status of the script based on the number of executions of the script and the change information of the control right of the main server.
Citation Information
Patent Citations
Synchronous configuration method of primary equipment and stand-by equipment and SNMP (Simple Network Management Protocol) system
CN104079440A
Configuration message synchronization method and device
CN107493201A