



技术领域technical field
本发明涉及通信技术,尤其涉及调度服务器的主备实现技术及提供调度服务技术。The invention relates to the communication technology, in particular to the master/backup realization technology of the scheduling server and the technology of providing the scheduling service.
背景技术Background technique
传统的客户端/服务器(C/S,client/server)架构如图1所示,每个客户端(client)都直接从应用服务器获得数据。The traditional client/server (C/S, client/server) architecture is shown in Figure 1, and each client (client) obtains data directly from the application server.
但是,对于下载、视频点播、直播等应用,应用服务器需要向客户端传输大量的数据。为了减轻传输大量数据给应用服务器和承载网络带来的负担,本领域技术人员发展了点对点(P2P,Peer To Peer)技术。如图2所示,在P2P技术中,客户端不仅可以从应用服务器获得数据,当其他客户端获得同样的数据后,所述客户端还可以从所述其他客户端获得数据,这样就可以减轻应用服务器和承载网络的压力。However, for applications such as downloading, video-on-demand, and live broadcasting, the application server needs to transmit a large amount of data to the client. In order to alleviate the burden of transmitting a large amount of data on the application server and the bearer network, those skilled in the art have developed a peer-to-peer (P2P, Peer To Peer) technology. As shown in Figure 2, in P2P technology, the client can not only obtain data from the application server, but also obtain data from other clients after other clients obtain the same data, so that the Pressure on application servers and hosting networks.
采用P2P技术需要在客户端之间建立P2P拓扑关系,即,建立客户端之间的数据传输关系。一般来说,P2P的拓扑管理可以分为集中式拓扑管理和分布式拓扑管理。对于集中式拓扑管理,由调度服务器指定客户端之间的数据传输关系;对于分布式拓扑管理,由调度服务器为某个客户端提供一组候选客户端,由所述客户端与客户端协商建立数据传输关系。Adopting the P2P technology needs to establish a P2P topology relationship between clients, that is, establish 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 clients; for distributed topology management, the scheduling server provides a group of candidate clients for a certain client, and the client negotiates with the client to establish data transfer relationship.
在集中式拓扑管理技术中,调度服务器需要保存客户端之间的数据传输关系,可以说,调度服务器在集中式拓扑管理技术中起着极其重要的作用,如果调度服务器发生故障,就会使客户端无法加入P2P拓扑关系中,已加入P2P拓扑关系中的客户端也无法在需要时调整拓扑关系。为避免调度服务器由于发生故障等原因导致的负面后果,调度服务器需要采用冗余备份机制,即,部署两台或两台以上的调度服务器,当其中一台调度服务器失效时,其它调度服务器还可以继续为客户端提供服务。In the centralized topology management technology, the scheduling server needs to save the data transmission relationship between 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 make the client The client cannot join the P2P topology relationship, and the client that has joined the P2P topology relationship cannot adjust the topology relationship when necessary. In order to avoid the negative consequences caused by the failure of the scheduling server, the scheduling server needs to adopt a redundant backup mechanism, that is, two or more scheduling servers are deployed. When one of the scheduling servers fails, the other scheduling servers can still Continue to serve clients.
传统的冗余备份机制包括如下3种实现方式:The traditional redundancy backup mechanism includes the following three implementation methods:
1.共享存储的冗余备份1. Redundant backup of shared storage
在这种实现方式中,P2P拓扑关系数据保存到一个永久存储装置中,当有需要时,每个调度服务器都可以从该永久存储装置获得P2P拓扑关系数据。例如,当主调度服务器失效时,其他调度服务器可以从该永久存储装置获得P2P拓扑关系数据,作为主调度服务器,继续在原有的P2P拓扑关系基础上维护P2P拓扑关系。In this implementation manner, the P2P topology relationship data is stored in a permanent storage device, and each scheduling server can obtain the P2P topology relationship data from the permanent storage device when necessary. For example, when the main scheduling server fails, other scheduling servers can obtain the P2P topology relationship data from the permanent storage device, and as the main scheduling server, continue to maintain the P2P topology relationship on the basis of the original P2P topology relationship.
虽然上述实现方式可以实现调度服务器的主备切换,但发明人经过仔细分析后发现:访问永久存储装置要比访问内存的性能低很多;另外,P2P拓扑关系的每次变化都要写入永久存储装置中,这将严重影响调度服务器的性能;此外,使用永久存储装置会增加成本,并且永久存储装置本身也存在失效的风险。Although the above implementation method can realize the active-standby switching of the scheduling server, the inventor found after careful analysis: the performance of accessing the permanent storage device is much lower than that of accessing the memory; in addition, every change of the P2P topology relationship must be written into the permanent storage In the device, this will seriously affect the performance of the scheduling server; moreover, the use of persistent storage will increase the cost, and the persistent storage itself has the risk of failure.
2.实时完全同步的冗余备份2. Real-time fully synchronized redundant backup
在这种实现方式中,主调度服务器实时将P2P拓扑关系数据传输到所有的备调度服务器保存,当主备切换后,备调度服务器根据实时同步得到的数据,在原有的P2P拓扑关系基础上维护P2P拓扑关系。In this implementation, the master scheduling server transmits the P2P topology relationship data to all the standby scheduling servers in real time for storage. After the master and standby switchover, the standby scheduling server maintains the P2P topology relationship based on the original P2P topology relationship based on the data obtained through real-time synchronization. topological relationship.
虽然上述实现方式也能够实现调度服务器的主备切换,但发明人经过仔细分析后发现:由于P2P拓扑关系数据量很大,所以网络传输开销也会很大,以支持10万在线客户端、每个客户端使用10字节为例,为传输P2P拓扑关系数据,就得需要1M字节的传输空间;另外,为了保证P2P拓扑关系数据的一致性,在同步过程中,主调度服务器不能修改拓扑,必须等待同步完成后,才可以继续为客户端提供调度功能,这样就严重影响了调度服务器的性能。Although the above-mentioned implementation method can also realize the active-standby switching of the scheduling server, the inventor found after careful analysis: due to the large amount of P2P topology relationship data, the network transmission overhead will also be very large to support 100,000 online clients, each A client uses 10 bytes as an example. In order to transmit P2P topology relationship data, a transmission space of 1M bytes is required; in addition, in order to ensure the consistency of P2P topology relationship data, the main scheduling server cannot modify the topology during the synchronization process. , must wait for the synchronization to be completed before continuing to provide the scheduling function for the client, which seriously affects the performance of the scheduling server.
3.实时增量同步的冗余备份3. Redundant backup for real-time incremental synchronization
在这种实现方式中,主调度服务器在每次修改P2P拓扑关系时,只将P2P拓扑关系数据中修改的部分发给备调度服务器。In this implementation manner, the primary scheduling server only sends 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-mentioned implementation method can still realize the active-standby switching of the scheduling server, the inventor found after careful analysis that this method is very complicated to implement and will increase the probability of software errors. Since the P2P topology relationship data is interrelated, a place If an error occurs, the entire P2P topology relationship may be unavailable; secondly, in some cases, the P2P topology relationship data still needs to be fully synchronized. For example, when the standby scheduling server fails, the primary scheduling server needs to wait for the standby scheduling server to recover. Finally, synchronize the P2P topology relationship data to the standby scheduling server at one time; sometimes, the main scheduling server can also save all the modified data, and then synchronize all the modified data to the standby scheduling server after the standby scheduling server recovers. However, if the recovery time of the standby scheduling server is too long, the accumulated modified data may exceed the amount of data synchronized at one time, or even exceed the maximum space that the primary scheduling server can use.
由此可见,上述几种冗余备份机制都存在性能、成本或可靠性方面的缺陷。It can be seen that the above-mentioned several redundant backup mechanisms all have defects in performance, cost or reliability.
发明内容Contents of the invention
本发明实施例要解决的技术问题在于提供一种调度服务器的主备实现方法、备调度服务器、调度服务器系统、提供调度服务的方法及调度服务器,用以在达到调度服务器冗余备份目的的同时,解决上述几种冗余备份机制存在的缺陷。The technical problem to be solved by the embodiments of the present invention is to provide a method for implementing active and standby dispatching servers, a standby dispatching server, a dispatching server system, a method for providing dispatching services, and a dispatching server, so as to achieve the purpose of redundant backup of dispatching servers , to solve the defects of the above-mentioned several redundant backup mechanisms.
为解决上述技术问题,本发明实施例提供一种调度服务器的主备实现方法,包括:确定主调度服务器是否能为客户端提供调度服务;如果主调度服务器不能为客户端提供调度服务,则在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,备调度服务器使用新的P2P拓扑关系为客户端提供调度服务。In order to solve the above technical problems, an embodiment of the present invention provides a method for implementing active and standby scheduling servers, including: determining whether the active scheduling server can provide scheduling services for clients; if the active scheduling server cannot provide scheduling services for clients, then Under the condition of not needing to obtain the P2P topology relationship data maintained by the main scheduling server, the standby scheduling server uses the new P2P topology relationship to provide scheduling services for the client.
本发明实施例还提供一种备调度服务器,包括:第一检测单元,用于检测主调度服务器是否能为客户端提供调度服务;调度服务提供单元,用于如果第一检测单元确定出主调度服务器不能为客户端提供调度服务,则在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,使用新的P2P拓扑关系为客户端提供调度服务。An embodiment of the present invention also provides a standby scheduling server, including: a first detection unit, configured to detect whether the primary scheduling server can provide scheduling services for clients; a scheduling service providing unit, configured to determine whether the primary scheduling server is If the server cannot provide scheduling service for the client, it uses the new P2P topology relationship to provide scheduling service for the client under the condition that it does not need to obtain the P2P topology relationship data maintained by the main scheduling server.
本发明实施例还提供一种调度服务器系统,包括:主调度服务器,用于为客户端提供调度服务;至少一个备调度服务器,当所述主调度服务器不能为客户端提供调度服务时,其中的一个备调度服务器在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,使用新的P2P拓扑关系为客户端提供调度服务。The embodiment of the present invention also provides a scheduling server system, including: a main scheduling server, used to provide scheduling services for clients; at least one standby scheduling server, when the main scheduling server cannot provide scheduling services for clients, the A standby scheduling server uses the new P2P topology relationship to provide scheduling services for the client without obtaining the P2P topology relationship data maintained by the primary scheduling server.
本发明实施例还提供一种调度服务器提供调度服务的方法,包括:在重新工作时,确定是否能够获得原来维护的P2P拓扑关系数据;如果不是,则使用新的P2P拓扑关系为客户端提供调度服务。The embodiment of the present invention also provides a method for a scheduling server to provide scheduling services, including: when re-working, determine whether the original maintained P2P topology relationship data can be obtained; if not, use the new P2P topology relationship to provide scheduling for the client Serve.
本发明实施例还提供一种调度服务器,包括:确定单元,在重新工作时,用于确定是否能够获得原来维护的P2P拓扑关系数据;调度服务提供单元,用于在所述确定单元确定不能获得原来维护的P2P拓扑关系数据后,使用新的P2P拓扑关系为客户端提供调度服务。The embodiment of the present invention also provides a scheduling server, including: a determining unit, used to determine whether the original maintained P2P topology relationship data can be obtained when re-working; After the original maintained P2P topology relationship data, use the new P2P topology relationship to provide scheduling services for clients.
本发明实施例还提供一种调度服务器提供调度服务的方法,包括:与客户端进行消息交互;如果所述客户端需要加入所述调度服务器当前维护的P2P拓扑关系中,则将所述调度服务器用于识别所述客户端的信息提供给所述客户端。An embodiment of the present invention also provides a method for a scheduling server to provide scheduling services, including: message interaction with a client; if the client needs to join the P2P topology relationship currently maintained by the scheduling server, the scheduling server Information identifying the client is provided to the client.
本发明实施例还提供一种调度服务器,包括:消息交互单元,用于与客户端进行消息交互;信息提供单元,用于如果所述客户端需要加入所述调度服务器当前维护的P2P拓扑关系中,则将所述调度服务器用于识别所述客户端的信息提供给所述客户端。The embodiment of the present invention also provides a scheduling server, including: a message interaction unit for message interaction with the client; an information providing unit for adding the client to the P2P topology relationship currently maintained by the scheduling server , the information used by the scheduling server to identify the client is provided to the client.
在本发明的调度服务器的主备实现实施例中,如果主备调度服务器发生切换,则备调用服务器无须获得主调度服务器维护的P2P拓扑关系数据,当然,备调用服务器也无须存储主调度服务器维护的P2P拓扑关系数据。这样,虽然备调用服务器不能对主调度服务器维护的P2P拓扑关系进行维护,但仍然可以保证P2P拓扑关系中的上下级节点正常传输数据,当其中的一个节点需要加入备调用服务器维护的P2P拓扑关系时,只需将这个节点加入备调用服务器维护的P2P拓扑关系中即可。所以,本发明的实施例无需备调度服务器具有存储P2P拓扑关系数据的存储装置,节省了成本;本发明的实施例也无需主调度服务器向备调度服务器同步P2P拓扑关系数据,从而提高了点对点数据传输的可靠性。In the active/standby implementation embodiment of the dispatching server of the present invention, if the active/standby dispatching server is switched, the standby invoking server does not need to obtain the P2P topology relationship data maintained by the active dispatching server, and of course, the standby invoking server does not need to store the information maintained by the active dispatching server. P2P topology relationship data. In this way, although the standby calling server cannot maintain the P2P topology relationship maintained by the main scheduling server, it can still ensure the normal transmission of data between the upper and lower nodes in the P2P topology relationship. When one of the nodes needs to join the P2P topology relationship maintained by the standby calling server , you only need to add this node to the P2P topology relationship maintained by the standby calling server. Therefore, the embodiment of the present invention does not require the standby scheduling server to have a storage device for storing P2P topology relationship data, which saves costs; the embodiment of the present invention also does not require the primary scheduling server to synchronize the P2P topology relationship data with the standby scheduling server, thereby improving peer-to-peer data. transmission reliability.
在本发明的调度服务器提供调度服务的一个实施例中,如果调度服务器重新工作,即使不能获得原来维护的P2P拓扑关系数据,但仍然可以使用新的P2P拓扑关系为客户端提供调度服务,从而解决了一旦调度服务器不能获得原来维护的P2P拓扑关系数据就不能提供调度服务的问题。In an embodiment of the dispatching server of the present invention that provides dispatching services, if the dispatching server works again, even if the P2P topology relationship data maintained originally cannot be obtained, it can still use the new P2P topology relation to provide dispatching services for the client, thereby solving the problem of This solves the problem that once the scheduling server cannot obtain the original maintained P2P topology relationship data, it cannot provide scheduling services.
在本发明的调度服务器提供调度服务的另一个实施例中,只要客户端需要加入所述调度服务器维护的P2P拓扑关系中时,就将调度服务器用于识别所述客户端的信息提供给所述客户端,这样就能保证调度服务器为客户端提供调度服务时,能确定客户端是否已在其维护的P2P拓扑关系中,从而提供相应的调度服务。In another embodiment of the scheduling server of the present invention that provides scheduling services, as long as the client needs to join the P2P topology relationship maintained by the scheduling server, the scheduling server will provide the client with the information used to identify the client In this way, it can be ensured that when the scheduling server provides scheduling services for the client, it can determine whether the client is already in the P2P topology relationship it maintains, so as to provide corresponding scheduling services.
附图说明Description of drawings
图1为现有的客户端/服务器架构示意图;FIG. 1 is a schematic diagram of an existing client/server architecture;
图2为现有的P2P数据传输示意图;FIG. 2 is a schematic diagram of existing P2P data transmission;
图3为本发明实施例的调度服务器的主备实现方法流程图;Fig. 3 is the flow chart of the implementation method of master and backup of the scheduling server according to the embodiment of the present invention;
图4为本发明实施例的调度服务系统的结构示意图;4 is a schematic structural diagram of a dispatching 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 ways
首先对本发明实施例的调度服务器的主备实现方法进行说明。如图3所示,所述方法包括:步骤S301:确定主调度服务器是否能为客户端提供调度服务;步骤S302:如果主调度服务器不能为客户端提供调度服务,则在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,备调度服务器使用新的P2P拓扑关系为客户端提供调度服务。新的P2P拓扑关系是相对于主调度服务器维护的P2P拓扑关系来说的,备调度服务器使用的新的P2P拓扑关系实质可以指备调度服务器维护的P2P拓扑关系。当备调度服务器开始工作但还没有与任何客户端进行消息交互时,其维护的P2P拓扑关系中只有内容服务器,随着更多的客户端加入到备调度服务器维护的P2P拓扑关系时,P2P拓扑关系中的节点才增多。Firstly, the method for implementing the master and backup of the scheduling server in the embodiment of the present invention will be described. As shown in Figure 3, the method includes: step S301: determine whether the main scheduling server can provide scheduling services for the client; Under the condition of the existing 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, and the new P2P topology relationship used by the standby scheduling server may essentially refer to the P2P topology relationship maintained by the standby scheduling server. When the standby scheduling server starts working but has not exchanged messages with any clients, only the content server is in the P2P topology maintained by it. As more clients join the P2P topology maintained by the standby scheduling server, the P2P topology The number of nodes in the relationship increases.
备调度服务器确定主调度服务器是否能为客户端提供调度服务可以由多种方式实现。例如,可以检测主调度服务器是否发生故障或者是否过载,如果是,则确定主调度服务器不能为客户端提供调度服务。再例如,可以判断是否收到主调度服务器或其他网络实体发出的主调度服务器发生故障或者是否过载的消息,如果是,则确定主调度服务器不能为客户端提供调度服务。The standby scheduling server may determine whether the primary scheduling server can provide scheduling services for the client in various ways. For example, it may be detected whether the main scheduling server is faulty or overloaded, and if so, it is determined that the main scheduling server cannot provide scheduling services for the client. For another example, it may be determined whether a message that the main scheduling server is faulty or overloaded is received from the main scheduling server or other network entities, and if so, it is determined that the main scheduling server cannot provide scheduling services for the client.
备调度服务器使用新的P2P拓扑关系为客户端提供调度服务可以由多种方式实现。例如,如果客户端需要加入新的P2P拓扑关系中,则将所述客户端加入到新的P2P拓扑关系中。The standby scheduling server uses the new P2P topology relationship to provide the scheduling service for the client in various ways. For example, if the client needs to be added to a new P2P topological relationship, the client is added to the new P2P topological 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 topological relationship, it needs to determine whether the client needs to join the new P2P topological relationship, which can be implemented in multiple ways. For example, the information reported by the client is obtained, and it is determined whether the client needs to join a new P2P topology relationship according to the information. Specifically, the new master scheduling server may first determine whether the client is in the new P2P topology relationship, and if not, determine whether the client needs to join the new P2P topology relationship. Determining whether the client is in the new P2P topology relationship can also be implemented in multiple ways. For example, the new main scheduling server judges whether the P2P topology version information used to identify the new P2P topology relationship reported by the client and/or the client information used to identify the client are consistent with the current P2P topology version information and/or assigned The client information given to the client is consistent, if yes, it is determined that the client is in the new P2P topology relationship, otherwise, it is determined that the client is not in the new P2P topology relationship. For another example, the new master scheduling server provides P2P topology version information used to identify the new P2P topology relationship and/or client information used to identify the client to the client that performs message interaction with it, and the client checks its own Whether it is in the new P2P topology relationship; if the client is in the new P2P topology relationship reported by the client, it is determined that the client is in the new P2P topology relationship; if the client is obtained If the client is not in the new P2P topology relationship reported by the terminal, 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 about an abnormal occurrence of an upper-level node, request information for replacing an upper-level node, or information about itself. The self information is, for example, its own load information, information about whether the self is in a P2P topological relationship, or information about which P2P topological relationship the self is in. The following example illustrates. Assuming that the client in the P2P topology relationship maintained by the original master scheduling server reports information that it is still in the P2P topology relationship maintained by the original master scheduling server, but its own load is heavy, then the new master scheduling server can , it is determined that the client should be added to the new P2P topology relationship to reduce the client’s own load. Of course, since the new master scheduling server has not obtained the data of the P2P topology relationship maintained by the original master scheduling server before, the new The master scheduling server of will treat 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 used to identify the new P2P topology relationship and/or client information used to identify the client. The P2P topology version information may be an identifier called a P2P topology version number. The terminal information can also be an identifier, called the client identifier. Among all the scheduling servers, the new master scheduling server can use the P2P topology version information and/or client information to identify the client. In this case, if the client reports the P2P topology version information and/or client information, the new master scheduling server can judge whether the client is in the new P2P topology relationship, if not, then determine whether the client needs to join in a new P2P topology relationship.
新的主调度服务器确定客户端需要加入新的P2P拓扑关系中后,可以为客户端指定上级节点。这样,客户端就可以从上级节点获得P2P数据。After the new main scheduling server determines that the client needs to join the new P2P topology relationship, it can designate a superior node for the client. In this way, the client can obtain P2P data from the upper node.
为客户端指定上级节点的同时或之后,还可以将用于标识新的主调度服务器维护的P2P拓扑关系的P2P拓扑版本信息和/或用于标识客户端的客户端信息提供给客户端。需要说明的是,P2P拓扑版本信息和客户端信息可以整合为一种信息,即,将P2P拓扑版本信息和客户端信息提供给客户端时,只需提供一种信息即可,这种信息既包括P2P拓扑版本信息的内容,又包括客户端信息的内容。将客户端加入新的P2P拓扑关系中之后,每次与客户端交互时,交互的消息都可以携带P2P拓扑版本信息和/或客户端信息。需要说明的是,客户端信息也可以由客户端上报,而无须新的主调度服务器提供客户端信息。例如,如果客户端需要加入新的P2P拓扑关系中,则可以记录客户端自己产生并上报的用于标识客户端的客户端信息。At the same time or after specifying the upper node for the client, the P2P topology version information used to identify the P2P topology relationship maintained by the new main scheduling server and/or the client information used to identify the client may also be provided to the client. It should be noted that the P2P topology version information and client information can be integrated into one kind of information, that is, when providing the P2P topology version information and client information to the client, only one kind of information needs to be provided. It includes the content of P2P topology version information and the content of client information. After the client is added to the new P2P topology relationship, each time it interacts with the client, the interactive message may carry P2P topology version information and/or client information. It should be noted that the client information can also be reported by the client without the new main scheduling server providing the client information. For example, if the client needs to join a new P2P topology relationship, the client information generated and reported by the client for identifying the client may be recorded.
另外,如果客户端需要加入新的P2P拓扑关系中,则可以记录客户端的信息。这里的客户端的信息不局限于用于标识客户端的客户端信息,也可以是指其他类型的与客户端相关的信息。In addition, if the client needs to join a new P2P topology relationship, the information of the client can be recorded. The client information here is not limited to client information used to identify the client, and may also refer to other types of client-related information.
备调度服务器使用新的P2P拓扑关系为客户端提供调度服务的另一种实现方式为,如果原主调度服务器维护的P2P拓扑关系中的客户端不需要加入新的P2P拓扑关系中,则原主调度服务器维护的P2P拓扑关系中的客户端仍然在原主调度服务器维护的P2P拓扑关系中获得P2P数据。Another way for the standby scheduling server to use the new P2P topology relationship to provide scheduling services for clients is that if the clients in the P2P topology relationship maintained by the original primary scheduling server do not need to be added to the new P2P topology relationship, the original primary scheduling server The client in the maintained P2P topological relationship still obtains P2P data in the P2P topological relationship maintained by the original master scheduling server.
确定原主调度服务器维护的P2P拓扑关系中的客户端不需要加入新的P2P拓扑关系中之前,需要确定原主调度服务器维护的P2P拓扑关系中的客户端是否需要加入新的P2P拓扑关系中,具体可以由多种方式实现。其中的一种方式为,获得原主调度服务器维护的P2P拓扑关系中的客户端上报的信息;根据所述信息确定所述原主调度服务器维护的P2P拓扑关系中的客户端是否需要加入新的P2P拓扑关系中。备调度服务器使用新的P2P拓扑关系为客户端提供调度服务的另一种实现方式为,如果需要将原来处于一个P2P拓扑关系中的客户端加入新的P2P拓扑关系中,则可以指示客户端在指定的时间到达后再退出原来的P2P拓扑关系。例如,可以指示客户端在30秒之后再退出原来的P2P拓扑关系,当30秒过后,客户端退出原来的P2P拓扑关系,加入新的主调度服务器维护的P2P拓扑关系。Before determining that the clients in the P2P topology relationship maintained by the original master scheduling server do not need to be added to the new P2P topology relationship, it is necessary to determine whether the clients in the P2P topology relationship maintained by the original master scheduling server need to be added to the new P2P topology relationship. It is achieved in many ways. One of the ways is to obtain the information reported by the client in the P2P topology relationship maintained by the original master scheduling server; determine whether the client in the P2P topology relationship maintained by the original master scheduling server needs to join a new P2P topology according to the information in relationship. Another way for the standby scheduling server to use the new P2P topology relationship to provide scheduling services for the client is that if it is necessary to add the client that was originally in a P2P topology relationship to the new P2P topology relationship, you can instruct the client to be in the Exit the original P2P topology relationship after the specified time is up. For example, the client may be instructed to exit the original P2P topology relationship after 30 seconds. After 30 seconds, the client exits the original P2P topology relationship and joins the new P2P topology relationship maintained by the main scheduling server.
上述方法可以由多种形式的装置实现,其中的一种备调度服务器,包括:第一检测单元,用于检测主调度服务器是否能为客户端提供调度服务;调度服务提供单元,用于如果第一检测单元确定出主调度服务器不能为客户端提供调度服务,则在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,使用新的P2P拓扑关系为客户端提供调度服务。The above method can be realized by devices in various forms, one of which is a standby scheduling server, including: a first detection unit for detecting whether the main scheduling server can provide scheduling services for the client; a scheduling service providing unit for if the second A detection unit determines that the main scheduling server cannot provide scheduling services for the client, and uses the new P2P topological relationship to provide scheduling services for the client without obtaining the P2P topology relationship data maintained by the main scheduling server.
调度服务提供单元包括:第二检测单元,用于检测客户端是否需要加入新的P2P拓扑关系中;P2P拓扑关系处理单元,用于如果第二检测单元检测出客户端需要加入新的P2P拓扑关系中,则将客户端加入新的P2P拓扑关系中。第二检测单元可以包括:信息获得单元,用于获得客户端上报的信息;确定单元,用于根据所述信息确定客户端是否需要加入新的P2P拓扑关系。The scheduling service providing unit includes: a second detection unit, used to detect whether the client needs to join a new P2P topology relationship; a P2P topology relationship processing unit, used to detect that the client needs to join a new P2P topology relationship if the second detection unit , the client is added to the new P2P topology relationship. The second detection unit may include: an information obtaining unit, configured to obtain information reported by the client; a determining unit, configured to determine whether the client needs to join a new P2P topology relationship according to the information.
备调度服务器还可以包括:信息记录单元,用于如果第二检测单元检测出客户端需要加入新的P2P拓扑关系中,则记录客户端的信息。The standby scheduling server may further include: an information recording unit, configured to record the information of the client if the second detection unit detects that the client needs to join a new P2P topology relationship.
除提供上述方法和备调度服务器外,本发明还提供一种调度服务器系统,包括:主调度服务器,用于为客户端提供调度服务;至少一个备调度服务器,当所述主调度服务器不能为客户端提供调度服务时,其中的一个备调度服务器在无须获得主调度服务器维护的P2P拓扑关系数据的条件下,使用新的P2P拓扑关系为客户端提供调度服务。In addition to providing the above method and standby scheduling server, the present invention also provides a scheduling server system, including: a main scheduling server, used to provide scheduling services for clients; at least one standby scheduling server, when the main scheduling server cannot serve clients When the end provides scheduling services, one of the standby scheduling servers uses the new P2P topology relationship to provide scheduling services for the client without obtaining the P2P topology relationship data maintained by the main scheduling server.
调度服务器系统还可以包括消息转发装置,用于转发客户端与能够为客户端提供调度服务的调度服务器之间的消息,其中,当所述主调度服务器不能为客户端提供调度服务、其中的一个备调度服务器为客户端提供调度服务时,所述消息转发装置转发所述为客户端提供调度服务的备调度服务器与客户端之间的消息。消息转发装置可以是交换机等设备,也可以是独立于交换机的独立设备。The scheduling server system may also include message forwarding means for forwarding messages between the client and a scheduling server capable of providing scheduling services for the client, wherein, when the main scheduling server cannot provide scheduling services 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 providing the scheduling service for the client and the client. The message forwarding device may be a device such as a switch, or an independent device independent of the switch.
需要说明的是,上面提到的备调度服务器可以不仅仅是指主调度服务器的备用调度服务器,其还可以是指正在维护其他P2P拓扑关系的调度服务器,或者说,调度服务器的主备关系都是相对的。It should be noted that the standby scheduling server mentioned above may not only refer to the standby scheduling server of the main scheduling server, but also refer to the scheduling server that is maintaining other P2P topology relationships. is relative.
本发明实施例还提供一种调度服务器提供调度服务的方法,包括:在重新工作时,确定是否能够获得原来维护的P2P拓扑关系数据;如果不是,则使用新的P2P拓扑关系为客户端提供调度服务。重新工作可以是指,调度服务器之前已经为客户端提供调度服务,但由于某种或某些原因导致调度服务器出现死机或关机等异常现象,致使调度服务器不能再提供调度服务,调度服务器通过重新启动等方式处理异常后,再重新开始提供调度服务。不能获得原来维护的P2P拓扑关系数据也可以有很多种原因,例如,调度服务器在不能继续提供调度服务之前,没有保存P2P拓扑关系数据,这样,当调度服务器重新启动后,就无法获得原来维护的P2P拓扑关系数据。新的P2P拓扑关系是相对于调度服务器原来维护的P2P拓扑关系来说的。当调度服务器重新开始工作但还没有与任何客户端进行消息交互时,其维护的新的P2P拓扑关系中只有内容服务器,随着更多的客户端加入到调度服务器维护的新的P2P拓扑关系时,新的P2P拓扑关系中的节点才增多。The embodiment of the present invention also provides a method for a scheduling server to provide scheduling services, including: when re-working, determine whether the original maintained P2P topology relationship data can be obtained; if not, use the new P2P topology relationship to provide scheduling for the client Serve. Re-work can mean that the scheduling server has provided scheduling services for the client before, but due to some reasons or some reasons, the scheduling server crashes or shuts down and other abnormal phenomena, so that the scheduling server can no longer provide scheduling services, and the scheduling server restarts After the exception is handled in other ways, the scheduling service is restarted. There may be many reasons for not being able to obtain the original maintained P2P topology relationship data. For example, the scheduling server did not save the P2P topology relationship data before it could not continue to provide scheduling services. P2P topology relationship data. The new P2P topology relationship is relative to the original P2P topology relationship maintained by the scheduling server. When the scheduling server starts working again but has not interacted with any client, only the content server is in the new P2P topology relationship maintained by it. As more clients join the new P2P topology relationship maintained by the scheduling server , the number of nodes in the new P2P topology relationship increases.
使用新的P2P拓扑关系为客户端提供调度服务可以有多种方式实现。例如,如果客户端需要加入新的P2P拓扑关系中,则可以将所述客户端加入到新的P2P拓扑关系中。There are many ways to use the new P2P topology relationship to provide scheduling services for clients. For example, if a client needs to join a new P2P topological relationship, the client may be added to the new P2P topological relationship.
确定客户端需要加入新的P2P拓扑关系中之前,可以先确定客户端是否需要加入新的P2P拓扑关系中。确定客户端是否需要加入新的P2P拓扑关系中也可以由多种方式实现。例如,获得客户端上报的信息;根据所述信息确定所述客户端是否需要加入新的P2P拓扑关系。Before determining that the client needs to join the new P2P topological relationship, it may first be determined whether the client needs to join the new P2P topological relationship. Determining whether the client needs to join a new P2P topology relationship can also be implemented in multiple ways. For example, obtain information reported by the client; determine whether the client needs to join a new P2P topology relationship according to the information.
根据所述信息确定所述客户端是否需要加入新的主调度服务器维护的P2P拓扑关系之前,还可以确定所述客户端是否在新的P2P拓扑关系中,如果不是,则再确定所述客户端是否需要加入新的P2P拓扑关系中。Before determining whether the client needs to join the P2P topology relationship maintained by the new main scheduling server according to the information, it can also determine whether the client is in the new P2P topology relationship, if not, then determine the client Whether it needs to be added to the new P2P topology relationship.
确定所述客户端是否在新的P2P拓扑关系中也可以由多种方式实现。例如,判断所述客户端上报的用于标识新的P2P拓扑关系的P2P拓扑版本信息和/或用于标识客户端的客户端信息是否与当前的P2P拓扑版本信息和/或分配给所述客户端的客户端信息一致,如果是,则确定所述客户端在新的P2P拓扑关系中,否则,确定所述客户端不在新的P2P拓扑关系中。再例如,向与调度服务器进行消息交互的客户端提供用于标识新的主调度服务器维护的P2P拓扑关系的P2P拓扑版本信息和/或用于标识客户端的客户端信息,由所述客户端检查其自身是否在新的P2P拓扑关系中;如果获得所述客户端上报的所述客户端在新的P2P拓扑关系中的信息,则确定所述客户端在新的P2P拓扑关系中;如果获得所述客户端上报的所述客户端不在新的P2P拓扑关系中的信息,则确定所述客户端不在新的P2P拓扑关系中。Determining whether the client is in the new P2P topology relationship can also be implemented in multiple ways. For example, it is determined whether the P2P topology version information used to identify the new P2P topology relationship reported by the client and/or the client information used to identify the client are consistent with the current P2P topology version information and/or the current P2P topology version information assigned to the client. If the client information is consistent, it is determined that the client is in the new P2P topology relationship, otherwise, it is determined that the client is not in the new P2P topology relationship. For another example, P2P topology version information used to identify the P2P topology relationship maintained by the new master scheduling server and/or client information used to identify the client are provided to the client performing message interaction with the scheduling server, and the client checks Whether itself is in the new P2P topology relationship; if the client is in the new P2P topology relationship reported by the client, it is determined that the client is in the new P2P topology relationship; if the client is obtained If the information reported by the client is that 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拓扑关系为客户端提供调度服务的另一种方式为,如果原来维护的P2P拓扑关系中的客户端不需要加入新的P2P拓扑关系中,则原来维护的P2P拓扑关系中的客户端仍然在原来维护的P2P拓扑关系中获得P2P数据。Another way to use the new P2P topology relationship to provide scheduling services for clients is that if the clients in the originally maintained P2P topology relationship do not need to join the new P2P topology relationship, the clients in the originally maintained P2P topology relationship The end still obtains P2P data in the P2P topological relationship maintained originally.
确定原来维护的P2P拓扑关系中的客户端不需要加入新的P2P拓扑关系中之前,还可以确定原来维护的P2P拓扑关系中的客户端是否需要加入新的P2P拓扑关系中。确定原来维护的P2P拓扑关系中的客户端是否需要加入新的P2P拓扑关系中的一种方式为,获得原来维护的P2P拓扑关系中的客户端上报的信息;根据所述信息确定所述原来维护的P2P拓扑关系中的客户端是否需要加入新的P2P拓扑关系中。Before it is determined that the clients in the originally maintained P2P topological relationship do not need to join in the new P2P topological relationship, it may also be determined whether the clients in the originally maintained P2P topological relationship need to join in the new P2P topological relationship. One way of determining whether the client in the originally maintained P2P topology relationship needs to join the new P2P topology relationship is to obtain the information reported by the client in the originally maintained P2P topology relationship; Whether the client in the P2P topology relationship needs to join the new P2P topology relationship.
上述方法实施例可以由多种形式的装置实现,其中的一种调度服务器包括:确定单元,在重新工作时,用于确定是否能够获得原来维护的P2P拓扑关系数据;调度服务提供单元,用于在所述确定单元确定不能获得原来维护的P2P拓扑关系数据后,使用新的P2P拓扑关系为客户端提供调度服务。The above method embodiments can be realized by various forms of devices, one of which includes a scheduling server: a determining unit, used to determine whether the originally maintained P2P topology relationship data can be obtained when re-working; a scheduling service providing unit, used to After the determining unit determines that the originally maintained P2P topology relationship data cannot be obtained, it uses the new P2P topology relationship to provide scheduling services for the client.
调度服务提供单元可以包括:检测单元,用于检测客户端是否需要加入新的P2P拓扑关系中;P2P拓扑关系处理单元,用于如果所述检测单元检测出客户端需要加入新的P2P拓扑关系中,则将所述客户端加入新的P2P拓扑关系中。The scheduling service providing unit may include: a detection unit, configured to detect whether the client needs to join a new P2P topology relationship; a P2P topology relationship processing unit, configured to detect that the client needs to join a new P2P topology relationship , then add the client into the new P2P topology relationship.
检测单元可以包括:信息获得单元,用于获得客户端上报的信息;确定单元,用于根据所述信息确定所述客户端是否需要加入新的P2P拓扑关系。The detecting unit may include: an information obtaining unit, configured to obtain information reported by the client; a determining unit, configured to determine whether the client needs to join a new P2P topology relationship according to the information.
本发明实施例还提供一种调度服务器提供调度服务的方法,包括:与客户端进行消息交互;如果所述客户端需要加入所述调度服务器当前维护的P2P拓扑关系中,则将所述调度服务器用于识别所述客户端的信息提供给所述客户端。An embodiment of the present invention also provides a method for a scheduling server to provide scheduling services, including: message interaction with a client; if the client needs to join the P2P topology relationship currently maintained by the scheduling server, the scheduling server Information identifying the client is provided to the client.
将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后,获得的所述客户端发送的所有或部分消息中可以携带所述调度服务器用于识别所述客户端的信息。After the information used by the scheduling server to identify the client is provided to the client, all or part of the obtained messages sent by the client may carry the information used by the scheduling server to identify the client.
将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后,如果再次与所述客户端进行消息交互,则还可以再次将所述调度服务器用于识别所述客户端的信息提供给所述客户端,由所述客户端检查其自身是否在新的P2P拓扑关系中;如果获得所述客户端上报的所述客户端在新的P2P拓扑关系中的信息,则确定所述客户端在新的P2P拓扑关系中;如果获得所述客户端上报的所述客户端不在新的P2P拓扑关系中的信息,则确定所述客户端不在新的P2P拓扑关系中。After the information used by the scheduling server to identify the client is provided to the client, if message interaction is performed with the client again, the information used by the scheduling server to identify the client may also be provided again to the client, and the client checks whether it is in the new P2P topology relationship; if the information reported by the client is obtained that the client is in the new P2P topology relationship, it is determined that the client The terminal is in the new P2P topological relationship; if the information reported by the client that the client is not in the new P2P topological relationship is obtained, it is determined that the client is not in the new P2P topological relationship.
将所述调度服务器用于识别所述客户端的信息提供给所述客户端之后,如果再次与所述客户端进行消息交互,则根据所述客户端上报的消息中携带的所述调度服务器用于识别所述客户端的信息,确定所述客户端是否在新的P2P拓扑关系中。After providing the client with the information used by the scheduling server to identify the client, if message interaction is performed with the client again, according to the information of the scheduling server carried in the message reported by the client Identify the information of the client, and determine whether the client is in the 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 above method can be implemented by various devices, one of which can include a scheduling server: a message interaction unit for message interaction with the client; an information providing unit for joining the current maintenance of the scheduling server if the client needs to In the P2P topology relationship, the information used by the scheduling server to identify the client is provided to the client.
下面对本发明的实施例进行详细说明。Embodiments of the present invention will be described in detail below.
如图4所示,调度服务器1、调度服务器2及消息转发装置组成一个调度服务器系统,与P2P终端(即上文提到的客户端)进行交互。在同一时刻,调度服务器1和调度服务器2中只有一个调度服务器接收并处理P2P终端的请求,并且备调度服务器需要监控主调度服务器是否失效。如果备调度服务器发现主调度服务器失效,备调度服务器就需要作为主调度服务器,与P2P终端进行交互,原来的主调度服务器恢复后,可以作为备调度服务器。对于P2P终端而言,与其交互的是调度服务器装置,而不是调度服务器1和调度服务器2。As shown in Fig. 4, the scheduling server 1, the scheduling server 2 and the message forwarding device form a scheduling server system, which interacts with the P2P terminal (ie, the client mentioned above). At the same time, only one of the scheduling server 1 and the scheduling server 2 receives and processes the request of the P2P terminal, and the standby scheduling server needs to monitor whether the main scheduling server fails. If the standby scheduling server finds that the main scheduling server fails, the standby scheduling server needs to act as the main scheduling server to interact with the P2P terminal. After the original main scheduling server recovers, it can be used as the standby scheduling server. For the P2P terminal, it is the scheduling server device that interacts with it, rather than the scheduling server 1 and the scheduling server 2 .
每个调度服务器都包括终端请求处理器、服务侧终端拓扑管理器、终端拓扑单元、终端拓扑版本号管理器和监控单元。其中,终端请求处理器负责接收并处理P2P终端的请求,服务侧终端拓扑管理器负责查询和更新P2P终端的拓扑,终端拓扑单元负责保存P2P终端的拓扑,终端拓扑版本号管理器负责维护P2P终端当前的拓扑版本号(即上文提到的P2P拓扑版本信息),监控单元负责检测对端是否失效、触发主备切换以及进行主备调度服务器之间的数据同步,其中,同步的数据指配置参数等少量数据,不包含大数据量的P2P拓扑关系数据。Each scheduling server includes a terminal request processor, a server-side terminal topology manager, a terminal topology unit, a terminal topology version number manager and a monitoring unit. Among them, the terminal request processor is responsible for receiving and processing requests from P2P terminals, the service-side terminal topology manager is responsible for querying and updating the topology of P2P terminals, the terminal topology unit is responsible for saving the topology of P2P terminals, and the terminal topology version number manager is responsible for maintaining P2P terminals The current topology version number (that is, the P2P topology version information mentioned above), the monitoring unit is responsible for detecting whether the peer end is invalid, triggering the master-standby switchover, and performing data synchronization between the master-standby scheduling servers, where the synchronized data refers to the configuration A small amount of data, such as parameters, does not contain large amounts of P2P topology relationship 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 topology manager on the terminal side is responsible for interacting with the dispatching server device and updating the upper node information. Each P2P terminal has a unique terminal identifier (that is, the above-mentioned client information used to identify the client), and the terminal identifier unit is responsible for storing the terminal identifier. When each P2P terminal joins the P2P topology relationship for the first time, it will obtain a terminal topology version number from the scheduling server device, and the terminal topology version number unit is responsible for storing 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 new P2P topology relationship after this startup. Every time a new topology version number is generated, it must be ensured that the new topology version number does not overlap with all topology version numbers previously used by the active and standby scheduling servers within a period of time. A simple implementation method is to set the current time (which can be Accurate to the second) combined with the network card address of the server as the topology version number.
当P2P终端加入P2P拓扑关系时,处理流程如图5所示:When the P2P terminal joins the P2P topology relationship, the processing flow is shown in Figure 5:
步骤S501:P2P终端向调度服务器装置发送加入P2P拓扑关系的请求,所述请求中包括P2P终端的信息,例如P2P终端的IP地址、网卡地址及上下行带宽等信息。Step S501: The P2P terminal sends a request to join the P2P topology relationship to the scheduling server device, and the request includes the information of the P2P terminal, such as the IP address of the P2P terminal, the address of the network card, and the uplink and downlink bandwidth.
步骤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 request processor of the main scheduling server assigns a unique terminal identifier to the P2P terminal.
步骤S504:终端请求处理器调用服务侧终端拓扑管理器,将P2P终端加入P2P拓扑关系中。Step S504: The terminal request processor invokes the terminal topology manager at the service side to add the P2P terminal to the P2P topology relationship.
步骤S505:服务侧终端拓扑管理器记录P2P终端的信息,根据拓扑管理策略为P2P终端指定上级节点。Step S505: The terminal topology manager on the service side records the information of the P2P terminal, and designates a superior node for the P2P terminal according to the topology management policy.
步骤S506:终端请求处理器将服务侧终端拓扑管理器返回的拓扑信息以及为P2P终端分配的拓扑版本号返回给P2P终端。Step S506: The terminal requests the processor to return 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 topology manager on the terminal side analyzes the information, saves the terminal identification in the information in the terminal identification unit, and saves the terminal topology version number in the information in the terminal topology version After that, follow the instructions in the message to connect to the upper-level node and obtain data from the upper-level node.
终端侧拓扑管理器连接上级节点后,可以向调度服务器装置发送拓扑更新请求,具体可以参见图5的步骤S508-S510。After the terminal-side topology manager is connected to the upper-level node, it may send a topology update request to the dispatching server device. For details, refer to steps S508-S510 in FIG. 5 .
步骤S508:终端侧拓扑管理器向调度服务器装置发送拓扑更新请求。Step S508: The terminal-side topology manager sends a topology update request to the scheduling server device.
步骤S509:主调度服务器的终端请求处理器收到拓扑更新请求后,调用服务侧终端拓扑管理器更新拓扑。Step S509: After receiving the topology update request, the terminal request processor of the main scheduling server invokes the terminal topology manager of the service side to update the topology.
步骤S510:服务侧终端拓扑管理器将更新后的拓扑记录到终端拓扑部件中。Step S510: the server-side terminal topology manager records the updated topology into the terminal topology component.
P2P终端加入P2P拓扑关系后,可能因为各种原因需要与调度服务器再次交互。例如,P2P终端发现上级节点失效,需要连接新的上级节点;P2P终端需要将自身负荷情况提供给调度服务器,以便调度服务器决策是否将所述P2P终端作为其它P2P终端的上级节点。P2P终端加入P2P拓扑关系后,每次向调度服务器发送消息时,消息中都可以携带终端拓扑版本号。After the P2P terminal joins the P2P topology relationship, it may need to interact with the scheduling server again for various reasons. For example, when a P2P terminal finds that the upper node fails, it needs to connect to a new upper node; the P2P terminal needs to provide its own load information to the scheduling server, so that the scheduling server can decide whether to use the P2P terminal as the upper node of other P2P terminals. After the P2P terminal joins the P2P topology relationship, each time it sends a message to the scheduling server, the message may 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 failure of the main scheduling server results in active-standby switchover, the standby scheduling server starts to provide scheduling services for P2P terminals as the new main scheduling server. When the new main scheduling server is started, the new terminal topology version number is used as the current terminal topology version number, and the original P2P topology relationship can continue to exist, that is, there is no need to completely adjust the P2P topology relationship, only when the P2P terminal needs to join the new Only when the P2P topological relationship maintained by the main scheduling server, the P2P terminal is added to the P2P topological relationship maintained by the new main scheduling server. For example, if the P2P terminals in the P2P topology relationship maintained by the original master scheduling server cannot use the original P2P topology relationship to continue to obtain data due to reasons such as the exit of the superior node, then exit the original P2P topology relationship and join a new P2P topology relationship. Specifically, the new master scheduling server can compare the current terminal topology version number with the terminal topology version number carried in the message sent by the P2P terminal, and judge whether the P2P topology relationship where the P2P terminal is located is the one currently maintained by the new master scheduling server. P2P topology relationship, if yes, then add the P2P terminal to the P2P topology relationship maintained by the new main scheduling server, otherwise, the following different processing can be performed according to the content of the request and other factors:
1.如果P2P终端上报自身信息(例如当前的上下行带宽),则新的主调度服务器可以忽略这一请求,P2P终端可以继续依靠原来的P2P拓扑关系获取数据;1. If the P2P terminal reports its own information (such as the current uplink and downlink bandwidth), the new main scheduling server can ignore this 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 upper node is abnormal and/or adjusts the upper node by itself, since the P2P terminal may have replaced the upper node by itself, the new master scheduling server can also ignore this request and let the P2P terminal maintain the P2P topology by itself relation;
3.如果P2P终端需要退出P2P拓扑关系,则新的主调度服务器可以忽略这一请求;3. If the P2P terminal needs to exit the P2P topology relationship, the new main scheduling server can ignore this request;
4.如果P2P终端需要再次加入P2P拓扑关系,则新的主调度服务器将P2P终端加入新的主调度服务器维护的某个P2P拓扑关系,并向P2P终端返回新的终端拓扑版本号,P2P终端更新保存的终端拓扑版本号;4. If the P2P terminal needs to join the P2P topology relationship again, the new main scheduling server will add the P2P terminal to a certain P2P topology relationship maintained by the new main scheduling server, and return the new terminal topology version number to the P2P terminal, and the P2P terminal will update 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-level node due to the failure of its upper-level node, the new main scheduling server can return a message that the terminal topology version number is wrong to the P2P terminal, and the P2P terminal will disconnect all connections with other terminals after receiving the error message , re-request to join the new P2P topology relationship. Since the withdrawal of a P2P terminal may cause its subordinate terminals to withdraw, and the withdrawal of its subordinate terminals may cause more P2P terminals to withdraw, this chain reaction may cause the new main scheduling server to be overloaded for a period of time run. In order to avoid this chain reaction, P2P terminals can randomly 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 P2P terminals Centrally send requests to the new main scheduling server in a short period of time, reducing the burden on the new main scheduling server.
在实际应用中,终端拓扑版本号与终端标识可以不是相互独立的标识,而是可以整合为一个标识,例如,终端拓扑版本号可以作为终端标识的一部分,新的主调度服务器为P2P终端分配终端标识时,提供的终端标识就包括了终端拓扑版本号。另外,终端标识可以由调度服务器指定,也可以由P2P终端自行上报一个可以唯一标识其自身的终端标识,例如P2P终端的网卡地址。In practical applications, the terminal topology version number and the terminal identification may not be independent of each other, but can be integrated into one identification. For example, the terminal topology version number can be used as a part of the terminal identification, and the new main scheduling server allocates terminals for P2P terminals. When identifying, the terminal identification provided includes the terminal topology version number. In addition, the terminal identifier can be specified by the scheduling server, or a terminal identifier that can uniquely identify itself can be reported by the P2P terminal itself, such as the network card address of the P2P terminal.
在实际应用中,不论何种情况下,新的主调度服务器只要发现P2P终端所在的P2P拓扑关系不是新的主调度服务器维护的P2P拓扑关系,都可以要求P2P终端重新加入P2P拓扑关系。In practical applications, no matter what the situation is, the new master scheduling server can request the P2P terminal to rejoin the P2P topology relationship as long as it finds that the P2P topology relationship where the P2P terminal is located is not the P2P topology relationship maintained by the new master scheduling server.
在实际应用中,可以由新的主调度服务器识别P2P终端是否在新的主调度服务器维护的P2P拓扑关系中;在调度服务器主动向P2P终端发送携带有当前的终端拓扑版本号的消息的情况下,也可以由P2P终端来检查其自身是否在新的主调度服务器维护的P2P拓扑关系中。In practical applications, the new main scheduling server can identify whether the P2P terminal is in the P2P topology relationship maintained by the new main scheduling server; when the scheduling server actively sends a message carrying the current terminal topology version number to the P2P terminal , the P2P terminal can also check whether it is in the P2P topology relationship maintained by the new main scheduling server.
在实际应用中,如果确定在某些场景下可以不检查终端拓扑版本号(例如P2P终端上报当前的上下行带宽),则P2P终端向新的主调度服务器发送的消息中也可以不携带终端拓扑版本号。In practical applications, 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 master scheduling server may not carry the terminal topology version number.
在调度服务器的主备实现实施例中,备调度服务器既可以是指没有维护任何P2P拓扑关系的调度服务器,即,作为主调度服务器的专用备调度服务器,也可以是指正在维护其他P2P拓扑关系的调度服务器,即,并不是作为主调度服务器的专用备调度服务器,而是维护其他P2P拓扑关系的主调度服务器,当需要主备切换时,正在维护其他P2P拓扑关系的调度服务器相当于新的主调度服务器,为原主调度服务器维护的P2P拓扑关系中的P2P终端提供调度服务。In the embodiment of the active/standby implementation of the dispatching server, the standby dispatching server may refer to a dispatching server that does not maintain any P2P topological relationship, that is, a dedicated standby dispatching server as the main dispatching server, or it may refer to maintaining other P2P topological relations In other words, it is not a dedicated standby scheduling server as the main scheduling server, but a main scheduling server that maintains other P2P topological relationships. The main scheduling server provides scheduling services for the P2P terminals in the P2P topology relationship maintained by the original main scheduling server.
最后需要说明的是,调度服务器提供调度服务的实施例可以应用于很多种场景。例如,当主调度服务器发生故障,备调度服务器启动时,备调度服务器可以使用这种实施例。再例如,当一个调度服务器由于原来维护的P2P拓扑关系丢失等原因,需要重新建立P2P拓扑关系时,也可以使用这种实施例。Finally, it should be noted that the embodiment in which the scheduling server provides the scheduling service can be applied to many scenarios. For example, when the primary scheduling server fails and the standby scheduling server starts up, the standby scheduling server can use this embodiment. For another example, this embodiment can also be used when a scheduling server needs to re-establish the P2P topology relationship due to the loss of the originally maintained P2P topology relationship.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications should also be It is regarded as the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 200810088808CN101262369B (en) | 2008-03-28 | 2008-03-28 | Master/slave realization method for dispatching server and dispatching server |
| PCT/CN2009/070973WO2009117946A1 (en) | 2008-03-28 | 2009-03-24 | Main-spare realizing method for dispatch servers and dispatch server |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 200810088808CN101262369B (en) | 2008-03-28 | 2008-03-28 | Master/slave realization method for dispatching server and dispatching server |
| Publication Number | Publication Date |
|---|---|
| CN101262369Atrue CN101262369A (en) | 2008-09-10 |
| CN101262369B CN101262369B (en) | 2011-05-11 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 200810088808Expired - Fee RelatedCN101262369B (en) | 2008-03-28 | 2008-03-28 | Master/slave realization method for dispatching server and dispatching server |
| Country | Link |
|---|---|
| CN (1) | CN101262369B (en) |
| WO (1) | WO2009117946A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009117946A1 (en)* | 2008-03-28 | 2009-10-01 | 华为技术有限公司 | Main-spare realizing method for dispatch servers and dispatch 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 |
| 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 |
| CN104731702A (en)* | 2013-12-23 | 2015-06-24 | 展讯通信(上海)有限公司 | Test system and service side thereof |
| CN104734902A (en)* | 2013-12-23 | 2015-06-24 | 展讯通信(上海)有限公司 | Testing system and server end thereof |
| WO2015101101A1 (en)* | 2013-12-31 | 2015-07-09 | 广州华多网络科技有限公司 | Channel access method and system |
| CN106301967A (en)* | 2016-10-25 | 2017-01-04 | 杭州华为数字技术有限公司 | A 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 |
| EP2790362B1 (en)* | 2012-01-11 | 2018-07-25 | ZTE Corporation | Network load control method and registration server |
| CN112448990A (en)* | 2019-09-05 | 2021-03-05 | 北京京东尚科信息技术有限公司 | Method, device and system for guaranteeing service availability |
| 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 |
| CN1314250C (en)* | 2004-10-29 | 2007-05-02 | 清华大学 | A robust point to point based stream scheduling method |
| JP2007257023A (en)* | 2006-03-20 | 2007-10-04 | Nec Corp | Server multiplying system and server multiplying method |
| CN101060391A (en)* | 2007-05-16 | 2007-10-24 | 华为技术有限公司 | Master and spare server switching method and system and master server and spare server |
| CN100461740C (en)* | 2007-06-05 | 2009-02-11 | 华为技术有限公司 | A client node network topology construction method and streaming media distribution system |
| CN101262369B (en)* | 2008-03-28 | 2011-05-11 | 华为技术有限公司 | Master/slave realization method for dispatching server and dispatching server |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009117946A1 (en)* | 2008-03-28 | 2009-10-01 | 华为技术有限公司 | Main-spare realizing method for dispatch servers and dispatch 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 |
| EP2790362B1 (en)* | 2012-01-11 | 2018-07-25 | ZTE Corporation | Network load control method and registration server |
| CN104734902B (en)* | 2013-12-23 | 2018-03-23 | 展讯通信(上海)有限公司 | Test system and its service end |
| CN104731702B (en)* | 2013-12-23 | 2017-12-26 | 展讯通信(上海)有限公司 | Test system and its service end |
| CN104734902A (en)* | 2013-12-23 | 2015-06-24 | 展讯通信(上海)有限公司 | Testing system and server end thereof |
| CN104731702A (en)* | 2013-12-23 | 2015-06-24 | 展讯通信(上海)有限公司 | Test system and service side thereof |
| WO2015101101A1 (en)* | 2013-12-31 | 2015-07-09 | 广州华多网络科技有限公司 | Channel access method and system |
| CN106301967A (en)* | 2016-10-25 | 2017-01-04 | 杭州华为数字技术有限公司 | A data synchronization method and out-of-band management equipment |
| CN106301967B (en)* | 2016-10-25 | 2019-10-15 | 杭州华为数字技术有限公司 | A data synchronization method and out-of-band management equipment |
| US11010086B2 (en) | 2016-10-25 | 2021-05-18 | Huawei Technologies Co., Ltd. | Data synchronization method and out-of-band management device |
| CN107197036A (en)* | 2017-06-22 | 2017-09-22 | 广东网金控股股份有限公司 | A kind of consistent processing method of information based on block chain and terminal |
| CN112448990A (en)* | 2019-09-05 | 2021-03-05 | 北京京东尚科信息技术有限公司 | Method, device and system for guaranteeing service availability |
| CN112448990B (en)* | 2019-09-05 | 2023-12-05 | 北京京东尚科信息技术有限公司 | Method, device, system and storage medium for guaranteeing service availability |
| Publication number | Publication date |
|---|---|
| CN101262369B (en) | 2011-05-11 |
| WO2009117946A1 (en) | 2009-10-01 |
| Publication | Publication Date | Title |
|---|---|---|
| CN101262369A (en) | Master/standby implementation method of dispatching server and dispatching server | |
| CN111565229B (en) | Communication system distributed method based on Redis | |
| CN111615066B (en) | A broadcast-based distributed microservice registration and invocation method | |
| US20190050304A1 (en) | Method and Apparatus for Indirectly Assessing a Status of an Active Entity | |
| JP5863942B2 (en) | Provision of witness service | |
| CN104168193B (en) | A kind of method and routing device of Virtual Router Redundancy Protocol fault detect | |
| CN113726556B (en) | Edge internet of things proxy node operation and maintenance method, system, storage medium and computing equipment | |
| US20070121490A1 (en) | Cluster system, load balancer, node reassigning method and recording medium storing node reassigning program | |
| CN102404146B (en) | Master-slave switching method, network device and DHCP server | |
| US20040221207A1 (en) | Proxy response apparatus | |
| US20080285436A1 (en) | Methods, systems, and computer program products for providing site redundancy in a geo-diverse communications network | |
| CN112333015B (en) | Media data storage method, device, system, electronic equipment and storage medium | |
| CN109344014A (en) | A kind of main/standby switching method, device and communication equipment | |
| CN114500340B (en) | A method and system for intelligent scheduling distributed path calculation | |
| CN107276839A (en) | A kind of cloud platform from monitoring method and system | |
| US8711734B2 (en) | Method and system for fail-safe call survival | |
| CN102710438B (en) | Node management method, device and system | |
| CN113132159A (en) | Storage cluster node fault processing method and device and storage system | |
| CN115426250B (en) | Dual-machine hot standby switching method and device for target range command | |
| KR20200072941A (en) | Method and apparatus for handling VRRP(Virtual Router Redundancy Protocol)-based network failure using real-time fault detection | |
| CN114090342A (en) | Link management method for storage disaster recovery, message execution node, and storage control cluster | |
| US10536875B2 (en) | System and method for seamless TCP connection handoff | |
| CN101640941B (en) | Connection resource release processing method and device | |
| CN104243473A (en) | Data transmission method and device | |
| CN117201507A (en) | Cloud platform switching method and device, electronic equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| C17 | Cessation of patent right | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20110511 Termination date:20130328 |