WO2018040066A1 - Method, device and system enabling apparatus to automatically access server - Google Patents

Method, device and system enabling apparatus to automatically access server Download PDF

Info

Publication number
WO2018040066A1
WO2018040066A1 PCT/CN2016/097935 CN2016097935W WO2018040066A1 WO 2018040066 A1 WO2018040066 A1 WO 2018040066A1 CN 2016097935 W CN2016097935 W CN 2016097935W WO 2018040066 A1 WO2018040066 A1 WO 2018040066A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
optimal
automatically
module
restarted
Prior art date
Application number
PCT/CN2016/097935
Other languages
French (fr)
Chinese (zh)
Inventor
张占华
卢海峰
Original Assignee
深圳中兴力维技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳中兴力维技术有限公司 filed Critical 深圳中兴力维技术有限公司
Priority to PCT/CN2016/097935 priority Critical patent/WO2018040066A1/en
Publication of WO2018040066A1 publication Critical patent/WO2018040066A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present invention relates to the field of monitoring and Internet of things technologies, and in particular, to a method for automatically accessing a server by a device
  • the number of device accesses is generally large, and servers are often required to manage signaling and media access.
  • the existing network management system configures the corresponding server when accessing the new device. If the server crashes or the service is faulty after the configuration, the access device can only re-access after the original server restarts the service. Some information cannot be preserved and manual intervention is required. In addition, the administrator may mistakenly configure multiple devices on the same server or a fixed number of servers, so that there are fewer devices on other servers, resulting in uneven load on each server.
  • the main purpose of the present invention is to provide a method, device and system for automatically accessing a server by a device, and assigning the most suitable server to the device for automatic access according to the load condition of the server.
  • the present invention further provides a method for a device to automatically access a server, the method comprising: receiving a registration request sent by a device; verifying the registration request; and when the verification passes, combining multiple servers The load situation, sending data information of the optimal server to the device, so that the device automatically accesses the server; updating the state of the server, and a dictionary pair of the device and the accessed server.
  • the data information of the optimal server is sent to the device in combination with the load situation of the multiple servers, so that the device automatically accesses the server, including: determining whether the device exists to the device The allocated server; if yes, sending the data information of the allocated server to the device, so that the device automatically accesses the server; if not, selecting the data information of the optimal server to send The device is provided to enable the device to automatically access the server.
  • the method further includes: detecting that the device is disconnected from the allocated server; receiving a second registration request sent by the device; verifying the second registration request; Determining whether the device is disconnected from the allocated server to reach a preset time threshold;
  • the method further includes: receiving a message that the server sent by the device is down, the device automatically disconnects from the server; updating a status of the accessed server, and a dictionary pair of the device and the accessed server; receiving a third registration request sent by the device; verifying the third registration request; sending the data information of the server and the first valid day to the device when the verification passes Sending data information of the optimal server to the device, so that the device accesses the optimal first server; when the first valid time expires, the device and the optimal first The server is disconnected.
  • the method further includes: determining whether the server of the downtime is restarted; if yes, receiving a status message sent by the restarted server, and updating a status of the restarted server in the memory, and The device is automatically connected to the restarted server; if not, sending a second valid session of the restarted server to the device, and the device is automatically reconnected with the optimal first server When the second valid time expires, the device is disconnected from the optimal first server again; determining whether the server of the downtime is restarted; if yes, receiving a status sent by the restarting server a message, and updating a state of the restarted server in the memory, and the device is automatically connected to the restarted server; if not, transmitting an optimal server to the device in combination with load conditions of the plurality of servers Data information.
  • the method further includes: detecting that the server is automatically disconnected from the device; determining whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, determining the server The load upper limit is reached, and the access capability of the server is updated to the number of access devices; if not, the device is allocated to the server for access.
  • the present invention further provides an apparatus for automatically accessing a server, where the apparatus includes: a registration request receiving module, a registration request sent by the receiving device; and a verification module, And the sending module is configured to send the data information of the optimal server to the device when the verification is passed, combining the load conditions of the multiple servers, so that the device automatically accesses the server; An update module, configured to update a state of the server, and a dictionary pair of the device and the accessed server.
  • the sending module includes: a determining unit, configured to determine whether there is a server that has been allocated to the device; and the first sending unit is configured to determine that there is a server that has been allocated to the device, And sending the data information of the allocated server to the device, so that the device automatically accesses the server; and the second sending unit is configured to: when it is determined that there is no server allocated to the device, Then, the data information of the optimal server is selected and sent to the device, so that the device automatically accesses the server.
  • the device further includes: a detecting module, configured to detect that the device is disconnected from the allocated server; and a message receiving module, configured to receive a second registration request sent by the device; And determining, when the verification module verifies that the second registration request passes, determining whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, the sending The module is further configured to update the saved information, and select the data information of the optimal server to send to the device; if not, the sending module sends the data information of the allocated server to the device.
  • the device further includes: a message receiving module, configured to receive a message that the server sent by the device is down, the device is automatically disconnected from the server; and the updating module is further a state of the server that updates the access, and a dictionary pair of the device and the accessed server; the registration request receiving module is further configured to receive a third registration request sent by the device; And sending the third registration request to be verified; the sending module is further configured to: when the verification passes, send the data information of the server and the first valid time to the device, and send the optimal number to the device. Data information of a server, so that the device accesses the optimal first server; and a disconnection connection module is set, when the first valid time is expired, the device and the optimal first The server is disconnected.
  • a message receiving module configured to receive a message that the server sent by the device is down, the device is automatically disconnected from the server
  • the updating module is further a state of the server that updates the access, and a dictionary pair of the device and the accessed server
  • the registration request receiving module is further
  • the device further includes: a determining module, configured to determine whether the server of the downtime is restarted; if yes, the message receiving module is further configured to receive a status message sent by the restarted server And the update module updates a state of the restarted server in memory, and the device is automatically connected to the restarted server; if not, the sending module sends the restart to the device The second active time of the server, and the device is automatically reconnected with the optimal first server, and when the second valid time expires, the device and the optimal first server are disconnected again
  • the determining module is further configured to determine whether the server of the downtime is restarted; if yes, the message receiving module is further configured to receive a status message sent by the restart server, and the update module updates the memory.
  • the state of the restarted server, and the device is automatically connected to the restarted server; if not, the sending module is further configured to transmit the load condition to the plurality of servers, and send the most to the device Excellent server data information.
  • the device further includes: a detecting module, configured to detect that the server is automatically disconnected from the device; and a determining module, configured to determine whether the number of times of the automatic disconnection connection reaches a preset a threshold of the number of times; if yes, determining that the server reaches the upper limit of the load, and triggering the update module to update the access capability of the server as the number of access devices; if not, triggering the sending module to allocate the device again The server performs access.
  • a detecting module configured to detect that the server is automatically disconnected from the device
  • a determining module configured to determine whether the number of times of the automatic disconnection connection reaches a preset a threshold of the number of times; if yes, determining that the server reaches the upper limit of the load, and triggering the update module to update the access capability of the server as the number of access devices; if not, triggering the sending module to allocate the device again
  • the server performs access.
  • the method, device and system for automatically accessing a server by the device provided by the present invention, after the device is accessed, the registration machine can dynamically select and select an access server for the device to access, avoiding human intervention and appearing in the access server.
  • the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and problems occur in the server. It is also possible to quickly and automatically change access.
  • FIG. 1 is a schematic diagram of a system for automatically accessing a server by a device according to a first embodiment of the present invention
  • FIG. 2 is a block diagram of an apparatus for automatically accessing a server by a device according to a second embodiment of the present invention
  • FIG. 3 is a block diagram of a module of the transmitting module of FIG.
  • FIG. 4 is another schematic diagram of an apparatus for automatically accessing a server by a device according to a second embodiment of the present invention.
  • FIG. 5 is a schematic diagram of another module of an apparatus for automatically accessing a server according to a second embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a sub-flow of FIG. 6;
  • FIG. 8 is a schematic diagram of a sub-flow of FIG. 7;
  • FIG. 9 is another schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention.
  • FIG. 10 is another schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention.
  • FIG. 11 is a schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention.
  • FIG. 12 is a schematic diagram of a sub-flow of FIG. 11;
  • FIG. 13 is a schematic diagram of a sub-flow of FIG. 12;
  • FIG. 14 is another schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention.
  • FIG. 15 is another schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention.
  • the system includes a database server 100, a central server 200 connected to the database server 100, and a central server 200.
  • the central server 200 is disposed in the management registration machine 400, and the notification notification register 400 is changed in the state of the server 600.
  • the registration machine 400 is capable of selecting a suitable server 60 among the plurality of servers 600. 0 is assigned to device 500 for automatic access.
  • the information to be saved in the registration machine 400 is a dictionary pair.
  • the dictionary pair refers to the data structure of the device 500 identification code (ID) and the access server ID.
  • the access server group and their online status need to be saved.
  • the information in the registration machine 400 needs to save the database. When restarting, it is necessary to obtain corresponding information through the database, and to change the database of the registration machine 400 after the status of the server 600 is changed. specifically:
  • the device 500 is configured to send a registration request to the registration machine 400.
  • the device 500 is configured with an ID of the registrar 400, a network protocol (IP), and necessary authentication information.
  • IP network protocol
  • the registration information is sent to the registrar 400, and the registration message includes at least a registration protocol. .
  • the registration machine 400 is configured to verify the registration request, and when the verification passes, combine the load conditions of the plurality of servers 600, and send the data information of the optimal server 600 to the device 500.
  • the registration machine 400 searches for the corresponding server 600 in the dictionary pair by the ID of the device 500. More specifically, the server 600 that the registration machine 400 is looking for may be the server 600 having a connection history with the device 500, or may be the optimal server 600. The registration machine 400 transmits the data information of the server 600 sought to the device 500.
  • the server 600 with the smallest load can be selected as the optimal server according to the load condition of each server 600.
  • the data information includes at least the ID, IP, authentication information, and the like of the server 600.
  • the device 500 is further configured to send an access request to the server 600 according to the data information, and automatically access the server 600.
  • the device 500 sends the ID, IP, and authentication information of the access server 600 to the server 60.
  • the registration machine 400 is configured to update the state of the server 600, and a dictionary pair of the device 400 and the accessed server.
  • the registration machine 400 updates the dictionary pairs in the memory and the information of the database.
  • the registration machine 400 is specifically configured to verify the registration request according to the registration request sent by the device 500. begging.
  • the registration machine 400 determines whether there is a server 600 that has been assigned (with a connection history) to the device 500.
  • the registrar 400 transmits the data information of the assigned server 600 to the device 500.
  • the registrar 400 selects the data information of the optimal server 600 and sends it to the device 500. Specifically, if the registrar 400 does not find the corresponding access server 600, and the representative has not previously been assigned, then the weighting algorithm is used to optimize the access server 600 for allocation to achieve an optimal configuration.
  • the registration machine 400 is further disposed on the detection device 500 to be disconnected from the allocated server.
  • the registration machine 400 receives the second registration request and verifies the second registration request.
  • the registration machine 400 determines the device 500 and the allocated server. Whether the time between the 600 broken connections reaches the preset daytime threshold.
  • the inter-turn threshold can be set to 3 minutes or any inter-turn, and the specific time is determined according to the performance index requirements of each system, and the present invention does not impose specific restrictions.
  • the registrar 400 updates the saved information and selects the data information of the optimal server 600 to be sent to the device 500.
  • the optimal server 600 is re-selected for the registrar 400 in conjunction with the load conditions of the plurality of servers.
  • the registrar 400 transmits the data information of the allocated server 600 to the device 500, and the registrar 400 does not update the information of the dictionary pair, and the reconnection of the device 500 does not generate a redirection.
  • the registration machine 400 verifies the third registration request, and sends the data information of the server 600 and the first valid time to the device 500 when the verification passes, wherein the data information includes at least the ID, IP, verification information, and the like of the server 600.
  • the first active time is for the server 600 to handle the failure.
  • the registration machine 400 transmits the data information of the optimal first server to the device 500 to enable the device 500 to access the optimal first server 600.
  • the optimal first server 600 refers to: an optimal server among other servers other than the down server 600.
  • the device 500 is disconnected from the optimal first server 600.
  • the registration machine 400 determines whether the server 600 of the downtime is restarted.
  • the restarted server 600 (that is, the server 600 that repairs the failed downtime) is sent to the registration machine.
  • restarted server 600 notifies the registration machine 400 of the status by means of message reporting.
  • the registration machine 400 receives the status of restarting the server 600 and updates the status of the restarted server 60 in the memory, and the device 500 is automatically connected to the restarted server 600.
  • the registrar 400 transmits the second valid time of the server of the downtime to the device 500 again, and the server 600 of the second valid day-to-day fingerprint machine It is expected to handle the remaining time of the fault.
  • the device 500 is automatically reconnected to the optimal first server 600, and when the second active time expires, the device 500 is again disconnected from the optimal first server 600.
  • the registration machine 600 After the second valid timeout expires, the registration machine 600 again determines whether the server 600 of the downtime is restarted, and if so, the registration machine 400 receives the restart server 600 (ie, the server 600 that repaired the failed downtime). The state of the restarted server 600 in memory is updated and the device 500 is automatically connected to the restarted server 600.
  • the restart server 600 ie, the server 600 that repaired the failed downtime.
  • the registrar 400 transmits the data information of the optimal server to the device 500 in conjunction with the load conditions of the plurality of servers.
  • the optimal server here may be the optimal first server or other servers.
  • the optimal first server in this embodiment can be understood as an excessive server in the process of handling a failure of the server of the downtime, and if the server of the downtime still does not restart after expiration of the second valid time, the registration is performed.
  • the machine can periodically determine whether the server of the downtime is restarted according to the predetermined setting, and continue to send the third effective time to the device... the Nth effective time.
  • the registration machine 400 assigns the restarted server 600 to the new device to balance the allocation of the devices to the respective servers.
  • the registration machine 400 determines whether the number of automatic disconnection connections reaches a preset number of times threshold.
  • the registrar 400 determines that the server 600 reaches the load limit and updates the access capability of the server 600 to the number of access devices. If not, the registrar 400 again allocates the server 600 to the device 500 for access. [0067] Specifically, since the access capability of each access server 600 is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected. The registration machine 400 selects the weighted round robin algorithm to select the access server 600, but the actual weight of the access capability of the access server 600 may deviate from the value set by the central server 200. In this case, the dynamic optimization may be performed.
  • Weight if a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the connection process of the device connected to the access server, it can be determined that the access capability of the access server 600 reaches the maximum, and the access of the access device is maximized.
  • the value of the capability (weight) is dynamically adjusted to the number of access devices for this purpose so that the number of access devices 500 of each access server 600 is more even.
  • a plurality of registrars 400 may also be supported, and the plurality of registrars 400 are managed by the central server 200, each registrar 400 managing a group of access servers 600.
  • the registration machine 400 performs the assignment of the access device 500 to the access server 600 within the group.
  • the device provided by the embodiment automatically accesses the server.
  • the registration machine 400 can dynamically select the access server 600 for access by the device 500, thereby avoiding human intervention.
  • the registration machine 400 will exclude the corresponding access server 600 of the downtime, and allocate it to other access devices 500 of the device 500, thereby making the device access more. Convenient and flexible, it can also quickly and automatically change access when there is a problem with the server
  • FIG. 2 is a device for automatically accessing a server according to a second embodiment of the present invention, which is applied to a registration machine, but is not limited to a registration machine, and the device includes:
  • the registration request receiving module 210 is configured to set a registration request sent by the receiving device.
  • the verification module 220 is configured to verify the registration request.
  • the verification is performed according to the verification information carried in the registration request.
  • the sending module 230 is configured to send the data information of the optimal server to the device when the verification passes, combining the load conditions of the multiple servers, so that the device automatically accesses the server.
  • the corresponding server is searched for in the dictionary pair by using the ID carried in the registration request.
  • the server you are looking for can be a server with a history of connection to the device, or it can be an optimal server.
  • the transmitting module 230 transmits the data information of the sought server to the device.
  • the server with the smallest load can be selected as the optimal according to the load condition of each server. Server.
  • the data information includes at least an ID, an IP, a verification information, and the like of the server.
  • the device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server. After the device and the server are successfully connected, the dictionary pairs in the memory and the database information are updated.
  • the sending module 230 includes:
  • the determining unit 310 is configured to determine whether there is a server that has been allocated to the device (having a connection history); [0082] the first sending unit 320 is configured to be allocated when it is determined that there is a server that has been allocated to the device. The data information of the server is sent to the device, so that the device automatically accesses the server.
  • the second sending unit 330 is configured to: when it is determined that there is no server allocated to the device, send data information of the optimal server to the device, so that the device automatically accesses the server.
  • the second sending unit Specifically, if the corresponding access server is not found, and the representative is not previously allocated, the second sending unit
  • the update module 240 is configured to update a state of the server, and a dictionary pair of the device and the accessed server.
  • the device further includes a detection module and a message receiving module.
  • a detecting module configured to detect that the device is disconnected from the allocated server
  • a message receiving module configured to receive a second registration request sent by the device
  • the determining module is configured to: when the verification module 220 verifies that the second registration request passes, determine whether the device is disconnected from the allocated server to reach a preset time threshold;
  • the sending module 230 is further configured to update the saved information, and select the data information of the optimal server to send to the device; the optimal server 600 is the registrar 400. The load situation is re-selected.
  • the sending module 230 sends the data information of the allocated server to the device.
  • the device further includes a message receiving module 410, and is broken. a connection module 430, and a determination module 440, wherein
  • the message receiving module 410 is configured to send a message that the server sent by the receiving device is down, and the device is automatically disconnected from the server.
  • the device detects that the accessed server is down and sends a message of the downtime, and the device automatically disconnects from the accessed server, and the message is received.
  • Module 410 receives the message of the downtime.
  • the update module 240 is further configured to update the state of the accessed server, and a dictionary pair of the device and the accessed server.
  • the registration request receiving module 210 is further configured to receive a third registration request sent by the device.
  • the verification module 220 is further configured to verify the third registration request
  • the sending module 230 is further configured to: when the verification passes, send the data information of the server and the first valid time to the device, and send the data information of the optimal first server to the device, so that the device accesses the most Excellent first server.
  • the optimal first server 600 refers to: an optimal server among servers other than the down server 600.
  • the break connection module 430 is configured to be disconnected from the optimal first server when the first active time expires.
  • the determination module 440 determines whether the server 600 of the downtime is restarted.
  • the message receiving module 410 is further configured to receive a status message sent by the restart server (ie, the server that repaired the failed server), and the update module 240 to update the status of the restarted server in the memory. And the device is automatically connected to the restarted server.
  • the sending module 230 sends the second valid time of the server of the downtime to the device again, and the server of the second valid inter-turn finger machine is expected to handle the fault. The rest of the day. And the device is automatically reconnected with the optimal first server, and when the second valid time expires, the device and the optimal first server are disconnected again.
  • the determining module 440 is further configured to determine whether the server of the downtime is restarted.
  • the message receiving module 410 is further configured to receive the restarting of the server, that is, to repair the faulty downtime.
  • the server sends a status message, and the update module 240 updates the status of the restarted server in memory, and the device automatically connects to the restarted server.
  • the sending module 230 is further configured to send the data information of the optimal server to the device in combination with the load condition of the plurality of servers.
  • the optimal server can be the optimal first server or other server.
  • the optimal first server in this embodiment can be understood as an excessive server in the process of processing a failure of the server of the downtime, and if the server of the downtime still does not restart after expiration of the second valid time, the registration is performed.
  • the machine can periodically determine whether the server of the downtime is restarted according to the predetermined setting, and continue to send the third effective time to the device... the Nth effective time.
  • the sending module 230 assigns the restarted server to the new device to equalize the allocation of the device to each server.
  • the apparatus further includes a detecting module 510 and a determining module 520, where
  • the detecting module 510 is configured to detect that the server is automatically disconnected from the device.
  • the determining module 530 is configured to determine whether the number of times the automatic disconnection connection reaches a preset number of times threshold
  • the trigger sending module 230 allocates the server to the device again for access.
  • the access capability of each access server is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected.
  • the weight can be dynamically optimized. If a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the device connection process on the access server, the determining module 520 can determine that the access capability of the access server reaches the maximum. The value of the access capability (weight) of this port is dynamically adjusted to the number of access devices for each port, so that the number of access devices of each access server is more balanced.
  • the device of the embodiment automatically accesses the server, and the registration request receiving module 210 receives the registration request sent by the device, and the verification module 220 verifies the registration request.
  • the sending module 230 combines multiple servers. Load situation, send the optimal server data information to the device, so that the device The server is dynamically accessed, and the most suitable server can be allocated according to the load condition of the server to automatically access the device.
  • a third embodiment of the present invention provides a method for an apparatus to automatically access a server, where the method includes:
  • Step 610 The device sends a registration request to the registration machine.
  • the ID of the registrar, the network protocol (IP), and the necessary verification information are configured in the device, and the device sends the registration information to the registrar when the device is started, and the registration message includes at least the registration protocol.
  • IP network protocol
  • Step 620 The registration machine verifies the registration request. When the verification passes, the registration machine combines the load status of the multiple servers, and sends the data information of the optimal server to the device.
  • the registration machine searches for the corresponding server in the dictionary pair by using the ID of the device. More specifically, the server that the registry is looking for may be a server with a history of connection to the device, or it may be an optimal server. The registration machine sends the data information of the server it is looking for to the device.
  • the server with the smallest load may be selected as the optimal server according to the load condition of each server.
  • the data information includes at least the ID, IP, authentication information, and the like of the server.
  • Step 630 The device sends an access request to the server according to the data information, and automatically accesses the server.
  • the device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server.
  • Step 640 Register the machine update server status, and the dictionary pair of the device and the accessed server.
  • the registration machine updates the dictionary pair in the memory and the f ⁇ information of the database.
  • step 620 further includes:
  • Step 710 The registration machine verifies the registration request according to the registration request.
  • Step 720 When the verification passes, the registration machine determines whether there is a server that has been allocated to the device;
  • step 730 If no, the process proceeds to step 740.
  • Step 730 The registration machine sends the data information of the allocated server to the device.
  • Step 740 The data information of the registration machine selecting the optimal server is sent to the device.
  • the privilege algorithm is searched for the optimal access server for allocation, and the optimal configuration is achieved.
  • step 730 further includes:
  • Step 810 The registration machine detecting device is disconnected from the allocated server.
  • Step 820 The device sends a second registration request to the registrar.
  • Step 830 The registration machine receives the second registration request, and verifies the second registration request.
  • Step 840 when the verification passes, the registration machine determines whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, proceeds to step 850, and if not, Enter step
  • the inter-turn threshold may be set to 3 minutes or any time, and the specific time is determined according to the performance index requirements of each system, and the present invention does not specifically limit.
  • Step 850 The registration machine updates the saved information, and selects data information of the optimal server to send to the device.
  • the optimal server is re-selected for the registration machine to combine the load conditions of multiple servers.
  • Step 860 The registration machine sends the data information of the allocated server to the device, and the registration machine does not update the information of the dictionary pair, and the device reconnection does not generate a redirection.
  • the method further includes:
  • Step 910 The device detects that the accessed server is down, the device disconnects from the accessed server, and sends a third registration request to the registrar.
  • Step 920 The registration machine verifies the third registration request. When the verification passes, the registration machine sends the data information of the server and the first valid time to the device, where the data information includes at least the ID of the server.
  • the first valid time is the time when the server handles the failure.
  • Step 930 The registration machine sends the data information of the optimal first server to the device, so that the device accesses the optimal first server.
  • the optimal first server refers to: an optimal server among servers other than the down server.
  • Step 940 When the first valid time expires, the device is disconnected from the optimal first server.
  • Step 950 The registration machine determines whether the server of the downtime is restarted. If yes, the process proceeds to step 960. If not, the process proceeds to step 980. [0147] Step 960, the restarted server (ie, the server that repaired the failed downtime) sends a status message to the registrar.
  • the restarted server ie, the server that repaired the failed downtime
  • the restarted server notifies the registration machine of the status by means of message reporting.
  • Step 970 The registrar receives the status of restarting the server and updates the status of the restarted server in the memory, and the device automatically connects with the restarted server.
  • Step 980 the registering machine sends the second valid time of the server of the downtime to the device again, and the server of the second valid daytime ⁇ machine is expected to handle the remaining time of the fault.
  • Step 990 The device is automatically reconnected with the optimal first server, and when the second valid time expires, the device is disconnected from the optimal first server again.
  • the registration machine returns to step 950, and steps 950-990 are repeated, when the number of repetitions reaches a preset number of times (ie, the last judgment), if the registration machine determines that the machine is down.
  • the device After the server is restarted, the device automatically connects with the restarted server; if the registered machine determines that the downed server is still not restarted, the data of the optimal server is sent to the device according to the load of the multiple servers, where The optimal server can be an optimal first server or another server.
  • step 990 Preferably, if the preset number of repetitions is set to repeat 1 time, after step 990, the following steps are further included:
  • the registration machine determines whether the server of the downtime is restarted
  • the registrar receives a status message sent by the restart server, and updates the status of the restarted server in the memory, and the device is automatically connected to the restarted server; [0156]
  • the registration machine combines the load conditions of the multiple servers to send the data information of the optimal server to the device.
  • the registration machine assigns the restarted server to the new device to balance the allocation of the device to each server.
  • the method further includes:
  • Step 1010 The server automatically disconnects from the device.
  • Step 1020 The registration machine determines whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, proceeds to step 1030, and if no, proceeds to step 1040.
  • Step 1030 the registration machine determines that the server reaches the load upper limit, and updates the access capability of the server.
  • the force is the number of access devices, and the optimal server is selected among the remaining servers to be assigned to the device.
  • Step 1040 The registration machine allocates the server to the device for access again.
  • the connection is actively disconnected.
  • the registration opportunity selects the weighted round robin algorithm to select the access server, but the real weight of the access server's access capability will deviate from the value set by the central server.
  • the weight can be dynamically optimized.
  • a disconnected connection occurs in a preset number of times (for example, 5 times) during the connection process of the device on the access server, and it can be determined that the access capability of the access server reaches the maximum, and the value of the access capability (weight) of the device is determined. Dynamically adjust the number of access devices for this purpose, so that the number of access devices of each access server is more balanced.
  • the method for automatically accessing a server by the device provided by the embodiment, after the device is accessed, the registration machine can dynamically select and select an access server for accessing the device, thereby avoiding human intervention, and the access server is down.
  • the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and when the server has problems, Fast and automatic conversion access.
  • a method for automatically accessing a server by using a device according to a fourth embodiment of the present invention is applicable to a registration machine, but is not limited to a registration machine, and the method includes:
  • Step 1110 Receive a registration request sent by the device.
  • Step 1120 Verify the registration request.
  • the verification is performed according to the verification information carried in the registration request.
  • Step 1130 When the verification passes, combining the load conditions of the multiple servers, the data information of the optimal server is sent to the device, so that the device automatically accesses the server.
  • the corresponding server is searched for in the dictionary pair by using the ID carried in the registration request.
  • the server you are looking for can be a server with a history of connection to the device, or it can be an optimal server. Send the data information of the server you are looking for to the device.
  • the server with the smallest load may be selected as the optimal server according to the load condition of each server.
  • the data information includes at least the ID, IP, authentication information, and the like of the server.
  • Step 1140 Update the status of the server, and a dictionary pair of the device and the accessed server.
  • the device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server. After the device and the server are successfully connected, the dictionary pairs in the memory and the database information are updated.
  • step 1130 further includes:
  • Step 1210 Determine whether there is a server that has been allocated to the device; if yes, go to 1220, if no, go to step 1230.
  • Step 1220 Send data information of the allocated server to the device, so that the device automatically accesses the server.
  • Step 1230 Select data information of the optimal server to send to the device, so that the device automatically accesses the server.
  • the weighting algorithm is searched for the optimal access server for allocation, and the optimal configuration is achieved.
  • the method further includes:
  • Step 1310 Detect that the device is disconnected from the allocated server.
  • Step 1320 Receive a second registration request sent by the device.
  • Step 1330 Verify the second registration request.
  • Step 1340 when the verification passes, determine whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, enter 1350, and if no, proceed to step 1360. .
  • the inter-turn threshold may be set to 3 minutes or any inter-day, and the specific time is determined according to the performance index requirements of each system, and the present invention does not specifically limit.
  • Step 1350 Update the saved information, and select the data information of the optimal server to send to the device.
  • Step 1360 Send the data information of the allocated server to the device, and do not update the information of the dictionary pair, and the device reconnection does not generate a redirect.
  • the method further includes:
  • Step 1410 Receive a message that the server sent by the device is down, and the device automatically disconnects from the server. [0191] Specifically, when the server that the device has accessed is down, the device detects that the accessed server has a downtime and sends a message of the downtime, and receives the message of the downtime.
  • Step 1420 Update a status of the accessed server, and a dictionary pair of the device and the accessed server.
  • Step 1430 Receive a third registration request sent by the device.
  • Step 1440 verifying the third registration request.
  • Step 1450 When the verification passes, send the data information of the server and the first valid time to the device.
  • the data information includes at least a server ID, an IP, an authentication information, and the like, and the first valid time is a time when the server processes the fault.
  • Step 1460 Send data information of the optimal server to the device, so that the device accesses the optimal first server.
  • Step 1470 when the first valid time expires, the device is disconnected from the optimal first server.
  • Step 1480 determining whether the server of the downtime is restarted; if yes, proceeding to step 1490, and if no, proceeding to step 1400.
  • Step 1490 Receive a status message sent by the restarted server, and update a status of the restarted server in the memory, and the device is automatically connected to the restarted server.
  • Step 1400 Send a second active time of the restarted server to the device, and the device is automatically reconnected with the optimal first server, when the second valid time expires In other words, the device is disconnected again from the optimal first server.
  • step 1480 When the second valid time expires, return to step 1480, and repeat to step 1490, or step 1400, when the number of repetitions reaches a preset number of times (ie, the last judgment), if the downtime is determined Rebooting the server, receiving a status message sent by the restart server, and updating the status of the restarted server in the memory, and the device is automatically connected to the restarted server; if it is determined that the downtime is If the server is not restarted, the data of the optimal server is sent to the device according to the load of the multiple servers.
  • the optimal server may be the optimal first server or other servers.
  • the restarted server is assigned to the new device to balance the allocation of the device to each server.
  • the method further includes:
  • Step 1510 The detection server and the device are automatically disconnected.
  • Step 1520 Determine whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, go to 1530, if no, go to step 1540.
  • Step 1530 the server reaches the load limit, and updates the access capability of the server to the number of access devices.
  • Step 1540 Assign the server to the device for access again.
  • the access capability of each access server is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected.
  • the weight can be dynamically optimized. If a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the connection process of the device connected to the access server, it can be determined that the access capability of the access server reaches the maximum.
  • the value of the access capability (weight) is dynamically adjusted to the number of access devices for each port, so that the number of access devices of each access server is more balanced.
  • the method for automatically accessing the server by the device in this embodiment is to verify the registration request by receiving a registration request sent by the device, and send the data of the optimal server to the device when the verification passes, combined with the load situation of multiple servers.
  • the information is such that the device automatically accesses the server, and the most suitable server can be allocated according to the load condition of the server to automatically access the device.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • a storage medium such as ROM/RAM, disk
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • the method, device and system for automatically accessing a server by the device provided by the present invention, after the device is accessed, the registration machine can dynamically select the access server for the device to access, avoiding human intervention and appearing on the access server.
  • the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and problems occur in the server. It is also possible to quickly and automatically change access. Therefore, it has industrial applicability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the field of monitoring and Internet of Things techniques. Disclosed are a method, device and system enabling an apparatus to automatically access a server. The method comprises: receiving a registration request transmitted by an apparatus; verifying the registration request; if the verification is successful, combining loading states of multiple servers, and transmitting, to the apparatus, information of the optimal server, such that the apparatus automatically accesses said server; and updating a state of said server and a pair of dictionaries of the apparatus and said server to which the apparatus has access. In the method, device and system enabling an apparatus to automatically access a server of the invention, when an apparatus is to access a server, a registrar can make, according to loading states of servers, a dynamic and balanced selection of an access server for the apparatus to access, thereby avoiding human intervention.

Description

设备自动接入服务器的方法、 装置及系统 技术领域  Method, device and system for automatically accessing server by device
[0001] 本发明涉及监控及物联网技术领域, 尤其涉及一种设备自动接入服务器的方法 [0001] The present invention relates to the field of monitoring and Internet of things technologies, and in particular, to a method for automatically accessing a server by a device
、 装置及系统。 , devices and systems.
背景技术  Background technique
[0002] 在监控行业中, 设备接入的数量一般都很大, 通常需要服务器来管理信令和媒 体的接入。 现有的网管系统都是在接入新设备的吋候配置对应的服务器, 配置 后如果出现服务器死机或者服务出现问题, 接入设备只有在原对应的服务器重 启服务后才能重新接入, 这样会导致一些信息不能及吋的保存, 也需要人工进 行干预。 另外, 管理人员可能会误把多个设备配置到同一个服务器或者固定的 几个服务器上面, 这样, 其他服务器上面的设备偏少, 导致各个服务器负载不 均衡的情况。  [0002] In the surveillance industry, the number of device accesses is generally large, and servers are often required to manage signaling and media access. The existing network management system configures the corresponding server when accessing the new device. If the server crashes or the service is faulty after the configuration, the access device can only re-access after the original server restarts the service. Some information cannot be preserved and manual intervention is required. In addition, the administrator may mistakenly configure multiple devices on the same server or a fixed number of servers, so that there are fewer devices on other servers, resulting in uneven load on each server.
技术问题  technical problem
[0003] 本发明的主要目的在于提出一种设备自动接入服务器的方法、 装置及系统, 根 据服务器的负载情况分配最合适的服务器给设备进行自动接入。  [0003] The main purpose of the present invention is to provide a method, device and system for automatically accessing a server by a device, and assigning the most suitable server to the device for automatic access according to the load condition of the server.
问题的解决方案  Problem solution
技术解决方案  Technical solution
[0004] 为实现上述目的, 本发明还提供一种设备自动接入服务器的方法, 所述方法包 括: 接收设备发送的注册请求; 验证所述注册请求; 当验证通过吋, 结合多个 服务器的负载情况, 向所述设备发送最优服务器的数据信息, 以使所述设备自 动接入所述服务器; 更新所述服务器的状态, 以及所述设备与接入的服务器的 字典对。  [0004] In order to achieve the above object, the present invention further provides a method for a device to automatically access a server, the method comprising: receiving a registration request sent by a device; verifying the registration request; and when the verification passes, combining multiple servers The load situation, sending data information of the optimal server to the device, so that the device automatically accesses the server; updating the state of the server, and a dictionary pair of the device and the accessed server.
[0005] 可选地, 所述结合多个服务器的负载情况, 向所述设备发送最优服务器的数据 信息, 以使所述设备自动接入所述服务器, 包括: 判断是否存在向所述设备已 分配的服务器; 若是, 则将所述已分配的服务器的数据信息发送给所述设备, 以使所述设备自动接入所述服务器; 若否, 则选择最优服务器的数据信息发送 给所述设备, 以使所述设备自动接入所述服务器。 [0005] Optionally, the data information of the optimal server is sent to the device in combination with the load situation of the multiple servers, so that the device automatically accesses the server, including: determining whether the device exists to the device The allocated server; if yes, sending the data information of the allocated server to the device, so that the device automatically accesses the server; if not, selecting the data information of the optimal server to send The device is provided to enable the device to automatically access the server.
[0006] 可选地, 所述方法还包括: 检测所述设备与已分配的服务器断幵连接; 接收所 述设备发送的第二注册请求; 验证所述第二注册请求; 当验证通过吋, 判断所 述设备与所述已分配的服务器断幵连接的吋间是否达到预设的吋间阈值; 若是 [0006] Optionally, the method further includes: detecting that the device is disconnected from the allocated server; receiving a second registration request sent by the device; verifying the second registration request; Determining whether the device is disconnected from the allocated server to reach a preset time threshold;
, 则更新保存的信息, 并选择最优服务器的数据信息发送给所述设备; 若否, 则将所述已分配的服务器的数据信息发送给所述设备。 And updating the saved information, and selecting the data information of the optimal server to send to the device; if not, transmitting the data information of the allocated server to the device.
[0007] 可选地, 所述方法还包括: 接收所述设备发送的服务器出现宕机的消息, 所述 设备自动与所述服务器断幵连接; 更新所述接入的服务器的状态, 以及所述设 备与接入的服务器的字典对; 接收所述设备发送的第三注册请求; 验证所述第 三注册请求; 当验证通过吋, 向所述设备发送服务器的数据信息和第一有效吋 间; 向所述设备发送最优服务器的数据信息, 以使所述设备接入所述最优第一 服务器; 当所述第一有效吋间到期吋, 所述设备与所述最优第一服务器断幵连 接。 [0007] Optionally, the method further includes: receiving a message that the server sent by the device is down, the device automatically disconnects from the server; updating a status of the accessed server, and a dictionary pair of the device and the accessed server; receiving a third registration request sent by the device; verifying the third registration request; sending the data information of the server and the first valid day to the device when the verification passes Sending data information of the optimal server to the device, so that the device accesses the optimal first server; when the first valid time expires, the device and the optimal first The server is disconnected.
[0008] 可选地, 所述方法还包括: 判断宕机的服务器是否重新启动; 若是, 则接收重 新启动的服务器发送的状态消息、 以及更新内存中的所述重新启动的服务器的 状态, 且所述设备与所述重新启动的服务器自动连接; 若否, 则向所述设备发 送所述重新启动的服务器的第二有效吋间, 且所述设备重新与所述最优第一服 务器自动连接, 当所述第二有效吋间到期吋, 所述设备与所述最优第一服务器 再次断幵连接; 判断所述宕机的服务器是否重新启动; 若是, 则接收重新启动 服务器发送的状态消息、 以及更新内存中的所述重新启动的服务器的状态, 且 所述设备与所述重新启动的服务器自动连接; 若否, 则结合多个服务器的负载 情况, 向所述设备发送最优服务器的数据信息。  [0008] Optionally, the method further includes: determining whether the server of the downtime is restarted; if yes, receiving a status message sent by the restarted server, and updating a status of the restarted server in the memory, and The device is automatically connected to the restarted server; if not, sending a second valid session of the restarted server to the device, and the device is automatically reconnected with the optimal first server When the second valid time expires, the device is disconnected from the optimal first server again; determining whether the server of the downtime is restarted; if yes, receiving a status sent by the restarting server a message, and updating a state of the restarted server in the memory, and the device is automatically connected to the restarted server; if not, transmitting an optimal server to the device in combination with load conditions of the plurality of servers Data information.
[0009] 可选地, 所述方法还包括: 检测所述服务器与所述设备自动断幵连接; 判断所 述自动断幵连接的次数是否达到预设的次数阈值; 若是, 则判定所述服务器达 到负载上限, 并更新所述服务器的接入能力为接入设备的数量; 若否, 贝晌所 述设备再次分配所述服务器进行接入。 [0009] Optionally, the method further includes: detecting that the server is automatically disconnected from the device; determining whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, determining the server The load upper limit is reached, and the access capability of the server is updated to the number of access devices; if not, the device is allocated to the server for access.
[0010] 此外, 为实现上述目的, 本发明还提供一种设备自动接入服务器的装置, 所述 装置包括: 注册请求接收模块, 设置于接收设备发送的注册请求; 验证模块, 设置于验证所述注册请求; 发送模块, 设置于当验证通过吋, 结合多个服务器 的负载情况, 向所述设备发送最优服务器的数据信息, 以使所述设备自动接入 所述服务器; 更新模块, 设置于更新所述服务器的状态, 以及所述设备与接入 的服务器的字典对。 [0010] In addition, in order to achieve the above object, the present invention further provides an apparatus for automatically accessing a server, where the apparatus includes: a registration request receiving module, a registration request sent by the receiving device; and a verification module, And the sending module is configured to send the data information of the optimal server to the device when the verification is passed, combining the load conditions of the multiple servers, so that the device automatically accesses the server; An update module, configured to update a state of the server, and a dictionary pair of the device and the accessed server.
[0011] 可选地, 所述发送模块包括: 判断单元, 设置于判断是否存在向所述设备已分 配的服务器; 第一发送单元, 设置于当判定存在向所述设备已分配的服务器吋 , 则将所述已分配的服务器的数据信息发送给所述设备, 以使所述设备自动接 入所述服务器; 第二发送单元, 设置于当判定不存在向所述设备已分配的服务 器吋, 则选择最优服务器的数据信息发送给所述设备, 以使所述设备自动接入 所述服务器。  [0011] Optionally, the sending module includes: a determining unit, configured to determine whether there is a server that has been allocated to the device; and the first sending unit is configured to determine that there is a server that has been allocated to the device, And sending the data information of the allocated server to the device, so that the device automatically accesses the server; and the second sending unit is configured to: when it is determined that there is no server allocated to the device, Then, the data information of the optimal server is selected and sent to the device, so that the device automatically accesses the server.
[0012] 可选地, 所述装置还包括: 检测模块, 设置于检测所述设备与已分配的服务器 断幵连接; 消息接收模块, 设置于接收所述设备发送的第二注册请求; 判断模 块, 设置于当所述验证模块验证所述第二注册请求通过吋, 判断所述设备与所 述已分配的服务器断幵连接的吋间是否达到预设的吋间阈值; 若是, 则所述发 送模块, 还设置于更新保存的信息, 并选择最优服务器的数据信息发送给所述 设备; 若否, 则所述发送模块将所述已分配的服务器的数据信息发送给所述设 备。  [0012] Optionally, the device further includes: a detecting module, configured to detect that the device is disconnected from the allocated server; and a message receiving module, configured to receive a second registration request sent by the device; And determining, when the verification module verifies that the second registration request passes, determining whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, the sending The module is further configured to update the saved information, and select the data information of the optimal server to send to the device; if not, the sending module sends the data information of the allocated server to the device.
[0013] 可选地, 所述装置还包括: 消息接收模块, 设置于接收所述设备发送的服务器 出现宕机的消息, 所述设备自动与所述服务器断幵连接; 所述更新模块, 还设 置于更新所述接入的服务器的状态, 以及所述设备与接入的服务器的字典对; 所述注册请求接收模块, 还设置于接收所述设备发送的第三注册请求; 所述验 证模块, 还设置于验证所述第三注册请求; 所述发送模块, 还设置于当验证通 过吋, 向所述设备发送服务器的数据信息和第一有效吋间, 并向所述设备发送 最优第一服务器的数据信息, 以使所述设备接入所述最优第一服务器; 断幵连 接模块, 设置于当所述第一有效吋间到期吋, 所述设备与所述最优第一服务器 断幵连接。  [0013] Optionally, the device further includes: a message receiving module, configured to receive a message that the server sent by the device is down, the device is automatically disconnected from the server; and the updating module is further a state of the server that updates the access, and a dictionary pair of the device and the accessed server; the registration request receiving module is further configured to receive a third registration request sent by the device; And sending the third registration request to be verified; the sending module is further configured to: when the verification passes, send the data information of the server and the first valid time to the device, and send the optimal number to the device. Data information of a server, so that the device accesses the optimal first server; and a disconnection connection module is set, when the first valid time is expired, the device and the optimal first The server is disconnected.
[0014] 可选地, 所述装置还包括: 判断模块, 设置于判断宕机的服务器是否重新启动 ; 若是, 则所述消息接收模块还设置于接收重新启动的服务器发送的状态消息 、 以及所述更新模块更新内存中的所述重新启动的服务器的状态, 且所述设备 与所述重新启动的服务器自动连接; 若否, 则所述发送模块向所述设备发送所 述重新启动的服务器的第二有效吋间, 且所述设备重新与所述最优第一服务器 自动连接, 当所述第二有效吋间到期吋, 所述设备与所述最优第一服务器再次 断幵连接; 所述判断模块, 还设置于判断所述宕机的服务器是否重新启动; 若 是, 则所述消息接收模块还设置于接收重新启动服务器发送的状态消息、 以及 所述更新模块更新内存中的所述重新启动的服务器的状态, 且所述设备与所述 重新启动的服务器自动连接; 若否, 则所述发送模块, 还设置于结合多个服务 器的负载情况, 向所述设备发送最优服务器的数据信息。 [0014] Optionally, the device further includes: a determining module, configured to determine whether the server of the downtime is restarted; if yes, the message receiving module is further configured to receive a status message sent by the restarted server And the update module updates a state of the restarted server in memory, and the device is automatically connected to the restarted server; if not, the sending module sends the restart to the device The second active time of the server, and the device is automatically reconnected with the optimal first server, and when the second valid time expires, the device and the optimal first server are disconnected again The determining module is further configured to determine whether the server of the downtime is restarted; if yes, the message receiving module is further configured to receive a status message sent by the restart server, and the update module updates the memory. The state of the restarted server, and the device is automatically connected to the restarted server; if not, the sending module is further configured to transmit the load condition to the plurality of servers, and send the most to the device Excellent server data information.
[0015] 可选地, 所述装置还包括: 检测模块, 设置于检测所述服务器与所述设备自动 断幵连接; 判断模块, 设置于判断所述自动断幵连接的次数是否达到预设的次 数阈值; 若是, 则判定所述服务器达到负载上限, 并触发所述更新模块更新所 述服务器的接入能力为接入设备的数量; 若否, 则触发所述发送模块向所述设 备再次分配所述服务器进行接入。  [0015] Optionally, the device further includes: a detecting module, configured to detect that the server is automatically disconnected from the device; and a determining module, configured to determine whether the number of times of the automatic disconnection connection reaches a preset a threshold of the number of times; if yes, determining that the server reaches the upper limit of the load, and triggering the update module to update the access capability of the server as the number of access devices; if not, triggering the sending module to allocate the device again The server performs access.
发明的有益效果  Advantageous effects of the invention
有益效果  Beneficial effect
[0016] 本发明提出的设备自动接入服务器的方法、 装置及系统, 在设备接入吋, 注册 机能够动态均衡的选择接入服务器供设备接入, 避免了人为干预, 在接入服务 器出现宕机的情况下, 设备再次注册的吋候, 注册机会排除对应的宕机的接入 服务器, 分配给设备其它的接入设备, 从而使得设备的接入更加的方便以及灵 活, 在服务器出现问题吋候也能够快速的自动的变换接入。  [0016] The method, device and system for automatically accessing a server by the device provided by the present invention, after the device is accessed, the registration machine can dynamically select and select an access server for the device to access, avoiding human intervention and appearing in the access server. In the case of downtime, when the device is registered again, the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and problems occur in the server. It is also possible to quickly and automatically change access.
对附图的简要说明  Brief description of the drawing
附图说明  DRAWINGS
[0017] 图 1为本发明第一实施例提供的设备自动接入服务器的系统的示意图;  1 is a schematic diagram of a system for automatically accessing a server by a device according to a first embodiment of the present invention;
[0018] 图 2为本发明第二实施例提供的设备自动接入服务器的装置的模块示意图; [0019] 图 3为图 2中发送模块的模块示意图; 2 is a block diagram of an apparatus for automatically accessing a server by a device according to a second embodiment of the present invention; [0019] FIG. 3 is a block diagram of a module of the transmitting module of FIG.
[0020] 图 4为本发明第二实施例提供的设备自动接入服务器的装置的另一模块示意图 [0021] 图 5为本发明第二实施例提供的设备自动接入服务器的装置的另一模块示意图 4 is another schematic diagram of an apparatus for automatically accessing a server by a device according to a second embodiment of the present invention; [0021] FIG. 5 is a schematic diagram of another module of an apparatus for automatically accessing a server according to a second embodiment of the present invention;
[0022] 图 6为本发明第三实施例提供的设备自动接入服务器的方法的流程示意图;6 is a schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention;
[0023] 图 7为图 6的子流程示意图; 7 is a schematic diagram of a sub-flow of FIG. 6;
[0024] 图 8为图 7的子流程示意图;  8 is a schematic diagram of a sub-flow of FIG. 7;
[0025] 图 9为本发明第三实施例提供的设备自动接入服务器的方法的另一流程示意图  9 is another schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention.
[0026] 图 10为本发明第三实施例提供的设备自动接入服务器的方法的另一流程示意图 10 is another schematic flowchart of a method for automatically accessing a server by a device according to a third embodiment of the present invention.
[0027] 图 11为本发明第四实施例提供的设备自动接入服务器的方法的流程示意图;11 is a schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention;
[0028] 图 12为图 11的子流程示意图; 12 is a schematic diagram of a sub-flow of FIG. 11;
[0029] 图 13为图 12的子流程示意图;  13 is a schematic diagram of a sub-flow of FIG. 12;
[0030] 图 14为本发明第四实施例提供的设备自动接入服务器的方法的另一流程示意图  FIG. 14 is another schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention;
[0031] 图 15为本发明第四实施例提供的设备自动接入服务器的方法的另一流程示意图 FIG. 15 is another schematic flowchart of a method for automatically accessing a server by a device according to a fourth embodiment of the present invention; FIG.
[0032] 本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步说明。 [0032] The implementation, functional features, and advantages of the present invention will be further described with reference to the accompanying drawings.
本发明的实施方式 Embodiments of the invention
[0033] 在此处键入本发明的实施方式描述段落。 下面详细描述本发明的实施例, 所述 实施例的示例在附图中示出, 其中自始至终相同或类似的标号表示相同或类似 的元件或具有相同或类似功能的元件。 下面通过参考附图描述的实施例是示例 性的, 旨在设置为解释本发明, 而不能理解为对本发明的限制。  [0033] The description paragraphs of the embodiments of the present invention are entered here. The embodiments of the present invention are described in detail below, and the examples of the embodiments are illustrated in the drawings, wherein the same or similar reference numerals are used to refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are intended to be illustrative, and are not to be construed as limiting.
[0034] 请参照图 1, 为本发明第一实施例提供的设备自动接入服务器系统的示意图, 所述系统包括数据库服务器 100、 与数据库服务器 100连接的中心服务器 200、 与 中心服务器 200连接的终端 300、 注册机 400、 多个设备 500以及多个服务器 600。 其中, 中心服务器 200, 设置于管理注册机 400, 以及在服务器 600状态改变的吋 候通知注册机 400。 注册机 400能够在多个服务器 600中选择一个合适的服务器 60 0分配给设备 500进行自动接入。 注册机 400中需要保存的信息有字典对, 字典对 是指设备 500身份标识码 (ID) 以及接入服务器 ID的数据结构, 另外, 还需要保 存接入服务器组和他们的在线状态。 注册机 400中的信息需要保存数据库, 重启 的吋候需要通过数据库获取相应的信息, 以及在服务器 600的状态发生改变吋及 吋更新注册机 400的数据库。 具体地: 1 is a schematic diagram of a device automatic access server system according to a first embodiment of the present invention. The system includes a database server 100, a central server 200 connected to the database server 100, and a central server 200. The terminal 300, the registration machine 400, the plurality of devices 500, and the plurality of servers 600. The central server 200 is disposed in the management registration machine 400, and the notification notification register 400 is changed in the state of the server 600. The registration machine 400 is capable of selecting a suitable server 60 among the plurality of servers 600. 0 is assigned to device 500 for automatic access. The information to be saved in the registration machine 400 is a dictionary pair. The dictionary pair refers to the data structure of the device 500 identification code (ID) and the access server ID. In addition, the access server group and their online status need to be saved. The information in the registration machine 400 needs to save the database. When restarting, it is necessary to obtain corresponding information through the database, and to change the database of the registration machine 400 after the status of the server 600 is changed. specifically:
[0035] 设备 500, 设置于向注册机 400发送注册请求。 [0035] The device 500 is configured to send a registration request to the registration machine 400.
[0036] 具体地, 设备 500中配置了注册机 400的 ID, 网络协议 (IP) 以及必要的验证信 息, 设备 500启动的吋候向注册机 400发送注册信息, 该注册消息中至少包括注 册协议。  [0036] Specifically, the device 500 is configured with an ID of the registrar 400, a network protocol (IP), and necessary authentication information. When the device 500 starts, the registration information is sent to the registrar 400, and the registration message includes at least a registration protocol. .
[0037] 注册机 400, 设置于验证所述注册请求, 当验证通过吋, 结合多个服务器 600的 负载情况, 向设备 500发送最优服务器 600的数据信息。  [0037] The registration machine 400 is configured to verify the registration request, and when the verification passes, combine the load conditions of the plurality of servers 600, and send the data information of the optimal server 600 to the device 500.
[0038] 具体地, 注册机 400通过设备 500的 ID在字典对中寻找相应的服务器 600进行接 入。 更具体地, 注册机 400寻找的服务器 600可以是与设备 500有连接历史的服务 器 600, 也可以是最优服务器 600。 注册机 400将寻找的服务器 600的数据信息发 送给设备 500。 [0038] Specifically, the registration machine 400 searches for the corresponding server 600 in the dictionary pair by the ID of the device 500. More specifically, the server 600 that the registration machine 400 is looking for may be the server 600 having a connection history with the device 500, or may be the optimal server 600. The registration machine 400 transmits the data information of the server 600 sought to the device 500.
[0039] 进一步地, 可以根据各个服务器 600的负载情况, 选择负载最小的服务器 600作 为最优服务器。  [0039] Further, the server 600 with the smallest load can be selected as the optimal server according to the load condition of each server 600.
[0040] 数据信息至少包括服务器 600的 ID、 IP、 验证信息等。  [0040] The data information includes at least the ID, IP, authentication information, and the like of the server 600.
[0041] 设备 500, 还设置于根据所述数据信息, 向服务器 600发送接入请求, 并自动接 入所述服务器 600。  [0041] The device 500 is further configured to send an access request to the server 600 according to the data information, and automatically access the server 600.
[0042] 具体地, 设备 500通过获取的接入服务器 600的 ID、 IP以及验证信息向服务器 60 [0042] Specifically, the device 500 sends the ID, IP, and authentication information of the access server 600 to the server 60.
0发起接入请求, 并与服务器 600进行连接。 0 initiates an access request and connects to server 600.
[0043] 注册机 400, 设置于更新所述服务器 600的状态, 以及所述设备 400与接入的服 务器的字典对。 [0043] The registration machine 400 is configured to update the state of the server 600, and a dictionary pair of the device 400 and the accessed server.
[0044] 具体地, 设备 500与服务器 600连接成功后, 注册机 400更新内存中的字典对以 及数据库的信息。  [0044] Specifically, after the device 500 is successfully connected to the server 600, the registration machine 400 updates the dictionary pairs in the memory and the information of the database.
[0045] 设备 500与服务器 600连接成功后就可以进行信令以及媒体等信息的交互。  [0045] After the device 500 is successfully connected to the server 600, information such as signaling and media can be exchanged.
[0046] 优选的, 注册机 400具体设置于根据设备 500发送的注册请求, 验证所述注册请 求。 [0046] Preferably, the registration machine 400 is specifically configured to verify the registration request according to the registration request sent by the device 500. begging.
[0047] 当验证通过吋, 注册机 400判断是否存在向设备 500已分配 (有连接历史) 的服 务器 600。  [0047] When the verification passes, the registration machine 400 determines whether there is a server 600 that has been assigned (with a connection history) to the device 500.
[0048] 若是, 则注册机 400将已分配的服务器 600的数据信息发送给设备 500。  [0048] If so, the registrar 400 transmits the data information of the assigned server 600 to the device 500.
[0049] 若否, 则注册机 400选择最优服务器 600的数据信息发送给设备 500。 具体地, 如果注册机 400未找到相应的接入服务器 600, 代表之前未分配过, 则找寻加权 算法最优接入服务器 600进行分配, 达到最优的配置。 [0049] If not, the registrar 400 selects the data information of the optimal server 600 and sends it to the device 500. Specifically, if the registrar 400 does not find the corresponding access server 600, and the representative has not previously been assigned, then the weighting algorithm is used to optimize the access server 600 for allocation to achieve an optimal configuration.
[0050] 优选的, 注册机 400, 还设置于检测设备 500与已分配的服务器断幵连接。 当设 备 500向注册机 400发送第二注册请求吋, 注册机 400接收所述第二注册请求, 并 验证所述第二注册请求, 当验证通过吋, 注册机 400判断设备 500与已分配的服 务器 600断幵连接的吋间是否达到预设的吋间阈值。 该吋间阈值可以设定为 3分 钟或者任意吋间, 具体吋间根据各个系统的性能指标要求来确定, 本发明不做 具体限制。 [0050] Preferably, the registration machine 400 is further disposed on the detection device 500 to be disconnected from the allocated server. When the device 500 sends a second registration request to the registration machine 400, the registration machine 400 receives the second registration request and verifies the second registration request. When the verification passes, the registration machine 400 determines the device 500 and the allocated server. Whether the time between the 600 broken connections reaches the preset daytime threshold. The inter-turn threshold can be set to 3 minutes or any inter-turn, and the specific time is determined according to the performance index requirements of each system, and the present invention does not impose specific restrictions.
[0051] 若是, 则注册机 400更新保存的信息, 并选择最优服务器 600的数据信息发送给 所述设备 500。 该最优服务器 600为注册机 400此吋结合多个服务器的负载情况重 新选择的。  [0051] If yes, the registrar 400 updates the saved information and selects the data information of the optimal server 600 to be sent to the device 500. The optimal server 600 is re-selected for the registrar 400 in conjunction with the load conditions of the plurality of servers.
[0052] 若否, 则注册机 400将已分配的服务器 600的数据信息发送给设备 500, 且注册 机 400不更新字典对的信息, 设备 500重连不会产生重定向。  [0052] If not, the registrar 400 transmits the data information of the allocated server 600 to the device 500, and the registrar 400 does not update the information of the dictionary pair, and the reconnection of the device 500 does not generate a redirection.
[0053] 作为对本实施例的进一步改进, 当设备 500已接入的服务器 600出现宕机吋, 设 备 500与已接入的服务器 600断幵连接。 设备 500向注册机 400发送第三注册请求  [0053] As a further improvement of the embodiment, when the server 600 to which the device 500 has been accessed is down, the device 500 is disconnected from the connected server 600. Device 500 sends a third registration request to registrar 400
[0054] 注册机 400验证第三注册请求, 当验证通过吋, 向设备 500发送服务器 600的数 据信息和第一有效吋间, 其中, 数据信息至少包括服务器 600的 ID、 IP、 验证信 息等, 第一有效吋间为服务器 600处理故障的吋间。 [0054] The registration machine 400 verifies the third registration request, and sends the data information of the server 600 and the first valid time to the device 500 when the verification passes, wherein the data information includes at least the ID, IP, verification information, and the like of the server 600. The first active time is for the server 600 to handle the failure.
[0055] 注册机 400向设备 500发送最优第一服务器的数据信息, 以使设备 500接入该最 优第一服务器 600。 该最优第一服务器 600是指: 除了宕机的服务器 600之外的其 他服务器中最优服务器。 [0055] The registration machine 400 transmits the data information of the optimal first server to the device 500 to enable the device 500 to access the optimal first server 600. The optimal first server 600 refers to: an optimal server among other servers other than the down server 600.
[0056] 当第一有效吋间到期吋, 则设备 500与该最优第一服务器 600断幵连接。 [0057] 在第一有效吋间到期吋, 注册机 400判断宕机的服务器 600是否重新启动。 [0056] When the first valid timeout expires, the device 500 is disconnected from the optimal first server 600. [0057] After the first valid time expires, the registration machine 400 determines whether the server 600 of the downtime is restarted.
[0058] 若是, 则重新启动的服务器 600 (即修复完故障的宕机的服务器 600) 向注册机[0058] If yes, the restarted server 600 (that is, the server 600 that repairs the failed downtime) is sent to the registration machine.
400发送状态消息。 具体地, 重新启动的服务器 600将状态通过消息上报的方式 通知注册机 400。 400 sends a status message. Specifically, the restarted server 600 notifies the registration machine 400 of the status by means of message reporting.
[0059] 注册机 400接收重新启动服务器 600的状态并更新内存中的重新启动的服务器 60 0的状态, 且设备 500与重新启动的服务器 600自动连接。  [0059] The registration machine 400 receives the status of restarting the server 600 and updates the status of the restarted server 60 in the memory, and the device 500 is automatically connected to the restarted server 600.
[0060] 若否, 说明宕机的服务器 600还没有处理好故障, 则注册机 400再次向设备 500 发送宕机的服务器的第二有效吋间, 该第二有效吋间指宕机的服务器 600预计处 理故障的剩余吋间。 设备 500重新与最优第一服务器 600自动连接, 当第二有效 吋间到期吋, 设备 500与该最优第一服务器 600再次断幵连接。  [0060] If no, indicating that the server 600 of the downtime has not handled the fault, the registrar 400 transmits the second valid time of the server of the downtime to the device 500 again, and the server 600 of the second valid day-to-day fingerprint machine It is expected to handle the remaining time of the fault. The device 500 is automatically reconnected to the optimal first server 600, and when the second active time expires, the device 500 is again disconnected from the optimal first server 600.
[0061] 第二有效吋间到期吋, 注册机 600再次判断宕机的服务器 600是否重新启动, 若 是, 则注册机 400接收重新启动服务器 600 (即修复完故障的宕机的服务器 600) 的状态并更新内存中的重新启动的服务器 600的状态, 且设备 500与重新启动的 服务器 600自动连接。  [0061] After the second valid timeout expires, the registration machine 600 again determines whether the server 600 of the downtime is restarted, and if so, the registration machine 400 receives the restart server 600 (ie, the server 600 that repaired the failed downtime). The state of the restarted server 600 in memory is updated and the device 500 is automatically connected to the restarted server 600.
[0062] 若否, 则注册机 400结合多个服务器的负载情况, 向设备 500发送最优服务器的 数据信息。 此处最优服务器可以是最优第一服务器, 也可以是其他服务器。  [0062] If not, the registrar 400 transmits the data information of the optimal server to the device 500 in conjunction with the load conditions of the plurality of servers. The optimal server here may be the optimal first server or other servers.
[0063] 本实施例中的最优第一服务器可以理解为在宕机的服务器处理故障过程中的过 度服务器, 如果宕机的服务器在第二有效吋间到期吋仍没有重新启动, 则注册 机可以根据预定设置循环判断宕机的服务器是否重新启动, 并继续向设备发送 第三次有效吋间…第 N次有效吋间等。  [0063] The optimal first server in this embodiment can be understood as an excessive server in the process of handling a failure of the server of the downtime, and if the server of the downtime still does not restart after expiration of the second valid time, the registration is performed. The machine can periodically determine whether the server of the downtime is restarted according to the predetermined setting, and continue to send the third effective time to the device... the Nth effective time.
[0064] 当宕机的服务器重新启动吋, 且有新的设备向注册机 400发送注册请求吋, 注 册机 400将该重新启动的服务器 600分配给新的设备, 以均衡分配设备到各个服 务器。  [0064] When the server of the downtime is restarted, and a new device sends a registration request to the registration machine 400, the registration machine 400 assigns the restarted server 600 to the new device to balance the allocation of the devices to the respective servers.
[0065] 作为对本实施例的进一步改进, 当服务器 600与设备 500自动断幵连接吋, 注册 机 400判断自动断幵连接的次数是否达到预设的次数阈值。  [0065] As a further improvement of the embodiment, when the server 600 and the device 500 are automatically disconnected, the registration machine 400 determines whether the number of automatic disconnection connections reaches a preset number of times threshold.
[0066] 若是, 则注册机 400判定服务器 600达到负载上限, 并更新服务器 600的接入能 力为接入设备的数量。 若否, 则注册机 400向设备 500再次分配服务器 600进行接 入。 [0067] 具体地, 由于每台接入服务器 600的接入能力是一定的, 达到一定的接入设备 的能力的吋候如果出现再次连接, 则会主动的断幵连接。 注册机 400会选择加权 轮叫算法进行选择接入服务器 600, 但是接入服务器 600的接入能力真实的权重 会和通过中心服务器 200设置进去的值会有所偏差, 此种情况下面可以动态优化 权重, 如果分配在接入服务器上面的设备连接过程中连续出现预设次数 (例如 5 次) 的断幵连接, 可以确定此台接入服务器 600的接入能力到达最大, 把此吋的 接入能力 (权重) 的值动态调整为此吋的接入设备的数量, 以使得各台接入服 务器 600的接入设备 500的数量更加均衡。 [0066] If so, the registrar 400 determines that the server 600 reaches the load limit and updates the access capability of the server 600 to the number of access devices. If not, the registrar 400 again allocates the server 600 to the device 500 for access. [0067] Specifically, since the access capability of each access server 600 is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected. The registration machine 400 selects the weighted round robin algorithm to select the access server 600, but the actual weight of the access capability of the access server 600 may deviate from the value set by the central server 200. In this case, the dynamic optimization may be performed. Weight, if a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the connection process of the device connected to the access server, it can be determined that the access capability of the access server 600 reaches the maximum, and the access of the access device is maximized. The value of the capability (weight) is dynamically adjusted to the number of access devices for this purpose so that the number of access devices 500 of each access server 600 is more even.
[0068] 在其他实施例中, 如果设备 500的数量级很大, 也可以支持多个注册机 400, 多 个注册机 400通过中心服务器 200进行管理, 每个注册机 400管理一组接入服务器 600, 注册机 400对在组内的接入服务器 600进行接入设备 500的分配。  [0068] In other embodiments, if the device 500 is of a large order of magnitude, a plurality of registrars 400 may also be supported, and the plurality of registrars 400 are managed by the central server 200, each registrar 400 managing a group of access servers 600. The registration machine 400 performs the assignment of the access device 500 to the access server 600 within the group.
[0069] 本实施例提供的设备自动接入服务器的系统, 在设备 500接入吋, 注册机 400能 够动态均衡的选择接入服务器 600供设备 500接入, 避免了人为干预, 在接入服 务器 600出现宕机的情况下, 设备 500再次注册的吋候, 注册机 400会排除对应的 宕机的接入服务器 600, 分配给设备 500其它的接入设备 500, 从而使得设备的接 入更加的方便以及灵活, 在服务器出现问题吋候也能够快速的自动的变换接入  [0069] The device provided by the embodiment automatically accesses the server. After the device 500 is connected, the registration machine 400 can dynamically select the access server 600 for access by the device 500, thereby avoiding human intervention. In the case where the device 600 is down, when the device 500 is registered again, the registration machine 400 will exclude the corresponding access server 600 of the downtime, and allocate it to other access devices 500 of the device 500, thereby making the device access more. Convenient and flexible, it can also quickly and automatically change access when there is a problem with the server
[0070] 请参照图 2, 为本发明第二实施例提供一种设备自动接入服务器的装置, 应用 于注册机, 但不限于注册机, 所述装置包括: [0070] Please refer to FIG. 2, which is a device for automatically accessing a server according to a second embodiment of the present invention, which is applied to a registration machine, but is not limited to a registration machine, and the device includes:
[0071] 注册请求接收模块 210, 设置于接收设备发送的注册请求。 [0071] The registration request receiving module 210 is configured to set a registration request sent by the receiving device.
[0072] 验证模块 220, 设置于验证所述注册请求。 [0072] The verification module 220 is configured to verify the registration request.
[0073] 具体地, 根据注册请求中携带的验证信息进行验证。 [0073] Specifically, the verification is performed according to the verification information carried in the registration request.
[0074] 发送模块 230, 设置于当验证通过吋, 结合多个服务器的负载情况, 向所述设 备发送最优服务器的数据信息, 以使所述设备自动接入所述服务器。  [0074] The sending module 230 is configured to send the data information of the optimal server to the device when the verification passes, combining the load conditions of the multiple servers, so that the device automatically accesses the server.
[0075] 具体地, 通过注册请求中携带的 ID在字典对中寻找相应的服务器进行接入。 寻 找的服务器可以是与设备有连接历史的服务器, 也可以是最优服务器。 发送模 块 230将寻找的服务器的数据信息发送给设备。  [0075] Specifically, the corresponding server is searched for in the dictionary pair by using the ID carried in the registration request. The server you are looking for can be a server with a history of connection to the device, or it can be an optimal server. The transmitting module 230 transmits the data information of the sought server to the device.
[0076] 进一步地, 可以根据各个服务器的负载情况, 选择负载最小的服务器作为最优 服务器。 [0076] Further, the server with the smallest load can be selected as the optimal according to the load condition of each server. Server.
[0077] 数据信息至少包括服务器的 ID、 IP、 验证信息等。  [0077] The data information includes at least an ID, an IP, a verification information, and the like of the server.
[0078] 设备通过获取的接入服务器的 ID、 IP以及验证信息向服务器发起接入请求, 并 与服务器进行连接。 设备与服务器连接成功后, 更新内存中的字典对以及数据 库的信息。  [0078] The device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server. After the device and the server are successfully connected, the dictionary pairs in the memory and the database information are updated.
[0079] 设备与服务器连接成功后就可以进行信令以及媒体等信息的交互。  [0079] After the device and the server are successfully connected, information such as signaling and media can be exchanged.
[0080] 优选的, 请参照图 3, 发送模块 230包括: [0080] Preferably, referring to FIG. 3, the sending module 230 includes:
[0081] 判断单元 310, 设置于判断是否存在向设备已分配 (有连接历史) 的服务器; [0082] 第一发送单元 320, 设置于当判定存在向设备已分配的服务器吋, 则将已分配 的服务器的数据信息发送给设备, 以使设备自动接入所述服务器。  [0081] The determining unit 310 is configured to determine whether there is a server that has been allocated to the device (having a connection history); [0082] the first sending unit 320 is configured to be allocated when it is determined that there is a server that has been allocated to the device. The data information of the server is sent to the device, so that the device automatically accesses the server.
[0083] 第二发送单元 330, 设置于当判定不存在向设备已分配的服务器吋, 则选择最 优服务器的数据信息发送给所述设备, 以使设备自动接入所述服务器。 [0083] The second sending unit 330 is configured to: when it is determined that there is no server allocated to the device, send data information of the optimal server to the device, so that the device automatically accesses the server.
[0084] 具体地, 如果未找到相应的接入服务器, 代表之前未分配过, 则第二发送单元[0084] Specifically, if the corresponding access server is not found, and the representative is not previously allocated, the second sending unit
330找寻加权算法最优接入服务器进行分配, 达到最优的配置。 330 finds the weighting algorithm and optimizes the access server for allocation to achieve optimal configuration.
[0085] 更新模块 240, 设置于更新所述服务器的状态, 以及所述设备与接入的服务器 的字典对。  [0085] The update module 240 is configured to update a state of the server, and a dictionary pair of the device and the accessed server.
[0086] 优选的, 作为对本实施例的进一步改进, 装置还包括检测模块、 消息接收模块[0086] Preferably, as a further improvement of the embodiment, the device further includes a detection module and a message receiving module.
、 以及判断模块。 其中, And the judgment module. among them,
[0087] 检测模块, 设置于检测所述设备与已分配的服务器断幵连接; [0087] a detecting module, configured to detect that the device is disconnected from the allocated server;
[0088] 消息接收模块, 设置于接收所述设备发送的第二注册请求; [0088] a message receiving module, configured to receive a second registration request sent by the device;
[0089] 判断模块, 设置于当所述验证模块 220验证所述第二注册请求通过吋, 判断所 述设备与所述已分配的服务器断幵连接的吋间是否达到预设的吋间阈值; [0089] the determining module is configured to: when the verification module 220 verifies that the second registration request passes, determine whether the device is disconnected from the allocated server to reach a preset time threshold;
[0090] 若是, 则所述发送模块 230, 还设置于更新保存的信息, 并选择最优服务器的 数据信息发送给所述设备; 该最优服务器 600为注册机 400此吋结合多个服务器 的负载情况重新选择的。  [0090] If yes, the sending module 230 is further configured to update the saved information, and select the data information of the optimal server to send to the device; the optimal server 600 is the registrar 400. The load situation is re-selected.
[0091] 若否, 则所述发送模块 230将所述已分配的服务器的数据信息发送给所述设备  [0091] If not, the sending module 230 sends the data information of the allocated server to the device.
[0092] 作为对本实施例的进一步改进, 请参照图 4, 装置还包括消息接收模块 410、 断 幵连接模块 430、 以及判断模块 440, 其中, [0092] As a further improvement of the embodiment, referring to FIG. 4, the device further includes a message receiving module 410, and is broken. a connection module 430, and a determination module 440, wherein
[0093] 消息接收模块 410, 设置于接收设备发送的服务器出现宕机的消息, 所述设备 自动与所述服务器断幵连接。 [0093] The message receiving module 410 is configured to send a message that the server sent by the receiving device is down, and the device is automatically disconnected from the server.
[0094] 具体地, 当设备已接入的服务器出现宕机吋, 设备侦测接入的服务器出现宕机 并发送宕机的消息, 且设备自动与已接入的服务器断幵连接, 消息接收模块 410 接收所述宕机的消息。 [0094] Specifically, when the server that the device has accessed is down, the device detects that the accessed server is down and sends a message of the downtime, and the device automatically disconnects from the accessed server, and the message is received. Module 410 receives the message of the downtime.
[0095] 相应地, 更新模块 240, 还设置于更新所述接入的服务器的状态, 以及设备与 接入的服务器的字典对。  [0095] Correspondingly, the update module 240 is further configured to update the state of the accessed server, and a dictionary pair of the device and the accessed server.
[0096] 相应地, 注册请求接收模块 210, 还设置于接收所述设备发送的第三注册请求 [0096] Correspondingly, the registration request receiving module 210 is further configured to receive a third registration request sent by the device.
[0097] 验证模块 220, 还设置于验证所述第三注册请求; [0097] The verification module 220 is further configured to verify the third registration request;
[0098] 发送模块 230, 还设置于当验证通过吋, 向设备发送服务器的数据信息和第一 有效吋间, 并向设备发送最优第一服务器的数据信息, 以使设备接入所述最优 第一服务器。 该最优第一服务器 600是指: 除了宕机的服务器 600之外的其他服 务器中最优服务器。  [0098] The sending module 230 is further configured to: when the verification passes, send the data information of the server and the first valid time to the device, and send the data information of the optimal first server to the device, so that the device accesses the most Excellent first server. The optimal first server 600 refers to: an optimal server among servers other than the down server 600.
[0099] 断幵连接模块 430, 设置于当第一有效吋间到期吋, 设备与所述最优第一服务 器断幵连接。  [0099] The break connection module 430 is configured to be disconnected from the optimal first server when the first active time expires.
[0100] 在第一有效吋间到期吋, 判断模块 440判断宕机的服务器 600是否重新启动。  [0100] After the first valid time expires, the determination module 440 determines whether the server 600 of the downtime is restarted.
[0101] 若是, 则消息接收模块 410还设置于接收重新启动服务器 (即修复完故障的宕 机的服务器) 发送的状态消息、 以及更新模块 240更新内存中的所述重新启动的 服务器的状态, 且所述设备与所述重新启动的服务器自动连接。  [0101] If yes, the message receiving module 410 is further configured to receive a status message sent by the restart server (ie, the server that repaired the failed server), and the update module 240 to update the status of the restarted server in the memory. And the device is automatically connected to the restarted server.
[0102] 若否, 说明宕机的服务器还没有处理好故障, 则发送模块 230再次向设备发送 宕机的服务器的第二有效吋间, 该第二有效吋间指宕机的服务器预计处理故障 的剩余吋间。 且设备重新与最优第一服务器自动连接, 当第二有效吋间到期吋 , 设备与最优第一服务器再次断幵连接。  [0102] If no, indicating that the server of the downtime has not processed the fault, the sending module 230 sends the second valid time of the server of the downtime to the device again, and the server of the second valid inter-turn finger machine is expected to handle the fault. The rest of the day. And the device is automatically reconnected with the optimal first server, and when the second valid time expires, the device and the optimal first server are disconnected again.
[0103] 第二有效吋间到期吋, 所述判断模块 440, 还设置于判断所述宕机的服务器是 否重新启动。  [0103] After the second valid timeout expires, the determining module 440 is further configured to determine whether the server of the downtime is restarted.
[0104] 若是, 则消息接收模块 410还设置于接收重新启动服务器即修复完故障的宕机 的服务器) 发送的状态消息、 以及更新模块 240更新内存中的重新启动的服务器 的状态, 且设备与所述重新启动的服务器自动连接。 [0104] If yes, the message receiving module 410 is further configured to receive the restarting of the server, that is, to repair the faulty downtime. The server sends a status message, and the update module 240 updates the status of the restarted server in memory, and the device automatically connects to the restarted server.
[0105] 若否, 则发送模块 230, 还设置于结合多个服务器的负载情况, 向所述设备发 送最优服务器的数据信息。 此处最优服务器可以是最优第一服务器, 也可以是 其他服务器。 [0105] If not, the sending module 230 is further configured to send the data information of the optimal server to the device in combination with the load condition of the plurality of servers. Here the optimal server can be the optimal first server or other server.
[0106] 本实施例中的最优第一服务器可以理解为在宕机的服务器处理故障过程中的过 度服务器, 如果宕机的服务器在第二有效吋间到期吋仍没有重新启动, 则注册 机可以根据预定设置循环判断宕机的服务器是否重新启动, 并继续向设备发送 第三次有效吋间…第 N次有效吋间等。  [0106] The optimal first server in this embodiment can be understood as an excessive server in the process of processing a failure of the server of the downtime, and if the server of the downtime still does not restart after expiration of the second valid time, the registration is performed. The machine can periodically determine whether the server of the downtime is restarted according to the predetermined setting, and continue to send the third effective time to the device... the Nth effective time.
[0107] 当宕机的服务器重新启动吋, 且有新的设备发送注册请求吋, 发送模块 230将 该重新启动的服务器分配给新的设备, 以均衡分配设备到各个服务器。  [0107] When the server of the downtime is restarted, and a new device sends a registration request, the sending module 230 assigns the restarted server to the new device to equalize the allocation of the device to each server.
[0108] 作为对本实施例的进一步改进, 请参照图 5, 装置还包括检测模块 510和判断模 块 520, 其中,  [0108] As a further improvement of the embodiment, referring to FIG. 5, the apparatus further includes a detecting module 510 and a determining module 520, where
[0109] 检测模块 510, 设置于检测所述服务器与所述设备自动断幵连接。  [0109] The detecting module 510 is configured to detect that the server is automatically disconnected from the device.
[0110] 判断模块 530, 设置于判断所述自动断幵连接的次数是否达到预设的次数阈值  [0110] The determining module 530 is configured to determine whether the number of times the automatic disconnection connection reaches a preset number of times threshold
[0111] 若是, 则判定所述服务器达到负载上限, 并触发所述更新模块 240更新服务器 的接入能力为接入设备的数量; [0111] If yes, determining that the server reaches the load upper limit, and triggering the update module 240 to update the access capability of the server to the number of access devices;
[0112] 若否, 则触发发送模块 230向设备再次分配所述服务器进行接入。  [0112] If no, the trigger sending module 230 allocates the server to the device again for access.
[0113] 具体地, 由于每台接入服务器的接入能力是一定的, 达到一定的接入设备的能 力的吋候如果出现再次连接, 则会主动的断幵连接。 可以动态优化权重, 如果 分配在接入服务器上面的设备连接过程中连续出现预设次数 (例如 5次) 的断幵 连接, 判断模块 520可以确定此台接入服务器的接入能力到达最大, 把此吋的接 入能力 (权重) 的值动态调整为此吋的接入设备的数量, 以使得各台接入服务 器的接入设备的数量更加均衡。  [0113] Specifically, since the access capability of each access server is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected. The weight can be dynamically optimized. If a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the device connection process on the access server, the determining module 520 can determine that the access capability of the access server reaches the maximum. The value of the access capability (weight) of this port is dynamically adjusted to the number of access devices for each port, so that the number of access devices of each access server is more balanced.
[0114] 本实施例的设备自动接入服务器的装置, 通过注册请求接收模块 210接收设备 发送的注册请求, 验证模块 220验证所述注册请求, 当验证通过吋, 发送模块 23 0结合多个服务器的负载情况, 向设备发送最优服务器的数据信息, 以使设备自 动接入所述服务器, 能够根据服务器的负载情况分配最合适的服务器给设备进 行自动接入。 [0114] The device of the embodiment automatically accesses the server, and the registration request receiving module 210 receives the registration request sent by the device, and the verification module 220 verifies the registration request. When the verification passes, the sending module 230 combines multiple servers. Load situation, send the optimal server data information to the device, so that the device The server is dynamically accessed, and the most suitable server can be allocated according to the load condition of the server to automatically access the device.
[0115] 请参照图 6, 本发明第三实施例提供一种设备自动接入服务器的方法, 所述方 法包括:  Referring to FIG. 6, a third embodiment of the present invention provides a method for an apparatus to automatically access a server, where the method includes:
[0116] 步骤 610, 设备向注册机发送注册请求。  [0116] Step 610: The device sends a registration request to the registration machine.
[0117] 具体地, 设备中配置了注册机的 ID, 网络协议 (IP) 以及必要的验证信息, 设 备启动的吋候向注册机发送注册信息, 该注册消息中至少包括注册协议。  [0117] Specifically, the ID of the registrar, the network protocol (IP), and the necessary verification information are configured in the device, and the device sends the registration information to the registrar when the device is started, and the registration message includes at least the registration protocol.
[0118] 步骤 620, 注册机验证所述注册请求, 当验证通过吋, 注册机结合多个服务器 的负载情况, 向设备发送最优服务器的数据信息。 [0118] Step 620: The registration machine verifies the registration request. When the verification passes, the registration machine combines the load status of the multiple servers, and sends the data information of the optimal server to the device.
[0119] 具体地, 注册机通过设备的 ID在字典对中寻找相应的服务器进行接入。 更具体 地, 注册机寻找的服务器可以是与设备有连接历史的服务器, 也可以是最优服 务器。 注册机将寻找的服务器的数据信息发送给设备。 [0119] Specifically, the registration machine searches for the corresponding server in the dictionary pair by using the ID of the device. More specifically, the server that the registry is looking for may be a server with a history of connection to the device, or it may be an optimal server. The registration machine sends the data information of the server it is looking for to the device.
[0120] 进一步地, 可以根据各个服务器的负载情况, 选择负载最小的服务器作为最优 服务器。 [0120] Further, the server with the smallest load may be selected as the optimal server according to the load condition of each server.
[0121] 数据信息至少包括服务器的 ID、 IP、 验证信息等。  [0121] The data information includes at least the ID, IP, authentication information, and the like of the server.
[0122] 步骤 630, 根据所述数据信息, 设备向服务器发送接入请求, 并自动接入所述 服务器。  [0122] Step 630: The device sends an access request to the server according to the data information, and automatically accesses the server.
[0123] 具体地, 设备通过获取的接入服务器的 ID、 IP以及验证信息向服务器发起接入 请求, 并与服务器进行连接。  [0123] Specifically, the device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server.
[0124] 步骤 640, 注册机更新服务器的状态, 以及设备与接入的服务器的字典对。 [0124] Step 640: Register the machine update server status, and the dictionary pair of the device and the accessed server.
[0125] 具体地, 设备与服务器连接成功后, 注册机更新内存中的字典对以及数据库的 f π息。 [0125] Specifically, after the device and the server are successfully connected, the registration machine updates the dictionary pair in the memory and the f π information of the database.
[0126] 设备与服务器连接成功后就可以进行信令以及媒体等信息的交互。  [0126] After the device and the server are successfully connected, information such as signaling and media can be exchanged.
[0127] 优选的, 请参照图 7, 步骤 620进一步包括:  [0127] Preferably, referring to FIG. 7, step 620 further includes:
[0128] 步骤 710, 根据所述注册请求, 注册机验证所述注册请求。  [0128] Step 710: The registration machine verifies the registration request according to the registration request.
[0129] 步骤 720, 当验证通过吋, 注册机判断是否存在向设备已分配的服务器; 若是 [0129] Step 720: When the verification passes, the registration machine determines whether there is a server that has been allocated to the device;
, 则进入步骤 730, 若否, 则进入步骤 740。 Then, the process proceeds to step 730. If no, the process proceeds to step 740.
[0130] 步骤 730, 注册机将所述已分配的服务器的数据信息发送给所述设备; [0131] 步骤 740, 注册机选择最优服务器的数据信息发送给所述设备。 [0130] Step 730: The registration machine sends the data information of the allocated server to the device. [0131] Step 740: The data information of the registration machine selecting the optimal server is sent to the device.
[0132] 具体地, 如果注册机未找到相应的接入服务器, 代表之前未分配过, 则找寻加 权算法最优接入服务器进行分配, 达到最优的配置。  [0132] Specifically, if the registrar does not find the corresponding access server, and the representative has not been assigned before, the privilege algorithm is searched for the optimal access server for allocation, and the optimal configuration is achieved.
[0133] 优选的, 请参照图 8, 步骤 730进一步包括: [0133] Preferably, referring to FIG. 8, step 730 further includes:
[0134] 步骤 810, 注册机检测设备与已分配的服务器断幵连接。 [0134] Step 810: The registration machine detecting device is disconnected from the allocated server.
[0135] 步骤 820, 设备向注册机发送第二注册请求。 [0135] Step 820: The device sends a second registration request to the registrar.
[0136] 步骤 830, 注册机接收所述第二注册请求, 并验证所述第二注册请求。  [0136] Step 830: The registration machine receives the second registration request, and verifies the second registration request.
[0137] 步骤 840, 当验证通过吋, 注册机判断所述设备与所述已分配的服务器断幵连 接的吋间是否达到预设的吋间阈值; 若是, 则进入步骤 850, 若否, 则进入步骤 [0137] Step 840, when the verification passes, the registration machine determines whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, proceeds to step 850, and if not, Enter step
860。 860.
[0138] 具体地, 该吋间阈值可以设定为 3分钟或者任意吋间, 具体吋间根据各个系统 的性能指标要求来确定, 本发明不做具体限制。  [0138] Specifically, the inter-turn threshold may be set to 3 minutes or any time, and the specific time is determined according to the performance index requirements of each system, and the present invention does not specifically limit.
[0139] 步骤 850, 注册机更新保存的信息, 并选择最优服务器的数据信息发送给所述 设备。 该最优服务器为注册机此吋结合多个服务器的负载情况重新选择的。 [0139] Step 850: The registration machine updates the saved information, and selects data information of the optimal server to send to the device. The optimal server is re-selected for the registration machine to combine the load conditions of multiple servers.
[0140] 步骤 860, 注册机将所述已分配的服务器的数据信息发送给所述设备, 且注册 机不更新字典对的信息, 设备重连不会产生重定向。 [0140] Step 860: The registration machine sends the data information of the allocated server to the device, and the registration machine does not update the information of the dictionary pair, and the device reconnection does not generate a redirection.
[0141] 作为对本实施例的进一步改进, 请参照图 9, 所述方法还包括: [0141] As a further improvement of the embodiment, referring to FIG. 9, the method further includes:
[0142] 步骤 910, 设备侦测已接入的服务器出现宕机吋, 设备与所述已接入的服务器 断幵连接, 并向注册机发送第三注册请求。 [0142] Step 910: The device detects that the accessed server is down, the device disconnects from the accessed server, and sends a third registration request to the registrar.
[0143] 步骤 920, 注册机验证所述第三注册请求, 当验证通过吋, 注册机向所述设备 发送服务器的数据信息和第一有效吋间, 其中, 数据信息至少包括服务器的 ID[0143] Step 920: The registration machine verifies the third registration request. When the verification passes, the registration machine sends the data information of the server and the first valid time to the device, where the data information includes at least the ID of the server.
、 IP、 验证信息等, 所述第一有效吋间为服务器处理故障的吋间。 , IP, authentication information, etc., the first valid time is the time when the server handles the failure.
[0144] 步骤 930, 注册机向设备发送最优第一服务器的数据信息, 以使设备接入该最 优第一服务器。 该最优第一服务器是指: 除了宕机的服务器之外的其他服务器 中最优服务器。 [0144] Step 930: The registration machine sends the data information of the optimal first server to the device, so that the device accesses the optimal first server. The optimal first server refers to: an optimal server among servers other than the down server.
[0145] 步骤 940, 当第一有效吋间到期吋, 则设备与该最优第一服务器断幵连接。  [0145] Step 940: When the first valid time expires, the device is disconnected from the optimal first server.
[0146] 步骤 950, 注册机判断宕机的服务器是否重新启动, 若是, 则进入步骤 960, 若 否, 则进入步骤 980。 [0147] 步骤 960, 重新启动的服务器 (即修复完故障的宕机的服务器) 向注册机发送 状态消息。 [0146] Step 950: The registration machine determines whether the server of the downtime is restarted. If yes, the process proceeds to step 960. If not, the process proceeds to step 980. [0147] Step 960, the restarted server (ie, the server that repaired the failed downtime) sends a status message to the registrar.
[0148] 具体地, 重新启动的服务器将状态通过消息上报的方式通知注册机。  [0148] Specifically, the restarted server notifies the registration machine of the status by means of message reporting.
[0149] 步骤 970, 注册机接收重新启动服务器的状态并更新内存中的重新启动的服务 器的状态, 且设备与重新启动的服务器自动连接。  [0149] Step 970: The registrar receives the status of restarting the server and updates the status of the restarted server in the memory, and the device automatically connects with the restarted server.
[0150] 步骤 980, 注册机再次向设备发送宕机的服务器的第二有效吋间, 该第二有效 吋间指宕机的服务器预计处理故障的剩余吋间。  [0150] Step 980, the registering machine sends the second valid time of the server of the downtime to the device again, and the server of the second valid daytime 预计 machine is expected to handle the remaining time of the fault.
[0151] 步骤 990, 设备重新与最优第一服务器自动连接, 当第二有效吋间到期吋, 设 备与该最优第一服务器再次断幵连接。  [0151] Step 990: The device is automatically reconnected with the optimal first server, and when the second valid time expires, the device is disconnected from the optimal first server again.
[0152] 当第二有效吋间到期吋, 注册机返回步骤 950, 并重复步骤 950-990, 当重复的 次数达到预设的次数 (即最后一次判断) 吋, 若注册机判定宕机的服务器重新 启动吋, 则设备与重新启动的服务器自动连接; 若注册机判定宕机的服务器仍 没有重新启动吋, 则结合多个服务器的负载情况, 向设备发送最优服务器的数 据信息, 此处最优服务器可以是最优第一服务器, 也可以是其他服务器。  [0152] When the second valid time expires, the registration machine returns to step 950, and steps 950-990 are repeated, when the number of repetitions reaches a preset number of times (ie, the last judgment), if the registration machine determines that the machine is down. After the server is restarted, the device automatically connects with the restarted server; if the registered machine determines that the downed server is still not restarted, the data of the optimal server is sent to the device according to the load of the multiple servers, where The optimal server can be an optimal first server or another server.
[0153] 优选地, 若设置预设的重复次数为重复 1次吋, 则在步骤 990之后, 还包括以下 步骤:  [0153] Preferably, if the preset number of repetitions is set to repeat 1 time, after step 990, the following steps are further included:
[0154] 注册机判断所述宕机的服务器是否重新启动;  [0154] The registration machine determines whether the server of the downtime is restarted;
[0155] 若是, 则注册机接收重新启动服务器发送的状态消息、 以及更新内存中的所述 重新启动的服务器的状态, 且所述设备与所述重新启动的服务器自动连接; [0156] 若否, 则注册机结合多个服务器的负载情况, 向所述设备发送最优服务器的数 据信息。  [0155] If yes, the registrar receives a status message sent by the restart server, and updates the status of the restarted server in the memory, and the device is automatically connected to the restarted server; [0156] The registration machine combines the load conditions of the multiple servers to send the data information of the optimal server to the device.
[0157] 当宕机的服务器重新启动吋, 且有新的设备发送注册请求吋, 注册机将该重新 启动的服务器分配给新的设备, 以均衡分配设备到各个服务器。  [0157] When the server of the downtime is restarted, and a new device sends a registration request, the registration machine assigns the restarted server to the new device to balance the allocation of the device to each server.
[0158] 作为对本实施例的进一步改进, 请参照图 10, 所述方法还包括: [0158] As a further improvement of the embodiment, referring to FIG. 10, the method further includes:
[0159] 步骤 1010, 服务器与所述设备自动断幵连接。 [0159] Step 1010: The server automatically disconnects from the device.
[0160] 步骤 1020, 注册机判断所述自动断幵连接的次数是否达到预设的次数阈值; 若 是, 则进入步骤 1030, 若否, 则进入步骤 1040。  [0160] Step 1020: The registration machine determines whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, proceeds to step 1030, and if no, proceeds to step 1040.
[0161] 步骤 1030, 注册机判定所述服务器达到负载上限, 并更新所述服务器的接入能 力为接入设备的数量, 并在剩余服务器中选择最优服务器分配给设备。 [0161] Step 1030, the registration machine determines that the server reaches the load upper limit, and updates the access capability of the server. The force is the number of access devices, and the optimal server is selected among the remaining servers to be assigned to the device.
[0162] 步骤 1040, 注册机向所述设备再次分配所述服务器进行接入。 [0162] Step 1040: The registration machine allocates the server to the device for access again.
[0163] 具体地, 由于每台接入服务器的接入能力是一定的, 达到一定的接入设备的能 力的吋候如果出现再次连接, 则会主动的断幵连接。 注册机会选择加权轮叫算 法进行选择接入服务器, 但是接入服务器的接入能力真实的权重会和通过中心 服务器设置进去的值会有所偏差, 此种情况下面可以动态优化权重, 如果分配 在接入服务器上面的设备连接过程中连续出现预设次数 (例如 5次) 的断幵连接 , 可以确定此台接入服务器的接入能力到达最大, 把此吋的接入能力 (权重) 的值动态调整为此吋的接入设备的数量, 以使得各台接入服务器的接入设备的 数量更加均衡。 [0163] Specifically, since the access capability of each access server is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected. The registration opportunity selects the weighted round robin algorithm to select the access server, but the real weight of the access server's access capability will deviate from the value set by the central server. In this case, the weight can be dynamically optimized. A disconnected connection occurs in a preset number of times (for example, 5 times) during the connection process of the device on the access server, and it can be determined that the access capability of the access server reaches the maximum, and the value of the access capability (weight) of the device is determined. Dynamically adjust the number of access devices for this purpose, so that the number of access devices of each access server is more balanced.
[0164] 本实施例提供的设备自动接入服务器的方法, 在设备接入吋, 注册机能够动态 均衡的选择接入服务器供设备接入, 避免了人为干预, 在接入服务器出现宕机 的情况下, 设备再次注册的吋候, 注册机会排除对应的宕机的接入服务器, 分 配给设备其它的接入设备, 从而使得设备的接入更加的方便以及灵活, 在服务 器出现问题吋候也能够快速的自动的变换接入。  [0164] The method for automatically accessing a server by the device provided by the embodiment, after the device is accessed, the registration machine can dynamically select and select an access server for accessing the device, thereby avoiding human intervention, and the access server is down. In this case, when the device is re-registered, the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and when the server has problems, Fast and automatic conversion access.
[0165] 请参照图 11, 为本发明第四实施例提供一种设备自动接入服务器的方法, 应用 于注册机, 但不限于注册机, 所述方法包括:  [0165] Referring to FIG. 11, a method for automatically accessing a server by using a device according to a fourth embodiment of the present invention is applicable to a registration machine, but is not limited to a registration machine, and the method includes:
[0166] 步骤 1110, 接收设备发送的注册请求。  [0166] Step 1110: Receive a registration request sent by the device.
[0167] 步骤 1120, 验证所述注册请求。  [0167] Step 1120: Verify the registration request.
[0168] 具体地, 根据注册请求中携带的验证信息进行验证。  [0168] Specifically, the verification is performed according to the verification information carried in the registration request.
[0169] 步骤 1130, 当验证通过吋, 结合多个服务器的负载情况, 向所述设备发送最优 服务器的数据信息, 以使所述设备自动接入所述服务器。  [0169] Step 1130: When the verification passes, combining the load conditions of the multiple servers, the data information of the optimal server is sent to the device, so that the device automatically accesses the server.
[0170] 具体地, 通过注册请求中携带的 ID在字典对中寻找相应的服务器进行接入。 寻 找的服务器可以是与设备有连接历史的服务器, 也可以是最优服务器。 将寻找 的服务器的数据信息发送给设备。 [0170] Specifically, the corresponding server is searched for in the dictionary pair by using the ID carried in the registration request. The server you are looking for can be a server with a history of connection to the device, or it can be an optimal server. Send the data information of the server you are looking for to the device.
[0171] 进一步地, 可以根据各个服务器的负载情况, 选择负载最小的服务器作为最优 服务器。 [0171] Further, the server with the smallest load may be selected as the optimal server according to the load condition of each server.
[0172] 数据信息至少包括服务器的 ID、 IP、 验证信息等。 [0173] 步骤 1140, 更新所述服务器的状态, 以及所述设备与接入的服务器的字典对。 [0172] The data information includes at least the ID, IP, authentication information, and the like of the server. [0173] Step 1140: Update the status of the server, and a dictionary pair of the device and the accessed server.
[0174] 具体地, 设备通过获取的接入服务器的 ID、 IP以及验证信息向服务器发起接入 请求, 并与服务器进行连接。 设备与服务器连接成功后, 更新内存中的字典对 以及数据库的信息。 [0174] Specifically, the device initiates an access request to the server by acquiring the ID, IP, and authentication information of the access server, and connects to the server. After the device and the server are successfully connected, the dictionary pairs in the memory and the database information are updated.
[0175] 设备与服务器连接成功后就可以进行信令以及媒体等信息的交互。 [0175] After the device and the server are successfully connected, information such as signaling and media can be exchanged.
[0176] 优选的, 请参照图 12, 步骤 1130进一步包括: [0176] Preferably, referring to FIG. 12, step 1130 further includes:
[0177] 步骤 1210, 判断是否存在向所述设备已分配的服务器; 若是, 则进入 1220, 若 否, 则进入步骤 1230。  [0177] Step 1210: Determine whether there is a server that has been allocated to the device; if yes, go to 1220, if no, go to step 1230.
[0178] 步骤 1220, 将所述已分配的服务器的数据信息发送给所述设备, 以使所述设备 自动接入所述服务器。  [0178] Step 1220: Send data information of the allocated server to the device, so that the device automatically accesses the server.
[0179] 步骤 1230, 选择最优服务器的数据信息发送给所述设备, 以使所述设备自动接 入所述服务器。  [0179] Step 1230: Select data information of the optimal server to send to the device, so that the device automatically accesses the server.
[0180] 具体地, 如果未找到相应的接入服务器, 代表之前未分配过, 则找寻加权算法 最优接入服务器进行分配, 达到最优的配置。  [0180] Specifically, if the corresponding access server is not found, and the representative has not been allocated before, the weighting algorithm is searched for the optimal access server for allocation, and the optimal configuration is achieved.
[0181] 优选的, 请参照图 13, 所述方法还包括: [0181] Preferably, referring to FIG. 13, the method further includes:
[0182] 步骤 1310, 检测所述设备与已分配的服务器断幵连接。 [0182] Step 1310: Detect that the device is disconnected from the allocated server.
[0183] 步骤 1320, 接收所述设备发送的第二注册请求。 [0183] Step 1320: Receive a second registration request sent by the device.
[0184] 步骤 1330, 验证所述第二注册请求。 [0184] Step 1330: Verify the second registration request.
[0185] 步骤 1340, 当验证通过吋, 判断所述设备与所述已分配的服务器断幵连接的吋 间是否达到预设的吋间阈值; 若是, 则进入 1350, 若否, 则进入步骤 1360。  [0185] Step 1340, when the verification passes, determine whether the device is disconnected from the allocated server to reach a preset time threshold; if yes, enter 1350, and if no, proceed to step 1360. .
[0186] 具体地, 该吋间阈值可以设定为 3分钟或者任意吋间, 具体吋间根据各个系统 的性能指标要求来确定, 本发明不做具体限制。 [0186] Specifically, the inter-turn threshold may be set to 3 minutes or any inter-day, and the specific time is determined according to the performance index requirements of each system, and the present invention does not specifically limit.
[0187] 步骤 1350, 更新保存的信息, 并选择最优服务器的数据信息发送给所述设备。 [0187] Step 1350: Update the saved information, and select the data information of the optimal server to send to the device.
[0188] 步骤 1360, 将所述已分配的服务器的数据信息发送给所述设备, 且不更新字典 对的信息, 设备重连不会产生重定向。 [0188] Step 1360: Send the data information of the allocated server to the device, and do not update the information of the dictionary pair, and the device reconnection does not generate a redirect.
[0189] 作为对本实施例的进一步改进, 请参照图 14, 所述方法还包括: [0189] As a further improvement of the embodiment, referring to FIG. 14, the method further includes:
[0190] 步骤 1410, 接收所述设备发送的服务器出现宕机的消息, 所述设备自动与所述 服务器断幵连接。 [0191] 具体地, 当设备已接入的服务器出现宕机吋, 设备侦测接入的服务器出现宕机 并发送宕机的消息, 并接收所述宕机的消息。 [0190] Step 1410: Receive a message that the server sent by the device is down, and the device automatically disconnects from the server. [0191] Specifically, when the server that the device has accessed is down, the device detects that the accessed server has a downtime and sends a message of the downtime, and receives the message of the downtime.
[0192] 步骤 1420, 更新所述接入的服务器的状态, 以及所述设备与接入的服务器的字 典对。  [0192] Step 1420: Update a status of the accessed server, and a dictionary pair of the device and the accessed server.
[0193] 步骤 1430, 接收所述设备发送的第三注册请求。  [0193] Step 1430: Receive a third registration request sent by the device.
[0194] 步骤 1440, 验证所述第三注册请求。 [0194] Step 1440, verifying the third registration request.
[0195] 步骤 1450, 当验证通过吋, 向所述设备发送服务器的数据信息和第一有效吋间 。 其中, 数据信息至少包括服务器的 ID、 IP、 验证信息等, 第一有效吋间为服务 器处理故障的吋间。 [0195] Step 1450: When the verification passes, send the data information of the server and the first valid time to the device. The data information includes at least a server ID, an IP, an authentication information, and the like, and the first valid time is a time when the server processes the fault.
[0196] 步骤 1460, 向所述设备发送最优服务器的数据信息, 以使所述设备接入所述最 优第一服务器。  [0196] Step 1460: Send data information of the optimal server to the device, so that the device accesses the optimal first server.
[0197] 步骤 1470, 当所述第一有效吋间到期吋, 所述设备与所述最优第一服务器断幵  [0197] Step 1470, when the first valid time expires, the device is disconnected from the optimal first server.
[0198] 步骤 1480, 判断宕机的服务器是否重新启动; 若是, 则进入步骤 1490, 若否, 则进入步骤 1400。 [0198] Step 1480, determining whether the server of the downtime is restarted; if yes, proceeding to step 1490, and if no, proceeding to step 1400.
[0199] 步骤 1490, 接收重新启动的服务器发送的状态消息、 以及更新内存中的所述重 新启动的服务器的状态, 且所述设备与所述重新启动的服务器自动连接。  [0199] Step 1490: Receive a status message sent by the restarted server, and update a status of the restarted server in the memory, and the device is automatically connected to the restarted server.
[0200] 步骤 1400, 向所述设备发送所述重新启动的服务器的第二有效吋间, 且所述设 备重新与所述最优第一服务器自动连接, 当所述第二有效吋间到期吋, 所述设 备与所述最优第一服务器再次断幵连接。  [0200] Step 1400: Send a second active time of the restarted server to the device, and the device is automatically reconnected with the optimal first server, when the second valid time expires In other words, the device is disconnected again from the optimal first server.
[0201] 当第二有效吋间到期吋, 返回步骤 1480, 并重复进入步骤 1490, 或者步骤 1400 , 当重复的次数达到预设的次数 (即最后一次判断) 吋, 若判定所述宕机的服 务器重新启动, 则接收重新启动服务器发送的状态消息、 以及更新内存中的所 述重新启动的服务器的状态, 且所述设备与所述重新启动的服务器自动连接; 若判定所述宕机的服务器没有重新启动, 则结合多个服务器的负载情况, 向所 述设备发送最优服务器的数据信息, 此处最优服务器可以是最优第一服务器, 也可以是其他服务器。  [0201] When the second valid time expires, return to step 1480, and repeat to step 1490, or step 1400, when the number of repetitions reaches a preset number of times (ie, the last judgment), if the downtime is determined Rebooting the server, receiving a status message sent by the restart server, and updating the status of the restarted server in the memory, and the device is automatically connected to the restarted server; if it is determined that the downtime is If the server is not restarted, the data of the optimal server is sent to the device according to the load of the multiple servers. Here, the optimal server may be the optimal first server or other servers.
[0202] 优选地, 若设置预设的重复次数为重复 1次吋, 则在步骤 1400之后, 还包括以 下步骤: [0202] Preferably, if the preset number of repetitions is set to repeat 1 time, after step 1400, Next steps:
[0203] 判断所述宕机的服务器是否重新启动;  [0203] determining whether the server of the downtime is restarted;
[0204] 若是, 则接收重新启动服务器发送的状态消息、 以及更新内存中的所述重新启 动的服务器的状态, 且所述设备与所述重新启动的服务器自动连接;  [0204] if yes, receiving a status message sent by the restart server, and updating a status of the restarted server in the memory, and the device is automatically connected to the restarted server;
[0205] 若否, 则结合多个服务器的负载情况, 向所述设备发送最优服务器的数据信息 [0205] If no, the data information of the optimal server is sent to the device according to the load situation of the multiple servers.
[0206] 当宕机的服务器重新启动吋, 且有新的设备发送注册请求吋, 将该重新启动的 服务器分配给新的设备, 以均衡分配设备到各个服务器。 [0206] When the server of the downtime is restarted, and a new device sends a registration request, the restarted server is assigned to the new device to balance the allocation of the device to each server.
[0207] 作为对本实施例的进一步改进, 请参照图 15, 所述方法还包括: [0207] As a further improvement of the embodiment, referring to FIG. 15, the method further includes:
[0208] 步骤 1510, 检测服务器与设备自动断幵连接。 [0208] Step 1510: The detection server and the device are automatically disconnected.
[0209] 步骤 1520, 判断所述自动断幵连接的次数是否达到预设的次数阈值; 若是, 则 进入 1530, 若否, 则进入步骤 1540。  [0209] Step 1520: Determine whether the number of times of the automatic disconnection connection reaches a preset number of times threshold; if yes, go to 1530, if no, go to step 1540.
[0210] 步骤 1530, 服务器达到负载上限, 并更新服务器的接入能力为接入设备的数量[0210] Step 1530, the server reaches the load limit, and updates the access capability of the server to the number of access devices.
, 并在剩余服务器中选择最优服务器分配给设备。 And select the optimal server assigned to the device in the remaining servers.
[0211] 步骤 1540, 向设备再次分配所述服务器进行接入。 [0211] Step 1540: Assign the server to the device for access again.
[0212] 具体地, 由于每台接入服务器的接入能力是一定的, 达到一定的接入设备的能 力的吋候如果出现再次连接, 则会主动的断幵连接。 可以动态优化权重, 如果 分配在接入服务器上面的设备连接过程中连续出现预设次数 (例如 5次) 的断幵 连接, 可以确定此台接入服务器的接入能力到达最大, 把此吋的接入能力 (权 重) 的值动态调整为此吋的接入设备的数量, 以使得各台接入服务器的接入设 备的数量更加均衡。  [0212] Specifically, since the access capability of each access server is certain, if a certain access device capability is reached, if a reconnection occurs, the connection is actively disconnected. The weight can be dynamically optimized. If a predetermined number of times (for example, 5 times) of disconnected connections are continuously generated during the connection process of the device connected to the access server, it can be determined that the access capability of the access server reaches the maximum. The value of the access capability (weight) is dynamically adjusted to the number of access devices for each port, so that the number of access devices of each access server is more balanced.
[0213] 本实施例的设备自动接入服务器的方法, 通过接收设备发送的注册请求, 验证 所述注册请求, 当验证通过吋, 结合多个服务器的负载情况, 向设备发送最优 服务器的数据信息, 以使设备自动接入所述服务器, 能够根据服务器的负载情 况分配最合适的服务器给设备进行自动接入。  [0213] The method for automatically accessing the server by the device in this embodiment is to verify the registration request by receiving a registration request sent by the device, and send the data of the optimal server to the device when the verification passes, combined with the load situation of multiple servers. The information is such that the device automatically accesses the server, and the most suitable server can be allocated according to the load condition of the server to automatically access the device.
[0214] 需要说明的是, 在本文中, 术语"包括"或者其任何其他变体意在涵盖非排他性 的包含, 从而使得包括一系列要素的过程、 方法、 物品或者装置不仅包括那些 要素, 而且还包括没有明确列出的其他要素, 或者是还包括为这种过程、 方法 、 物品或者装置所固有的要素。 在没有更多限制的情况下, 由语句 "包括一个… …"限定的要素, 并不排除在包括该要素的过程、 方法、 物品或者装置中还存在 另外的相同要素。 [0214] It should be noted that the term "comprising" or any other variation thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also Also includes other elements not explicitly listed, or is included for this process, method , the elements inherent in the item or device. An element defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in a process, method, article, or device that comprises the element, without further limitation.
[0215] 上述本发明实施例序号仅仅为了描述, 不代表实施例的优劣。  [0215] The foregoing serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
[0216] 通过以上的实施方式的描述, 本领域的技术人员可以清楚地了解到上述实施例 方法可借助软件加必需的通用硬件平台的方式来实现, 当然也可以通过硬件, 但很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本 质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来, 该计 算机软件产品存储在一个存储介质 (如 ROM/RAM、 磁碟、 光盘) 中, 包括若干 指令用以使得一台终端设备 (可以是手机, 计算机, 服务器, 空调器, 或者网 络设备等) 执行本发明各个实施例所述的方法。 [0216] Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former It is a better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
[0217] 以上仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本 发明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运用在 其他相关的技术领域, 均同理包括在本发明的专利保护范围内。  The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the contents of the drawings may be directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of the present invention.
工业实用性  Industrial applicability
[0218] 本发明提出的设备自动接入服务器的方法、 装置及系统, 在设备接入吋, 注册 机能够动态均衡的选择接入服务器供设备接入, 避免了人为干预, 在接入服务 器出现宕机的情况下, 设备再次注册的吋候, 注册机会排除对应的宕机的接入 服务器, 分配给设备其它的接入设备, 从而使得设备的接入更加的方便以及灵 活, 在服务器出现问题吋候也能够快速的自动的变换接入。 因此具有工业实用 性。  [0218] The method, device and system for automatically accessing a server by the device provided by the present invention, after the device is accessed, the registration machine can dynamically select the access server for the device to access, avoiding human intervention and appearing on the access server. In the case of downtime, when the device is registered again, the registration opportunity excludes the corresponding access server of the downtime and allocates it to other access devices of the device, thereby making the access of the device more convenient and flexible, and problems occur in the server. It is also possible to quickly and automatically change access. Therefore, it has industrial applicability.

Claims

权利要求书 Claim
[权利要求 1] 一种设备自动接入服务器的方法, 所述方法包括:  [Claim 1] A method for a device to automatically access a server, the method comprising:
接收设备发送的注册请求;  Receiving a registration request sent by the device;
验证所述注册请求;  Verify the registration request;
当验证通过吋, 结合多个服务器的负载情况, 向所述设备发送最优服 务器的数据信息, 以使所述设备自动接入所述服务器;  When the verification passes, combining the load conditions of the multiple servers, sending the data information of the optimal server to the device, so that the device automatically accesses the server;
更新所述服务器的状态, 以及所述设备与接入的服务器服务器的字典 对。  Updating the status of the server, and a dictionary pair of the device with the accessed server server.
[权利要求 2] 根据权利要求 1所述的设备自动接入服务器的方法, 其中, 所述结合 多个服务器的负载情况, 向所述设备发送最优服务器的数据信息, 以 使所述设备自动接入所述服务器, 包括:  [Claim 2] The method for automatically accessing a server by a device according to claim 1, wherein the combining the load conditions of the plurality of servers, transmitting data information of the optimal server to the device, so that the device automatically Accessing the server includes:
判断是否存在向所述设备已分配的服务器;  Determining whether there is a server that has been allocated to the device;
若是, 则将所述已分配的服务器的数据信息发送给所述设备, 以使所 述设备自动接入所述服务器;  If yes, sending the data information of the allocated server to the device, so that the device automatically accesses the server;
若否, 则选择最优服务器的数据信息发送给所述设备, 以使所述设备 自动接入所述服务器。  If not, the data information of the optimal server is selected and sent to the device, so that the device automatically accesses the server.
[权利要求 3] 根据权利要求 1所述的设备自动接入服务器的方法, 其中, 所述方法 还包括:  [Claim 3] The method for automatically accessing a server by a device according to claim 1, wherein the method further includes:
检测所述设备与已分配的服务器断幵连接;  Detecting that the device is disconnected from the allocated server;
接收所述设备发送的第二注册请求;  Receiving a second registration request sent by the device;
验证所述第二注册请求;  Verifying the second registration request;
当验证通过吋, 判断所述设备与所述已分配的服务器断幵连接的吋间 是否达到预设的吋间阈值;  When the verification passes, determining whether the device is disconnected from the allocated server to reach a preset time threshold;
若是, 则更新保存的信息, 并选择最优服务器的数据信息发送给所述 设备;  If yes, the saved information is updated, and the data information of the optimal server is selected and sent to the device;
若否, 则将所述已分配的服务器的数据信息发送给所述设备。  If not, the data information of the allocated server is sent to the device.
[权利要求 4] 根据权利要求 1所述的设备自动接入服务器的方法, 其中, 所述方法 还包括: 接收所述设备发送的服务器出现宕机的消息, 所述设备自动与所述服 务器断幵连接; [Claim 4] The method for automatically accessing a server by a device according to claim 1, wherein the method further includes: Receiving a message that the server sent by the device is down, the device is automatically disconnected from the server;
更新所述接入的服务器的状态, 以及所述设备与接入的服务器的字典 对;  Updating a status of the accessed server, and a dictionary pair of the device and the accessed server;
接收所述设备发送的第三注册请求;  Receiving a third registration request sent by the device;
验证所述第三注册请求;  Verifying the third registration request;
当验证通过吋, 向所述设备发送服务器的数据信息和第一有效吋间; 向所述设备发送最优服务器的数据信息, 以使所述设备接入所述最优 第一服务器;  Sending, by the device, the data information of the server and the first valid time to the device; sending the data information of the optimal server to the device, so that the device accesses the optimal first server;
当所述第一有效吋间到期吋, 所述设备与所述最优第一服务器断幵连 接。  When the first valid time expires, the device is disconnected from the optimal first server.
[权利要求 5] 根据权利要求 4所述的设备自动接入服务器的方法, 其中, 所述方法 还包括:  [Claim 5] The method for automatically accessing a server by a device according to claim 4, wherein the method further includes:
判断宕机的服务器是否重新启动;  Determine whether the server of the downtime is restarted;
若是, 则接收重新启动的服务器发送的状态消息、 以及更新内存中的 所述重新启动的服务器的状态, 且所述设备与所述重新启动的服务器 自动连接;  If yes, receiving a status message sent by the restarted server, and updating a status of the restarted server in the memory, and the device is automatically connected to the restarted server;
若否, 则向所述设备发送所述重新启动的服务器的第二有效吋间, 且 所述设备重新与所述最优第一服务器自动连接, 当所述第二有效吋间 到期吋, 所述设备与所述最优第一服务器再次断幵连接;  If not, sending a second valid time of the restarted server to the device, and the device is automatically reconnected with the optimal first server, when the second valid time expires, The device is disconnected from the optimal first server again;
判断所述宕机的服务器是否重新启动;  Determining whether the server of the downtime is restarted;
若是, 则接收重新启动服务器发送的状态消息、 以及更新内存中的所 述重新启动的服务器的状态, 且所述设备与所述重新启动的服务器自 动连接;  If yes, receiving a status message sent by the restart server, and updating a status of the restarted server in the memory, and the device is automatically connected to the restarted server;
若否, 则结合多个服务器的负载情况, 向所述设备发送最优服务器的 数据信息。  If not, the data information of the optimal server is sent to the device in combination with the load condition of the plurality of servers.
[权利要求 6] 根据权利要求 1所述的设备自动接入服务器的方法, 其中, 所述方法 还包括: 检测所述服务器与所述设备自动断幵连接; [Claim 6] The method for automatically accessing a server by a device according to claim 1, wherein the method further includes: Detecting that the server is automatically disconnected from the device;
判断所述自动断幵连接的次数是否达到预设的次数阈值;  Determining whether the number of times of the automatic disconnection connection reaches a preset number of times threshold;
若是, 则判定所述服务器达到负载上限, 并更新所述服务器的接入能 力为接入设备的数量;  If yes, determining that the server reaches the load limit, and updating the access capability of the server as the number of access devices;
若否, 则向所述设备再次分配所述服务器进行接入。  If not, the server is again assigned to the device for access.
[权利要求 7] —种设备自动接入服务器的装置, 所述装置包括: [Claim 7] A device for automatically accessing a server by a device, the device comprising:
注册请求接收模块, 设置于接收设备发送的注册请求;  a registration request receiving module, configured to be configured by the receiving device to send a registration request;
验证模块, 设置于验证所述注册请求;  a verification module, configured to verify the registration request;
发送模块, 设置于当验证通过吋, 结合多个服务器的负载情况, 向所 述设备发送最优服务器的数据信息, 以使所述设备自动接入所述服务 器;  The sending module is configured to send the data information of the optimal server to the device when the verification passes, combining the load conditions of the multiple servers, so that the device automatically accesses the server;
更新模块, 设置于更新所述服务器的状态, 以及所述设备与接入的服 务器的字典对。  An update module, configured to update a state of the server, and a dictionary pair of the device and the accessed server.
[权利要求 8] 根据权利要求 7所述的设备自动接入服务器的装置, 其中, 所述发送 模块包括:  [Claim 8] The device for automatically accessing a server according to claim 7, wherein the sending module comprises:
判断单元, 设置于判断是否存在向所述设备已分配的服务器; 第一发送单元, 设置于当判定存在向所述设备已分配的服务器吋, 则 将所述已分配的服务器的数据信息发送给所述设备, 以使所述设备自 动接入所述服务器;  a determining unit, configured to determine whether there is a server that has been allocated to the device; the first sending unit is configured to: when it is determined that there is a server that has been allocated to the device, send the data information of the allocated server to The device, so that the device automatically accesses the server;
第二发送单元, 设置于当判定不存在向所述设备已分配的服务器吋, 则选择最优服务器的数据信息发送给所述设备, 以使所述设备自动接 入所述服务器。  The second sending unit is configured to: when it is determined that there is no server allocated to the device, send data information of the optimal server to the device, so that the device automatically accesses the server.
[权利要求 9] 根据权利要求 7所述的设备自动接入服务器的装置, 其中, 所述装置 还包括:  [Claim 9] The device for automatically accessing a server according to claim 7, wherein the device further includes:
检测模块, 设置于检测所述设备与已分配的服务器断幵连接; 消息接收模块, 设置于接收所述设备发送的第二注册请求; 判断模块, 设置于当所述验证模块验证所述第二注册请求通过吋, 判 断所述设备与所述已分配的服务器断幵连接的吋间是否达到预设的吋 间阈值; a detecting module, configured to detect that the device is disconnected from the allocated server; a message receiving module, configured to receive a second registration request sent by the device; and a determining module, configured to verify, when the verifying module After the registration request is passed, it is determined whether the device is disconnected from the allocated server and the preset time is reached. Interval threshold
若是, 则所述发送模块, 还设置于更新保存的信息, 并选择最优服务 器的数据信息发送给所述设备;  If yes, the sending module is further configured to update the saved information, and select the data information of the optimal server to send to the device;
若否, 则所述发送模块将所述已分配的服务器的数据信息发送给所述 设备。  If not, the sending module sends the data information of the allocated server to the device.
[权利要求 10] 根据权利要求 7所述的设备自动接入服务器的装置, 其中, 所述装置 还包括:  [Claim 10] The device of the device automatically accesses the server according to claim 7, wherein the device further includes:
消息接收模块, 设置于接收所述设备发送的服务器出现宕机的消息, 所述设备自动与所述服务器断幵连接;  The message receiving module is configured to receive a message that the server sent by the device is down, and the device automatically disconnects from the server;
所述更新模块, 还设置于更新所述接入的服务器的状态, 以及所述设 备与接入的服务器的字典对;  The update module is further configured to update a state of the accessed server, and a dictionary pair of the device and the accessed server;
所述注册请求接收模块, 还设置于接收所述设备发送的第三注册请求 所述验证模块, 还设置于验证所述第三注册请求; 所述发送模块, 还设置于当验证通过吋, 向所述设备发送服务器的数 据信息和第一有效吋间, 并向所述设备发送最优第一服务器的数据信 息, 以使所述设备接入所述最优第一服务器;  The registration request receiving module is further configured to receive the third registration request sent by the device, and the verification module is further configured to verify the third registration request; the sending module is further configured to perform verification, The device sends the data information of the server and the first valid time, and sends the data information of the optimal first server to the device, so that the device accesses the optimal first server;
断幵连接模块, 设置于当所述第一有效吋间到期吋, 所述设备与所述 最优第一服务器断幵连接。  And disconnecting the connection module, the device is configured to be disconnected from the optimal first server when the first valid time expires.
[权利要求 11] 根据权利要求 10所述的设备自动接入服务器的装置, 其中, 所述装置 还包括: [Claim 11] The device of the device automatically accesses the server according to claim 10, wherein the device further includes:
判断模块, 设置于判断宕机的服务器是否重新启动;  The judging module is set to determine whether the server of the downtime is restarted;
若是, 则所述消息接收模块还设置于接收重新启动的服务器发送的状 态消息、 以及所述更新模块更新内存中的所述重新启动的服务器的状 态, 且所述设备与所述重新启动的服务器自动连接;  If yes, the message receiving module is further configured to receive a status message sent by the restarted server, and the update module updates the status of the restarted server in the memory, and the device and the restarted server auto connect;
若否, 则所述发送模块向所述设备发送所述重新启动的服务器的第二 有效吋间, 且所述设备重新与所述最优第一服务器自动连接, 当所述 第二有效吋间到期吋, 所述设备与所述最优第一服务器再次断幵连接 所述判断模块, 还设置于判断所述宕机的服务器是否重新启动; 若是, 则所述消息接收模块还设置于接收重新启动服务器发送的状态 消息、 以及所述更新模块更新内存中的所述重新启动的服务器的状态 , 且所述设备与所述重新启动的服务器自动连接; 若否, 则所述发送模块, 还设置于结合多个服务器的负载情况, 向所 述设备发送最优服务器的数据信息。 If not, the sending module sends the second valid time of the restarted server to the device, and the device is automatically reconnected with the optimal first server, when the second effective day After expiration, the device is disconnected from the optimal first server again. The determining module is further configured to determine whether the server of the downtime is restarted; if yes, the message receiving module is further configured to receive a status message sent by the restart server, and the update module updates the memory a state of the restarted server, and the device is automatically connected to the restarted server; if not, the sending module is further configured to transmit a load of the plurality of servers, and send the optimal server to the device Data information.
[权利要求 12] 根据权利要求 7所述的设备自动接入服务器的装置, 其中, 所述装置 还包括: [Claim 12] The device for automatically accessing a server according to claim 7, wherein the device further includes:
检测模块, 设置于检测所述服务器与所述设备自动断幵连接; 判断模块, 设置于判断所述自动断幵连接的次数是否达到预设的次数 阈值;  a detecting module, configured to detect that the server is automatically disconnected from the device; and the determining module is configured to determine whether the number of times of the automatic disconnection connection reaches a preset number of times threshold;
若是, 则判定所述服务器达到负载上限, 并触发所述更新模块更新所 述服务器的接入能力为接入设备的数量;  If yes, determining that the server reaches the load limit, and triggering the update module to update the access capability of the server to be the number of access devices;
若否, 则触发所述发送模块向所述设备再次分配所述服务器进行接入  If not, triggering the sending module to allocate the server to the device for access again.
PCT/CN2016/097935 2016-09-02 2016-09-02 Method, device and system enabling apparatus to automatically access server WO2018040066A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/097935 WO2018040066A1 (en) 2016-09-02 2016-09-02 Method, device and system enabling apparatus to automatically access server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/097935 WO2018040066A1 (en) 2016-09-02 2016-09-02 Method, device and system enabling apparatus to automatically access server

Publications (1)

Publication Number Publication Date
WO2018040066A1 true WO2018040066A1 (en) 2018-03-08

Family

ID=61299690

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/097935 WO2018040066A1 (en) 2016-09-02 2016-09-02 Method, device and system enabling apparatus to automatically access server

Country Status (1)

Country Link
WO (1) WO2018040066A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538608A (en) * 2020-04-30 2020-08-14 深圳前海微众银行股份有限公司 Method for preventing terminal equipment from being down, terminal equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079884A (en) * 2007-03-27 2007-11-28 腾讯科技(深圳)有限公司 A method, system and device for client login to service server
CN101272389A (en) * 2008-05-27 2008-09-24 华为技术有限公司 CS communication method, system and device
CN101741907A (en) * 2009-12-23 2010-06-16 金蝶软件(中国)有限公司 Method and system for balancing server load and main server
CN103401947A (en) * 2013-08-20 2013-11-20 曙光信息产业(北京)有限公司 Method and device for allocating tasks to multiple servers
US20150341428A1 (en) * 2014-05-20 2015-11-26 Citrix Systems, Inc. Systems and methods for providing load balancing as a service
CN105871977A (en) * 2015-11-27 2016-08-17 乐视体育文化产业发展(北京)有限公司 Long connection establishment method and system, and devices

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079884A (en) * 2007-03-27 2007-11-28 腾讯科技(深圳)有限公司 A method, system and device for client login to service server
CN101272389A (en) * 2008-05-27 2008-09-24 华为技术有限公司 CS communication method, system and device
CN101741907A (en) * 2009-12-23 2010-06-16 金蝶软件(中国)有限公司 Method and system for balancing server load and main server
CN103401947A (en) * 2013-08-20 2013-11-20 曙光信息产业(北京)有限公司 Method and device for allocating tasks to multiple servers
US20150341428A1 (en) * 2014-05-20 2015-11-26 Citrix Systems, Inc. Systems and methods for providing load balancing as a service
CN105871977A (en) * 2015-11-27 2016-08-17 乐视体育文化产业发展(北京)有限公司 Long connection establishment method and system, and devices

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538608A (en) * 2020-04-30 2020-08-14 深圳前海微众银行股份有限公司 Method for preventing terminal equipment from being down, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
US10673938B2 (en) Method and system for load balancing over a cluster of authentication, authorization and accounting (AAA) servers
US11418620B2 (en) Service request management
US10135882B1 (en) Multiple-master DNS system
EP2454679B1 (en) Management of an instant message session
KR100810139B1 (en) System and method for maximizing connectivity during network failures in a cluster system, computer-readable recording medium having computer program embedded thereon for executing the same method
JP4122341B2 (en) System and method for session resetting between client terminal device and server
WO2020119328A1 (en) Data transmission method, apparatus and device, and storage medium
CN112925620A (en) Distributed task scheduling system and method
CN106657259B (en) Routing server and routing service method for server cluster
US6675217B1 (en) Recovery of cluster consistency following failover
CN112039710B (en) Service fault processing method, terminal equipment and readable storage medium
US10505787B2 (en) Automatic recovery in remote management services
CN113783741B (en) Method, device, server, gateway equipment and system for configuring gateway equipment
WO2018040066A1 (en) Method, device and system enabling apparatus to automatically access server
CN113132498B (en) Message processing method, relay device, system and storage medium
US20220278980A1 (en) Load balancing across certificates and certificate authorities
CN110809064B (en) IP address switching method, device and system
US11936560B1 (en) Systems and methods for data flow between mobile applications and customer premises equipment, using a consistent server hash
US9019964B2 (en) Methods and systems for routing application traffic
CN111385323B (en) EJB service processing method, device, equipment and medium
JP2017059868A (en) Address management device and communication system
TWI502375B (en) Instant messaging method, system and device
GB2551808A (en) Data validation
CN115396364A (en) Route forwarding method and device
CN115941588A (en) Service access method, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16914632

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16914632

Country of ref document: EP

Kind code of ref document: A1