WO2009117946A1 - Main-spare realizing method for dispatch servers and dispatch server - Google Patents

Main-spare realizing method for dispatch servers and dispatch server Download PDF

Info

Publication number
WO2009117946A1
WO2009117946A1 PCT/CN2009/070973 CN2009070973W WO2009117946A1 WO 2009117946 A1 WO2009117946 A1 WO 2009117946A1 CN 2009070973 W CN2009070973 W CN 2009070973W WO 2009117946 A1 WO2009117946 A1 WO 2009117946A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
scheduling server
scheduling
new
topology relationship
Prior art date
Application number
PCT/CN2009/070973
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 华为技术有限公司
Publication of WO2009117946A1 publication Critical patent/WO2009117946A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • the present invention relates to communication technologies, and in particular, to a master-slave implementation technology of a scheduling server and a scheduling service technology.
  • Each client receives data directly from the application server.
  • the application server needs to transfer a large amount of data to the client.
  • P2P peer-to-peer
  • the client can not only obtain data from the application server, but after other clients obtain the same data, the client can also obtain data from the other client, so that the client can alleviate the data.
  • P2P topology management can be divided into centralized topology management and distributed topology management.
  • the scheduling server specifies the data transmission relationship between the clients; for distributed topology management, the scheduling server provides a client with a set of candidate clients, and the client and the client Negotiate to establish a data transmission relationship.
  • the scheduling server needs to save the data transmission relationship between the clients. It can be said that the scheduling server plays an extremely important role in the centralized topology management technology. If the scheduling server fails, it will The client cannot join the P2P topology relationship. Clients that have joined the P2P topology relationship cannot adjust the topology relationship when needed. In order to avoid the negative consequences of the scheduling server due to failures, the scheduling server needs to use the redundant backup mechanism, that is, deploy two or more scheduling servers. When one of the scheduling servers fails, the other scheduling servers also You can continue to provide services to clients.
  • the traditional redundant backup mechanism includes the following three implementation methods: 1. Redundant backup of shared storage
  • the P2P topology relationship data is saved to a persistent storage device, and each scheduling server can obtain P2P topology relationship data from the persistent storage device when needed. For example, when the primary scheduling server fails, other scheduling servers can obtain P2P topology relationship data from the persistent storage device as the primary scheduling server, and continue to maintain the P2P topology relationship based on the original P2P topology relationship.
  • the primary scheduling server transmits the P2P topology relationship data to all the standby scheduling servers in real time.
  • the standby scheduling server bases on the original P2P topology relationship based on the data obtained by the real-time synchronization. Maintain P2P topology relationships.
  • the inventors have carefully analyzed and found that: Due to the large amount of data of the P2P topology relationship, the network transmission overhead is also large, to support 100,000 online clients, Each client uses 10 bytes as an example. In order to transmit P2P topology data, a transmission space of 1 Mbyte is required. In addition, in order to ensure the consistency of P2P topology data, in the synchronization process, the main scheduling server You cannot modify the topology. You must wait for the synchronization to complete before you can continue to provide scheduling functions for the client. This seriously affects the performance of the scheduling server.
  • the primary scheduling server sends only the modified part of the P2P topology relationship data to the standby scheduling server each time the P2P topology relationship is modified.
  • the inventors have carefully analyzed and found that: This method is very complicated to implement, and will increase the probability of software errors. Since the P2P topology data is interrelated, one If the local error occurs, the entire P2P topology relationship may be unavailable. Secondly, in some cases, the P2P topology relationship data needs to be completely synchronized. For example, in the case of a failure of the standby scheduling server, the primary scheduling server needs to be prepared. After the scheduling server is restored, the P2P topology relationship data is synchronized to the standby scheduling server at one time; sometimes, the primary scheduling server You can also save all the modified data.
  • the standby scheduling server After the standby server is restored, all the modified data is synchronized to the standby scheduling server. However, if the standby scheduling server recovers too long, the accumulated modified data may exceed the one-time. The amount of data being synchronized is even greater than the maximum space available to the primary dispatch server.
  • the technical problem to be solved by the embodiments of the present invention is to provide a master/slave implementation method of a scheduling server, a standby scheduling server, a scheduling server system, a method for providing a scheduling service, and a scheduling server, which are used to achieve the purpose of redundancy backup of the scheduling server. To solve the defects of the above several redundant backup mechanisms.
  • an embodiment of the present invention provides a method for implementing a master/slave of a scheduling server, including: the standby scheduling server determines whether the primary scheduling server can provide a scheduling service for the client; if the primary scheduling server cannot provide a scheduling service for the client The standby scheduling server provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • the embodiment of the present invention further provides a scheduling server, including: a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client; and a scheduling service providing unit, configured to: if the first detecting unit determines the primary scheduling server If the scheduling service cannot be provided for the client, the scheduling service is provided to the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • a scheduling server including: a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client; and a scheduling service providing unit, configured to: if the first detecting unit determines the primary scheduling server If the scheduling service cannot be provided for the client, the scheduling service is provided to the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • the embodiment of the present invention further provides a scheduling server system, including: a primary scheduling server, configured to provide a scheduling service for a client; at least one standby scheduling server, when the primary scheduling server cannot provide a scheduling service for the client, where A standby scheduling server provides scheduling services for clients by using a new P2P topology relationship without obtaining P2P topology data maintained by the primary scheduling server.
  • the embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: when the scheduling server is re-working, determining whether the P2P topology relationship data originally maintained by the scheduling server can be obtained; if not, the scheduling server Provide scheduling services for clients using new P2P topology relationships.
  • the embodiment of the present invention further provides a scheduling server, including: a determining unit, configured to determine whether the originally maintained P2P topology relationship data can be obtained when the scheduling server is re-working; and a scheduling service providing unit, configured to After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, the new P2P topology relationship is used to provide a scheduling service for the client.
  • the embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: the scheduling server performs message interaction with a client; if the client needs to join a P2P topology relationship currently maintained by the scheduling server, The dispatch server provides information for identifying the client to the client.
  • the embodiment of the present invention further provides a scheduling server, including: a message interaction unit, configured to perform message interaction with a client; and an information providing unit, configured to: if the client needs to join a P2P topology relationship currently maintained by the scheduling server And providing, by the scheduling server, information for identifying the client to the client.
  • a scheduling server including: a message interaction unit, configured to perform message interaction with a client; and an information providing unit, configured to: if the client needs to join a P2P topology relationship currently maintained by the scheduling server And providing, by the scheduling server, information for identifying the client to the client.
  • the standby calling server does not need to obtain the P2P topology relationship data maintained by the primary scheduling server.
  • the standby calling server does not need to store the primary scheduling server. Maintain P2P topology relationship data.
  • the standby server cannot maintain the P2P topology relationship maintained by the primary scheduling server, it can still ensure that the upper and lower nodes in the P2P topology relationship transmit data normally, and one of the nodes needs to join the P2P maintained by the standby calling server. In the topology relationship, you only need to add this node to the P2P topology relationship maintained by the standby server.
  • the embodiment of the present invention does not require the storage server to store the P2P topology relationship data, which saves the cost.
  • the embodiment of the present invention does not need the primary scheduling server to synchronize the P2P topology relationship data with the standby scheduling server, thereby improving the The reliability of point-to-point data transmission.
  • the scheduling server of the present invention provides the scheduling service
  • the scheduling service can be provided to the client by using the new P2P topology relationship. Therefore, the problem that the scheduling service cannot be provided once the scheduling server cannot obtain the originally maintained P2P topology relationship data is solved.
  • the scheduling server of the present invention provides a scheduling service
  • the information used by the scheduling server to identify the client is provided to the Client, this will ensure that the scheduling server provides scheduling for the client
  • the service it can be determined whether the client is already in the P2P topology relationship maintained by the client, thereby providing a corresponding scheduling service.
  • Figure 1 is a schematic diagram of an existing client/server architecture
  • FIG. 3 is a flowchart of a method for implementing active/standby of a scheduling server according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a scheduling service system according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of processing when a P2P terminal joins a P2P topology relationship according to an embodiment of the present invention. detailed description
  • the active/standby implementation method of the scheduling server in the embodiment of the present invention includes: Step S301: determining whether the primary scheduling server can provide a scheduling service for the client; Step S302: If the primary scheduling server cannot provide the scheduling service for the client, the primary scheduling server maintenance is not required.
  • the standby scheduling server uses the new P2P topology relationship to provide scheduling services for the client.
  • the new P2P topology relationship is relative to the P2P topology relationship maintained by the primary scheduling server.
  • the new P2P topology relationship used by the standby scheduling server can be used to refer to the P2P topology relationship maintained by the scheduling server.
  • the standby scheduling server starts working but has not yet communicated with any client, only the content server is maintained in the P2P topology relationship. As more clients join the P2P topology maintained by the standby scheduling server, The number of nodes in the P2P topology relationship increases.
  • the standby scheduling server determines whether the primary scheduling server can provide scheduling services for clients can be implemented in a variety of ways. For example, it can be detected whether the primary scheduling server is faulty or overloaded, and if so, it is determined that the primary scheduling server cannot provide scheduling services for the client. For another example, it may be determined whether a message that the primary scheduling server or other network entity issues a failure or overload of the primary scheduling server is received, and if so, it is determined that the primary scheduling server cannot provide a scheduling service for the client.
  • the standby scheduling server uses the new P2P topology relationship to provide scheduling services for clients, which can be implemented in a variety of ways. For example, if the client needs to join a new P2P topology relationship, the client is added to the new P2P topology relationship.
  • the new master scheduling server determines that the client needs to join the new P2P topology relationship.
  • the new primary scheduling server may first determine whether the client is in a new P2P topology relationship, and if not, determine whether the client needs to join a new P2P topology relationship. Determining whether the client is in a new P2P topology relationship can also be implemented in a variety of ways.
  • the new primary scheduling server determines whether the P2P topology version information reported by the client for identifying a new P2P topology relationship and/or the client information used to identify the client is related to the current P2P topology version information and / or the client information assigned to the client is consistent, and if so, the client is determined to be in a new P2P topology relationship, otherwise, the client is determined not to be in a new P2P topology relationship.
  • the new primary scheduling server provides P2P topology version information for identifying a new P2P topology relationship and/or client information for identifying the client to the client with which the message is exchanged, and is checked by the client.
  • the information reported by the client may include information that needs to be added to the P2P topology relationship, information that the upper node is abnormal, request information for replacing the superior node, or information about itself.
  • the self information is, for example, load information of itself, information on whether or not it is in the P2P topology relationship, or information in which P2P topology relationship itself.
  • the following is an example. Assume that the client in the P2P topology relationship maintained by the original primary scheduling server reports the information in the P2P topology relationship maintained by the original primary scheduling server but has a heavy load on its own, so the new primary scheduling server can report it according to its The information determines that the client should be added to the new P2P topology relationship to reduce the load of the client. Of course, since the new primary scheduling server does not obtain the P2P topology relationship maintained by the original primary scheduling server before, Data, so the new master dispatch server treats the client as a new client.
  • the information reported by the client may also include P2P topology version information for identifying a new P2P topology relationship and/or client information for identifying the client.
  • the P2P topology version information may be an identifier, which is called a P2P topology.
  • the version number, the client information can also be an identifier, called the client identifier.
  • the new primary scheduling server can identify the client using P2P topology version information and/or client information. In this case, if the client reports the P2P topology version information and/or the client information, the new primary scheduling server can be based on the P2P topology version information and/or the client. End information, determine whether the client is in a new P2P topology relationship, and if not, determine whether the client needs to join a new P2P topology relationship.
  • the new primary scheduling server determines that the client needs to join the new P2P topology relationship, it can specify the superior node for the client. In this way, the client can obtain P2P data from the superior node.
  • the P2P topology version information for identifying the P2P topology relationship maintained by the new primary scheduling server and/or the client information for identifying the client may also be provided to the client at the same time as or after the client is designated with the upper node. It should be noted that the P2P topology version information and the client information can be integrated into one type of information, that is, when the P2P topology version information and the client information are provided to the client, only one type of information can be provided. The information includes both the content of the P2P topology version information and the content of the client information.
  • the interactive message can carry P2P topology version information and/or client information each time it interacts with the client.
  • the client information can also be reported by the client without the need for a new primary dispatch server to provide client information. For example, if the client needs to join the new P2P topology relationship, it can record the client information generated and reported by the client to identify the client.
  • the client information can be recorded.
  • the information of the client here is not limited to the client information used to identify the client, but also refers to other types of client-related information.
  • Another implementation manner in which the standby scheduling server uses the new P2P topology relationship to provide the scheduling service for the client is that if the client in the P2P topology relationship maintained by the original primary scheduling server does not need to join the new P2P topology relationship, The client in the P2P topology relationship maintained by the original primary scheduling server still obtains P2P data in the P2P topology relationship maintained by the original primary scheduling server.
  • determining whether the client in the P2P topology relationship maintained by the original primary scheduling server does not need to join the new P2P topology relationship you need to determine whether the client in the P2P topology relationship maintained by the original primary scheduling server needs to join the new P2P topology relationship.
  • it can be implemented in a variety of ways.
  • One of the methods is: obtaining information reported by the client in the P2P topology relationship maintained by the original primary scheduling server; determining, according to the information, whether the client in the P2P topology relationship maintained by the original primary scheduling server needs to join a new one. P2P topology relationship.
  • Another implementation manner in which the standby scheduling server uses the new P2P topology relationship to provide the scheduling service for the client is that if the client that is originally in a P2P topology relationship needs to be added to the new P2P topology relationship, the indication may be indicated.
  • the client quits after the specified time arrives The original P2P topology relationship. For example, the client can be instructed to quit the original P2P topology relationship after 30 seconds. After 30 seconds, the client exits the original P2P topology relationship and joins the P2P topology relationship maintained by the new primary scheduling server.
  • the foregoing method may be implemented by multiple forms of devices, where the scheduling server includes: a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client; and a scheduling service providing unit, if the first The detecting unit determines that the primary scheduling server cannot provide the scheduling service for the client, and provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • a first detecting unit configured to detect whether the primary scheduling server can provide a scheduling service for the client
  • a scheduling service providing unit if the first The detecting unit determines that the primary scheduling server cannot provide the scheduling service for the client, and provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • the scheduling service providing unit includes: a second detecting unit, configured to detect whether the client needs to join a new P2P topology relationship; and a P2P topology relationship processing unit, configured to: if the second detecting unit detects that the client needs to join the new P2P In the topology relationship, the client is added to the new P2P topology relationship.
  • the second detecting unit may include: an information obtaining unit, configured to obtain information reported by the client; and a determining unit, configured to determine, according to the information, whether the client needs to join a new P2P topology relationship.
  • the scheduling server may further include: an information recording unit, configured to record the information of the client if the second detecting unit detects that the client needs to join the new P2P topology relationship.
  • the present invention further provides a scheduling server system, including: a primary scheduling server, configured to provide a scheduling service for a client; at least one standby scheduling server, when the primary scheduling server cannot be a client When the scheduling service is provided, one of the standby scheduling servers provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • a primary scheduling server configured to provide a scheduling service for a client
  • at least one standby scheduling server when the primary scheduling server cannot be a client
  • one of the standby scheduling servers provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
  • the scheduling server system may further include a message forwarding device, configured to forward a message between the client and a scheduling server capable of providing a scheduling service for the client, where the primary scheduling server cannot provide a scheduling service for the client, one of the When the standby scheduling server provides the scheduling service for the client, the message forwarding device forwards the message between the standby scheduling server and the client that provides the scheduling service for the client.
  • the message forwarding device may be a device such as a switch or a separate device independent of the switch.
  • the standby scheduling server mentioned above may refer not only to the standby scheduling server of the primary scheduling server, but also to the scheduling server that is maintaining other P2P topology relationships, or the scheduling relationship of the scheduling server. They are all relative.
  • the embodiment of the present invention further provides a method for the scheduling server to provide the scheduling service, including: determining whether the original maintained P2P topology relationship data can be obtained when re-working; if not, using the new P2P topology relationship as the client Provide scheduling services.
  • Re-work can mean that the scheduling server has already provided the scheduling service for the client, but the scheduling server has an abnormal phenomenon such as a crash or shutdown due to some or some reasons, so that the scheduling server can no longer provide the scheduling service, and the scheduling server restarts.
  • the scheduling service is restarted.
  • the scheduling server does not save the P2P topology relationship data until the scheduling server cannot continue to provide the scheduling service.
  • the original cannot be obtained.
  • Maintain P2P topology relationship data The new P2P topology relationship is relative to the P2P topology relationship originally maintained by the dispatch server.
  • Using the new P2P topology to provide scheduling services to clients can be implemented in a variety of ways. For example, if the client needs to join a new P2P topology relationship, the client can be added to the new P2P topology relationship.
  • Determining whether a client needs to join a new P2P topology relationship can also be implemented in a variety of ways. For example, obtaining information reported by the client; determining, according to the information, whether the client needs to join a new P2P topology relationship.
  • Determining whether the client is in a new P2P topology relationship can also be implemented in a variety of ways. For example, determining whether the P2P topology version information used to identify the new P2P topology relationship on the client and/or the client information used to identify the client is related to the current P2P topology version information and/or allocation. The client information to the client is consistent, and if so, the client is determined to be in a new P2P topology relationship, otherwise, the client is determined not to be in a new P2P topology relationship. For another example, a client that performs message interaction with the dispatch server provides a P2P extension for identifying a new primary dispatch server maintenance.
  • P2P topology version information of the Pu relationship and/or client information for identifying the client the client checking whether it is in a new P2P topology relationship; if obtaining the client reported by the client The information in the new P2P topology relationship is determined to be in the new P2P topology relationship; if the information reported by the client is not in the new P2P topology relationship, It is determined that the client is not in a new P2P topology relationship.
  • Another way to use the new P2P topology relationship to provide scheduling services for clients is to maintain the P2P topology if the clients in the original P2P topology relationship do not need to join the new P2P topology relationship. The client in the relationship still obtains P2P data in the originally maintained P2P topology relationship.
  • a method for determining whether a client in the P2P topology relationship that is to be maintained needs to be added to a new P2P topology relationship is obtained by obtaining information reported by the client in the originally maintained P2P topology relationship; Whether the client in the original maintained P2P topology needs to join the new P2P topology relationship.
  • the foregoing method embodiment may be implemented by multiple forms of devices, and one of the scheduling servers includes: a determining unit, configured to determine whether the originally maintained P2P topology relationship data can be obtained when re-working; the scheduling service providing unit, After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, the new P2P topology relationship is used to provide a scheduling service for the client.
  • a determining unit configured to determine whether the originally maintained P2P topology relationship data can be obtained when re-working
  • the scheduling service providing unit After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, the new P2P topology relationship is used to provide a scheduling service for the client.
  • the scheduling service providing unit may include: a detecting unit, configured to detect whether the client needs to join a new P2P topology relationship; and a P2P topology relationship processing unit, configured to: if the detecting unit detects that the client needs to join a new P2P extension In the Park relationship, the client is added to the new P2P topology relationship.
  • the detecting unit may include: an information obtaining unit, configured to obtain information reported by the client; and a determining unit, configured to determine, according to the information, whether the client needs to join a new P2P topology relationship.
  • the embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: performing message interaction with a client; if the client needs to join a P2P topology relationship currently maintained by the scheduling server, the scheduling is performed.
  • Information for the server to identify the client is provided to the client. After the information that the scheduling server uses to identify the client is provided to the client, all or part of the messages sent by the client may be carried by the scheduling server to identify the information of the client.
  • the scheduling server After the scheduling server is configured to identify that the information of the client is provided to the client, if the message interaction with the client is performed again, the scheduling server may be used again to identify the information provided by the client.
  • the client checks whether it is in a new P2P topology relationship; if the client reports the information in the new P2P topology relationship, The client is in the new P2P topology relationship; if the information reported by the client is not in the new P2P topology relationship, it is determined that the client is not in the new P2P topology relationship.
  • the scheduling server is configured to identify that the information of the client is provided to the client, if the message is exchanged with the client again, the scheduling server is used according to the message carried in the message reported by the client. Identifying the information of the client to determine whether the client is in a new P2P topology relationship.
  • the information for identifying the client includes P2P topology version information of the P2P topology relationship currently maintained by the scheduling server and/or client information for identifying the client is provided to the client.
  • one of the scheduling servers may include: a message interaction unit, configured to perform message interaction with the client; and an information providing unit, configured to perform current maintenance if the client needs to join the scheduling server In the P2P topology relationship, the information used by the scheduling server to identify the client is provided to the client.
  • the scheduling server 1, the scheduling server 2, and the message forwarding device form a scheduling server system, and interact with the P2P terminal (ie, the client mentioned above).
  • the P2P terminal ie, the client mentioned above.
  • the standby dispatching server needs to monitor whether the primary dispatching server is invalid. If the standby scheduling server finds that the primary scheduling server is invalid, the standby scheduling server needs to act as the primary scheduling server to interact with the P2P terminal. After the original primary scheduling server is restored, it can serve as the standby scheduling server.
  • the P2P terminal it interacts with the scheduling server device instead of the scheduling server 1 and the scheduling server 2.
  • Each scheduling server includes a terminal request processor, a service side terminal topology manager, a terminal topology unit, a terminal topology version number manager, and a monitoring unit.
  • the terminal request processor is responsible for receiving and processing the request of the P2P terminal
  • the service side terminal topology manager is responsible for querying and updating the topology of the P2P terminal
  • the terminal topology unit is responsible for saving the topology of the P2P terminal, and managing the terminal topology version number.
  • the device is responsible for maintaining the current topology version number of the P2P terminal (that is, the P2P topology version information mentioned above).
  • the monitoring unit is responsible for detecting whether the peer end is invalid, triggering the active/standby switchover, and performing data synchronization between the active and standby dispatch servers.
  • the synchronized data refers to a small amount of data such as configuration parameters, and does not include P2P topology data of a large amount of data.
  • the P2P terminal includes a terminal side topology manager, a terminal identification unit, and a terminal topology version number manager.
  • the terminal side topology manager is responsible for interacting with the scheduling server device to update the superior node information.
  • Each P2P terminal has a unique terminal identifier (i.e., the client information mentioned above for identifying the client), and the terminal identification unit is responsible for saving the terminal identifier.
  • the terminal topology version number unit is responsible for saving the terminal topology version number.
  • the terminal topology version number manager When each scheduling server is started, the terminal topology version number manager needs to update the terminal topology version number to identify the newly created P2P topology relationship after the startup. Each time a new topology version number is generated, it must be ensured that the new topology version number does not overlap with all the topology version numbers used by the active and standby scheduling servers for a period of time.
  • a simple implementation is that The time (which can be accurate to the second) is combined with the server's NIC address as the topology version number.
  • Step S501 The P2P terminal sends a request for joining the P2P topology relationship to the scheduling server device, where the request includes information of the P2P terminal, for example, information such as an IP address, a network card address, and an uplink and downlink bandwidth of the P2P terminal.
  • information of the P2P terminal for example, information such as an IP address, a network card address, and an uplink and downlink bandwidth of the P2P terminal.
  • Step S502 After receiving the request, the message forwarding device in the scheduling server device forwards the request to the main scheduling server.
  • Step S503 After receiving the request, the terminal of the primary scheduling server allocates a unique terminal identifier to the P2P terminal.
  • Step S504 The terminal requests the processor to invoke the service side terminal topology manager, and adds the P2P terminal to the P2P topology relationship.
  • Step S505 The service side terminal topology manager records the information of the P2P terminal, and specifies the upper node for the P2P terminal according to the topology management policy.
  • Step S506 The terminal requesting processor returns the topology information returned by the service side terminal topology manager and the topology version number assigned to the P2P terminal to the P2P terminal.
  • Step S507 After the P2P terminal receives the information returned by the scheduling server device, the terminal side topology manager parses the information, saves the terminal identifier in the information in the terminal identification unit, and saves the terminal topology version number in the information in the terminal.
  • the topology version number unit after which, follow the instructions in the message to connect to the superior node and obtain data from the superior node.
  • the topology update request may be sent to the scheduling server device. For details, refer to steps S508-S510 of FIG.
  • Step S508 The terminal side topology manager sends a topology update request to the scheduling server device.
  • Step S510 The service side terminal topology manager records the updated topology into the terminal topology component.
  • a P2P terminal After a P2P terminal joins a P2P topology relationship, it may need to interact with the scheduling server again for various reasons. For example, the P2P terminal finds that the upper node fails and needs to connect to the new upper node; the P2P terminal needs to provide its own load condition to the scheduling server, so that the scheduling server decides whether to use the P2P terminal as the upper node of the other P2P terminal.
  • the P2P terminal joins the P2P topology relationship, each time the message is sent to the scheduling server, the message can carry the terminal topology version number.
  • the standby scheduling server is started, and the new primary scheduling server provides scheduling services for the P2P terminal.
  • the new primary scheduling server is started, the new terminal topology version number is used as the current terminal topology version number.
  • the original P2P topology relationship can continue to exist, that is, the P2P topology relationship does not need to be completely adjusted, only when P2P is used.
  • the P2P terminal is added to the P2P topology relationship maintained by the new primary scheduling server.
  • the new primary scheduling server may use the current terminal topology version number and the terminal topology carried in the message sent by the P2P terminal. The version number is compared to determine whether the P2P topology relationship of the P2P terminal is the P2P topology relationship currently maintained by the new primary scheduling server. If yes, the P2P terminal is added to the P2P topology relationship maintained by the new primary scheduling server. Otherwise, According to the content of the request and other factors, the following different treatments can be performed:
  • the new primary scheduling server can ignore the request, and the P2P terminal can continue to rely on the original P2P topology relationship to obtain data.
  • the P2P terminal may have replaced the upper node by itself, and the new primary scheduling server may also ignore the request, so that the P2P terminal maintains the P2P extension itself. Park relationship;
  • the new primary scheduling server can ignore the request
  • the new primary scheduling server adds the P2P terminal to a P2P topology relationship maintained by the new primary scheduling server, and returns a new terminal topology version number to the P2P terminal.
  • the P2P terminal updates the saved terminal topology version number
  • the new primary scheduling server can return the terminal topology version number error message to the P2P terminal. After receiving the error message, the P2P terminal disconnects all the other terminals. Connect, re-request to join the new P2P topology relationship. Since the exit of one P2P terminal may cause its lower-level terminal to exit, and the exit of its lower-level terminal may cause more P2P terminal to exit, this chain-locking reaction may cause the new primary dispatching server to be overloaded for a period of time. run.
  • the P2P terminal can wait for a period of time before exiting the original P2P topology relationship, then exit the original P2P topology relationship, and then add a new P2P topology relationship, thus avoiding a large number of
  • the P2P terminal centrally sends a request to the new primary dispatch server in a short time, reducing the burden on the new primary dispatch server.
  • the terminal topology version number and the terminal identifier may not be mutually independent identifiers, but may be integrated into one identifier.
  • the terminal topology version number may be part of the terminal identifier, and the new master scheduling server is a P2P terminal.
  • the terminal identifier is assigned, the provided terminal identifier includes the terminal topology version number.
  • the terminal identifier may be specified by the scheduling server, or the P2P terminal may itself identify a terminal identifier that can uniquely identify itself, such as a network card address of the P2P terminal.
  • the new primary dispatch server only needs to discover the P2P terminal in any case.
  • the P2P topology relationship is not the P2P topology relationship maintained by the new primary scheduling server, and the P2P terminal may be required to rejoin the P2P topology relationship.
  • the new primary scheduling server may identify whether the P2P terminal is in the P2P topology relationship maintained by the new primary scheduling server; and the scheduling server actively sends the message carrying the current terminal topology version number to the P2P terminal. In this case, it is also possible for the P2P terminal to check whether it is in the P2P topology relationship maintained by the new primary dispatch server.
  • the message sent by the P2P terminal to the new primary scheduling server may not carry the terminal. Topology version number.
  • the standby scheduling server can refer to a scheduling server that does not maintain any P2P topology relationship, that is, a dedicated standby scheduling server that is the primary scheduling server, or that is maintaining other P2P extensions.
  • the scheduling server of the Park relationship that is, the dedicated scheduling server that is not the primary scheduling server, but the primary scheduling server that maintains other P2P topology relationships.
  • the scheduling server that maintains other P2P topology relationships is maintained. It is equivalent to the new primary scheduling server, which provides scheduling services for P2P terminals in the P2P topology relationship maintained by the original primary scheduling server.
  • embodiments of the scheduling server providing scheduling services can be applied to a wide variety of scenarios. For example, when the primary dispatch server fails and the standby dispatch server starts, the standby dispatch server can use this embodiment. For example, when a scheduling server needs to re-establish a P2P topology relationship due to the loss of the originally maintained P2P topology, etc., such an embodiment can also be used.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

A main-spare realizing method for dispatch servers, a dispatch server, a dispatch server system and a method for providing dispatch service by dispatch server, the main-spare realizing method for dispatch servers includes the following steps. A spare dispatch server determines whether a main dispatch server can provide the dispatch service for a client, if the main dispatch server cannot provide the dispatch service for the client, the spare dispatch server provides the dispatch service for the client using a new P2P topological relation under the condition of needing not obtain the P2P topological relation data maintained by the main dispatch server.

Description

调度服务器的主备实现方法及调度服务器  Master and standby implementation method of scheduling server and scheduling server
本申请要求于 2008 年 3 月 28 日提交中国专利局、 申请号为 200810088808.4、 发明名称为"调度服务器的主备实现方法及调度服务器 "的中 国专利申请的优先权, 其全部内容通过引用结合在本申请中。  The present application claims priority to Chinese Patent Application No. 200810088808.4, entitled "Scheduled Server Active and Standby Implementation Method and Scheduling Server", filed on March 28, 2008, the entire contents of which are incorporated by reference. In this application.
技术领域 Technical field
本发明涉及通信技术,尤其涉及调度服务器的主备实现技术及提供调度服 务技术。  The present invention relates to communication technologies, and in particular, to a master-slave implementation technology of a scheduling server and a scheduling service technology.
背景技术 Background technique
传统的客户端 /服务器(C/S, client/server )架构如图 1所示, 每个客户端 ( client )都直接从应用服务器获得数据。  The traditional client/server (C/S, client/server) architecture is shown in Figure 1. Each client receives data directly from the application server.
但是, 对于下载、 视频点播、 直播等应用, 应用服务器需要向客户端传输 大量的数据。 为了减轻传输大量数据给应用服务器和承载网络带来的负担, 本 领域技术人员发展了点对点 (P2P, Peer To Peer )技术。 如图 2所示, 在 P2P 技术中,客户端不仅可以从应用服务器获得数据, 当其他客户端获得同样的数 据后, 所述客户端还可以从所述其他客户端获得数据, 这样就可以减轻应用服 务器和承载网络的压力。  However, for applications such as downloads, video on demand, live broadcasts, etc., the application server needs to transfer a large amount of data to the client. In order to alleviate the burden of transmitting a large amount of data to the application server and the bearer network, those skilled in the art have developed a peer-to-peer (P2P) technology. As shown in FIG. 2, in the P2P technology, the client can not only obtain data from the application server, but after other clients obtain the same data, the client can also obtain data from the other client, so that the client can alleviate the data. The pressure of application servers and hosting networks.
釆用 P2P技术需要在客户端之间建立 P2P拓朴关系, 即, 建立客户端之 间的数据传输关系。 一般来说, P2P的拓朴管理可以分为集中式拓朴管理和分 布式拓朴管理。对于集中式拓朴管理, 由调度服务器指定客户端之间的数据传 输关系; 对于分布式拓朴管理, 由调度服务器为某个客户端提供一组候选客户 端, 由所述客户端与客户端协商建立数据传输关系。  Using P2P technology requires establishing a P2P topology relationship between clients, that is, establishing a data transmission relationship between clients. In general, P2P topology management can be divided into centralized topology management and distributed topology management. For centralized topology management, the scheduling server specifies the data transmission relationship between the clients; for distributed topology management, the scheduling server provides a client with a set of candidate clients, and the client and the client Negotiate to establish a data transmission relationship.
在集中式拓朴管理技术中,调度服务器需要保存客户端之间的数据传输关 系, 可以说, 调度服务器在集中式拓朴管理技术中起着极其重要的作用, 如果 调度服务器发生故障, 就会使客户端无法加入 P2P拓朴关系中, 已加入 P2P 拓朴关系中的客户端也无法在需要时调整拓朴关系。为避免调度服务器由于发 生故障等原因导致的负面后果, 调度服务器需要釆用冗余备份机制, 即, 部署 两台或两台以上的调度服务器, 当其中一台调度服务器失效时, 其它调度服务 器还可以继续为客户端提供服务。  In the centralized topology management technology, the scheduling server needs to save the data transmission relationship between the clients. It can be said that the scheduling server plays an extremely important role in the centralized topology management technology. If the scheduling server fails, it will The client cannot join the P2P topology relationship. Clients that have joined the P2P topology relationship cannot adjust the topology relationship when needed. In order to avoid the negative consequences of the scheduling server due to failures, the scheduling server needs to use the redundant backup mechanism, that is, deploy two or more scheduling servers. When one of the scheduling servers fails, the other scheduling servers also You can continue to provide services to clients.
传统的冗余备份机制包括如下 3种实现方式: 1.共享存储的冗余备份 The traditional redundant backup mechanism includes the following three implementation methods: 1. Redundant backup of shared storage
在这种实现方式中, P2P拓朴关系数据保存到一个永久存储装置中, 当有 需要时,每个调度服务器都可以从该永久存储装置获得 P2P拓朴关系数据。例 如, 当主调度服务器失效时, 其他调度服务器可以从该永久存储装置获得 P2P 拓朴关系数据, 作为主调度服务器, 继续在原有的 P2P拓朴关系基础上维护 P2P拓朴关系。  In this implementation, the P2P topology relationship data is saved to a persistent storage device, and each scheduling server can obtain P2P topology relationship data from the persistent storage device when needed. For example, when the primary scheduling server fails, other scheduling servers can obtain P2P topology relationship data from the persistent storage device as the primary scheduling server, and continue to maintain the P2P topology relationship based on the original P2P topology relationship.
虽然上述实现方式可以实现调度服务器的主备切换,但发明人经过仔细分 析后发现: 访问永久存储装置要比访问内存的性能低很多; 另外, P2P拓朴关 系的每次变化都要写入永久存储装置中, 这将严重影响调度服务器的性能; 此 外,使用永久存储装置会增加成本,并且永久存储装置本身也存在失效的风险。  Although the above implementation can implement the active/standby switchover of the dispatch server, the inventors have carefully analyzed and found that: accessing the permanent storage device is much lower than the performance of accessing the memory; in addition, each change of the P2P topology relationship is written permanently. In a storage device, this will seriously affect the performance of the dispatch server; in addition, the use of permanent storage increases the cost, and the permanent storage itself is also at risk of failure.
2.实时完全同步的冗余备份  2. Real-time fully synchronized redundant backup
在这种实现方式中,主调度服务器实时将 P2P拓朴关系数据传输到所有的 备调度服务器保存, 当主备切换后, 备调度服务器根据实时同步得到的数据, 在原有的 P2P拓朴关系基础上维护 P2P拓朴关系。  In this implementation manner, the primary scheduling server transmits the P2P topology relationship data to all the standby scheduling servers in real time. After the active/standby switchover, the standby scheduling server bases on the original P2P topology relationship based on the data obtained by the real-time synchronization. Maintain P2P topology relationships.
虽然上述实现方式也能够实现调度服务器的主备切换,但发明人经过仔细 分析后发现: 由于 P2P拓朴关系数据量很大, 所以网络传输开销也会很大, 以 支持 10万在线客户端、每个客户端使用 10字节为例,为传输 P2P拓朴关系数 据, 就得需要 1M字节的传输空间; 另外, 为了保证 P2P拓朴关系数据的一致 性, 在同步过程中, 主调度服务器不能修改拓朴, 必须等待同步完成后, 才可 以继续为客户端提供调度功能, 这样就严重影响了调度服务器的性能。  Although the above implementation manner can also implement the active/standby switchover of the scheduling server, the inventors have carefully analyzed and found that: Due to the large amount of data of the P2P topology relationship, the network transmission overhead is also large, to support 100,000 online clients, Each client uses 10 bytes as an example. In order to transmit P2P topology data, a transmission space of 1 Mbyte is required. In addition, in order to ensure the consistency of P2P topology data, in the synchronization process, the main scheduling server You cannot modify the topology. You must wait for the synchronization to complete before you can continue to provide scheduling functions for the client. This seriously affects the performance of the scheduling server.
3.实时增量同步的冗余备份  3. Redundant backup of real-time incremental synchronization
在这种实现方式中, 主调度服务器在每次修改 P2P拓朴关系时, 只将 P2P 拓朴关系数据中修改的部分发给备调度服务器。  In this implementation manner, the primary scheduling server sends only the modified part of the P2P topology relationship data to the standby scheduling server each time the P2P topology relationship is modified.
虽然上述实现方式仍然能够实现调度服务器的主备切换,但发明人经过仔 细分析后发现: 这种方式实现起来非常复杂, 会增加软件出错的概率, 由于 P2P拓朴关系数据是相互关联的,一个地方出错, 就可能造成整个 P2P拓朴关 系不可用; 其次, 某些情况下, P2P拓朴关系数据还是需要完全同步的, 例如, 在备调度服务器发生故障的情况下, 主调度服务器需要等备调度服务器恢复 后, 一次性的将 P2P拓朴关系数据同步到备调度服务器; 有时, 主调度服务器 也可以将所有修改的数据保存下来,待备调度服务器恢复后,再将所有修改的 数据同步到备调度服务器,但如果备调度服务器恢复时间过长, 那么累积的修 改的数据可能会超过一次性同步的数据量,甚至超过主调度服务器所能使用的 最大空间。 Although the above implementation can still implement the active/standby switchover of the scheduling server, the inventors have carefully analyzed and found that: This method is very complicated to implement, and will increase the probability of software errors. Since the P2P topology data is interrelated, one If the local error occurs, the entire P2P topology relationship may be unavailable. Secondly, in some cases, the P2P topology relationship data needs to be completely synchronized. For example, in the case of a failure of the standby scheduling server, the primary scheduling server needs to be prepared. After the scheduling server is restored, the P2P topology relationship data is synchronized to the standby scheduling server at one time; sometimes, the primary scheduling server You can also save all the modified data. After the standby server is restored, all the modified data is synchronized to the standby scheduling server. However, if the standby scheduling server recovers too long, the accumulated modified data may exceed the one-time. The amount of data being synchronized is even greater than the maximum space available to the primary dispatch server.
由此可见,上述几种冗余备份机制都存在性能、成本或可靠性方面的缺陷。 发明内容  It can be seen that the above several redundant backup mechanisms have defects in performance, cost or reliability. Summary of the invention
本发明实施例要解决的技术问题在于提供一种调度服务器的主备实现方 法、 备调度服务器、 调度服务器系统、 提供调度服务的方法及调度服务器, 用 以在达到调度服务器冗余备份目的的同时,解决上述几种冗余备份机制存在的 缺陷。  The technical problem to be solved by the embodiments of the present invention is to provide a master/slave implementation method of a scheduling server, a standby scheduling server, a scheduling server system, a method for providing a scheduling service, and a scheduling server, which are used to achieve the purpose of redundancy backup of the scheduling server. To solve the defects of the above several redundant backup mechanisms.
为解决上述技术问题, 本发明实施例提供一种调度服务器的主备实现方 法, 包括: 备调度服务器确定主调度服务器是否能为客户端提供调度服务; 如 果主调度服务器不能为客户端提供调度服务,则所述备调度服务器在无须获得 主调度服务器维护的 P2P拓朴关系数据的条件下, 使用新的 P2P拓朴关系为 客户端提供调度服务。  To solve the above technical problem, an embodiment of the present invention provides a method for implementing a master/slave of a scheduling server, including: the standby scheduling server determines whether the primary scheduling server can provide a scheduling service for the client; if the primary scheduling server cannot provide a scheduling service for the client The standby scheduling server provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
本发明实施例还提供一种调度服务器, 包括: 第一检测单元, 用于检测主 调度服务器是否能为客户端提供调度服务; 调度服务提供单元, 用于如果第一 检测单元确定出主调度服务器不能为客户端提供调度服务,则在无须获得主调 度服务器维护的 P2P拓朴关系数据的条件下, 使用新的 P2P拓朴关系为客户 端提供调度服务。  The embodiment of the present invention further provides a scheduling server, including: a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client; and a scheduling service providing unit, configured to: if the first detecting unit determines the primary scheduling server If the scheduling service cannot be provided for the client, the scheduling service is provided to the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
本发明实施例还提供一种调度服务器系统, 包括: 主调度服务器, 用于为 客户端提供调度服务; 至少一个备调度服务器, 当所述主调度服务器不能为客 户端提供调度服务时,其中的一个备调度服务器在无须获得主调度服务器维护 的 P2P拓朴关系数据的条件下, 使用新的 P2P拓朴关系为客户端提供调度服 务。  The embodiment of the present invention further provides a scheduling server system, including: a primary scheduling server, configured to provide a scheduling service for a client; at least one standby scheduling server, when the primary scheduling server cannot provide a scheduling service for the client, where A standby scheduling server provides scheduling services for clients by using a new P2P topology relationship without obtaining P2P topology data maintained by the primary scheduling server.
本发明实施例还提供一种调度服务器提供调度服务的方法, 包括: 调度服 务器在重新工作时,确定是否能够获得所述调度服务器原来维护的 P2P拓朴关 系数据;如果不是,则所述调度服务器使用新的 P2P拓朴关系为客户端提供调 度服务。 本发明实施例还提供一种调度服务器, 包括: 确定单元, 在所述调度服务 器重新工作时,用于确定是否能够获得原来维护的 P2P拓朴关系数据;调度服 务提供单元 ,用于在所述确定单元确定不能获得原来维护的 P2P拓朴关系数据 后, 使用新的 P2P拓朴关系为客户端提供调度服务。 The embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: when the scheduling server is re-working, determining whether the P2P topology relationship data originally maintained by the scheduling server can be obtained; if not, the scheduling server Provide scheduling services for clients using new P2P topology relationships. The embodiment of the present invention further provides a scheduling server, including: a determining unit, configured to determine whether the originally maintained P2P topology relationship data can be obtained when the scheduling server is re-working; and a scheduling service providing unit, configured to After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, the new P2P topology relationship is used to provide a scheduling service for the client.
本发明实施例还提供一种调度服务器提供调度服务的方法, 包括: 所述调 度服务器与客户端进行消息交互;如果所述客户端需要加入所述调度服务器当 前维护的 P2P拓朴关系中 ,则所述调度服务器将其用于识别所述客户端的信息 提供给所述客户端。  The embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: the scheduling server performs message interaction with a client; if the client needs to join a P2P topology relationship currently maintained by the scheduling server, The dispatch server provides information for identifying the client to the client.
本发明实施例还提供一种调度服务器, 包括: 消息交互单元, 用于与客户 端进行消息交互; 信息提供单元, 用于如果所述客户端需要加入所述调度服务 器当前维护的 P2P拓朴关系中,则将所述调度服务器用于识别所述客户端的信 息提供给所述客户端。  The embodiment of the present invention further provides a scheduling server, including: a message interaction unit, configured to perform message interaction with a client; and an information providing unit, configured to: if the client needs to join a P2P topology relationship currently maintained by the scheduling server And providing, by the scheduling server, information for identifying the client to the client.
在本发明的调度服务器的主备实现实施例中,如果主备调度服务器发生切 换, 则备调用服务器无须获得主调度服务器维护的 P2P拓朴关系数据, 当然, 备调用服务器也无须存储主调度服务器维护的 P2P拓朴关系数据。这样, 虽然 备调用服务器不能对主调度服务器维护的 P2P拓朴关系进行维护 ,但仍然可以 保证 P2P拓朴关系中的上下级节点正常传输数据,当其中的一个节点需要加入 备调用服务器维护的 P2P拓朴关系时,只需将这个节点加入备调用服务器维护 的 P2P拓朴关系中即可。 所以, 本发明的实施例无需备调度服务器具有存储 P2P拓朴关系数据的存储装置, 节省了成本; 本发明的实施例也无需主调度服 务器向备调度服务器同步 P2P拓朴关系数据,从而提高了点对点数据传输的可 靠性。  In the active/standby implementation of the scheduling server of the present invention, if the active/standby scheduling server is switched, the standby calling server does not need to obtain the P2P topology relationship data maintained by the primary scheduling server. Of course, the standby calling server does not need to store the primary scheduling server. Maintain P2P topology relationship data. In this way, although the standby server cannot maintain the P2P topology relationship maintained by the primary scheduling server, it can still ensure that the upper and lower nodes in the P2P topology relationship transmit data normally, and one of the nodes needs to join the P2P maintained by the standby calling server. In the topology relationship, you only need to add this node to the P2P topology relationship maintained by the standby server. Therefore, the embodiment of the present invention does not require the storage server to store the P2P topology relationship data, which saves the cost. The embodiment of the present invention does not need the primary scheduling server to synchronize the P2P topology relationship data with the standby scheduling server, thereby improving the The reliability of point-to-point data transmission.
在本发明的调度服务器提供调度服务的一个实施例中,如果调度服务器重 新工作, 即使不能获得原来维护的 P2P拓朴关系数据, 但仍然可以使用新的 P2P拓朴关系为客户端提供调度服务,从而解决了一旦调度服务器不能获得原 来维护的 P2P拓朴关系数据就不能提供调度服务的问题。  In an embodiment in which the scheduling server of the present invention provides the scheduling service, if the scheduling server is re-working, even if the originally maintained P2P topology relationship data cannot be obtained, the scheduling service can be provided to the client by using the new P2P topology relationship. Therefore, the problem that the scheduling service cannot be provided once the scheduling server cannot obtain the originally maintained P2P topology relationship data is solved.
在本发明的调度服务器提供调度服务的另一个实施例中,只要客户端需要 加入所述调度服务器维护的 P2P拓朴关系中时,就将调度服务器用于识别所述 客户端的信息提供给所述客户端,这样就能保证调度服务器为客户端提供调度 服务时,能确定客户端是否已在其维护的 P2P拓朴关系中,从而提供相应的调 度服务。 In another embodiment in which the scheduling server of the present invention provides a scheduling service, as long as the client needs to join the P2P topology relationship maintained by the scheduling server, the information used by the scheduling server to identify the client is provided to the Client, this will ensure that the scheduling server provides scheduling for the client When the service is serviced, it can be determined whether the client is already in the P2P topology relationship maintained by the client, thereby providing a corresponding scheduling service.
附图说明 DRAWINGS
图 1为现有的客户端 /服务器架构示意图;  Figure 1 is a schematic diagram of an existing client/server architecture;
图 2为现有的 P2P数据传输示意图;  2 is a schematic diagram of existing P2P data transmission;
图 3为本发明实施例的调度服务器的主备实现方法流程图;  3 is a flowchart of a method for implementing active/standby of a scheduling server according to an embodiment of the present invention;
图 4为本发明实施例的调度服务系统的结构示意图;  4 is a schematic structural diagram of a scheduling service system according to an embodiment of the present invention;
图 5为本发明实施例的 P2P终端加入 P2P拓朴关系时的处理流程图。 具体实施方式  FIG. 5 is a flowchart of processing when a P2P terminal joins a P2P topology relationship according to an embodiment of the present invention. detailed description
首先对本发明实施例的调度服务器的主备实现方法进行说明。 如图 3 所 示, 所述方法包括: 步骤 S301 : 确定主调度服务器是否能为客户端提供调度 服务; 步骤 S302: 如果主调度服务器不能为客户端提供调度服务, 则在无须 获得主调度服务器维护的 P2P拓朴关系数据的条件下,备调度服务器使用新的 P2P拓朴关系为客户端提供调度服务。新的 P2P拓朴关系是相对于主调度服务 器维护的 P2P拓朴关系来说的, 备调度服务器使用的新的 P2P拓朴关系实质 可以指备调度服务器维护的 P2P拓朴关系。当备调度服务器开始工作但还没有 与任何客户端进行消息交互时,其维护的 P2P拓朴关系中只有内容服务器, 随 着更多的客户端加入到备调度服务器维护的 P2P拓朴关系时, P2P拓朴关系中 的节点才增多。  First, the active/standby implementation method of the scheduling server in the embodiment of the present invention will be described. As shown in FIG. 3, the method includes: Step S301: determining whether the primary scheduling server can provide a scheduling service for the client; Step S302: If the primary scheduling server cannot provide the scheduling service for the client, the primary scheduling server maintenance is not required. Under the condition of P2P topology relationship data, the standby scheduling server uses the new P2P topology relationship to provide scheduling services for the client. The new P2P topology relationship is relative to the P2P topology relationship maintained by the primary scheduling server. The new P2P topology relationship used by the standby scheduling server can be used to refer to the P2P topology relationship maintained by the scheduling server. When the standby scheduling server starts working but has not yet communicated with any client, only the content server is maintained in the P2P topology relationship. As more clients join the P2P topology maintained by the standby scheduling server, The number of nodes in the P2P topology relationship increases.
备调度服务器确定主调度服务器是否能为客户端提供调度服务可以由多 种方式实现。 例如, 可以检测主调度服务器是否发生故障或者是否过载, 如果 是, 则确定主调度服务器不能为客户端提供调度服务。 再例如, 可以判断是否 收到主调度服务器或其他网络实体发出的主调度服务器发生故障或者是否过 载的消息, 如果是, 则确定主调度服务器不能为客户端提供调度服务。  The standby scheduling server determines whether the primary scheduling server can provide scheduling services for clients can be implemented in a variety of ways. For example, it can be detected whether the primary scheduling server is faulty or overloaded, and if so, it is determined that the primary scheduling server cannot provide scheduling services for the client. For another example, it may be determined whether a message that the primary scheduling server or other network entity issues a failure or overload of the primary scheduling server is received, and if so, it is determined that the primary scheduling server cannot provide a scheduling service for the client.
备调度服务器使用新的 P2P拓朴关系为客户端提供调度服务可以由多种 方式实现。 例如, 如果客户端需要加入新的 P2P拓朴关系中, 则将所述客户端 加入到新的 P2P拓朴关系中。  The standby scheduling server uses the new P2P topology relationship to provide scheduling services for clients, which can be implemented in a variety of ways. For example, if the client needs to join a new P2P topology relationship, the client is added to the new P2P topology relationship.
新的主调度服务器确定客户端需要加入新的 P2P拓朴关系中之前,需要确 定客户端是否需要加入新的 P2P拓朴关系中,具体可以有多种方式实现。例如, 获得客户端上报的信息,根据所述信息确定客户端是否需要加入新的 P2P拓朴 关系。 具体的, 新的主调度服务器可以首先确定所述客户端是否在新的 P2P 拓朴关系中,如果不是,则确定所述客户端是否需要加入新的 P2P拓朴关系中。 确定所述客户端是否在新的 P2P拓朴关系中也可以由多种方式实现。例如,新 的主调度服务器判断所述客户端上报的用于标识新的 P2P拓朴关系的 P2P拓 朴版本信息和 /或用于标识客户端的客户端信息是否与当前的 P2P拓朴版本信 息和 /或分配给所述客户端的客户端信息一致, 如果是, 则确定所述客户端在 新的 P2P拓朴关系中, 否则, 确定所述客户端不在新的 P2P拓朴关系中。 再 例如,新的主调度服务器向与其进行消息交互的客户端提供用于标识新的 P2P 拓朴关系的 P2P拓朴版本信息和 /或用于标识客户端的客户端信息, 由所述客 户端检查其自身是否在新的 P2P拓朴关系中;如果获得所述客户端上报的所述 客户端在新的 P2P拓朴关系中的信息, 则确定所述客户端在新的 P2P拓朴关 系中; 如果获得所述客户端上报的所述客户端不在新的 P2P拓朴关系中的信 息, 则确定所述客户端不在新的 P2P拓朴关系中。 Before the new master scheduling server determines that the client needs to join the new P2P topology relationship, you need to determine whether the client needs to join the new P2P topology relationship. E.g, Obtain the information reported by the client, and determine whether the client needs to join the new P2P topology relationship according to the information. Specifically, the new primary scheduling server may first determine whether the client is in a new P2P topology relationship, and if not, determine whether the client needs to join a new P2P topology relationship. Determining whether the client is in a new P2P topology relationship can also be implemented in a variety of ways. For example, the new primary scheduling server determines whether the P2P topology version information reported by the client for identifying a new P2P topology relationship and/or the client information used to identify the client is related to the current P2P topology version information and / or the client information assigned to the client is consistent, and if so, the client is determined to be in a new P2P topology relationship, otherwise, the client is determined not to be in a new P2P topology relationship. For another example, the new primary scheduling server provides P2P topology version information for identifying a new P2P topology relationship and/or client information for identifying the client to the client with which the message is exchanged, and is checked by the client. Whether it is in a new P2P topology relationship; if the information of the client reported by the client in the new P2P topology relationship is obtained, it is determined that the client is in a new P2P topology relationship; If the information reported by the client that the client is not in the new P2P topology relationship is obtained, it is determined that the client is not in the new P2P topology relationship.
客户端上报的信息可以包括需要加入 P2P拓朴关系的信息、上级节点发生 异常的信息、 更换上级节点的请求信息或自身信息等信息。 自身信息例如是自 身的负荷信息、 自身是否在 P2P拓朴关系中的信息或自身在哪个 P2P拓朴关 系中的信息。下面举例说明。假设原主调度服务器维护的 P2P拓朴关系中的客 户端上报了其仍然在原主调度服务器维护的 P2P拓朴关系中、但自身的负荷较 重的信息, 那么新的主调度服务器就可以根据其上报的信息,确定应该将所述 客户端加入新的 P2P拓朴关系中, 以减少所述客户端的自身负荷, 当然, 由于 新的主调度服务器之前并没有获得原主调度服务器维护的 P2P拓朴关系的数 据, 所以新的主调度服务器会将所述客户端当作一个新的客户端来处理。  The information reported by the client may include information that needs to be added to the P2P topology relationship, information that the upper node is abnormal, request information for replacing the superior node, or information about itself. The self information is, for example, load information of itself, information on whether or not it is in the P2P topology relationship, or information in which P2P topology relationship itself. The following is an example. Assume that the client in the P2P topology relationship maintained by the original primary scheduling server reports the information in the P2P topology relationship maintained by the original primary scheduling server but has a heavy load on its own, so the new primary scheduling server can report it according to its The information determines that the client should be added to the new P2P topology relationship to reduce the load of the client. Of course, since the new primary scheduling server does not obtain the P2P topology relationship maintained by the original primary scheduling server before, Data, so the new master dispatch server treats the client as a new client.
客户端上报的信息也可以包括用于标识新的 P2P拓朴关系的 P2P拓朴版 本信息和 /或用于标识客户端的客户端信息, P2P拓朴版本信息可以是一个标 识, 称为 P2P拓朴版本号, 客户端信息也可以是一个标识, 称为客户端标识。 在所有的调度服务器中, 新的主调度服务器可以利用 P2P拓朴版本信息和 /或 客户端信息识别客户端。这种情况下,如果客户端上报了 P2P拓朴版本信息和 /或客户端信息, 则新的主调度服务器就可以根据 P2P拓朴版本信息和 /或客户 端信息, 判断客户端是否在新的 P2P拓朴关系中, 如果不是, 再确定所述客户 端是否需要加入新的 P2P拓朴关系中。 The information reported by the client may also include P2P topology version information for identifying a new P2P topology relationship and/or client information for identifying the client. The P2P topology version information may be an identifier, which is called a P2P topology. The version number, the client information can also be an identifier, called the client identifier. Among all the scheduling servers, the new primary scheduling server can identify the client using P2P topology version information and/or client information. In this case, if the client reports the P2P topology version information and/or the client information, the new primary scheduling server can be based on the P2P topology version information and/or the client. End information, determine whether the client is in a new P2P topology relationship, and if not, determine whether the client needs to join a new P2P topology relationship.
新的主调度服务器确定客户端需要加入新的 P2P拓朴关系中后,可以为客 户端指定上级节点。 这样, 客户端就可以从上级节点获得 P2P数据。  After the new primary scheduling server determines that the client needs to join the new P2P topology relationship, it can specify the superior node for the client. In this way, the client can obtain P2P data from the superior node.
为客户端指定上级节点的同时或之后,还可以将用于标识新的主调度服务 器维护的 P2P拓朴关系的 P2P拓朴版本信息和 /或用于标识客户端的客户端信 息提供给客户端。 需要说明的是, P2P拓朴版本信息和客户端信息可以整合为 一种信息, 即, 将 P2P拓朴版本信息和客户端信息提供给客户端时, 只需提供 一种信息即可,这种信息既包括 P2P拓朴版本信息的内容,又包括客户端信息 的内容。将客户端加入新的 P2P拓朴关系中之后,每次与客户端交互时, 交互 的消息都可以携带 P2P拓朴版本信息和 /或客户端信息。 需要说明的是, 客户 端信息也可以由客户端上报,而无须新的主调度服务器提供客户端信息。例如, 如果客户端需要加入新的 P2P拓朴关系中,则可以记录客户端自己产生并上报 的用于标识客户端的客户端信息。  The P2P topology version information for identifying the P2P topology relationship maintained by the new primary scheduling server and/or the client information for identifying the client may also be provided to the client at the same time as or after the client is designated with the upper node. It should be noted that the P2P topology version information and the client information can be integrated into one type of information, that is, when the P2P topology version information and the client information are provided to the client, only one type of information can be provided. The information includes both the content of the P2P topology version information and the content of the client information. After the client is added to the new P2P topology relationship, the interactive message can carry P2P topology version information and/or client information each time it interacts with the client. It should be noted that the client information can also be reported by the client without the need for a new primary dispatch server to provide client information. For example, if the client needs to join the new P2P topology relationship, it can record the client information generated and reported by the client to identify the client.
另夕卜,如果客户端需要加入新的 P2P拓朴关系中,则可以记录客户端的信 息。这里的客户端的信息不局限于用于标识客户端的客户端信息,也可以是指 其他类型的与客户端相关的信息。  In addition, if the client needs to join the new P2P topology relationship, the client information can be recorded. The information of the client here is not limited to the client information used to identify the client, but also refers to other types of client-related information.
备调度服务器使用新的 P2P拓朴关系为客户端提供调度服务的另一种实 现方式为,如果原主调度服务器维护的 P2P拓朴关系中的客户端不需要加入新 的 P2P拓朴关系中, 则原主调度服务器维护的 P2P拓朴关系中的客户端仍然 在原主调度服务器维护的 P2P拓朴关系中获得 P2P数据。  Another implementation manner in which the standby scheduling server uses the new P2P topology relationship to provide the scheduling service for the client is that if the client in the P2P topology relationship maintained by the original primary scheduling server does not need to join the new P2P topology relationship, The client in the P2P topology relationship maintained by the original primary scheduling server still obtains P2P data in the P2P topology relationship maintained by the original primary scheduling server.
确定原主调度服务器维护的 P2P拓朴关系中的客户端不需要加入新的 P2P 拓朴关系中之前,需要确定原主调度服务器维护的 P2P拓朴关系中的客户端是 否需要加入新的 P2P拓朴关系中,具体可以由多种方式实现。其中的一种方式 为,获得原主调度服务器维护的 P2P拓朴关系中的客户端上报的信息;根据所 述信息确定所述原主调度服务器维护的 P2P拓朴关系中的客户端是否需要加 入新的 P2P拓朴关系中。 备调度服务器使用新的 P2P拓朴关系为客户端提供 调度服务的另一种实现方式为,如果需要将原来处于一个 P2P拓朴关系中的客 户端加入新的 P2P拓朴关系中 ,则可以指示客户端在指定的时间到达后再退出 原来的 P2P拓朴关系。 例如, 可以指示客户端在 30秒之后再退出原来的 P2P 拓朴关系, 当 30秒过后, 客户端退出原来的 P2P拓朴关系, 加入新的主调度 服务器维护的 P2P拓朴关系。 Before determining whether the client in the P2P topology relationship maintained by the original primary scheduling server does not need to join the new P2P topology relationship, you need to determine whether the client in the P2P topology relationship maintained by the original primary scheduling server needs to join the new P2P topology relationship. In particular, it can be implemented in a variety of ways. One of the methods is: obtaining information reported by the client in the P2P topology relationship maintained by the original primary scheduling server; determining, according to the information, whether the client in the P2P topology relationship maintained by the original primary scheduling server needs to join a new one. P2P topology relationship. Another implementation manner in which the standby scheduling server uses the new P2P topology relationship to provide the scheduling service for the client is that if the client that is originally in a P2P topology relationship needs to be added to the new P2P topology relationship, the indication may be indicated. The client quits after the specified time arrives The original P2P topology relationship. For example, the client can be instructed to quit the original P2P topology relationship after 30 seconds. After 30 seconds, the client exits the original P2P topology relationship and joins the P2P topology relationship maintained by the new primary scheduling server.
上述方法可以由多种形式的装置实现, 其中的一种调度服务器, 包括: 第 一检测单元, 用于检测主调度服务器是否能为客户端提供调度服务; 调度服务 提供单元,用于如果第一检测单元确定出主调度服务器不能为客户端提供调度 服务,则在无须获得主调度服务器维护的 P2P拓朴关系数据的条件下,使用新 的 P2P拓朴关系为客户端提供调度服务。  The foregoing method may be implemented by multiple forms of devices, where the scheduling server includes: a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client; and a scheduling service providing unit, if the first The detecting unit determines that the primary scheduling server cannot provide the scheduling service for the client, and provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
调度服务提供单元包括: 第二检测单元, 用于检测客户端是否需要加入新 的 P2P拓朴关系中; P2P拓朴关系处理单元, 用于如果第二检测单元检测出客 户端需要加入新的 P2P拓朴关系中, 则将客户端加入新的 P2P拓朴关系中。 第二检测单元可以包括: 信息获得单元, 用于获得客户端上报的信息; 确定单 元, 用于根据所述信息确定客户端是否需要加入新的 P2P拓朴关系。  The scheduling service providing unit includes: a second detecting unit, configured to detect whether the client needs to join a new P2P topology relationship; and a P2P topology relationship processing unit, configured to: if the second detecting unit detects that the client needs to join the new P2P In the topology relationship, the client is added to the new P2P topology relationship. The second detecting unit may include: an information obtaining unit, configured to obtain information reported by the client; and a determining unit, configured to determine, according to the information, whether the client needs to join a new P2P topology relationship.
调度服务器还可以包括: 信息记录单元, 用于如果第二检测单元检测出客 户端需要加入新的 P2P拓朴关系中, 则记录客户端的信息。  The scheduling server may further include: an information recording unit, configured to record the information of the client if the second detecting unit detects that the client needs to join the new P2P topology relationship.
除提供上述方法和调度服务器外, 本发明还提供一种调度服务器系统, 包 括: 主调度服务器, 用于为客户端提供调度服务; 至少一个备调度服务器, 当 所述主调度服务器不能为客户端提供调度服务时,其中的一个备调度服务器在 无须获得主调度服务器维护的 P2P拓朴关系数据的条件下, 使用新的 P2P拓 朴关系为客户端提供调度服务。  In addition to providing the above method and scheduling server, the present invention further provides a scheduling server system, including: a primary scheduling server, configured to provide a scheduling service for a client; at least one standby scheduling server, when the primary scheduling server cannot be a client When the scheduling service is provided, one of the standby scheduling servers provides the scheduling service for the client by using the new P2P topology relationship without obtaining the P2P topology relationship data maintained by the primary scheduling server.
调度服务器系统还可以包括消息转发装置,用于转发客户端与能够为客户 端提供调度服务的调度服务器之间的消息, 其中, 当所述主调度服务器不能为 客户端提供调度服务、其中的一个备调度服务器为客户端提供调度服务时, 所 述消息转发装置转发所述为客户端提供调度服务的备调度服务器与客户端之 间的消息。 消息转发装置可以是交换机等设备,也可以是独立于交换机的独立 设备。  The scheduling server system may further include a message forwarding device, configured to forward a message between the client and a scheduling server capable of providing a scheduling service for the client, where the primary scheduling server cannot provide a scheduling service for the client, one of the When the standby scheduling server provides the scheduling service for the client, the message forwarding device forwards the message between the standby scheduling server and the client that provides the scheduling service for the client. The message forwarding device may be a device such as a switch or a separate device independent of the switch.
需要说明的是,上面提到的备调度服务器可以不仅仅是指主调度服务器的 备用调度服务器,其还可以是指正在维护其他 P2P拓朴关系的调度服务器,或 者说, 调度服务器的主备关系都是相对的。 本发明实施例还提供一种调度服务器提供调度服务的方法, 包括: 在重新 工作时, 确定是否能够获得原来维护的 P2P拓朴关系数据; 如果不是, 则使用 新的 P2P拓朴关系为客户端提供调度服务。重新工作可以是指,调度服务器之 前已经为客户端提供调度服务,但由于某种或某些原因导致调度服务器出现死 机或关机等异常现象,致使调度服务器不能再提供调度服务,调度服务器通过 重新启动等方式处理异常后,再重新开始提供调度服务。 不能获得原来维护的 P2P拓朴关系数据也可以有很多种原因, 例如, 调度服务器在不能继续提供调 度服务之前, 没有保存 P2P拓朴关系数据, 这样, 当调度服务器重新启动后, 就无法获得原来维护的 P2P拓朴关系数据。 新的 P2P拓朴关系是相对于调度 服务器原来维护的 P2P拓朴关系来说的。当调度服务器重新开始工作但还没有 与任何客户端进行消息交互时, 其维护的新的 P2P拓朴关系中只有内容服务 器, 随着更多的客户端加入到调度服务器维护的新的 P2P拓朴关系时, 新的 P2P拓朴关系中的节点才增多。 It should be noted that the standby scheduling server mentioned above may refer not only to the standby scheduling server of the primary scheduling server, but also to the scheduling server that is maintaining other P2P topology relationships, or the scheduling relationship of the scheduling server. They are all relative. The embodiment of the present invention further provides a method for the scheduling server to provide the scheduling service, including: determining whether the original maintained P2P topology relationship data can be obtained when re-working; if not, using the new P2P topology relationship as the client Provide scheduling services. Re-work can mean that the scheduling server has already provided the scheduling service for the client, but the scheduling server has an abnormal phenomenon such as a crash or shutdown due to some or some reasons, so that the scheduling server can no longer provide the scheduling service, and the scheduling server restarts. After the exception is handled in an equal manner, the scheduling service is restarted. There is a wide variety of reasons for not being able to obtain the P2P topology data that was originally maintained. For example, the scheduling server does not save the P2P topology relationship data until the scheduling server cannot continue to provide the scheduling service. Thus, when the scheduling server is restarted, the original cannot be obtained. Maintain P2P topology relationship data. The new P2P topology relationship is relative to the P2P topology relationship originally maintained by the dispatch server. When the scheduling server restarts working but has not yet interacted with any client, only the content server is maintained in the new P2P topology relationship, as more clients join the new P2P topology maintained by the scheduling server. When there is a relationship, the number of nodes in the new P2P topology relationship increases.
使用新的 P2P拓朴关系为客户端提供调度服务可以有多种方式实现。 例 如,如果客户端需要加入新的 P2P拓朴关系中,则可以将所述客户端加入到新 的 P2P拓朴关系中。  Using the new P2P topology to provide scheduling services to clients can be implemented in a variety of ways. For example, if the client needs to join a new P2P topology relationship, the client can be added to the new P2P topology relationship.
确定客户端需要加入新的 P2P拓朴关系中之前,可以先确定客户端是否需 要加入新的 P2P拓朴关系中。 确定客户端是否需要加入新的 P2P拓朴关系中 也可以由多种方式实现。 例如, 获得客户端上报的信息; 根据所述信息确定所 述客户端是否需要加入新的 P2P拓朴关系。  Before determining that a client needs to join a new P2P topology, you can determine if the client needs to join the new P2P topology. Determining whether a client needs to join a new P2P topology relationship can also be implemented in a variety of ways. For example, obtaining information reported by the client; determining, according to the information, whether the client needs to join a new P2P topology relationship.
根据所述信息确定所述客户端是否需要加入新的主调度服务器维护的 P2P拓朴关系之前,还可以确定所述客户端是否在新的 P2P拓朴关系中,如果 不是, 则再确定所述客户端是否需要加入新的 P2P拓朴关系中。  Before determining, according to the information, whether the client needs to join the P2P topology relationship maintained by the new primary scheduling server, whether the client is in a new P2P topology relationship, and if not, determining the Whether the client needs to join the new P2P topology relationship.
确定所述客户端是否在新的 P2P拓朴关系中也可以由多种方式实现。 例 如, 判断所述客户端上 >¾的用于标识新的 P2P拓朴关系的 P2P拓朴版本信息 和 /或用于标识客户端的客户端信息是否与当前的 P2P拓朴版本信息和 /或分配 给所述客户端的客户端信息一致,如果是,则确定所述客户端在新的 P2P拓朴 关系中, 否则, 确定所述客户端不在新的 P2P拓朴关系中。 再例如, 向与调度 服务器进行消息交互的客户端提供用于标识新的主调度服务器维护的 P2P拓 朴关系的 P2P拓朴版本信息和 /或用于标识客户端的客户端信息, 由所述客户 端检查其自身是否在新的 P2P拓朴关系中;如果获得所述客户端上报的所述客 户端在新的 P2P拓朴关系中的信息, 则确定所述客户端在新的 P2P拓朴关系 中; 如果获得所述客户端上报的所述客户端不在新的 P2P拓朴关系中的信息, 则确定所述客户端不在新的 P2P拓朴关系中。 Determining whether the client is in a new P2P topology relationship can also be implemented in a variety of ways. For example, determining whether the P2P topology version information used to identify the new P2P topology relationship on the client and/or the client information used to identify the client is related to the current P2P topology version information and/or allocation. The client information to the client is consistent, and if so, the client is determined to be in a new P2P topology relationship, otherwise, the client is determined not to be in a new P2P topology relationship. For another example, a client that performs message interaction with the dispatch server provides a P2P extension for identifying a new primary dispatch server maintenance. P2P topology version information of the Pu relationship and/or client information for identifying the client, the client checking whether it is in a new P2P topology relationship; if obtaining the client reported by the client The information in the new P2P topology relationship is determined to be in the new P2P topology relationship; if the information reported by the client is not in the new P2P topology relationship, It is determined that the client is not in a new P2P topology relationship.
使用新的 P2P拓朴关系为客户端提供调度服务的另一种方式为,如果原来 维护的 P2P拓朴关系中的客户端不需要加入新的 P2P拓朴关系中, 则原来维 护的 P2P拓朴关系中的客户端仍然在原来维护的 P2P拓朴关系中获得 P2P数 据。  Another way to use the new P2P topology relationship to provide scheduling services for clients is to maintain the P2P topology if the clients in the original P2P topology relationship do not need to join the new P2P topology relationship. The client in the relationship still obtains P2P data in the originally maintained P2P topology relationship.
确定原来维护的 P2P拓朴关系中的客户端不需要加入新的 P2P拓朴关系 中之前, 还可以确定原来维护的 P2P拓朴关系中的客户端是否需要加入新的 P2P拓朴关系中。确定原来维护的 P2P拓朴关系中的客户端是否需要加入新的 P2P拓朴关系中的一种方式为,获得原来维护的 P2P拓朴关系中的客户端上报 的信息;根据所述信息确定所述原来维护的 P2P拓朴关系中的客户端是否需要 加入新的 P2P拓朴关系中。  Before determining whether the client in the original P2P topology relationship does not need to join the new P2P topology relationship, you can determine whether the client in the original maintained P2P topology needs to join the new P2P topology relationship. A method for determining whether a client in the P2P topology relationship that is to be maintained needs to be added to a new P2P topology relationship is obtained by obtaining information reported by the client in the originally maintained P2P topology relationship; Whether the client in the original maintained P2P topology needs to join the new P2P topology relationship.
上述方法实施例可以由多种形式的装置实现, 其中的一种调度服务器包 括: 确定单元, 在重新工作时, 用于确定是否能够获得原来维护的 P2P拓朴关 系数据; 调度服务提供单元, 用于在所述确定单元确定不能获得原来维护的 P2P拓朴关系数据后, 使用新的 P2P拓朴关系为客户端提供调度服务。  The foregoing method embodiment may be implemented by multiple forms of devices, and one of the scheduling servers includes: a determining unit, configured to determine whether the originally maintained P2P topology relationship data can be obtained when re-working; the scheduling service providing unit, After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, the new P2P topology relationship is used to provide a scheduling service for the client.
调度服务提供单元可以包括: 检测单元, 用于检测客户端是否需要加入新 的 P2P拓朴关系中; P2P拓朴关系处理单元, 用于如果所述检测单元检测出客 户端需要加入新的 P2P拓朴关系中, 则将所述客户端加入新的 P2P拓朴关系 中。  The scheduling service providing unit may include: a detecting unit, configured to detect whether the client needs to join a new P2P topology relationship; and a P2P topology relationship processing unit, configured to: if the detecting unit detects that the client needs to join a new P2P extension In the Park relationship, the client is added to the new P2P topology relationship.
检测单元可以包括: 信息获得单元, 用于获得客户端上报的信息; 确定单 元, 用于根据所述信息确定所述客户端是否需要加入新的 P2P拓朴关系。  The detecting unit may include: an information obtaining unit, configured to obtain information reported by the client; and a determining unit, configured to determine, according to the information, whether the client needs to join a new P2P topology relationship.
本发明实施例还提供一种调度服务器提供调度服务的方法, 包括: 与客户 端进行消息交互; 如果所述客户端需要加入所述调度服务器当前维护的 P2P 拓朴关系中 ,则将所述调度服务器用于识别所述客户端的信息提供给所述客户 端。 将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后 ,获 得的所述客户端发送的所有或部分消息中可以携带所述调度服务器用于识别 所述客户端的信息。 The embodiment of the present invention further provides a method for a scheduling server to provide a scheduling service, including: performing message interaction with a client; if the client needs to join a P2P topology relationship currently maintained by the scheduling server, the scheduling is performed. Information for the server to identify the client is provided to the client. After the information that the scheduling server uses to identify the client is provided to the client, all or part of the messages sent by the client may be carried by the scheduling server to identify the information of the client.
将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后 ,如 果再次与所述客户端进行消息交互,则还可以再次将所述调度服务器用于识别 所述客户端的信息提供给所述客户端, 由所述客户端检查其自身是否在新的 P2P拓朴关系中;如果获得所述客户端上报的所述客户端在新的 P2P拓朴关系 中的信息,则确定所述客户端在新的 P2P拓朴关系中;如果获得所述客户端上 报的所述客户端不在新的 P2P拓朴关系中的信息,则确定所述客户端不在新的 P2P拓朴关系中。  After the scheduling server is configured to identify that the information of the client is provided to the client, if the message interaction with the client is performed again, the scheduling server may be used again to identify the information provided by the client. To the client, the client checks whether it is in a new P2P topology relationship; if the client reports the information in the new P2P topology relationship, The client is in the new P2P topology relationship; if the information reported by the client is not in the new P2P topology relationship, it is determined that the client is not in the new P2P topology relationship.
将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后 ,如 果再次与所述客户端进行消息交互 ,则根据所述客户端上报的消息中携带的所 述调度服务器用于识别所述客户端的信息, 确定所述客户端是否在新的 P2P 拓朴关系中。  After the scheduling server is configured to identify that the information of the client is provided to the client, if the message is exchanged with the client again, the scheduling server is used according to the message carried in the message reported by the client. Identifying the information of the client to determine whether the client is in a new P2P topology relationship.
所述用于识别客户端的信息包括所述调度服务器当前维护的 P2P拓朴关 系的 P2P拓朴版本信息和 /或用于标识所述客户端的客户端信息提供给所述客 户端。  The information for identifying the client includes P2P topology version information of the P2P topology relationship currently maintained by the scheduling server and/or client information for identifying the client is provided to the client.
上述方法可以由多种形式的装置实现, 其中的一种调度服务器可以包括: 消息交互单元, 用于与客户端进行消息交互; 信息提供单元, 用于如果客户端 需要加入所述调度服务器当前维护的 P2P拓朴关系中,则将所述调度服务器用 于识别所述客户端的信息提供给客户端。  The foregoing method may be implemented by multiple forms of devices, and one of the scheduling servers may include: a message interaction unit, configured to perform message interaction with the client; and an information providing unit, configured to perform current maintenance if the client needs to join the scheduling server In the P2P topology relationship, the information used by the scheduling server to identify the client is provided to the client.
下面对本发明的实施例进行详细说明。  The embodiments of the present invention are described in detail below.
如图 4所示, 调度服务器 1、 调度服务器 2及消息转发装置组成一个调度 服务器系统, 与 P2P终端(即上文提到的客户端)进行交互。 在同一时刻, 调 度服务器 1和调度服务器 2中只有一个调度服务器接收并处理 P2P终端的请 求, 并且备调度服务器需要监控主调度服务器是否失效。如果备调度服务器发 现主调度服务器失效,备调度服务器就需要作为主调度服务器,与 P2P终端进 行交互,原来的主调度服务器恢复后, 可以作为备调度服务器。对于 P2P终端 而言, 与其交互的是调度服务器装置, 而不是调度服务器 1和调度服务器 2。 每个调度服务器都包括终端请求处理器、服务侧终端拓朴管理器、终端拓 朴单元、 终端拓朴版本号管理器和监控单元。 其中, 终端请求处理器负责接收 并处理 P2P终端的请求, 服务侧终端拓朴管理器负责查询和更新 P2P终端的 拓朴,终端拓朴单元负责保存 P2P终端的拓朴,终端拓朴版本号管理器负责维 护 P2P终端当前的拓朴版本号(即上文提到的 P2P拓朴版本信息 ), 监控单元 负责检测对端是否失效、触发主备切换以及进行主备调度服务器之间的数据同 步, 其中, 同步的数据指配置参数等少量数据, 不包含大数据量的 P2P拓朴关 系数据。 As shown in FIG. 4, the scheduling server 1, the scheduling server 2, and the message forwarding device form a scheduling server system, and interact with the P2P terminal (ie, the client mentioned above). At the same time, only one of the dispatching server 1 and the dispatching server 2 receives and processes the request of the P2P terminal, and the standby dispatching server needs to monitor whether the primary dispatching server is invalid. If the standby scheduling server finds that the primary scheduling server is invalid, the standby scheduling server needs to act as the primary scheduling server to interact with the P2P terminal. After the original primary scheduling server is restored, it can serve as the standby scheduling server. For the P2P terminal, it interacts with the scheduling server device instead of the scheduling server 1 and the scheduling server 2. Each scheduling server includes a terminal request processor, a service side terminal topology manager, a terminal topology unit, a terminal topology version number manager, and a monitoring unit. The terminal request processor is responsible for receiving and processing the request of the P2P terminal, and the service side terminal topology manager is responsible for querying and updating the topology of the P2P terminal, and the terminal topology unit is responsible for saving the topology of the P2P terminal, and managing the terminal topology version number. The device is responsible for maintaining the current topology version number of the P2P terminal (that is, the P2P topology version information mentioned above). The monitoring unit is responsible for detecting whether the peer end is invalid, triggering the active/standby switchover, and performing data synchronization between the active and standby dispatch servers. The synchronized data refers to a small amount of data such as configuration parameters, and does not include P2P topology data of a large amount of data.
P2P 终端包括终端侧拓朴管理器、 终端标识单元和终端拓朴版本号管理 器。 终端侧拓朴管理器负责与调度服务器装置交互, 更新上级节点信息。 每个 P2P终端都有一个唯一的终端标识(即上文提到的用于标识客户端的客户端信 息 ), 终端标识单元负责保存终端标识。 每个 P2P终端在第一次加入 P2P拓朴 关系时, 都会从调度服务器装置得到一个终端拓朴版本号, 终端拓朴版本号单 元负责保存终端拓朴版本号。  The P2P terminal includes a terminal side topology manager, a terminal identification unit, and a terminal topology version number manager. The terminal side topology manager is responsible for interacting with the scheduling server device to update the superior node information. Each P2P terminal has a unique terminal identifier (i.e., the client information mentioned above for identifying the client), and the terminal identification unit is responsible for saving the terminal identifier. When the P2P terminal joins the P2P topology relationship for the first time, it obtains a terminal topology version number from the scheduling server device, and the terminal topology version number unit is responsible for saving the terminal topology version number.
每个调度服务器启动时, 终端拓朴版本号管理器需要更新终端拓朴版本 号, 以标识这次启动后新建的 P2P拓朴关系。每次生成新的拓朴版本号时, 必 须保证新的拓朴版本号在一段时间内不与主备调度服务器之前用过的所有拓 朴版本号重复, 一种简单的实现方式是, 将当前时间 (可以精确到秒)与服务 器的网卡地址组合作为拓朴版本号。  When each scheduling server is started, the terminal topology version number manager needs to update the terminal topology version number to identify the newly created P2P topology relationship after the startup. Each time a new topology version number is generated, it must be ensured that the new topology version number does not overlap with all the topology version numbers used by the active and standby scheduling servers for a period of time. A simple implementation is that The time (which can be accurate to the second) is combined with the server's NIC address as the topology version number.
当 P2P终端加入 P2P拓朴关系时, 处理流程如图 5所示:  When a P2P terminal joins a P2P topology relationship, the processing flow is as shown in Figure 5:
步骤 S501 : P2P终端向调度服务器装置发送加入 P2P拓朴关系的请求, 所述请求中包括 P2P终端的信息, 例如 P2P终端的 IP地址、 网卡地址及上下 行带宽等信息。  Step S501: The P2P terminal sends a request for joining the P2P topology relationship to the scheduling server device, where the request includes information of the P2P terminal, for example, information such as an IP address, a network card address, and an uplink and downlink bandwidth of the P2P terminal.
步骤 S502: 调度服务器装置中的消息转发装置收到请求后, 将请求转发 给主调度服务器。  Step S502: After receiving the request, the message forwarding device in the scheduling server device forwards the request to the main scheduling server.
步骤 S503: 主调度服务器的终端请求处理器收到请求后, 为 P2P终端分 配一个唯一的终端标识。  Step S503: After receiving the request, the terminal of the primary scheduling server allocates a unique terminal identifier to the P2P terminal.
步骤 S504: 终端请求处理器调用服务侧终端拓朴管理器, 将 P2P终端加 入 P2P拓朴关系中。 步骤 S505: 服务侧终端拓朴管理器记录 P2P终端的信息, 根据拓朴管理 策略为 P2P终端指定上级节点。 Step S504: The terminal requests the processor to invoke the service side terminal topology manager, and adds the P2P terminal to the P2P topology relationship. Step S505: The service side terminal topology manager records the information of the P2P terminal, and specifies the upper node for the P2P terminal according to the topology management policy.
步骤 S506: 终端请求处理器将服务侧终端拓朴管理器返回的拓朴信息以 及为 P2P终端分配的拓朴版本号返回给 P2P终端。  Step S506: The terminal requesting processor returns the topology information returned by the service side terminal topology manager and the topology version number assigned to the P2P terminal to the P2P terminal.
步骤 S507: P2P终端收到调度服务器装置返回的信息后, 终端侧拓朴管 理器解析这些信息,将信息中的终端标识保存在终端标识单元中,将信息中的 终端拓朴版本号保存在终端拓朴版本号单元,之后,按照信息中的指示连接上 级节点, 并从上级节点获取数据。  Step S507: After the P2P terminal receives the information returned by the scheduling server device, the terminal side topology manager parses the information, saves the terminal identifier in the information in the terminal identification unit, and saves the terminal topology version number in the information in the terminal. The topology version number unit, after which, follow the instructions in the message to connect to the superior node and obtain data from the superior node.
终端侧拓朴管理器连接上级节点后,可以向调度服务器装置发送拓朴更新 请求, 具体可以参见图 5的步骤 S508-S510。  After the terminal-side topology manager is connected to the upper-level node, the topology update request may be sent to the scheduling server device. For details, refer to steps S508-S510 of FIG.
步骤 S508: 终端侧拓朴管理器向调度服务器装置发送拓朴更新请求。 步骤 S509: 主调度服务器的终端请求处理器收到拓朴更新请求后, 调用 服务侧终端拓朴管理器更新拓朴。  Step S508: The terminal side topology manager sends a topology update request to the scheduling server device. Step S509: After receiving the topology update request, the terminal requesting processor of the main scheduling server invokes the service side terminal topology manager to update the topology.
步骤 S510: 服务侧终端拓朴管理器将更新后的拓朴记录到终端拓朴部件 中。  Step S510: The service side terminal topology manager records the updated topology into the terminal topology component.
P2P终端加入 P2P拓朴关系后,可能因为各种原因需要与调度服务器再次 交互。 例如, P2P终端发现上级节点失效, 需要连接新的上级节点; P2P终端 需要将自身负荷情况提供给调度服务器, 以便调度服务器决策是否将所述 P2P 终端作为其它 P2P终端的上级节点。 P2P终端加入 P2P拓朴关系后,每次向调 度服务器发送消息时, 消息中都可以携带终端拓朴版本号。  After a P2P terminal joins a P2P topology relationship, it may need to interact with the scheduling server again for various reasons. For example, the P2P terminal finds that the upper node fails and needs to connect to the new upper node; the P2P terminal needs to provide its own load condition to the scheduling server, so that the scheduling server decides whether to use the P2P terminal as the upper node of the other P2P terminal. After the P2P terminal joins the P2P topology relationship, each time the message is sent to the scheduling server, the message can carry the terminal topology version number.
当主调度服务器失效导致主备切换时,备调度服务器启动,作为新的主调 度服务器为 P2P终端提供调度服务。新的主调度服务器启动时,使用新的终端 拓朴版本号作为当前的终端拓朴版本号, 原来的 P2P拓朴关系可以继续存在, 即, 并不需要完全调整 P2P拓朴关系, 只有当 P2P终端需要加入新的主调度 服务器维护的 P2P拓朴关系时, 才将 P2P终端加入新的主调度服务器维护的 P2P拓朴关系。例如,如果原主调度服务器维护的 P2P拓朴关系中的 P2P终端 由于上级节点退出等原因导致无法使用原来的 P2P拓朴关系继续获取数据,则 退出原来的 P2P拓朴关系, 加入新的 P2P拓朴关系。 具体的, 新的主调度服 务器可以将当前的终端拓朴版本号和 P2P终端发出的消息中携带的终端拓朴 版本号进行比较, 判断 P2P终端所在的 P2P拓朴关系是否是新的主调度服务 器当前维护的 P2P拓朴关系, 如果是, 则将 P2P终端加入新的主调度服务器 维护的 P2P拓朴关系,否则,可以根据请求的内容等因素进行如下不同的处理:When the primary scheduling server fails, the standby scheduling server is started, and the new primary scheduling server provides scheduling services for the P2P terminal. When the new primary scheduling server is started, the new terminal topology version number is used as the current terminal topology version number. The original P2P topology relationship can continue to exist, that is, the P2P topology relationship does not need to be completely adjusted, only when P2P is used. When the terminal needs to join the P2P topology relationship maintained by the new primary scheduling server, the P2P terminal is added to the P2P topology relationship maintained by the new primary scheduling server. For example, if the P2P terminal in the P2P topology relationship maintained by the original primary scheduling server cannot be used to obtain data due to the original P2P topology relationship due to the exit of the upper-level node, etc., the original P2P topology relationship is exited, and a new P2P topology is added. relationship. Specifically, the new primary scheduling server may use the current terminal topology version number and the terminal topology carried in the message sent by the P2P terminal. The version number is compared to determine whether the P2P topology relationship of the P2P terminal is the P2P topology relationship currently maintained by the new primary scheduling server. If yes, the P2P terminal is added to the P2P topology relationship maintained by the new primary scheduling server. Otherwise, According to the content of the request and other factors, the following different treatments can be performed:
1.如果 P2P终端上报自身信息 (例如当前的上下行带宽 ), 则新的主调度 服务器可以忽略这一请求, P2P终端可以继续依靠原来的 P2P拓朴关系获取数 据; 1. If the P2P terminal reports its own information (such as the current uplink and downlink bandwidth), the new primary scheduling server can ignore the request, and the P2P terminal can continue to rely on the original P2P topology relationship to obtain data.
2.如果 P2P终端上报其上级节点异常和 /或自行调整了上级节点, 则由于 P2P终端可能已经自行更换了上级节点,新的主调度服务器也可以忽略这一请 求, 让 P2P终端自行维护 P2P拓朴关系;  2. If the P2P terminal reports that its superior node is abnormal and/or adjusts the upper node by itself, the P2P terminal may have replaced the upper node by itself, and the new primary scheduling server may also ignore the request, so that the P2P terminal maintains the P2P extension itself. Park relationship;
3.如果 P2P终端需要退出 P2P拓朴关系,则新的主调度服务器可以忽略这 一请求;  3. If the P2P terminal needs to exit the P2P topology relationship, the new primary scheduling server can ignore the request;
4.如果 P2P终端需要再次加入 P2P拓朴关系,则新的主调度服务器将 P2P 终端加入新的主调度服务器维护的某个 P2P拓朴关系, 并向 P2P终端返回新 的终端拓朴版本号, P2P终端更新保存的终端拓朴版本号;  4. If the P2P terminal needs to join the P2P topology relationship again, the new primary scheduling server adds the P2P terminal to a P2P topology relationship maintained by the new primary scheduling server, and returns a new terminal topology version number to the P2P terminal. The P2P terminal updates the saved terminal topology version number;
5.如果 P2P终端因为其上级节点故障需要调整上级节点,则新的主调度服 务器可以向 P2P终端返回终端拓朴版本号错误的消息, P2P终端收到错误消息 后, 断开与其它终端的所有连接, 重新请求加入新的 P2P拓朴关系。 由于一个 P2P终端的退出可能引起其下级终端退出, 而其下级终端的退出可能又会引起 更多的 P2P终端的退出,这种链锁反应可能会导致新的主调度服务器在一段时 间内超负荷运行。 为避免这种连锁反应, P2P终端可以在退出原来的 P2P拓朴 关系前, 随机等待一段时间后, 再退出原来的 P2P拓朴关系,之后再加入新的 P2P拓朴关系,这样就避免了大量的 P2P终端在短时间内集中向新的主调度服 务器发送请求, 减轻了新的主调度服务器的负担。  5. If the P2P terminal needs to adjust the upper node because its upper node is faulty, the new primary scheduling server can return the terminal topology version number error message to the P2P terminal. After receiving the error message, the P2P terminal disconnects all the other terminals. Connect, re-request to join the new P2P topology relationship. Since the exit of one P2P terminal may cause its lower-level terminal to exit, and the exit of its lower-level terminal may cause more P2P terminal to exit, this chain-locking reaction may cause the new primary dispatching server to be overloaded for a period of time. run. In order to avoid this kind of chain reaction, the P2P terminal can wait for a period of time before exiting the original P2P topology relationship, then exit the original P2P topology relationship, and then add a new P2P topology relationship, thus avoiding a large number of The P2P terminal centrally sends a request to the new primary dispatch server in a short time, reducing the burden on the new primary dispatch server.
在实际应用中, 终端拓朴版本号与终端标识可以不是相互独立的标识, 而 是可以整合为一个标识, 例如, 终端拓朴版本号可以作为终端标识的一部分, 新的主调度服务器为 P2P终端分配终端标识时,提供的终端标识就包括了终端 拓朴版本号。 另外, 终端标识可以由调度服务器指定, 也可以由 P2P终端自行 上才艮一个可以唯一标识其自身的终端标识, 例如 P2P终端的网卡地址。  In practical applications, the terminal topology version number and the terminal identifier may not be mutually independent identifiers, but may be integrated into one identifier. For example, the terminal topology version number may be part of the terminal identifier, and the new master scheduling server is a P2P terminal. When the terminal identifier is assigned, the provided terminal identifier includes the terminal topology version number. In addition, the terminal identifier may be specified by the scheduling server, or the P2P terminal may itself identify a terminal identifier that can uniquely identify itself, such as a network card address of the P2P terminal.
在实际应用中,不论何种情况下,新的主调度服务器只要发现 P2P终端所 在的 P2P拓朴关系不是新的主调度服务器维护的 P2P拓朴关系, 都可以要求 P2P终端重新加入 P2P拓朴关系。 In practical applications, the new primary dispatch server only needs to discover the P2P terminal in any case. The P2P topology relationship is not the P2P topology relationship maintained by the new primary scheduling server, and the P2P terminal may be required to rejoin the P2P topology relationship.
在实际应用中,可以由新的主调度服务器识别 P2P终端是否在新的主调度 服务器维护的 P2P拓朴关系中; 在调度服务器主动向 P2P终端发送携带有当 前的终端拓朴版本号的消息的情况下,也可以由 P2P终端来检查其自身是否在 新的主调度服务器维护的 P2P拓朴关系中。  In a practical application, the new primary scheduling server may identify whether the P2P terminal is in the P2P topology relationship maintained by the new primary scheduling server; and the scheduling server actively sends the message carrying the current terminal topology version number to the P2P terminal. In this case, it is also possible for the P2P terminal to check whether it is in the P2P topology relationship maintained by the new primary dispatch server.
在实际应用中,如果确定在某些场景下可以不检查终端拓朴版本号(例如 P2P终端上报当前的上下行带宽 ), 则 P2P终端向新的主调度服务器发送的消 息中也可以不携带终端拓朴版本号。  In a practical application, if it is determined that the terminal topology version number may not be checked in some scenarios (for example, the P2P terminal reports the current uplink and downlink bandwidth), the message sent by the P2P terminal to the new primary scheduling server may not carry the terminal. Topology version number.
在调度服务器的主备实现实施例中,备调度服务器既可以是指没有维护任 何 P2P拓朴关系的调度服务器, 即, 作为主调度服务器的专用备调度服务器, 也可以是指正在维护其他 P2P拓朴关系的调度服务器, 即,并不是作为主调度 服务器的专用备调度服务器,而是维护其他 P2P拓朴关系的主调度服务器, 当 需要主备切换时,正在维护其他 P2P拓朴关系的调度服务器相当于新的主调度 服务器, 为原主调度服务器维护的 P2P拓朴关系中的 P2P终端提供调度服务。  In the active and standby implementations of the scheduling server, the standby scheduling server can refer to a scheduling server that does not maintain any P2P topology relationship, that is, a dedicated standby scheduling server that is the primary scheduling server, or that is maintaining other P2P extensions. The scheduling server of the Park relationship, that is, the dedicated scheduling server that is not the primary scheduling server, but the primary scheduling server that maintains other P2P topology relationships. When the active/standby switchover is required, the scheduling server that maintains other P2P topology relationships is maintained. It is equivalent to the new primary scheduling server, which provides scheduling services for P2P terminals in the P2P topology relationship maintained by the original primary scheduling server.
最后需要说明的是,调度服务器提供调度服务的实施例可以应用于很多种 场景。 例如, 当主调度服务器发生故障, 备调度服务器启动时, 备调度服务器 可以使用这种实施例。再例如, 当一个调度服务器由于原来维护的 P2P拓朴关 系丟失等原因, 需要重新建立 P2P拓朴关系时, 也可以使用这种实施例。  Finally, it should be noted that embodiments of the scheduling server providing scheduling services can be applied to a wide variety of scenarios. For example, when the primary dispatch server fails and the standby dispatch server starts, the standby dispatch server can use this embodiment. For example, when a scheduling server needs to re-establish a P2P topology relationship due to the loss of the originally maintained P2P topology, etc., such an embodiment can also be used.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算 机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。 其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体(Random Access Memory, RAM )等。  A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium, the program When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通 技术人员来说, 在不脱离本发明原理的前提下, 还可以作出若干改进和润饰, 这些改进和润饰也应视为本发明的保护范围。  The above description is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It is considered as the scope of protection of the present invention.

Claims

权 利 要 求 Rights request
1.一种调度服务器的主备实现方法, 其特征在于, 包括:  An active/standby implementation method of a scheduling server, comprising:
备调度服务器确定主调度服务器是否能为客户端提供调度服务; 如果主调度服务器不能为客户端提供调度服务,则所述备调度服务器在无 须获得主调度服务器维护的 P2P拓朴关系数据的条件下, 使用新的 P2P拓朴 关系为客户端提供调度服务。  The standby scheduling server determines whether the primary scheduling server can provide a scheduling service for the client; if the primary scheduling server cannot provide the scheduling service for the client, the standby scheduling server does not need to obtain the P2P topology relationship data maintained by the primary scheduling server. Use the new P2P topology to provide scheduling services for clients.
2.如权利要求 1所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器确定主调度服务器是否能为客户端提供调度服务具体为:所述备调 度服务器检测主调度服务器是否发生故障或者是否过载, 如果是, 则确定主调 度服务器不能为客户端提供调度服务。  The active/standby implementation method of the scheduling server according to claim 1, wherein the standby scheduling server determines whether the primary scheduling server can provide a scheduling service for the client, where the standby scheduling server detects the primary scheduling server. Whether a fault has occurred or is overloaded, and if so, it is determined that the primary dispatch server cannot provide a scheduling service for the client.
3.如权利要求 1所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器确定客户端是否需要加入新的 P2P拓朴关系中,所述备调度服务器 按照下述方式确定客户端是否需要加入新的 P2P拓朴关系中:  The master/slave implementation method of the scheduling server according to claim 1, wherein the standby scheduling server determines whether the client needs to join a new P2P topology relationship, and the standby scheduling server determines according to the following manner. Whether the client needs to join the new P2P topology relationship:
所述备调度服务器获得客户端上报的信息;  The standby scheduling server obtains information reported by the client;
所述备调度服务器根据所述信息确定所述客户端是否需要加入新的 P2P 拓朴关系。  The standby scheduling server determines, according to the information, whether the client needs to join a new P2P topology relationship.
4.如权利要求 1所述的调度服务器的主备实现方法, 其特征在于, 所述信 息包括用于标识新的 P2P拓朴关系的 P2P拓朴版本信息和 /或用于标识客户端 的客户端信息。  The active/standby implementation method of the scheduling server according to claim 1, wherein the information includes P2P topology version information for identifying a new P2P topology relationship and/or a client for identifying a client. information.
5.如权利要求 4所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器按照下述方式确定所述客户端是否在新的 P2P拓朴关系中:  The master/slave implementation method of the scheduling server according to claim 4, wherein the standby scheduling server determines whether the client is in a new P2P topology relationship according to the following manner:
所述备调度服务器判断所述客户端上报的用于标识新的 P2P拓朴关系的 P2P拓朴版本信息和 /或用于标识客户端的客户端信息是否与当前的 P2P拓朴 版本信息和 /或分配给所述客户端的客户端信息一致;  The standby scheduling server determines whether the P2P topology version information used by the client to identify a new P2P topology relationship and/or the client information used to identify the client is related to the current P2P topology version information and/or The client information assigned to the client is consistent;
如果是,则所述备调度服务器确定所述客户端在新的 P2P拓朴关系中,否 则, 确定所述客户端不在新的 P2P拓朴关系中。  If yes, the standby scheduling server determines that the client is in a new P2P topology relationship, otherwise, determines that the client is not in a new P2P topology relationship.
6.如权利要求 4所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器按照下述方式确定所述客户端是否在新的 P2P拓朴关系中:  The master/slave implementation method of the scheduling server according to claim 4, wherein the standby scheduling server determines whether the client is in a new P2P topology relationship according to the following manner:
所述备调度服务器向与其进行消息交互的客户端提供用于标识新的 P2P 拓朴关系的 P2P拓朴版本信息和 /或用于标识客户端的客户端信息, 由所述客 户端检查其自身是否在新的 P2P拓朴关系中; The standby scheduling server provides a client for performing message interaction with it to identify a new P2P The P2P topology version information of the topology relationship and/or the client information used to identify the client, and the client checks whether it is in a new P2P topology relationship;
如果所述备调度服务器获得所述客户端上报的所述客户端在新的 P2P拓 朴关系中的信息, 则所述备调度服务器确定所述客户端在新的 P2P拓朴关系 中, 如果所述备调度服务器获得所述客户端上报的所述客户端不在新的 P2P 拓朴关系中的信息,则所述备调度服务器确定所述客户端不在新的 P2P拓朴关 系中。  If the standby scheduling server obtains information about the client in the new P2P topology relationship reported by the client, the standby scheduling server determines that the client is in a new P2P topology relationship, if When the scheduling server obtains the information that the client is not in the new P2P topology relationship, the standby scheduling server determines that the client is not in the new P2P topology relationship.
7.如权利要求 1所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器使用新的 P2P拓朴关系为客户端提供调度服务具体包括:如果主调 度服务器维护的 P2P拓朴关系中的客户端不需要加入新的 P2P拓朴关系中, 则主调度服务器维护的 P2P拓朴关系中的客户端仍然在主调度服务器维护的 P2P拓朴关系中获得 P2P数据。  The active/standby implementation method of the scheduling server according to claim 1, wherein the standby scheduling server uses the new P2P topology relationship to provide scheduling services for the client, including: if the primary scheduling server maintains the P2P extension The client in the P2P relationship does not need to be added to the new P2P topology relationship. The client in the P2P topology relationship maintained by the main scheduling server still obtains P2P data in the P2P topology relationship maintained by the main scheduling server.
8.如权利要求 7所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器确定主调度服务器维护的 P2P拓朴关系中的客户端是否需要加入 新的 P2P拓朴关系中 ,所述备调度服务器按照下述方式确定主调度服务器维护 的 P2P拓朴关系中的客户端是否需要加入新的 P2P拓朴关系中:  The master/slave implementation method of the scheduling server according to claim 7, wherein the standby scheduling server determines whether the client in the P2P topology relationship maintained by the primary scheduling server needs to join a new P2P topology relationship. The standby scheduling server determines whether the client in the P2P topology relationship maintained by the primary scheduling server needs to join the new P2P topology relationship according to the following manner:
所述备调度服务器获得主调度服务器维护的 P2P拓朴关系中的客户端上 报的信息;  The standby scheduling server obtains information reported by the client in the P2P topology relationship maintained by the primary scheduling server;
所述备调度服务器根据所述信息确定所述主调度服务器维护的 P2P拓朴 关系中的客户端是否需要加入新的 P2P拓朴关系中。  The standby scheduling server determines, according to the information, whether the client in the P2P topology relationship maintained by the primary scheduling server needs to join a new P2P topology relationship.
9.如权利要求 1所述的调度服务器的主备实现方法, 其特征在于, 所述备 调度服务器使用新的 P2P拓朴关系为客户端提供调度服务具体为:如果需要将 原来处于一个 P2P拓朴关系中的客户端加入新的 P2P拓朴关系中, 则所述备 调度服务器指示所述客户端在指定的时间到达后再退出原来的 P2P拓朴关系。  The master/slave implementation method of the scheduling server according to claim 1, wherein the standby scheduling server uses the new P2P topology relationship to provide a scheduling service for the client, specifically: if needed, the original P2P extension is required. When the client in the relationship is added to the new P2P topology relationship, the standby scheduling server instructs the client to exit the original P2P topology relationship after the specified time arrives.
10.—种调度服务器, 其特征在于, 包括:  10. A scheduling server, comprising:
第一检测单元, 用于检测主调度服务器是否能为客户端提供调度服务; 调度服务提供单元,用于如果第一检测单元确定出主调度服务器不能为客 户端提供调度服务,则在无须获得主调度服务器维护的 P2P拓朴关系数据的条 件下, 使用新的 P2P拓朴关系为客户端提供调度服务。 a first detecting unit, configured to detect whether the primary scheduling server can provide a scheduling service for the client, and a scheduling service providing unit, configured to: if the first detecting unit determines that the primary scheduling server cannot provide the scheduling service for the client, The scheduling service is provided for the client by using the new P2P topology relationship under the condition that the P2P topology relationship data maintained by the server is scheduled.
11.一种调度服务器系统, 其特征在于, 包括: A dispatch server system, comprising:
主调度服务器, 用于为客户端提供调度服务;  a primary scheduling server, configured to provide a scheduling service for the client;
至少一个备调度服务器,当所述主调度服务器不能为客户端提供调度服务 时,其中的一个备调度服务器在无须获得主调度服务器维护的 P2P拓朴关系数 据的条件下, 使用新的 P2P拓朴关系为客户端提供调度服务。  At least one standby scheduling server, when the primary scheduling server cannot provide scheduling services for the client, one of the standby scheduling servers uses the new P2P topology without obtaining the P2P topology relationship data maintained by the primary scheduling server. Relationships provide scheduling services for clients.
12.—种调度服务器提供调度服务的方法, 其特征在于, 包括:  12. A method for scheduling a server to provide a scheduling service, comprising:
调度服务器在重新工作时,确定是否能够获得所述调度服务器原来维护的 P2P拓朴关系数据;  When the scheduling server is working again, determining whether the P2P topology relationship data originally maintained by the scheduling server can be obtained;
如果不是,则所述调度服务器使用新的 P2P拓朴关系为客户端提供调度服 务。  If not, the scheduling server uses the new P2P topology to provide scheduling services for the client.
13.如权利要求 12所述的调度服务器提供调度服务的方法, 其特征在于, 所述调度服务器确定客户端是否需要加入新的 P2P拓朴关系中 ,所述调度服务 器按照下述方式确定客户端是否需要加入新的 P2P拓朴关系中:  The method for providing a scheduling service by a scheduling server according to claim 12, wherein the scheduling server determines whether a client needs to join a new P2P topology relationship, and the scheduling server determines the client according to the following manner. Need to join the new P2P topology relationship:
所述调度服务器获得客户端上报的信息;  The scheduling server obtains information reported by the client;
所述调度服务器根据所述信息确定所述客户端是否需要加入新的 P2P拓 朴关系。  The scheduling server determines, according to the information, whether the client needs to join a new P2P topology relationship.
14.如权利要求 12所述的调度服务器提供调度服务的方法, 其特征在于, 所述调度服务器使用新的 P2P拓朴关系为客户端提供调度服务具体包括:如果 原来维护的 P2P拓朴关系中的客户端不需要加入新的 P2P拓朴关系中, 则原 来维护的 P2P拓朴关系中的客户端仍然在原来维护的 P2P拓朴关系中获得 P2P 数据。  The method for providing a scheduling service by the scheduling server according to claim 12, wherein the scheduling server provides the scheduling service for the client by using the new P2P topology relationship, specifically: if the original maintained P2P topology relationship is The client does not need to join the new P2P topology relationship, and the client in the original maintained P2P topology relationship still obtains P2P data in the originally maintained P2P topology relationship.
15.如权利要求 14所述的调度服务器提供调度服务的方法, 其特征在于, 所述调度服务器确定原来维护的 P2P拓朴关系中的客户端是否需要加入新的 P2P拓朴关系中,所述调度服务器按照下述方式确定原来维护的 P2P拓朴关系 中的客户端是否需要加入新的 P2P拓朴关系中:  The method for providing a scheduling service by the scheduling server according to claim 14, wherein the scheduling server determines whether a client in the originally maintained P2P topology relationship needs to join a new P2P topology relationship, The scheduling server determines whether the client in the originally maintained P2P topology relationship needs to join the new P2P topology relationship as follows:
所述调度服务器获得原来维护的 P2P拓朴关系中的客户端上报的信息; 所述调度服务器根据所述信息确定所述原来维护的 P2P拓朴关系中的客 户端是否需要加入新的 P2P拓朴关系中。  The scheduling server obtains the information reported by the client in the P2P topology relationship that is originally maintained; the scheduling server determines, according to the information, whether the client in the originally maintained P2P topology relationship needs to join the new P2P topology. In the relationship.
16.—种调度服务器, 其特征在于, 包括: 确定单元, 在所述调度服务器重新工作时, 用于确定是否能够获得原来维 护的 P2P拓朴关系数据; 16. A scheduling server, comprising: a determining unit, configured to determine whether the originally maintained P2P topology relationship data can be obtained when the scheduling server is re-working;
调度服务提供单元, 用于在所述确定单元确定不能获得原来维护的 P2P 拓朴关系数据后, 使用新的 P2P拓朴关系为客户端提供调度服务。  The scheduling service providing unit is configured to provide a scheduling service for the client by using the new P2P topology relationship after the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained.
17.—种调度服务器提供调度服务的方法, 其特征在于, 包括:  17. A method for scheduling a server to provide a scheduling service, the method comprising:
所述调度服务器与客户端进行消息交互;  The scheduling server performs message interaction with the client;
如果所述客户端需要加入所述调度服务器当前维护的 P2P拓朴关系中 ,则 所述调度服务器将其用于识别所述客户端的信息提供给所述客户端。  If the client needs to join the P2P topology relationship currently maintained by the scheduling server, the scheduling server provides information for identifying the client to the client.
18.如权利要求 17所述的提供调度服务的方法, 其特征在于, 所述调度服 务器将其用于识别所述客户端的信息提供给所述客户端之后,如果再次与所述 客户端进行消息交互, 则还包括:  The method for providing a scheduling service according to claim 17, wherein after the scheduling server provides information for identifying the client to the client, if the message is sent again to the client Interaction also includes:
所述调度服务器再次将其用于识别所述客户端的信息提供给所述客户端, 由所述客户端检查其自身是否在新的 P2P拓朴关系中;  The scheduling server again provides information for identifying the client to the client, and the client checks whether it is in a new P2P topology relationship;
如果所述调度服务器获得所述客户端上报的所述客户端在新的 P2P拓朴 关系中的信息,则所述调度服务器确定所述客户端在新的 P2P拓朴关系中,如 果所述调度服务器获得所述客户端上报的所述客户端不在新的 P2P拓朴关系 中的信息, 则所述调度服务器确定所述客户端不在新的 P2P拓朴关系中。  If the scheduling server obtains information about the client in the new P2P topology relationship reported by the client, the scheduling server determines that the client is in a new P2P topology relationship, if the scheduling The server obtains information that the client is not in the new P2P topology relationship, and the scheduling server determines that the client is not in the new P2P topology relationship.
19.如权利要求 17所述的提供调度服务的方法, 其特征在于, 所述调度服 务器将其用于识别所述客户端的信息提供给所述客户端之后,如果再次与所述 客户端进行消息交互,则所述调度服务器根据所述客户端上报的消息中携带的 所述调度服务器用于识别所述客户端的信息,确定所述客户端是否在新的 P2P 拓朴关系中。  The method for providing a scheduling service according to claim 17, wherein after the scheduling server provides information for identifying the client to the client, if the message is sent again to the client In an interaction, the scheduling server determines, according to the information that the scheduling server is used by the scheduling server that is sent by the client, to identify the client, whether the client is in a new P2P topology relationship.
20.—种调度服务器, 其特征在于, 包括:  20. A scheduling server, comprising:
消息交互单元, 用于与客户端进行消息交互;  a message interaction unit, configured to perform message interaction with the client;
信息提供单元,用于如果所述客户端需要加入所述调度服务器当前维护的 An information providing unit, configured to: if the client needs to join the current maintenance of the scheduling server
P2P拓朴关系中,则将所述调度服务器用于识别所述客户端的信息提供给所述 客户端。 In the P2P topology relationship, information used by the scheduling server to identify the client is provided to the client.
PCT/CN2009/070973 2008-03-28 2009-03-24 Main-spare realizing method for dispatch servers and dispatch server WO2009117946A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810088808.4 2008-03-28
CN 200810088808 CN101262369B (en) 2008-03-28 2008-03-28 Master/slave realization method for dispatching server and dispatching server

Publications (1)

Publication Number Publication Date
WO2009117946A1 true WO2009117946A1 (en) 2009-10-01

Family

ID=39962594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/070973 WO2009117946A1 (en) 2008-03-28 2009-03-24 Main-spare realizing method for dispatch servers and dispatch server

Country Status (2)

Country Link
CN (1) CN101262369B (en)
WO (1) WO2009117946A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262369B (en) * 2008-03-28 2011-05-11 华为技术有限公司 Master/slave realization method for dispatching server and dispatching server
CN103124278A (en) * 2011-11-21 2013-05-29 苏州达联信息科技有限公司 Implement method and processing device of primary and standby synchronization information of video distribution network global server
CN102427412A (en) * 2011-12-31 2012-04-25 网宿科技股份有限公司 Zero-delay disaster recovery switching method and system of active standby source based on content distribution network
CN103209136A (en) * 2012-01-11 2013-07-17 中兴通讯股份有限公司 Network load control method and register server
CN104731702B (en) * 2013-12-23 2017-12-26 展讯通信(上海)有限公司 Test system and its service end
CN104734902B (en) * 2013-12-23 2018-03-23 展讯通信(上海)有限公司 Test system and its service end
CN103702226A (en) * 2013-12-31 2014-04-02 广州华多网络科技有限公司 Displaying method and device of direct broadcasting client end channel information
CN110703985B (en) 2016-10-25 2021-05-18 华为技术有限公司 Data synchronization method and out-of-band management equipment
CN107197036A (en) * 2017-06-22 2017-09-22 广东网金控股股份有限公司 A kind of consistent processing method of information based on block chain and terminal
CN112448990B (en) * 2019-09-05 2023-12-05 北京京东尚科信息技术有限公司 Method, device, system and storage medium for guaranteeing service availability

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1604569A (en) * 2004-10-29 2005-04-06 清华大学 A robust point to point based stream scheduling method
US20050283529A1 (en) * 2004-06-22 2005-12-22 Wan-Yen Hsu Method and apparatus for providing redundant connection services
US20070220305A1 (en) * 2006-03-20 2007-09-20 Nec Corporation Multiplex server system and server multiplexing method
CN101060391A (en) * 2007-05-16 2007-10-24 华为技术有限公司 Master and spare server switching method and system and master server and spare server
CN101068186A (en) * 2007-06-05 2007-11-07 华为技术有限公司 Customer end node network topological structure method and stream media distributing system
CN101262369A (en) * 2008-03-28 2008-09-10 华为技术有限公司 Master/slave realization method for dispatching server and dispatching server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050283529A1 (en) * 2004-06-22 2005-12-22 Wan-Yen Hsu Method and apparatus for providing redundant connection services
CN1604569A (en) * 2004-10-29 2005-04-06 清华大学 A robust point to point based stream scheduling method
US20070220305A1 (en) * 2006-03-20 2007-09-20 Nec Corporation Multiplex server system and server multiplexing method
CN101060391A (en) * 2007-05-16 2007-10-24 华为技术有限公司 Master and spare server switching method and system and master server and spare server
CN101068186A (en) * 2007-06-05 2007-11-07 华为技术有限公司 Customer end node network topological structure method and stream media distributing system
CN101262369A (en) * 2008-03-28 2008-09-10 华为技术有限公司 Master/slave realization method for dispatching server and dispatching server

Also Published As

Publication number Publication date
CN101262369A (en) 2008-09-10
CN101262369B (en) 2011-05-11

Similar Documents

Publication Publication Date Title
WO2009117946A1 (en) Main-spare realizing method for dispatch servers and dispatch server
US11172023B2 (en) Data synchronization method and system
CN111565229B (en) Communication system distributed method based on Redis
CN111615066B (en) Distributed micro-service registration and calling method based on broadcast
JP5863942B2 (en) Provision of witness service
KR100812374B1 (en) System and method for managing protocol network failures in a cluster system
US8566440B2 (en) Continuity check method, maintenance end point and system thereof
WO2012174893A1 (en) Dual-center disaster recovery-based switching method and device in iptv system
JP2004280738A (en) Proxy response device
WO2012037787A1 (en) Method and system for terminal access and management in cloud computing
CN112333015B (en) Media data storage method, device, system, electronic equipment and storage medium
WO2020024991A1 (en) Internet of things gateway access method and device, and storage medium
CN111371625A (en) Method for realizing dual-computer hot standby
WO2019174454A1 (en) Link recovery method and device, system, storage medium, and electronic device
WO2020057445A1 (en) Communication system, method, and device
CN112671554A (en) Node fault processing method and related device
US20100082822A1 (en) Technique for realizing high reliability in inter-application communication
US8161147B2 (en) Method of organising servers
KR20140001499A (en) Method and system for managing high availability
WO2021254466A1 (en) Method, apparatus and system for configuring edge side device
KR20200072941A (en) Method and apparatus for handling VRRP(Virtual Router Redundancy Protocol)-based network failure using real-time fault detection
US10536875B2 (en) System and method for seamless TCP connection handoff
WO2012167710A1 (en) Service backup method and system in network with heterogeneous nodes
KR101401006B1 (en) Method and appratus for performing software upgrade in high availability system
TWI397296B (en) Server system and method for user registeration

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: 09723723

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: 09723723

Country of ref document: EP

Kind code of ref document: A1