Server interaction method, device, server, client, and readable storage medium
By receiving the parameters of remote interactive programs and interactive configuration data tables, generating and transmitting scripts and data packets, automatic configuration synchronization between multiple servers is realized, solving the problem of low interaction efficiency between servers in the existing technology, and improving batch configuration efficiency.
Patent Information
- Application Number
- CN201910202108.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-15
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-03-15
AI Technical Summary
It is difficult to efficiently implement internal interactions between multiple servers in batches using existing technology. Adjusting configurations requires multiple operations, which is inefficient.
Obtain parameter configuration information by receiving remote interactive programs and pre-stored interactive configuration data tables, execute preset scripts to generate target scripts and interactive data packages, and transmit them to another server to perform synchronization configuration operations to achieve automatic configuration synchronization between servers.
It realizes efficient batch internal interaction between servers, simplifies the configuration adjustment process, and improves operational efficiency.
Smart Images

Figure CN109831340B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet, and in particular to a server interaction method, device, server, client and readable storage medium. Background Art
[0002] With the rapid development of financial technology (Fintech), especially Internet technology finance, more and more companies are gradually adopting online methods to manage personnel, sell products and promote products. At present, the main online implementation method is to deploy corresponding servers. However, the performance of a single server is limited and cannot meet business needs. It is usually necessary to deploy multiple servers.
[0003] After deploying multiple servers, due to business adjustments, the configuration of each server needs to be adjusted. Currently, the same operation can be performed on the servers in batches through the client at one time, but the internal interaction between servers cannot be realized at one time. In actual adjustments, internal interaction between servers is often required. However, multiple operations are required to realize the internal interaction between servers in batches. Therefore, how to efficiently realize the internal interaction between servers in batches is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the present invention is to provide a server interaction method, device, server, client and readable storage medium, aiming to realize internal interaction between servers in high efficiency and batch.
[0005] To achieve the above object, the present invention provides a server interaction method, which comprises the following steps:
[0006] Receive a remote interaction program, and obtain corresponding parameter configuration information from a pre-stored interaction configuration data table, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with;
[0007] Executing a pre-stored preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0008] The target script and the interactive data packet are sent to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0009] Optionally, before the step of receiving the remote interaction program and acquiring corresponding parameter configuration information from a pre-stored interaction configuration data table, the method further includes:
[0010] Receive the interaction configuration data table and the preset script sent by the client, and store the interaction configuration data table and the preset script.
[0011] Optionally, before the step of receiving the remote interaction program and acquiring corresponding parameter configuration information from a pre-stored interaction configuration data table, the method further includes:
[0012] Obtaining a first IP address of the server and a second IP address of another server to be interacted with from a pre-stored interaction configuration data table;
[0013] Based on the first IP address and the second IP address, determining whether the connection state between the server and the other server is a connected state or a disconnected state;
[0014] If the connection state between the server and the other server is a connected state, a remote interaction program is received, and corresponding parameter configuration information is obtained from a pre-stored interaction configuration data table.
[0015] Optionally, after the step of determining whether the connection state between the server and the other server is in a connected state or a disconnected state based on the first IP address and the second IP address, the method further includes:
[0016] If the connection state between the server and the other server is disconnected, the corresponding parameter configuration information is obtained from the pre-stored interaction configuration data table, and the pre-stored preset script is executed to generate the corresponding target script and interaction data packet based on the parameter configuration information;
[0017] The target script, the interactive data packet and the second IP address are transmitted to the client, so that the client can transmit the target script and the interactive data packet to another server corresponding to the second IP address through a preset remote interactive program, and the target script is executed by the other server to perform corresponding synchronization configuration operations based on the interactive data packet.
[0018] Optionally, the step of acquiring corresponding parameter configuration information from a pre-stored interaction configuration data table, and executing a pre-stored preset script to generate a corresponding target script and an interaction data packet based on the parameter configuration information includes:
[0019] Executing a pre-stored preset script to obtain corresponding function blocks and software configuration parameters based on the parameter configuration information, and writing the function blocks and the software configuration parameters into the preset script to generate a corresponding target script;
[0020] Based on the software configuration parameters, the corresponding software to be synchronized is obtained, and the software to be synchronized is packaged to obtain a corresponding interactive data packet.
[0021] In addition, to achieve the above objectives, the present invention further provides a server, the server comprising:
[0022] A receiving module, used for receiving a remote interactive program;
[0023] An acquisition module, used to acquire corresponding parameter configuration information from a pre-stored interaction configuration data table, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with;
[0024] A script execution module, used to execute a pre-stored preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0025] A sending module is used to send the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script and performs corresponding synchronization configuration operations based on the interactive data packet.
[0026] Optionally, the server further includes:
[0027] The receiving module is further used to receive the interactive configuration data table and the preset script sent by the client;
[0028] A storage module is used to store the interaction configuration data table and the preset script.
[0029] Optionally, the server further includes:
[0030] The acquisition module is further used to acquire the first IP address of the server and the second IP address of another server to be interacted from a pre-stored interaction configuration data table;
[0031] A determination module, configured to determine whether the connection state between the server and the other server is a connected state or a disconnected state based on the first IP address and the second IP address;
[0032] If the connection state between the server and the other server is a connected state, the receiving module receives the remote interaction program sent by the client;
[0033] The acquisition module is also used to acquire corresponding parameter configuration information from a pre-stored interaction configuration data table.
[0034] Optionally, the script execution module is further configured to obtain corresponding parameter configuration information from a pre-stored interaction configuration data table if the connection state between the server and the other server is disconnected, and execute a pre-stored preset script to generate a corresponding target script and an interaction data packet based on the parameter configuration information;
[0035] The sending module is also used to transmit the target script, the interactive data packet and the second IP address to the client, so that the client can transmit the target script and the interactive data packet to another server corresponding to the second IP address through a preset remote interactive program, and the target script is executed by the other server to perform corresponding synchronization configuration operations based on the interactive data packet.
[0036] Optionally, the script execution module is further used to:
[0037] Executing a pre-stored preset script to obtain corresponding function blocks and software configuration parameters based on the parameter configuration information, and writing the function blocks and the software configuration parameters into the preset script to generate a corresponding target script;
[0038] Based on the software configuration parameters, the corresponding software to be synchronized is obtained, and the software to be synchronized is packaged to obtain a corresponding interactive data packet.
[0039] In addition, to achieve the above objective, the present invention further provides a server interaction method, the server interaction method comprising the following steps:
[0040] When a triggered batch interaction instruction is detected, an interaction configuration data table is obtained from the batch interaction instruction, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with;
[0041] Based on the first IP address and the second IP address, determining whether a connection state between the server to be configured and another server to be interacted is in a connected state or a disconnected state;
[0042] If the connection state between the server to be configured and another server to be interacted is a connected state, a preset script and a remote interaction program are obtained, and corresponding parameter configuration information is obtained from the interaction configuration data table;
[0043] The preset script, the remote interactive program, the second IP address and the parameter configuration information are sent to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and interactive data packet based on the parameter configuration information, and transmits the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, and the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0044] Optionally, after the step of determining, based on the first IP address and the second IP address, whether the connection state between the server to be configured and another server to be interacted with is in a connected state or a disconnected state, the method further includes:
[0045] If the connection state between the server to be configured and another server to be interacted is disconnected, a preset script is obtained, and corresponding parameter configuration information is obtained from the interaction configuration data table;
[0046] Sending the preset script and the parameter configuration information to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0047] receiving the target script and the interactive data packet sent by the server, and acquiring a remote interactive program;
[0048] The target script and the interactive data packet are sent to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0049] In addition, to achieve the above object, the present invention further provides a client, the client comprising:
[0050] An acquisition module, configured to acquire an interaction configuration data table from the batch interaction instruction when a triggered batch interaction instruction is detected, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with;
[0051] A judgment module, used for judging whether the connection state between the server to be configured and another server to be interacted is a connected state or a disconnected state based on the first IP address and the second IP address;
[0052] The acquisition module is used to acquire a preset script and a remote interaction program if the connection state between the server to be configured and another server to be interacted is a connected state, and acquire corresponding parameter configuration information from the interaction configuration data table;
[0053] A sending module is used to send the preset script, the remote interactive program, the second IP address and the parameter configuration information to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and interactive data packet based on the parameter configuration information, and transmits the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, and the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0054] Optionally, the client further includes:
[0055] The acquisition module is also used to acquire a preset script if the connection state between the server to be configured and another server to be interacted is disconnected, and acquire corresponding parameter configuration information from the interaction configuration data table;
[0056] The sending module is further used to send the preset script and the parameter configuration information to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0057] A receiving module, used for receiving the target script and the interactive data packet sent by the server, and obtaining a remote interactive program;
[0058] The sending module is used to send the target script and the interactive data packet to another server corresponding to the first IP address through the remote interactive program, so that the other server executes the target script and performs corresponding synchronization configuration operations based on the interactive data packet.
[0059] In addition, to achieve the above-mentioned purpose, the present invention also provides a server interaction device, which includes: a memory, a processor, and a server interaction program stored in the memory and executable on the processor, and the server interaction program implements the steps of the server interaction method described above when executed by the processor.
[0060] The present invention also provides a readable storage medium, on which a server interaction program is stored. When the server interaction program is executed by a processor, the steps of the server interaction method described above are implemented.
[0061] The present invention provides a server interaction method, device, server, client and readable storage medium. The present invention receives a remote interaction program and obtains corresponding parameter configuration information from a pre-stored interaction configuration data table, then executes a pre-stored preset script to generate a corresponding target script and an interaction data packet based on the parameter configuration information, and transmits the target script and the interaction data packet to another server corresponding to a second IP address through the remote interaction program. The other server executes the target script to perform a corresponding synchronization configuration operation based on the interaction data packet. The user configures an interaction configuration data table, a script and a remote interaction program, and transmits relevant information to the server. The server automatically executes the script and the remote interaction program to realize internal interaction with another server, realize configuration synchronization of server components, and realize internal interaction between servers in batches efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0063] Figure 2 A schematic diagram of a flow chart of an embodiment of a server interaction method of the present invention;
[0064] Figure 3 A schematic diagram of a flow chart of another embodiment of the server interaction method of the present invention;
[0065] Figure 4 A schematic diagram of functional modules of an embodiment of a server of the present invention;
[0066] Figure 5 It is a schematic diagram of functional modules of a client according to an embodiment of the present invention.
[0067] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0068] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0069] like Figure 1 As shown, Figure 1 It is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.
[0070] like Figure 1As shown, the server interaction device can be a server or a client, and the server interaction device includes: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0071] Those skilled in the art will understand that Figure 1 The server interaction device structure shown in the figure does not constitute a limitation on the server interaction device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0072] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a server interaction program.
[0073] exist Figure 1 In the server interaction device shown, the processor 1001 can be used to call the server interaction program stored in the memory 1005 and execute the operations in the following server interaction method embodiments.
[0074] An embodiment of the present invention provides a server interaction method.
[0075] Reference Figure 2 , Figure 2 The figure is a flow chart of an embodiment of a server interaction method of the present invention.
[0076] In this embodiment, the server interaction method includes:
[0077] Step S101, receiving a remote interaction program, and obtaining corresponding parameter configuration information from a pre-stored interaction configuration data table, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with;
[0078] In this embodiment, the server interaction method is applied to a server, which may be Figure 1The device shown, data can be transmitted between the server and the client. When it is necessary to realize the internal interaction of batch servers, the client is configured first. Specifically, when the server configuration instruction is detected, the client displays the server configuration interface. At this time, the user enters the interactive configuration data including the first IP address (the IP address of the server to be configured), the second IP address (the IP address of the server to be interacted) and the parameter configuration information through the server configuration interface according to the configuration format in the server configuration interface. The client receives the interactive configuration data input based on the server configuration interface, and generates a corresponding interactive configuration data table based on the interactive configuration data. Then, when the save instruction of the interactive configuration data table is detected, the server interactive instruction containing the interactive configuration data table is triggered. It should be noted that the user can also write the interactive configuration data table in advance according to the agreed configuration format, and then input the interactive configuration data table into the client. The user does not need to configure in real time. After the configuration is completed, the interactive configuration data table is saved, and a scheduled task is set to trigger the server interactive instruction containing the interactive configuration data table. The interactive configuration data table stores at least one IP address group and corresponding parameter configuration information. The IP address group includes a first IP address and a second IP address. The first IP address and the second IP address in the same IP address group are associated with each other.
[0079] When a server interaction instruction is detected, the client obtains an interaction configuration data table from the server interaction instruction and obtains a preset script, and then sends the interaction configuration data table and the preset script to the server corresponding to the first IP address in the interaction configuration data table. The server receives the interaction configuration data table and the preset script sent by the client, and stores the interaction configuration data table and the preset script. Among them, the interaction configuration data table stores the first IP address of this server and the second IP address of another server to be interacted with, and also stores the parameter configuration information required by this server. The parameter configuration information includes but is not limited to the process name and the buffer size of the process. It should be noted that the preset script is a code segment written by the developer for automatic execution on the server, and is stored in the client in advance. It can be set based on actual conditions, and this embodiment does not specifically limit this.
[0080] In this embodiment, in order to achieve the timeliness of server interaction, after storing the interaction configuration data table and the preset script, if the server receives the remote interaction program sent by the client, the corresponding parameter configuration information is obtained from the interaction configuration data table, that is, the first IP address of the server is obtained, and the parameter configuration information corresponding to the first IP address is obtained from the interaction configuration data table. Among them, the remote interaction program is a program developed based on the expect tool (expect is a free programming tool language used to realize automatic and interactive tasks to communicate) for realizing server-to-server interaction. Of course, it can also be a program developed based on the ansible tool (ansible is developed based on Python, which combines the advantages of many operation and maintenance tools and realizes batch system configuration, batch program deployment and batch run command functions). This embodiment does not make specific limitations on this.
[0081] In addition, in order to improve the flexibility and intelligence of server interaction, the client can optionally send an interaction configuration data table and a preset script to the server, and at the same time send a scheduled task containing a remote interaction program. After the server stores the interaction configuration data table, the preset script and the scheduled task, it monitors the scheduled task. When the current moment meets the time point of the scheduled task, the scheduled task automatically triggers the remote interaction program. The server receives the remote interaction program and obtains the corresponding parameter configuration information from the pre-stored interaction configuration data table.
[0082] Step S102, executing a pre-stored preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0083] Step S103, sending the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0084] In this embodiment, after obtaining the remote interactive program and parameter configuration information, the server executes the preset script to generate a corresponding target script and interactive data packet based on the parameter configuration information, and then sends the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server can execute the target script to perform the corresponding synchronization configuration operation based on the interactive data packet. Specifically, the server executes the preset script to obtain the corresponding function block and software configuration parameters based on the parameter configuration information, and writes the function block and the software configuration parameters into the preset script to generate the corresponding target script, and then obtains the software to be synchronized based on the software configuration parameters, and packages the software to be synchronized to obtain the corresponding interactive data packet. Among them, the software configuration parameters include but are not limited to the software version number and the software running status. It should be noted that the above-mentioned function block is a code segment written by the developer for converting the script, which can be set based on the actual situation, and this embodiment does not specifically limit this.
[0085] Among them, the synchronization configuration operation is specifically as follows: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, and parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, then obtain the software configuration parameters carried by the target script itself, and based on the software configuration parameters and the software to be synchronized, deploy the same software and configuration on this server.
[0086] In this embodiment, the present invention receives a remote interactive program and obtains corresponding parameter configuration information from a pre-stored interactive configuration data table, and then executes a pre-stored preset script to generate a corresponding target script and interactive data packet based on the parameter configuration information, and transmits the target script and interactive data packet to another server corresponding to the second IP address through the remote interactive program, and the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet. The user configures the interactive configuration data table, script and remote interactive program on the client, and transmits relevant information to the server, and the server automatically executes the script and the remote interactive program to realize internal interaction with another server, realize configuration synchronization of server components, and can efficiently realize internal interaction between servers in batches.
[0087] Furthermore, based on the above embodiment, another embodiment of the server interaction method of the present invention is proposed.
[0088] The difference from the previous embodiment is that the connection status between servers determines the way the servers interact. To this end, the server obtains the first IP address of the server and the second IP address of another server to be interacted from a pre-stored interaction configuration data table, and based on the first IP address of the server and the second IP address of another server to be interacted, determines whether the connection status between the server and the other server is connected or disconnected. If the connection status between the server and the other server is connected, a remote interaction program is received, and corresponding parameter configuration information is obtained from a pre-stored interaction configuration data table, and then a preset script is executed to generate a corresponding target script and an interaction data packet based on the parameter configuration information, and the target script and the interaction data packet are sent to another server corresponding to the second IP address through the remote interaction program, so that the other server can execute the target script to perform the corresponding synchronization configuration operation based on the interaction data packet. Among them, the specific judgment method of the connection status between this server and another server is: the server sends a verification data packet to another server corresponding to the second IP address. If the server receives a response sent by the other server based on the verification data packet, it can be determined that the connection status between this server and the other server is a connected state. If the server does not receive a response sent by the other server based on the verification data packet, it can be determined that the connection status between this server and the other server is a disconnected state.
[0089] In addition, if the connection status between this server and another server is disconnected, the server executes the preset script and extracts the parameter configuration information from the pre-stored interaction configuration data table to generate a corresponding target script and interaction data packet based on the parameter configuration information, and transmits the target script, the interaction data packet and the second IP address to the client. After receiving the target script, the interaction data packet and the second IP address, the client transmits the target script and the interaction data packet to another server corresponding to the second IP address through a preset remote interaction program, and the other server executes the target script to perform the corresponding synchronization configuration operation based on the interaction data packet.
[0090] In this embodiment, when the connection status between servers is a connected state, the connected servers can interact directly through a remote interaction program, and when the connection status between services is a disconnected state, the client can forward the data that needs to be interacted between servers to another server, thereby realizing interaction between servers and improving the convenience of interaction between servers.
[0091] The embodiment of the present invention also provides a server interaction method.
[0092] Reference Figure 3 , Figure 3The figure is a flow chart of another embodiment of the server interaction method of the present invention.
[0093] In this embodiment, the server interaction method includes:
[0094] Step S201, when a triggered batch interaction instruction is monitored, an interaction configuration data table is obtained from the batch interaction instruction, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with;
[0095] In this embodiment, the server interaction method is applied to the client, and the client can be Figure 1 In the device shown, data can be transmitted between the client and the server. When it is necessary to realize the internal interaction of batch servers, the client is configured first. Specifically, when the server configuration instruction is detected, the client displays the server configuration interface. At this time, the user enters the interactive configuration data including the first IP address (the IP address of the server to be configured), the second IP address (the IP address of the server to be interacted with) and the parameter configuration information through the server configuration interface according to the configuration format in the server configuration interface. The client receives the interactive configuration data input based on the server configuration interface, and generates a corresponding interactive configuration data table based on the interactive configuration data. Then, when the save instruction of the interactive configuration data table is detected, the batch interactive instruction containing the interactive configuration data table is triggered. When the batch interactive instruction is detected, the client obtains the interactive configuration data table from the batch interactive instruction, and the interactive configuration data table stores the first IP address of the server to be configured and the second IP address of another server to be interacted with.
[0096] It should be noted that the user can also compile an interactive configuration data table in advance according to the agreed configuration format, and then input the interactive configuration data table into the client, without the need for real-time configuration by the user. The interactive configuration data table stores at least one IP address group and corresponding parameter configuration information, the IP address group includes a first IP address and a second IP address, and the first IP address and the second IP address in the same IP address group have an associated relationship.
[0097] Step S202: Based on the first IP address and the second IP address, determine whether the connection state between the server to be configured and another server to be interacted is a connected state or a disconnected state;
[0098] In this embodiment, after obtaining the interaction configuration data table, the client determines whether the connection status between the server to be configured and another server to interact is a connected state or a disconnected state based on the first IP address and the second IP address, that is, the server sends a verification data packet to the other server corresponding to the second IP address. If the server receives a response sent by the other server based on the verification data packet, it can be determined that the connection status between the server and the other server is a connected state. If the server does not receive a response sent by the other server based on the verification data packet, it can be determined that the connection status between the server and the other server is a disconnected state.
[0099] Step S203, if the connection state between the server to be configured and another server to be interacted is connected, then obtain a preset script and a remote interaction program, and obtain corresponding parameter configuration information from the interaction configuration data table;
[0100] In this embodiment, if the connection state between the server to be configured and another server to be interacted is a connected state, the client obtains a preset script and a remote interaction program, and obtains the corresponding parameter configuration information from the interaction configuration data table. Among them, the remote interaction program is a program developed based on the expect tool (expect is a free programming tool language used to realize automatic and interactive tasks to communicate) for realizing server-to-server interaction. Of course, it can also be a program developed based on the ansible tool (ansible is developed based on Python, which combines the advantages of many operation and maintenance tools and realizes batch system configuration, batch program deployment, batch running commands and other functions) for realizing server-to-server interaction. This embodiment does not specifically limit this.
[0101] Step S204, sending the preset script, the remote interaction program, the second IP address and the parameter configuration information to the server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and interaction data packet based on the parameter configuration information, and transmits the target script and the interaction data packet to another server corresponding to the second IP address through the remote interaction program, and the other server executes the target script to perform the corresponding synchronization configuration operation based on the interaction data packet.
[0102] In this embodiment, the client sends the preset script, the remote interactive program, the second IP address and the parameter configuration information to the server corresponding to the first IP address. After receiving the preset script, the remote interactive program, the second IP address and the parameter configuration information, the server executes the preset script to generate the corresponding target script and the interactive data packet based on the parameter configuration information, and then sends the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform the corresponding synchronization configuration operation based on the interactive data packet. Specifically, the server executes the preset script to obtain the corresponding function block and software configuration parameters based on the parameter configuration information, and writes the function block and the software configuration parameters into the preset script to generate the corresponding target script, and then obtains the software to be synchronized based on the software configuration parameters, and packages the software to be synchronized to obtain the corresponding interactive data packet. Among them, the software configuration parameters include but are not limited to the software version number and the software running status. It should be noted that the above-mentioned function block is a code segment written by the developer for converting the script, which can be set based on the actual situation, and this embodiment does not specifically limit this.
[0103] Among them, the synchronization configuration operation is specifically as follows: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, and parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, then obtain the software configuration parameters carried by the target script itself, and based on the software configuration parameters and the software to be synchronized, deploy the same software and configuration on this server.
[0104] In this embodiment, the user configures interactive configuration data tables, scripts and remote interaction programs on the client, and transmits relevant information to the server. The server automatically executes the scripts and remote interaction programs to achieve internal interaction with another server and synchronize the configuration of server components, which can efficiently and batch-wise realize internal interaction between servers.
[0105] Further, based on the above embodiments, another embodiment of the server interaction method of the present invention is proposed. The difference from the above embodiments is that if the connection state between the server to be configured and another server to be interacted is disconnected, a preset script is obtained, and the corresponding parameter configuration information is obtained from the interaction configuration data table, and then the preset script and the parameter configuration information are sent to the server corresponding to the first IP address. The server executes the preset script to generate a corresponding target script and interaction data packet based on the parameter configuration information, and sends the target script and interaction data packet to the client. The client receives the target script and interaction data packet sent by the server and obtains a remote interaction program. Then, through the remote interaction program, the target script and interaction data packet are sent to another server corresponding to the second IP address, so that the other server executes the target script to perform the corresponding synchronization configuration operation based on the interaction data packet.
[0106] In this embodiment, when the connection state between the servers is disconnected, the client can forward the data that needs to be interacted between the servers to another server, thereby realizing the interaction between the servers and improving the convenience of the interaction between the servers.
[0107] The embodiment of the present invention also provides a server.
[0108] Reference Figure 4 , Figure 4 This is a schematic diagram of the functional modules of a server according to an embodiment of the present invention.
[0109] In this embodiment, the server includes:
[0110] The receiving module 101 is used to receive an interaction configuration data table and a preset script sent by a client, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with;
[0111] The receiving module 101 is also used to receive the remote interaction program sent by the client;
[0112] An acquisition module 102 is used to acquire corresponding parameter configuration information from the interaction configuration data table;
[0113] A script execution module 103, used to execute the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0114] The sending module 104 is used to send the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
[0115] Furthermore, the server further includes:
[0116] A determination module, configured to determine whether the connection state between the server and the other server is a connected state or a disconnected state based on the first IP address and the second IP address;
[0117] If the connection state between the server and the other server is connected, the receiving module 101 receives the remote interaction program sent by the client;
[0118] The acquisition module 102 is further configured to acquire corresponding parameter configuration information from the interaction configuration data table.
[0119] Furthermore, the script execution module 103 is further configured to execute the preset script if the connection state between the server and the other server is disconnected, so as to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0120] The sending module 104 is also used to transmit the target script, the interactive data packet and the second IP address to the client, so that the client can transmit the target script and the interactive data packet to another server corresponding to the second IP address through a preset remote interactive program, and the target script is executed by the other server to perform corresponding synchronization configuration operations based on the interactive data packet.
[0121] Furthermore, the script execution module 103 is also used for:
[0122] Executing the preset script to obtain corresponding function blocks and software configuration parameters based on the parameter configuration information, and writing the function blocks and the software configuration parameters into the preset script to generate a corresponding target script;
[0123] Based on the software configuration parameters, the corresponding software to be synchronized is obtained, and the software to be synchronized is packaged to obtain a corresponding interactive data packet.
[0124] Among them, the specific embodiments of the server of the present invention are basically the same as the embodiments of the above-mentioned server interaction method, and will not be described in detail here.
[0125] The server provided by the present invention receives an interactive configuration data table and a preset script sent by a client, and receives a remote interactive program sent by the client, and obtains corresponding parameter configuration information from the interactive configuration data table, and then executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information, and transmits the target script and the interactive data packet to another server corresponding to a second IP address through the remote interactive program, and the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet. The user configures the interactive configuration data table, the script and the remote interactive program on the client, and transmits relevant information to the server, and the server automatically executes the script and the remote interactive program to realize internal interaction with another server, realize configuration synchronization of server components, and realize internal interaction between servers in batches efficiently.
[0126] The embodiment of the present invention also provides a client.
[0127] Reference Figure 5 , Figure 5 It is a schematic diagram of functional modules of a client according to an embodiment of the present invention.
[0128] In this embodiment, the client includes:
[0129] The acquisition module 201 is used to acquire an interaction configuration data table from the batch interaction instruction when a triggered batch interaction instruction is detected, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with;
[0130] A determination module 202, configured to determine whether a connection state between a server to be configured and another server to be interacted with is a connected state or a disconnected state based on the first IP address and the second IP address;
[0131] The acquisition module 201 is used to acquire a preset script and a remote interaction program if the connection state between the server to be configured and another server to be interacted is a connected state, and acquire corresponding parameter configuration information from the interaction configuration data table;
[0132] The sending module 203 is used to send the preset script, the remote interaction program, the second IP address and the parameter configuration information to the server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and interaction data packet based on the parameter configuration information, and transmits the target script and the interaction data packet to another server corresponding to the second IP address through the remote interaction program, and the other server executes the target script to perform the corresponding synchronization configuration operation based on the interaction data packet.
[0133] Furthermore, the client further includes:
[0134] The acquisition module 201 is also used to acquire a preset script if the connection state between the server to be configured and another server to be interacted is disconnected, and acquire corresponding parameter configuration information from the interaction configuration data table;
[0135] The sending module 203 is further used to send the preset script and the parameter configuration information to the server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information;
[0136] A receiving module, used for receiving the target script and the interactive data packet sent by the server, and obtaining a remote interactive program;
[0137] The sending module 203 is used to send the target script and the interactive data packet to another server corresponding to the first IP address through the remote interactive program, so that the other server executes the target script and performs corresponding synchronization configuration operations based on the interactive data packet.
[0138] Among them, the specific embodiments of the client of the present invention are basically the same as the embodiments of the above-mentioned server interaction method, and will not be described in detail here.
[0139] In an embodiment of the present invention, a user configures interactive configuration data tables, scripts and remote interaction programs on the client, and transmits relevant information to the server. The server automatically executes the scripts and remote interaction programs to achieve internal interaction with another server, achieve configuration synchronization of server components, and efficiently achieve internal interaction between servers in batches.
[0140] In addition, the embodiment of the present invention also provides a readable storage medium, which can be optionally stored in Figure 1 In the server interaction device, a server interaction program is stored on the readable storage medium, and when the server interaction program is executed by the processor, the operations in the above server interaction method embodiments are performed.
[0141] Among them, the specific embodiments of the readable storage medium of the present invention are basically the same as the embodiments of the above-mentioned server interaction method, and will not be described in detail here.
[0142] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0145] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A server interaction method, characterized in that: The server interaction method is applied to a server and comprises the following steps: Receiving a remote interaction program sent by a client, and acquiring corresponding parameter configuration information from a pre-stored interaction configuration data table sent by the client, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with; Executing a pre-stored preset script sent in advance by the client to generate a corresponding target script and an interactive data packet based on the parameter configuration information; The target script and the interactive data packet are sent to another server corresponding to the second IP address through the remote interactive program, so that the other server can execute the target script to perform the corresponding synchronization configuration operation based on the interactive data packet; wherein the synchronization configuration operation is specifically: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, and parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, then the software configuration parameters carried by the target script itself are obtained, and based on the software configuration parameters and the software to be synchronized, the same software and configuration as on the current server are deployed on the other server.
2. The server interaction method according to claim 1, characterized in that: Before the step of receiving the remote interactive program sent by the client and acquiring the corresponding parameter configuration information from the pre-stored interactive configuration data table, the method further includes: Receive the interaction configuration data table and the preset script sent by the client, and store the interaction configuration data table and the preset script.
3. The server interaction method according to claim 1, characterized in that: Before the step of receiving the remote interactive program sent by the client and acquiring the corresponding parameter configuration information from the pre-stored interactive configuration data table, the method further includes: Obtaining a first IP address of the server and a second IP address of another server to be interacted with from a pre-stored interaction configuration data table; Based on the first IP address and the second IP address, determining whether the connection state between the server and the other server is a connected state or a disconnected state; If the connection state between the server and the other server is a connected state, the remote interaction program sent by the client is received, and corresponding parameter configuration information is obtained from a pre-stored interaction configuration data table.
4. The server interaction method according to claim 3, characterized in that: After the step of determining whether the connection state between the server and the other server is connected or disconnected based on the first IP address and the second IP address, the method further includes: If the connection state between the server and the other server is disconnected, the corresponding parameter configuration information is obtained from the pre-stored interaction configuration data table, and the pre-stored preset script is executed to generate the corresponding target script and interaction data packet based on the parameter configuration information; The target script, the interactive data packet and the second IP address are transmitted to the client, so that the client can transmit the target script and the interactive data packet to another server corresponding to the second IP address through a preset remote interactive program, and the target script is executed by the other server to perform corresponding synchronization configuration operations based on the interactive data packet.
5. The server interaction method according to any one of claims 1 to 4, characterized in that: The steps of obtaining corresponding parameter configuration information from a pre-stored interaction configuration data table and executing a pre-stored preset script to generate a corresponding target script and an interaction data packet based on the parameter configuration information include: Executing a pre-stored preset script to obtain corresponding function blocks and software configuration parameters based on the parameter configuration information, and writing the function blocks and the software configuration parameters into the preset script to generate a corresponding target script; Based on the software configuration parameters, the corresponding software to be synchronized is obtained, and the software to be synchronized is packaged to obtain a corresponding interactive data packet.
6. A server, characterized in that: The server comprises: A receiving module, used for receiving a remote interactive program sent by a client; an acquisition module, configured to acquire corresponding parameter configuration information from a pre-stored interaction configuration data table sent by the client, wherein the interaction configuration data table stores a first IP address of the server and a second IP address of another server to be interacted with; A script execution module, used to execute a pre-stored preset script sent in advance by the client, so as to generate a corresponding target script and an interactive data packet based on the parameter configuration information; A sending module is used to send the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server can execute the target script to perform the corresponding synchronization configuration operation based on the interactive data packet; wherein the synchronization configuration operation is specifically: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, and parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, then obtain the software configuration parameters carried by the target script itself, and based on the software configuration parameters and the software to be synchronized, deploy the same software and configuration as the local server on the other server.
7. The server according to claim 6, characterized in that The server also includes: The receiving module is further used to receive the interactive configuration data table and the preset script sent by the client; A storage module is used to store the interaction configuration data table and the preset script.
8. The server according to claim 6, characterized in that The server also includes: The acquisition module is further used to acquire the first IP address of the server and the second IP address of another server to be interacted from a pre-stored interaction configuration data table; A determination module, configured to determine whether the connection state between the server and the other server is a connected state or a disconnected state based on the first IP address and the second IP address; If the connection state between the server and the other server is a connected state, the receiving module receives the remote interaction program; The acquisition module is also used to acquire corresponding parameter configuration information from a pre-stored interaction configuration data table.
9. The server according to claim 8, characterized in that The script execution module is further configured to obtain corresponding parameter configuration information from a pre-stored interaction configuration data table if the connection state between the server and the other server is disconnected, and execute a pre-stored preset script to generate a corresponding target script and an interaction data packet based on the parameter configuration information; The sending module is also used to transmit the target script, the interactive data packet and the second IP address to the client, so that the client can transmit the target script and the interactive data packet to another server corresponding to the second IP address through a preset remote interactive program, and the target script is executed by the other server to perform corresponding synchronization configuration operations based on the interactive data packet.
10. The server according to any one of claims 6 to 9, characterized in that: The script execution module is also used for: Executing a pre-stored preset script to obtain corresponding function blocks and software configuration parameters based on the parameter configuration information, and writing the function blocks and the software configuration parameters into the preset script to generate a corresponding target script; Based on the software configuration parameters, the corresponding software to be synchronized is obtained, and the software to be synchronized is packaged to obtain a corresponding interactive data packet.
11. A server interaction method, characterized in that: The server interaction method is applied to the client, comprising: When a triggered batch interaction instruction is detected, an interaction configuration data table is obtained from the batch interaction instruction, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with; Based on the first IP address and the second IP address, determining whether a connection state between the server to be configured and another server to be interacted is in a connected state or a disconnected state; If the connection state between the server to be configured and another server to be interacted is a connected state, a preset script and a remote interaction program are obtained, and corresponding parameter configuration information is obtained from the interaction configuration data table; The preset script, the remote interactive program, the second IP address and the parameter configuration information are sent to the server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information, and transmits the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, and the target script is executed by the other server to perform a corresponding synchronization configuration operation based on the interactive data packet; wherein the synchronization configuration operation is specifically as follows: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, the software configuration parameters carried by the target script itself are obtained, and based on the software configuration parameters and the software to be synchronized, the same software and configuration as those on the server corresponding to the first IP address are deployed on the other server.
12. The server interaction method according to claim 11, characterized in that: After the step of determining, based on the first IP address and the second IP address, whether the connection state between the server to be configured and another server to be interacted with is a connected state or a disconnected state, the method further includes: If the connection state between the server to be configured and another server to be interacted is disconnected, a preset script is obtained, and corresponding parameter configuration information is obtained from the interaction configuration data table; Sending the preset script and the parameter configuration information to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information; receiving the target script and the interactive data packet sent by the server, and acquiring a remote interactive program; The target script and the interactive data packet are sent to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script to perform corresponding synchronization configuration operations based on the interactive data packet.
13. A client, characterized in that: The client comprises: An acquisition module, configured to acquire an interaction configuration data table from the batch interaction instruction when a triggered batch interaction instruction is detected, wherein the interaction configuration data table stores a first IP address of a server to be configured and a second IP address of another server to be interacted with; A judgment module, used for judging whether the connection state between the server to be configured and another server to be interacted is a connected state or a disconnected state based on the first IP address and the second IP address; The acquisition module is used to acquire a preset script and a remote interaction program if the connection state between the server to be configured and another server to be interacted is a connected state, and acquire corresponding parameter configuration information from the interaction configuration data table; A sending module, used for sending the preset script, the remote interactive program, the second IP address and the parameter configuration information to the server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information, and transmits the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, and the other server executes the target script to perform a corresponding synchronization configuration operation based on the interactive data packet; wherein the synchronization configuration operation is specifically as follows: after receiving the target script and the interactive data packet, the other server executes the target script, obtains the software version number carried by the target script itself, parses the interactive data packet to obtain the software to be synchronized, and then determines whether the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script. If the software version number carried by the software to be synchronized itself is the same as the software version number carried by the target script, then obtain the software configuration parameters carried by the target script itself, and deploy the same software and configuration as those on the server corresponding to the first IP address on the other server based on the software configuration parameters and the software to be synchronized.
14. The client according to claim 13, characterized in that: The client also includes: The acquisition module is also used to acquire a preset script if the connection state between the server to be configured and another server to be interacted is disconnected, and acquire corresponding parameter configuration information from the interaction configuration data table; The sending module is further used to send the preset script and the parameter configuration information to a server corresponding to the first IP address, so that the server executes the preset script to generate a corresponding target script and an interactive data packet based on the parameter configuration information; A receiving module, used for receiving the target script and the interactive data packet sent by the server, and obtaining a remote interactive program; The sending module is used to send the target script and the interactive data packet to another server corresponding to the second IP address through the remote interactive program, so that the other server executes the target script and performs corresponding synchronization configuration operations based on the interactive data packet.
15. A server interaction device, characterized in that: The server interaction device comprises: a memory, a processor, and a server interaction program stored in the memory and executable on the processor, wherein the server interaction program implements the steps of the server interaction method according to any one of claims 1 to 5 when executed by the processor.
16. A server interaction device, characterized in that: The server interaction device comprises: a memory, a processor, and a server interaction program stored in the memory and executable on the processor. When the server interaction program is executed by the processor, the steps of the server interaction method as claimed in claim 11 or 12 are implemented.
17. A readable storage medium, characterized in that: The readable storage medium stores a server interaction program, and when the server interaction program is executed by a processor, the steps of the server interaction method according to any one of claims 1 to 5 are implemented.
18. A readable storage medium, characterized in that: The readable storage medium stores a server interaction program, and when the server interaction program is executed by the processor, the steps of the server interaction method according to claim 11 or 12 are implemented.
Citation Information
Patent Citations
Instant communication system, clients, server and method for judging on-line state
CN101552740A
Method and system for realizing redundant backup of dynamic host configuration protocol server
CN103532687A
Interactive page configuration method and system, server and client
CN104239334A
Register configuration code automatic generation method and apparatus
CN106484415A
File synchronization method and apparatus
CN106569919A
