Terminal device access method and device, storage medium, and electronic device

By registering multiple access servers in the central server and switching with virtual IP addresses, the problem that traditional access servers cannot switch without perception during failure is solved, high availability failover of terminal devices is achieved, and system availability is improved and stability.

CN114143370BActive Publication Date: 2024-12-06ZHEJIANG DAHUA TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111398162.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2024-12-06
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

Traditional access servers cannot switch without perception when a network failure or system crashes, resulting in equipment offline. Existing solutions such as manual restart or cold standby servers have disadvantages and cannot achieve unsensed high availability failover.

Method used

Unsensed failover is achieved by registering multiple access servers in the central server and automatically switching the terminal device to another normal access server using a virtual IP address when the connection is abnormal.

Benefits of technology

It realizes high availability failover for terminal devices when accessing servers are abnormal, ensures that the device is always online, and improves the availability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114143370B_ABST
    Figure CN114143370B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for accessing a terminal device, a storage medium, and an electronic device, the method comprising: when determining that an abnormality occurs in the connection with a first server, sending a setting instruction to a second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in a central server; and the terminal device is connected to the second server based on the virtual IP address. Through the present invention, the problem of switching connected servers is solved, and the effect of high-availability fault switching of terminal devices is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a method and device for accessing a terminal device, a storage medium, and an electronic device. Background Art

[0002] The Internet of Things platform, which is built based on audio and video multimedia, network communication, storage and other technologies, is composed of hardware such as monitoring equipment, voice equipment, alarm equipment, coding storage equipment, access control equipment, large-screen display equipment, computers, as well as network resources, software and other elements. The provincial-level platform involves a large number of devices, and these devices are manufactured by different manufacturers. Even if they are from the same manufacturer, the models are different, the production periods are different, the types of equipment are different, and the docking methods are different. Some are docking platforms, and some are docking devices, so different access services and different access servers are required to complete the docking.

[0003] Traditional access servers are offline due to network problems, system expansion, service failures, etc. The solution is to manually restart the server, or rely on the daemon process to automatically restart the service. The better way is to use the cold standby server method to start another server. These have more or less shortcomings, and cannot switch without perception, which will cause the device to be offline and then online. Summary of the invention

[0004] The embodiments of the present invention provide a method and device for accessing a terminal device, a storage medium, and an electronic device, so as to at least solve the problem of switching a connected server in the related art.

[0005] According to one embodiment of the present invention, there is provided a method for accessing a terminal device, comprising: in a case where it is determined that an abnormality occurs in the connection with a first server, sending a setting instruction to a second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server being configured with a terminal device, and the first server and the second server being both registered in a central server; and accessing the terminal device to the second server based on the virtual IP address.

[0006] According to another embodiment of the present invention, there is provided an access method for a terminal device, comprising: sending a first registration request to a central server, wherein the first registration request is used to request that a first server be registered with the central server, and the registration request includes device information of the terminal device; upon determining to register with the central server, receiving a management instruction sent by the central server; managing the terminal device in accordance with the management instruction; upon determining that an abnormality occurs in the connection with the central server, deleting the managed terminal device to instruct the central server to send the terminal device to a second server, wherein the second server is used to manage the terminal device according to a set virtual IP address, and both the first server and the second server are registered with the central server.

[0007] According to another embodiment of the present invention, there is provided a method for accessing a terminal device, comprising: receiving a setting instruction sent by a central server; setting a virtual Internet Protocol IP address according to the setting instruction; accessing a terminal device in a first server based on the virtual IP address to manage the terminal device, wherein the first server and the second server are both registered in the central server.

[0008] According to another embodiment of the present invention, there is provided an access device for a terminal device, comprising: a first sending module, for sending a setting instruction to a second server when it is determined that an abnormality occurs in the connection with the first server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Interconnection Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in a central server; and a first access module, for connecting the terminal device to the second server based on the virtual IP address.

[0009] In an exemplary embodiment, the above-mentioned device also includes: a third receiving module, which is used to receive a first registration request sent by the above-mentioned first server before sending a setting instruction to the second server when it is determined that the connection with the first server is abnormal, wherein the above-mentioned first registration request is used to request that the above-mentioned first server be registered to the above-mentioned central server, and the above-mentioned registration request includes the device information of the above-mentioned terminal device; a second access module, which is used to connect the above-mentioned terminal device to the above-mentioned first server according to the device information of the above-mentioned terminal device when the above-mentioned first server is registered to the above-mentioned central server, so as to instruct the above-mentioned first server to manage the above-mentioned terminal device.

[0010] In an exemplary embodiment, the above-mentioned first sending module includes: a first detection unit, used to detect whether the port between the IP address of the above-mentioned first server and the above-mentioned central server is connected when it is determined that the above-mentioned first server is down; a first determination unit, used to determine the above-mentioned second server according to the data load of the server when the port between the IP address of the above-mentioned first server and the above-mentioned central server is not connected and the duration of the disconnection is greater than a first preset threshold; a first sending unit, used to send the above-mentioned setting instruction to the above-mentioned second server.

[0011] In an exemplary embodiment, the above-mentioned device also includes: a fourth receiving module, which is used to receive a second registration request sent by the above-mentioned first server after sending a setting instruction to the second server when it is determined that the connection with the first server is abnormal, wherein the above-mentioned second registration request is used to request that the above-mentioned first server be registered to the above-mentioned central server, and the above-mentioned registration request includes the device information of the above-mentioned terminal device; a third sending module, which is used to send a deletion instruction to the above-mentioned second server when it is determined that the above-mentioned first server is registered to the above-mentioned central server and the above-mentioned terminal device is connected to the above-mentioned first server, wherein the above-mentioned deletion instruction is used to instruct the above-mentioned second server to delete the above-mentioned virtual IP address.

[0012] In an exemplary embodiment, the above-mentioned device also includes: a fifth receiving module, which is used to receive a third registration request sent by the above-mentioned second server before sending a setting instruction to the second server when it is determined that an abnormality has occurred in the connection with the first server, wherein the above-mentioned third registration request is used to request that the above-mentioned second server be registered to the above-mentioned central server; and a first registration module, which is used to register the above-mentioned second server to the above-mentioned central server according to the above-mentioned third registration request.

[0013] According to another embodiment of the present invention, there is provided an access device for a terminal device, comprising: a second sending module, used to send a first registration request to a central server, wherein the first registration request is used to request that a first server be registered with the central server, and the registration request includes device information of the terminal device; a first receiving module, used to receive a management instruction sent by the central server when it is determined that the terminal device is registered with the central server; a first management module, used to manage the terminal device according to the management instruction; a first deleting module, used to delete the managed terminal device when it is determined that an abnormality occurs in the connection with the central server, so as to instruct the central server to send the terminal device to a second server, wherein the second server is used to manage the terminal device according to a set virtual IP address, and both the first server and the second server are registered with the central server.

[0014] In an exemplary embodiment, the first deletion module includes: a first deletion unit, configured to delete the managed terminal device when it is determined that the duration of disconnection with the central server is greater than a first preset threshold.

[0015] In an exemplary embodiment, the apparatus further comprises: a second deletion module, configured to delete the virtual IP address when it is determined that the connection with the central server is abnormal and the virtual IP address is set.

[0016] In an exemplary embodiment, the above-mentioned device also includes: a fourth sending module, which is used to delete the managed terminal device after determining that an abnormality occurs in the connection with the central server, and then send a second registration request to the above-mentioned central server when it is determined that the connection with the above-mentioned central server is restored, wherein the above-mentioned second registration request is used to request registration with the above-mentioned central server, and the above-mentioned registration request includes the device information of the above-mentioned terminal device; a second management module, which is used to re-manage the above-mentioned terminal device according to the instructions of the above-mentioned central server after determining to register with the above-mentioned central server.

[0017] According to another embodiment of the present invention, there is provided an access device for a terminal device, comprising: a second receiving module for receiving a setting instruction sent by a central server; a first setting module for setting a virtual Internet Protocol IP address according to the setting instruction; and a second management module for accessing the terminal device in the first server based on the virtual IP address to manage the terminal device, wherein the first server and the second server are both registered in the central server.

[0018] In an exemplary embodiment, the apparatus further includes: a fifth sending module, configured to send a third registration request to the central server before receiving a setting instruction sent by the central server, wherein the third registration request is used to request registration of the second server to the central server.

[0019] In an exemplary embodiment, the above-mentioned device also includes: a sixth receiving module, which is used to receive a deletion instruction sent by the above-mentioned central server after the terminal device in the first server is accessed based on the above-mentioned virtual IP address; and a third deletion module, which is used to delete the above-mentioned virtual IP address according to the above-mentioned deletion instruction.

[0020] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0021] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0022] Through the present invention, when it is determined that the connection with the first server is abnormal, a setting instruction is sent to the second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in the central server; the terminal device is connected to the second server based on the virtual IP address. The purpose of loading the terminal device to another normal access server by means of a virtual IP when the access server is abnormal is achieved. Therefore, the problem of switching the connected server can be solved, and the effect of high-availability fault switching of the terminal device can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a hardware structure block diagram of a mobile terminal of a terminal device access method according to an embodiment of the present invention;

[0024] Figure 2 is a flowchart of an access method for a terminal device according to an embodiment of the present invention (I);

[0025] Figure 3 It is a schematic diagram of the entire architecture of an embodiment of the present invention;

[0026] Figure 4 is a flow chart (II) of the access method of a terminal device according to an embodiment of the present invention;

[0027] Figure 5 is a flowchart of the access method of the terminal device according to an embodiment of the present invention (III);

[0028] Figure 6 is a flow chart between various interaction devices according to an embodiment of the present invention;

[0029] Figure 7 is a schematic diagram of verification results according to an embodiment of the present invention;

[0030] Figure 8 is a structural block diagram of an access device for a terminal device according to an embodiment of the present invention (I);

[0031] Fig. 9 is a structural block diagram of an access device for a terminal device according to an embodiment of the present invention (II);

[0032] Fig.10 3 is a structural block diagram of an access device for a terminal device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0035] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a terminal device access method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the access method of the terminal device in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0038] In this embodiment, a method for accessing a terminal device is provided. Figure 2 1 is a flow chart of an access method for a terminal device according to an embodiment of the present invention (I), Figure 2 As shown, the process includes the following steps:

[0039] Step S202, when it is determined that the connection with the first server is abnormal, sending a setting instruction to the second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in the central server;

[0040] Step S204: connecting the terminal device to the second server based on the virtual IP address.

[0041] The execution subject of the above steps may be a server (eg, a central server), etc., but is not limited thereto.

[0042] In this embodiment, the terminal device includes but is not limited to monitoring equipment, voice equipment, alarm equipment, coding storage equipment, access control equipment, large-screen display equipment, computers, etc.

[0043] The abnormal connection with the first server includes failures such as network abnormality, system expansion, and service failure.

[0044] In this embodiment, the system structure between the first server (equivalent to access server 1), the second server (equivalent to access server 2), the central server and the terminal device is as follows: Figure 3 shown.

[0045] Through the above steps, when it is determined that the connection with the first server is abnormal, a setting instruction is sent to the second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in the central server; the terminal device is connected to the second server based on the virtual IP address. The purpose of loading the terminal device to another normal access server by means of a virtual IP when the access server is abnormal is achieved. Therefore, the problem of switching the connected server can be solved, and the effect of high-availability fault switching of the terminal device can be achieved.

[0046] In an exemplary embodiment, when it is determined that the connection with the first server is abnormal, before sending the setting instruction to the second server, the method further includes:

[0047] S1, receiving a first registration request sent by a first server, wherein the first registration request is used to request to register the first server with a central server, and the registration request includes device information of a terminal device;

[0048] S2, when the first server is registered with the central server, the terminal device is connected to the first server according to the device information of the terminal device to instruct the first server to manage the terminal device.

[0049] In this embodiment, after being powered on, the first server sends a first registration request to the central server, which manages and allocates resources to the first server, while waiting for the central server to send a notification of setting a virtual IP operation.

[0050] In an exemplary embodiment, when it is determined that the connection with the first server is abnormal, sending a setting instruction to the second server includes:

[0051] S1, when it is determined that the first server is down, detecting whether the port between the IP address of the first server and the central server is connected;

[0052] S2, when the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determining a second server according to the data load of the server;

[0053] S3, sending a setting instruction to the second server.

[0054] In this embodiment, determining the second server according to the data load of the server includes: the central server screens out servers that do not bear active registration devices; or the server of the active registration device with the smallest load and the server with active registration access service is notified to add a virtual IP.

[0055] In an exemplary embodiment, when it is determined that the connection with the first server is abnormal, after sending the setting instruction to the second server, the method further includes:

[0056] S1, receiving a second registration request sent by a first server, wherein the second registration request is used to request to register the first server with the central server, and the registration request includes device information of the terminal device;

[0057] S2, when it is determined that the first server is registered with the central server and the terminal device is connected to the first server, a deletion instruction is sent to the second server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

[0058] In this embodiment, the downtime first server re-registers with the central server after it returns to normal. The central server performs resource reconfiguration operations and sends the terminal device to the newly connected first server. After receiving the ACK confirmation from the first server, the central server notifies the second server to delete the virtual IP.

[0059] In an exemplary embodiment, when it is determined that the connection with the first server is abnormal, before sending the setting instruction to the second server, the method further includes:

[0060] S1, receiving a third registration request sent by a second server, wherein the third registration request is used to request to register the second server with the central server;

[0061] S2: Register the second server to the central server according to the third registration request.

[0062] In this embodiment, after the server 2 is powered on and started successfully, it actively registers with the central server, and is managed and resource allocated by the central server, while waiting for the central server to issue a notification of setting a virtual IP operation.

[0063] In this embodiment, a method for accessing a terminal device is provided. Figure 4 Flowchart (II) of the access method of the terminal device according to the embodiment of the present invention, such as Figure 4 As shown, the process includes the following steps:

[0064] Step S402, sending a first registration request to the central server, wherein the first registration request is used to request to register the first server with the central server, and the registration request includes device information of the terminal device;

[0065] Step S404, when it is determined to register with the central server, receiving a management instruction sent by the central server;

[0066] Step S406, managing the terminal device according to the management instruction;

[0067] Step S408, when it is determined that the connection with the central server is abnormal, delete the managed terminal device to instruct the central server to send the terminal device to the second server, where the second server is used to manage the terminal device according to the set virtual IP address, and the first server and the second server are both registered with the central server.

[0068] The execution subject of the above steps may be a server (eg, the first server), etc., but is not limited thereto.

[0069] In this embodiment, the terminal device includes but is not limited to monitoring equipment, voice equipment, alarm equipment, coding storage equipment, access control equipment, large-screen display equipment, computers, etc.

[0070] The abnormal connection with the first server includes failures such as network abnormality, system expansion, and service failure.

[0071] In this embodiment, the system structure between the first server (equivalent to access server 1), the second server (equivalent to access server 2), the central server and the terminal device is as follows: Figure 3 shown.

[0072] Through the above steps, by sending a first registration request to the central server, wherein the first registration request is used to request that the first server be registered with the central server, and the registration request includes the device information of the terminal device; when it is determined to be registered with the central server, receiving the management instruction sent by the central server; managing the terminal device according to the management instruction; when it is determined that the connection with the central server is abnormal, deleting the managed terminal device to instruct the central server to send the terminal device to the second server, wherein the second server is used to manage the terminal device according to the set virtual IP address, and the first server and the second server are both registered with the central server. The purpose of loading the terminal device to another normal access server by means of a virtual IP when the access server is abnormal is achieved. Therefore, the problem of switching the connected server can be solved, and the effect of high-availability fault switching of the terminal device can be achieved.

[0073] In an exemplary embodiment, when it is determined that the connection with the central server is abnormal, deleting the managed terminal device includes:

[0074] S1, when it is determined that the duration of disconnection with the central server is greater than a first preset threshold, deleting the managed terminal device.

[0075] In an exemplary embodiment, the method further comprises:

[0076] S1, when it is determined that the connection with the central server is abnormal and a virtual IP address is set, delete the virtual IP address.

[0077] In an exemplary embodiment, when it is determined that the connection with the central server is abnormal, after deleting the managed terminal device, the method further includes:

[0078] S1, when it is determined that the connection with the central server is restored, sending a second registration request to the central server, wherein the second registration request is used to request registration with the central server, and the registration request includes device information of the terminal device;

[0079] S2, after confirming to register with the central server, re-manage the terminal device according to the instruction of the central server.

[0080] In this embodiment, a method for accessing a terminal device is provided. Figure 5 Flowchart (III) of the access method of the terminal device according to the embodiment of the present invention, Figure 5 As shown, the process includes the following steps:

[0081] Step S502, receiving a setting instruction sent by a central server;

[0082] Step S504, setting a virtual Internet Protocol IP address according to the setting instruction;

[0083] Step S506: Access the terminal device in the first server based on the virtual IP address to manage the terminal device, wherein the first server and the second server are both registered in the central server.

[0084] The execution subject of the above steps may be a server (eg, the first server), etc., but is not limited thereto.

[0085] In this embodiment, the terminal device includes but is not limited to monitoring equipment, voice equipment, alarm equipment, coding storage equipment, access control equipment, large-screen display equipment, computers, etc.

[0086] The abnormal connection with the first server includes failures such as network abnormality, system expansion, and service failure.

[0087] In this embodiment, the system structure between the first server (equivalent to access server 1), the second server (equivalent to access server 2), the central server and the terminal device is as follows: Figure 3 shown.

[0088] Through the above steps, by receiving the setting instruction sent by the central server; setting the virtual Internet Protocol IP address according to the setting instruction; accessing the terminal device in the first server based on the virtual IP address to manage the terminal device, wherein both the first server and the second server are registered in the central server. The purpose of loading the terminal device to another normal access server by means of the virtual IP when the access server is abnormal is achieved. Therefore, the problem of switching the connected server can be solved, and the effect of high-availability fault switching of the terminal device can be achieved.

[0089] In an exemplary embodiment, before receiving the setting instruction sent by the central server, the method further includes:

[0090] S1. Send a third registration request to the central server, where the third registration request is used to request to register the second server with the central server.

[0091] In an exemplary embodiment, after accessing the terminal device in the first server based on the virtual IP address, the method further includes:

[0092] S1, receiving the deletion instruction sent by the central server;

[0093] S2, delete the virtual IP address according to the deletion instruction.

[0094] The present invention will be described below in conjunction with specific embodiments:

[0095] This embodiment uses a virtual Internet Protocol (IP) to load the actively registered device to another normal access server when the access server is abnormal, so as to achieve high-availability fault switching of the actively registered device. It mainly uses two-point downtime and virtual IP unreachability as the trigger conditions for device reloading. Because the device registration target address cannot be modified, the server IP can only be modified. However, in order not to affect the operation of other types of services on the same device, a virtual IP is used, and dual IPs work at the same time. If the access server and the content management system (CMS) are disconnected, when the set time is reached, ARS needs to clean up the set virtual IP.

[0096] This embodiment proposes a method for using computer virtual IP knowledge to load active registration devices to another normal access server when an access server is abnormal through a virtual IP. This method can be extended to all systems responsible for access terminal devices.

[0097] like Figure 6 As shown, this embodiment includes the following steps:

[0098] S601, the active registration service 1 (equivalent to the first server mentioned above) actively registers with the central server after being powered on and started successfully, and is managed and resource allocated by the central server, while waiting for the central server to send a notification of setting a virtual IP operation.

[0099] S602, the central server manages the device according to the service actively registered and the device information in the service, and sends the corresponding device to the access service on the server corresponding to the active service for access management, and the access service connects to the device.

[0100] S603, the active registration service 2 (equivalent to the second server mentioned above) actively registers with the central server after being powered on and started successfully, and is managed and resource allocated by the central server, while waiting for the central server to issue a notification for setting a virtual IP operation.

[0101] S604, when the active registration service 1 where the device is located is down for the set time (T1), check whether the active registration service IP and port can be linked, if not, trigger load redistribution;

[0102] S605, when the active registration service 1 and the central CMS are disconnected for a certain period of time (T2), the active registration service 1 checks whether there is a virtual IP, and if so, actively deletes the virtual IP.

[0103] S606, the central server selects the server that does not bear the active registration device or the server with the smallest load and the server 2 that is deployed with the active registration access service, and notifies to add a virtual IP.

[0104] S607, after receiving the IP setting command, the active registration access service 2 executes the setting operation and starts port monitoring (monitoring the virtual IP), and replies OK after success.

[0105] S608: The central server performs resource reallocation operations and sends the device to a new access server.

[0106] S609, the downtime active service 1 is restored to normal and then re-registers with the central server.

[0107] S610, the central server performs resource reconfiguration operations and sends the device to the new access server. After receiving the access server reply ACK confirmation success, the central server notifies the active registration service 2 to delete the virtual IP.

[0108] S611, actively registering service 2 to delete the virtual IP, and the process ends.

[0109] In this embodiment, the server switching is also verified. The verification result is as follows: Figure 7 shown.

[0110] In summary, this embodiment uses a virtual IP to load the active registration device to another normal access server when an access server is abnormal, thereby achieving high-availability failover of the active registration device.

[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented 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, 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, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0112] In this embodiment, an access device for a terminal device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0113] Figure 8 1 is a structural block diagram of an access device for a terminal device according to an embodiment of the present invention (I), such as Figure 8 As shown, the device comprises:

[0114] A first sending module 82 is used to send a setting instruction to a second server when it is determined that the connection with the first server is abnormal, wherein the setting instruction is used to instruct the second server to set a virtual Internet interconnection protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in a central server;

[0115] The first access module 84 is used to connect the terminal device to the second server based on the virtual IP address.

[0116] In an exemplary embodiment, the above device further comprises:

[0117] A third receiving module is used to receive a first registration request sent by the first server before sending a setting instruction to the second server when it is determined that the connection with the first server is abnormal, wherein the first registration request is used to request that the first server be registered with the central server, and the registration request includes device information of the terminal device;

[0118] The second access module is used to connect the terminal device to the first server according to the device information of the terminal device when the first server is registered with the central server, so as to instruct the first server to manage the terminal device.

[0119] In an exemplary embodiment, the first sending module includes:

[0120] A first detection unit is used to detect whether the IP address of the first server is connected to the port of the central server when it is determined that the first server is down;

[0121] A first determining unit is used to determine the second server according to the data load of the server when the IP address of the first server is not connected to the port of the central server and the duration of the disconnection is greater than a first preset threshold;

[0122] The first sending unit is used to send the above-mentioned setting instruction to the above-mentioned second server.

[0123] In an exemplary embodiment, the above device further comprises:

[0124] a fourth receiving module, configured to, when determining that the connection with the first server is abnormal, send a setting instruction to the second server and then receive a second registration request sent by the first server, wherein the second registration request is used to request that the first server be registered with the central server, and the registration request includes device information of the terminal device;

[0125] The third sending module is used to send a deletion instruction to the second server when it is determined that the first server is registered to the central server and the terminal device is connected to the first server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

[0126] In an exemplary embodiment, the above device further comprises:

[0127] a fifth receiving module, configured to, when determining that the connection with the first server is abnormal, receive a third registration request sent by the second server before sending a setting instruction to the second server, wherein the third registration request is used to request that the second server be registered with the central server;

[0128] The first registration module is used to register the second server with the central server according to the third registration request.

[0129] Fig. 9 2 is a block diagram of a terminal device access device according to an embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0130] A second sending module 92 is used to send a first registration request to the central server, wherein the first registration request is used to request to register the first server with the central server, and the registration request includes device information of the terminal device;

[0131] A first receiving module 94 is used to receive a management instruction sent by the central server when it is determined to register with the central server;

[0132] A first management module 96, configured to manage the terminal device according to the management instruction;

[0133] The first deletion module 98 is used to delete the managed terminal device when it is determined that the connection with the central server is abnormal, so as to instruct the central server to send the terminal device to the second server, wherein the second server is used to manage the terminal device according to the set virtual IP address, and the first server and the second server are both registered with the central server.

[0134] In an exemplary embodiment, the first deletion module includes:

[0135] The first deleting unit is used to delete the managed terminal device when it is determined that the duration of disconnection with the central server is greater than a first preset threshold.

[0136] In an exemplary embodiment, the above device further comprises:

[0137] The second deleting module is used to delete the above virtual IP address when it is determined that the connection with the central server is abnormal and the above virtual IP address is set.

[0138] In an exemplary embodiment, the apparatus further includes: a fourth sending module, configured to, when it is determined that an abnormality occurs in the connection with the central server, after deleting the managed terminal device, and when it is determined that the connection with the central server is restored, send a second registration request to the central server, wherein the second registration request is used to request registration with the central server, and the registration request includes device information of the terminal device;

[0139] The second management module is used to re-manage the terminal device according to the instruction of the central server after confirming to register with the central server.

[0140] Fig.10 3 is a structural block diagram of an access device for a terminal device according to an embodiment of the present invention, such as Fig.10 As shown, the device comprises:

[0141] The second receiving module 1002 is used to receive the setting instruction sent by the central server;

[0142] A first setting module 1004, configured to set a virtual Internet Protocol IP address according to the setting instruction;

[0143] The second management module 1006 is used to access the terminal device in the first server based on the virtual IP address to manage the terminal device, wherein the first server and the second server are both registered in the central server.

[0144] In an exemplary embodiment, the above device further comprises:

[0145] The fifth sending module is used to send a third registration request to the central server before receiving the setting instruction sent by the central server, wherein the third registration request is used to request to register the second server to the central server.

[0146] In an exemplary embodiment, the above device further comprises:

[0147] A sixth receiving module, configured to receive a deletion instruction sent by the central server after the terminal device in the first server is accessed based on the virtual IP address;

[0148] The third deleting module is used to delete the above virtual IP address according to the above deleting instruction.

[0149] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0150] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0151] In this embodiment, the computer-readable storage medium may be configured to store a computer program for executing the above steps.

[0152] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0153] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0154] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0155] In an exemplary embodiment, the processor may be configured to execute the above steps through a computer program.

[0156] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0157] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0158] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for accessing a terminal device, characterized in that: include: When it is determined that the connection with the first server is abnormal, sending a setting instruction to the second server, wherein the setting instruction is used to instruct the second server to set a virtual Internet Protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in the central server; Connecting the terminal device to the second server based on the virtual IP address; In the case where it is determined that the connection with the first server is abnormal, a setting instruction is sent to the second server, including: in the case where it is determined that the first server is down, detecting whether the port between the IP address of the first server and the central server is connected; in the case where the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determining the second server according to the data load of the server; sending the setting instruction to the second server; wherein, determining the second server according to the data load of the server includes: the central server screening out servers that do not bear active registration devices; or, servers with active registration devices with the smallest load, and servers with active registration access services deployed; Wherein, connecting the terminal device to the second server based on the virtual IP address includes: receiving a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; sending the terminal device to the second server to instruct the second server to connect to the terminal device and manage the terminal device; receiving a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; When it is determined that an abnormality occurs in the connection with the first server, after sending a setting instruction to the second server, the method further includes: receiving a second registration request sent by the first server, wherein the second registration request is used to request that the first server be registered to the central server, and the registration request includes device information of the terminal device; when it is determined that the first server is registered to the central server and the terminal device is connected to the first server, sending a deletion instruction to the second server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

2. The method according to claim 1, characterized in that When it is determined that the connection with the first server is abnormal, before sending the setting instruction to the second server, the method further includes: receiving a first registration request sent by the first server, wherein the first registration request is used to request that the first server be registered with the central server, and the registration request includes device information of the terminal device; When the first server is registered with the central server, the terminal device is connected to the first server according to the device information of the terminal device to instruct the first server to manage the terminal device.

3. The method according to claim 1, characterized in that When it is determined that the connection with the first server is abnormal, before sending the setting instruction to the second server, the method further includes: receiving a third registration request sent by the second server, wherein the third registration request is used to request that the second server be registered with the central server; The second server is registered in the central server according to the third registration request.

4. A method for accessing a terminal device, characterized in that: include: Sending a first registration request to the central server, wherein the first registration request is used to request to register the first server with the central server, and the registration request includes device information of the terminal device; In the case of determining to register with the central server, receiving a management instruction sent by the central server; Managing the terminal device according to the management instruction; When it is determined that the connection with the central server is abnormal, the managed terminal device is deleted to instruct the central server to send the terminal device to the second server, wherein the second server is used to manage the terminal device according to the set virtual IP address, and the first server and the second server are both registered with the central server; The central server is further used to detect whether the port between the IP address of the first server and the central server is connected when it is determined that the first server is down; when the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determine the second server according to the data load of the server; send a setting instruction to the second server; the central server determines the second server in the following manner: the central server screens out servers that do not bear active registration devices; or, servers with active registration devices with the smallest load and deployed with active registration access services; The central server is further configured to receive a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; send the terminal device to the second server to instruct the second server to access the terminal device and manage the terminal device; receive a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; When it is determined that an abnormality occurs in the connection with the central server, after deleting the managed terminal device, the method further includes: when it is determined that the connection with the central server is restored, sending a second registration request to the central server, wherein the second registration request is used to request registration with the central server, and the registration request includes device information of the terminal device; when it is determined to register with the central server, re-managing the terminal device in accordance with the instructions of the central server.

5. The method according to claim 4, characterized in that If the connection with the central server is abnormal, delete the managed terminal devices, including: When it is determined that the duration of disconnection with the central server is greater than a first preset threshold, the managed terminal device is deleted.

6. The method according to claim 4, characterized in that The method further comprises: When it is determined that the connection with the central server is abnormal and the virtual IP address is set, the virtual IP address is deleted.

7. A method for accessing a terminal device, characterized in that: include: Receive the setting instructions sent by the central server; Setting a virtual Internet Protocol IP address according to the setting instructions; Accessing a terminal device in a first server based on the virtual IP address to manage the terminal device, wherein both the first server and the second server are registered in the central server; The central server is further used to detect whether the port between the IP address of the first server and the central server is connected when it is determined that the first server is down; when the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determine the second server according to the data load of the server; send a setting instruction to the second server; the central server determines the second server in the following manner: the central server screens out servers that do not bear active registration devices; or, servers with active registration devices with the smallest load and deployed with active registration access services; The central server is further configured to receive a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; send the terminal device to the second server to instruct the second server to access the terminal device and manage the terminal device; receive a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; The central server is also used to receive a second registration request sent by the first server, wherein the second registration request is used to request that the first server be registered to the central server, and the registration request includes device information of the terminal device; when it is determined that the first server is registered to the central server and the terminal device is connected to the first server, a deletion instruction is sent to the second server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

8. The method according to claim 7, characterized in that Before receiving the setting instruction sent by the central server, the method further includes: A third registration request is sent to the central server, wherein the third registration request is used to request to register the second server with the central server.

9. The method according to claim 7, characterized in that: After accessing the terminal device in the first server based on the virtual IP address, the method further includes: Receiving a deletion instruction sent by the central server; Delete the virtual IP address according to the deletion instruction.

10. An access device for a terminal device, characterized in that: include: A first sending module is used to send a setting instruction to a second server when it is determined that the connection with the first server is abnormal, wherein the setting instruction is used to instruct the second server to set a virtual Internet interconnection protocol IP address, the first server is configured with a terminal device, and the first server and the second server are both registered in a central server; A first access module, used to access the terminal device to the second server based on the virtual IP address; The first sending module includes: a first detection unit, which is used to detect whether the port between the IP address of the first server and the central server is connected when it is determined that the first server is down; a first determination unit, which is used to determine the second server according to the data load of the server when the port between the IP address of the first server and the central server is not connected and the duration of the disconnection is greater than a first preset threshold; a first sending unit, which is used to send the setting instruction to the second server; wherein the first determination unit is also used by the central server to screen out servers that do not bear active registration devices; or servers with active registration devices with the smallest load and deployed with active registration access services; The first access module is further configured to receive a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; send the terminal device to the second server to instruct the second server to access the terminal device and manage the terminal device; receive a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; The above-mentioned device also includes: a fourth receiving module, which is used to send a setting instruction to the second server after determining that an abnormality occurs in the connection with the first server, and then receive a second registration request sent by the first server, wherein the second registration request is used to request that the first server be registered to the central server, and the registration request includes the device information of the terminal device; a third sending module, which is used to send a deletion instruction to the second server after determining that the first server is registered to the central server and the terminal device is connected to the first server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

11. An access device for a terminal device, characterized in that: include: A second sending module is used to send a first registration request to the central server, wherein the first registration request is used to request to register the first server with the central server, and the registration request includes device information of the terminal device; A first receiving module, configured to receive a management instruction sent by the central server when it is determined that the registration is to be made to the central server; A first management module, used to manage the terminal device according to the management instruction; A first deletion module is used to delete the managed terminal device when it is determined that the connection with the central server is abnormal, so as to instruct the central server to send the terminal device to the second server, wherein the second server is used to manage the terminal device according to the set virtual IP address, and the first server and the second server are both registered with the central server; The central server is further used to detect whether the port between the IP address of the first server and the central server is connected when it is determined that the first server is down; when the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determine the second server according to the data load of the server; send a setting instruction to the second server; the central server determines the second server in the following manner: the central server screens out servers that do not bear active registration devices; or, servers with active registration devices with the smallest load and deployed with active registration access services; The central server is further configured to receive a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; send the terminal device to the second server to instruct the second server to access the terminal device and manage the terminal device; receive a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; The above-mentioned device also includes: a fourth sending module, which is used to, when it is determined that an abnormality occurs in the connection with the central server, delete the managed terminal device, and when it is determined that the connection with the central server is restored, send a second registration request to the central server, wherein the second registration request is used to request registration with the central server, and the registration request includes device information of the terminal device; a second management module, which is used to re-manage the terminal device according to the instructions of the central server after determining to register with the central server.

12. An access device for a terminal device, characterized in that: include: The second receiving module is used to receive the setting instruction sent by the central server; A first setting module, used for setting a virtual Internet Protocol IP address according to the setting instruction; A second management module, configured to access a terminal device in the first server based on the virtual IP address to manage the terminal device, wherein both the first server and the second server are registered in the central server; The central server is further used to detect whether the port between the IP address of the first server and the central server is connected when it is determined that the first server is down; when the port between the IP address of the first server and the central server is not connected, and the duration of the disconnection is greater than a first preset threshold, determine the second server according to the data load of the server; send a setting instruction to the second server; the central server determines the second server in the following manner: the central server screens out servers that do not bear active registration devices; or, servers with active registration devices with the smallest load and deployed with active registration access services; The central server is further configured to receive a reply message sent by the second server, wherein the reply message is used to indicate that the second server has set the virtual IP address; send the terminal device to the second server to instruct the second server to access the terminal device and manage the terminal device; receive a confirmation message sent by the second server, wherein the confirmation message is used to indicate that the terminal device has been connected to the second server; The central server is also used to receive a second registration request sent by the first server, wherein the second registration request is used to request that the first server be registered to the central server, and the registration request includes device information of the terminal device; when it is determined that the first server is registered to the central server and the terminal device is connected to the first server, a deletion instruction is sent to the second server, wherein the deletion instruction is used to instruct the second server to delete the virtual IP address.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the computer program implements the method described in any one of claims 1 to 3, or implements the method described in any one of claims 4 to 7, or implements the method described in any one of claims 9 to 11.

14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 3, or execute the method described in any one of claims 4 to 6, or implement the method described in any one of claims 7 to 9.

Citation Information

Patent Citations

  • Management method and apparatus of cloud computing platform

    CN108234191A

  • Host-standby switch method, device and communication device

    CN109344014A

  • API service system, main / standby switching method and device

    CN110474797A

  • Access equipment dynamic migration method and device access platform

    CN111385134A

  • Node service exception handling method and device, equipment and storage medium

    CN111885112A