Disclosure of Invention
In order to solve the above technical problem or at least partially solve the above technical problem, the present invention provides a configuration change method, which solves the problem that a server cannot effectively manage a managed device when multilink configuration information of the server is changed.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
in a first aspect, an embodiment of the present invention provides a configuration change method, which is applied to a terminal device, and the method includes:
receiving a configuration change instruction sent by a server; the configuration change instruction carries target configuration information corresponding to at least one communication link and is used for indicating terminal equipment using the at least one communication link to change the original configuration information of the at least one communication link into the corresponding target configuration information;
judging whether the at least one communication link comprises a target communication link, wherein the target communication link is a communication link used by the terminal equipment;
and if so, updating the original configuration information of the target communication link into corresponding target configuration information.
As an optional implementation manner of the embodiment of the present invention, the configuration change instruction further carries original configuration information of the at least one communication link;
the determining whether the at least one communication link includes a target communication link includes:
judging whether the server IP address of the original configuration information of the at least one communication link contains the server IP address of the target communication link;
and if so, determining that the target communication link is included in the at least one communication link.
As an optional implementation manner of the embodiment of the present invention, the updating the original configuration information of the target communication link to the corresponding target configuration information includes:
and updating at least one of the server IP address, the server monitoring port, the server response port and the pre-shared key of the target communication link according to the target configuration information.
As an optional implementation manner in this embodiment of the present invention, after the original configuration information of the target communication link is updated to the corresponding target configuration information, the method further includes:
periodically sending a connection request to a server by taking a preset time length as a period until a communication link is successfully established with the server.
As an optional implementation manner of the embodiment of the present invention, there is provided a configuration change method, applied to a server, the method including:
generating a configuration change instruction, wherein the configuration change instruction carries target configuration information corresponding to at least one communication link and is used for indicating terminal equipment using the at least one communication link to change the original configuration information of the at least one communication link into the corresponding target configuration information;
and sending the configuration change instruction to each terminal device so as to change the original configuration information of the at least one communication link into corresponding target configuration information by using the terminal device of the at least one communication link.
As an optional implementation manner of the embodiment of the present invention, the sending the configuration change instruction to each terminal device includes:
and sending the configuration change instruction to each terminal device in a broadcasting mode.
As an optional implementation manner of the embodiment of the present invention, after sending the configuration change instruction to each terminal device, the method further includes:
and if the communication link is not successfully established with the terminal equipment using the at least one communication link within the first preset time length, re-sending the configuration change instruction to each terminal equipment.
In a second aspect, an embodiment of the present invention provides a terminal device, including:
the receiving module is used for receiving a configuration change instruction sent by the server; the configuration change instruction carries target configuration information corresponding to at least one communication link and is used for indicating terminal equipment using the at least one communication link to change the original configuration information of the at least one communication link into the corresponding target configuration information;
a judging module, configured to judge whether a target communication link is included in the at least one communication link, where the target communication link is a communication link used by the terminal device;
and the updating module is used for updating the original configuration information of the target communication link into corresponding target configuration information if the at least one communication link comprises the target communication link.
As an optional implementation manner of the embodiment of the present invention, the configuration change instruction further carries original configuration information of the at least one communication link;
the determining whether the at least one communication link includes a target communication link includes:
judging whether the server IP address of the original configuration information of the at least one communication link contains the server IP address of the target communication link;
and if so, determining that the target communication link is included in the at least one communication link.
As an optional implementation manner of the embodiment of the present invention, the updating the original configuration information of the target communication link to the corresponding target configuration information includes:
and updating at least one of the server IP address, the server monitoring port, the server response port and the pre-shared key of the target communication link according to the target configuration information.
As an optional implementation manner in this embodiment of the present invention, after the original configuration information of the target communication link is updated to the corresponding target configuration information, the method further includes:
periodically sending a connection request to a server by taking a preset time length as a period until a communication link is successfully established with the server.
In a third aspect, an embodiment of the present invention provides a server, including:
a generating module, configured to generate a configuration change instruction, where the configuration change instruction carries target configuration information corresponding to at least one communication link, and is used to instruct a terminal device using the at least one communication link to change original configuration information of the at least one communication link to the corresponding target configuration information;
a sending module, configured to send the configuration change instruction to each terminal device, so that the terminal device using the at least one communication link changes the original configuration information of the at least one communication link into corresponding target configuration information.
As an optional implementation manner of the embodiment of the present invention, the sending the configuration change instruction to each terminal device includes:
and sending the configuration change instruction to each terminal device in a broadcasting mode.
As an optional implementation manner of the embodiment of the present invention, after sending the configuration change instruction to each terminal device, the method further includes:
and if the communication link is not successfully established with the terminal equipment using the at least one communication link within the first preset time length, re-sending the configuration change instruction to each terminal equipment.
In a fourth aspect, an embodiment of the present invention provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the configuration change method according to the first aspect or any one of the embodiments of the first aspect when executing the computer program.
The configuration change method provided by the embodiment of the invention is applied to the terminal equipment, firstly, a configuration change instruction which is sent by a server and carries target configuration information corresponding to at least one communication link is received, then, whether the at least one communication link comprises the target communication link used by the terminal equipment is judged, and if yes, the original configuration information of the target communication link is updated to the corresponding target configuration information. The configuration change instruction carries the target configuration information corresponding to the at least one communication link, and the configuration change instruction is used for indicating the terminal equipment to change the original configuration information of the at least one communication link into the corresponding target configuration information, so that when the configuration information of the plurality of communication links of the server is changed, each terminal equipment can automatically update the link configuration information used by each terminal equipment, the effect of automatic re-online of each terminal equipment is achieved, and the problem of low change efficiency caused by manual configuration update on the plurality of terminal equipment is solved.
Detailed Description
In order that the above objects, features and advantages of the present invention may be more clearly understood, a solution of the present invention will be further described below. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present invention may be practiced in other ways than those described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the invention, and not all embodiments.
Relational terms such as "first" and "second," and the like may be used throughout the description and claims of the present invention to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
In the embodiments of the present invention, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion. Further, in the description of the embodiments of the present invention, "a plurality" means two or more unless otherwise specified.
The overall concept of the embodiment of the invention is as follows: when the multilink configuration information of the server needs to be changed, a broadcast message is sent to the managed equipment to inform the configuration information to be changed, and then at least one of the server IP address, the server monitoring port, the server response port and the pre-shared key of the communication link of the server is automatically changed within preset time.
The application provides a configuration change method which can be applied to an application environment shown in FIG. 1. FIG. 1 is a diagram of an application scenario of a configuration change method in one embodiment; the application environment includes at least one terminal device (3 terminal devices are illustrated in fig. 1 as an example, and the 3 terminal devices are aterminal device 11, aterminal device 12, and aterminal device 13, respectively) and aserver 14. Wherein the terminal device communicates with the server via a network. Specifically, the server sends a broadcast message to the terminal device to notify the changed configuration, wherein the broadcast message is realized based on the message communication framework already supported by the current system. The terminal equipment receives a configuration change instruction sent by the server; the configuration change instruction carries target configuration information corresponding to at least one communication link and is used for indicating the terminal equipment to change the original configuration information of the at least one communication link into the corresponding target configuration information; judging whether the at least one communication link comprises a target communication link, wherein the target communication link is a communication link used by the terminal equipment; and if so, updating the original configuration information of the target communication link into corresponding target configuration information. The terminal device may be, but not limited to, various smart phones, tablet computers, notebook computers, desktop computers, and portable wearable devices, and the server may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in FIG. 2, a configuration change method is provided. In this embodiment, the method is mainly applied to a terminal device for example, and includes the following steps:
s201, receiving a configuration change instruction sent by the server.
The configuration change instruction carries target configuration information corresponding to at least one communication link, and is used for indicating a terminal device using the at least one communication link to change original configuration information of the at least one communication link into corresponding target configuration information.
Illustratively, the terminal device may be a managed device. A server may have multiple IP addresses, each associated with a group of managed devices, each of which establishes a communication link with the server. For example, a first group of terminal devices is managed by a first IP address, and an nth group of terminal devices is managed by an nth IP address.
Specifically, the target configuration information is the configuration information after the modification of the corresponding item of the original configuration information. The managed device receives the configuration change instruction sent by the server.
S202, judging whether the at least one communication link comprises a target communication link. If the at least one communication link includes the target communication link, step S203 is executed.
Wherein the target communication link is a communication link used by the terminal device.
S203, updating the original configuration information of the target communication link into corresponding target configuration information.
As an optional implementation manner of the embodiment of the present invention, the implementation manner of step S203 may include:
and updating at least one of the server IP address, the server monitoring port, the server response port and the pre-shared key of the target communication link according to the target configuration information.
The IP Address is a unified Address format provided by the IP Protocol, and allocates a logical Address to each network and each host on the Internet, so as to shield the difference of physical addresses. For a device on a network, such as a computer or a router, whose IP address is designed based on the network topology, it is easy to change the IP address.
The server monitoring port is used for monitoring the client side by the server, is equivalent to an address, and is a link between the server and the client side. There are many services on a server, and port numbers distinguish different services on the server. After sending the request, the server transmits the request to different ports according to the port number for response.
In this embodiment, the pre-shared key functions as: the identities of the server and the managed device are confirmed.
As an optional implementation manner in this embodiment of the present invention, the configuration change instruction further carries original configuration information of the at least one communication link, and an implementation manner of the step S202 (determining whether the at least one communication link includes a target communication link) may include the following steps a and b:
a. and judging whether the server IP address of the original configuration information of the at least one communication link contains the server IP address of the target communication link.
b. And if so, determining that the target communication link is included in the at least one communication link.
Illustratively, the configuration change instruction further carries original configuration information of the at least one communication link, where the original configuration information includes a server IP address. The server IP address can be used as an identification method, and since the terminal device stores original configuration information, if the server IP address of the original configuration information of at least one communication link contains the server IP address of the target communication link, it can be determined that the target communication link is contained in the at least one communication link.
In one embodiment, the configuration change instruction further carries identification information of the at least one communication link;
the determining whether the at least one communication link includes a target communication link includes:
judging whether the identification information of the at least one communication link contains the identification information of the target communication link;
and if so, determining that the target communication link is included in the at least one communication link.
Illustratively, the identification information may be a number of the communication link. In this embodiment, the number of the communication link is used as an identification method, which is similar to the step of using the IP address of the server as an identification method, but is only used as an optional implementation manner, and the specific form or content of the identifier is not specifically limited.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 3, after the original configuration information of the target communication link is updated to the corresponding target configuration information, the method further includes step S204, periodically sending a connection request to the server with a preset time period as a period until the communication link is successfully established with the server.
Specifically, in order to verify that the original configuration information of the managed device is successfully changed into the target configuration information, the managed device sends a connection request to the server, and if the connection is successful within a preset time length, the configuration information is changed; and if the connection fails, re-sending the request to the server at preset time intervals.
The configuration change method provided by the embodiment of the invention is applied to the terminal equipment, firstly, a configuration change instruction which is sent by a server and carries target configuration information corresponding to at least one communication link is received, then, whether the at least one communication link comprises the target communication link used by the terminal equipment is judged, and if yes, the original configuration information of the target communication link is updated to the corresponding target configuration information. The configuration change instruction carries the target configuration information corresponding to the at least one communication link, and the configuration change instruction is used for indicating the terminal equipment to change the original configuration information of the at least one communication link into the corresponding target configuration information, so that when the multilink configuration of the server is changed, each terminal equipment can automatically update the link configuration information used by each terminal equipment, the effect of automatic re-online of each terminal equipment is achieved, and the problem of low change efficiency caused by manual configuration update on a plurality of terminal equipment is solved.
In one embodiment, as shown in FIG. 4, a configuration change method is provided. In this embodiment, the method is mainly applied to a server for example, and includes the following steps:
s401, a configuration change instruction is generated.
The configuration change instruction carries target configuration information corresponding to at least one communication link, and is used for indicating a terminal device using the at least one communication link to change original configuration information of the at least one communication link into corresponding target configuration information.
Illustratively, a manager configures and modifies communication information of each link of a server on a web page of the server, which is called server message ServerConnectInfo for short, and the information comprises an IP address of the server, a monitoring port of the server, a response port of the server and a pre-shared key; the manager can modify the communication information of multiple groups of links at the same time. Specifically, the configuration change instruction may be generated according to the communication information of at least one group of links modified by the administrator.
S402, sending the configuration change instruction to each terminal device so as to change the original configuration information of the at least one communication link into corresponding target configuration information by using the terminal device of the at least one communication link.
As an optional implementation manner of the embodiment of the present invention, an implementation manner of step S402 (sending the configuration change instruction to each terminal device) may include:
and sending the configuration change instruction to each terminal device in a broadcasting mode.
Specifically, broadcast refers to a transmission mode in which the destination address is all devices in the network when packets are transmitted in the computer network. In fact, all devices referred to herein are also limited in scope, referred to as "broadcast domains".
For example, the server information change notification broadcast message may define the following, ServerConnectInfoUpdate _ Notify:
{<ServerConnectInfo_01_Old,ServerConnectInfo_01_New>
<ServerConnectInfo_02_Old,ServerConnectInfo_02_New>,
<ServerConnectInfo_03_Old,ServerConnectInfo_03_New>,
...}
the ServerConnectInfo _01_ Old is the original configuration information of the server link 1, and the ServerConnectInfo _01_ New is the configuration information after the server link 1 is changed.
Other groups are as follows: the meaning of < ServerConnectInfo _02_ Old, ServerConnectInfo _02_ New > data is the same as described above.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 5, after step S402 (sending the configuration change instruction to each terminal device), the method further includes step S403, in a first preset time period, if a communication link is not successfully established with the terminal device using the at least one communication link, sending the configuration change instruction to each terminal device again.
Specifically, the implementation manner that, within the first preset time period, if the communication link is not successfully established with the terminal device using the at least one communication link, the configuration change instruction is re-sent to each terminal device may be understood as a timeout mechanism, for example, a sends a request, then waits for a response of B, and starts timeout, and if the response is successfully received within the timeout time, waits for the end and ends the timing. If the response is not received within the time-out time, the end of the communication is waited, and meanwhile, the communication fails. In this embodiment, the configuration change instruction may be sent to each terminal device again.
The configuration changing method provided by the embodiment of the invention is applied to a server, firstly, the server generates a configuration changing instruction, and then, the configuration changing instruction is sent to each terminal device, so that the managed device of at least one communication link is used for changing the original configuration information of at least one communication link into the corresponding target configuration information. Furthermore, when the configuration of a plurality of communication links of the server is changed, each terminal device can automatically update the link configuration information used by each terminal device, so that the effect of automatic re-online of each terminal device is achieved, and the problem of low change efficiency caused by manual configuration updating on a plurality of terminal devices is solved.
In one embodiment, as shown in fig. 6, there is provided a terminal device including:
areceiving module 601, configured to receive a configuration change instruction sent by a server; the configuration change instruction carries target configuration information corresponding to at least one communication link, and is used for indicating a terminal device using the at least one communication link to change the original configuration information of the at least one communication link into the corresponding target configuration information.
A determiningmodule 602, configured to determine whether the at least one communication link includes a target communication link, where the target communication link is a communication link used by the terminal device.
Anupdating module 603, configured to update the original configuration information of the target communication link to corresponding target configuration information if the at least one communication link includes the target communication link.
As an optional implementation manner in this embodiment of the present invention, the determining whether the at least one communication link includes a target communication link further includes: judging whether the server IP address of the original configuration information of the at least one communication link contains the server IP address of the target communication link; and if so, determining that the target communication link is included in the at least one communication link.
As an optional implementation manner of the embodiment of the present invention, the updating the original configuration information of the target communication link to the corresponding target configuration information includes: and updating at least one of the server IP address, the server monitoring port, the server response port and the pre-shared key of the target communication link according to the target configuration information.
As an optional implementation manner in this embodiment of the present invention, after the original configuration information of the target communication link is updated to the corresponding target configuration information, the method further includes: periodically sending a connection request to a server by taking a preset time length as a period until a communication link is successfully established with the server.
In one embodiment, as shown in fig. 7, there is provided a server comprising:
agenerating module 701, configured to generate a configuration change instruction, where the configuration change instruction carries target configuration information corresponding to at least one communication link, and is used to instruct a terminal device using the at least one communication link to change original configuration information of the at least one communication link to the corresponding target configuration information;
a sendingmodule 702, configured to send the configuration change instruction to each terminal device; so that the terminal device using the at least one communication link changes the original configuration information of the at least one communication link to the corresponding target configuration information.
As an optional implementation manner of the embodiment of the present invention, the sending the configuration change instruction to each terminal device includes: and sending the configuration change instruction to each terminal device in a broadcasting mode.
As an optional implementation manner of the embodiment of the present invention, after sending the configuration change instruction to each terminal device, the method further includes: and if the communication link is not successfully established with the terminal equipment using the at least one communication link within the first preset time length, re-sending the configuration change instruction to each terminal equipment.
An embodiment of the present invention further provides an electronic device, and fig. 8 is a schematic structural diagram of the configuration change electronic device provided in the embodiment of the present invention. As shown in fig. 8, the electronic device for changing configuration according to the present embodiment includes: amemory 81 and aprocessor 82, thememory 81 being for storing computer programs; theprocessor 82 is configured to execute the steps of the configuration change method provided by the above method embodiments when calling the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when being executed by a processor, the computer program realizes the configuration change method provided by the method embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
The processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media may implement information storage by any method or technology, and the information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.