CN109660410A - Determine the method and device of network topology - Google Patents

Determine the method and device of network topology Download PDF

Info

Publication number
CN109660410A
CN109660410A CN201910134995.3A CN201910134995A CN109660410A CN 109660410 A CN109660410 A CN 109660410A CN 201910134995 A CN201910134995 A CN 201910134995A CN 109660410 A CN109660410 A CN 109660410A
Authority
CN
China
Prior art keywords
service
service server
server
address
neighbours
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910134995.3A
Other languages
Chinese (zh)
Other versions
CN109660410B (en
Inventor
李艳国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu Technology Co Ltd
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 Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN201910134995.3A priority Critical patent/CN109660410B/en
Publication of CN109660410A publication Critical patent/CN109660410A/en
Application granted granted Critical
Publication of CN109660410B publication Critical patent/CN109660410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • 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
    • 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/133Protocols for remote procedure calls [RPC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure proposes a kind of method and device of determining network topology, is related to network technique field.This method is applied to service server, the described method includes: based on default remote procedure call agreement, obtain the service address of each neighbours' service server, obtain the information on services of the service server, the information on services of the service server includes the service name of the service server, address of service and service address, based on the default RPC agreement, by the service address of the information on services of the service server and each neighbours' service server, it is sent to topology server, the service address of the information on services of the service server and each neighbours' service server determines network topology for the topology server.The disclosure can be improved the reliability of determining network topology.

Description

Determine the method and device of network topology
Technical field
This disclosure relates to network technique field, in particular to a kind of method and device of determining network topology.
Background technique
With the development of network technology, in order to ensure the high availability of network system, usually can by the network system into Row distributed deployment, i.e., the multiple services for including by the network system are deployed in different service servers respectively.In order to make this It cooperates between multiple service servers, to realize the function of the network system, it is thus necessary to determine that the network of the network system Topology.
In the prior art, the topological structure of network system can be determined by topology server, wherein the Topology service The service name that device configured in advance has topology to explore each service server in script and network system, and the Topology service utensil There is the permission for logging in each service server.Topology server can explore script by operation topology, be logged in particular account number each Service server, each service server searches the connection relationship acquired between service server, so that it is determined that network system Topological structure.
But topological structure is determined due to needing to rely on pre-set topology exploration script, and the topology explores script Service condition is very harsh, if service server or the identical business service of presence service title is newly added in the network system Device is then difficult to determine that the network topology of network system, reliability are low.
Summary of the invention
A kind of method and device for being designed to provide determining network topology of the disclosure determines network topology to improve Reliability.
To achieve the goals above, the disclosure the technical solution adopted is as follows:
In a first aspect, a kind of method that the disclosure proposes determining network topology, is applied to service server, the method packet It includes:
Based on default RPC (Remote Procedure Call, remote procedure call) agreement, each neighbours' business clothes are obtained The service address of business device;
The information on services of the service server is obtained, the information on services of the service server includes the business service Service name, address of service and the service address of device;
Based on the default RPC agreement, by the information on services of the service server and each neighbours' service server Service address, be sent to topology server, the information on services of the service server and each neighbours' business service The service address of device determines network topology for the topology server.
Second aspect, a kind of method that the disclosure also proposes determining network topology are applied to topology server, the method Include:
Based on default RPC agreement, from each service server obtain the service server information on services and each neighbours' industry Be engaged in server service address, the information on services of the service server include the service server service name, Address of service and service address;
Service name, address of service, service address and each neighbours' business based on each service server The service address of server determines network topology.
The third aspect, the disclosure also propose a kind of device of determining network topology, are applied to service server, described device Include:
First obtains module, for obtaining the service address of each neighbours' service server based on default RPC agreement;
Second obtains module, for obtaining the information on services of the service server, the service letter of the service server Breath includes service name, address of service and the service address of the service server;
Sending module, for being based on the default RPC agreement, by the information on services of the service server and each neighbour The service address for occupying service server, is sent to topology server, the information on services of the service server and each described The service address of neighbours' service server determines network topology for the topology server.
Fourth aspect, the disclosure also propose a kind of device of determining network topology, are applied to topology server, described device Include:
Module is obtained, for obtaining the service letter of the service server from each service server based on default RPC agreement The service address of breath and each neighbours' service server, the information on services of the service server includes the service server Service name, address of service and service address;
Determining module, for the service name based on each service server, address of service, service address and each The service address of neighbours' service server determines network topology.
5th aspect, the disclosure also propose a kind of electronic equipment, deposit including being stored with the computer-readable of computer program Storage media and processor when the computer program is read and run by the processor, realize above-mentioned first aspect or second Method described in aspect.
6th aspect, the disclosure also proposes a kind of computer readable storage medium, is stored thereon with computer program, described When computer program is read out by the processor and runs, method described in above-mentioned first aspect or second aspect is realized.
Compared with the prior art, the disclosure has the advantages that
In the embodiments of the present disclosure, service server can obtain each neighbours' service server based on default RPC agreement Service address, and the information on services of the service server is obtained, based on default RPC agreement, by the clothes of the service server The service address for the information and each neighbours' service server of being engaged in, is sent to topology server, so that it is guaranteed that topology server energy Enough according to the information on services of service server and the service address of each neighbours' service server, network topology is determined.Due to It does not need topology and explores script to determine network topology, also there is no need to construct harsh fortune during determining network topology Row condition, reduces the difficulty of determining network topology, to improve the reliability of determining network topology.
Other feature and advantage of the disclosure will be illustrated in subsequent specification, also, partly be become from specification It is clear that by implementing disclosure understanding.The purpose of the disclosure and other advantages can be by written specifications, power Specifically noted structure is achieved and obtained in sharp claim and attached drawing.
Detailed description of the invention
In order to illustrate more clearly of the technical solution of the disclosure, letter will be made to attached drawing needed in the embodiment below It singly introduces, it should be understood that the following drawings illustrates only some embodiments of the disclosure, therefore is not construed as to range It limits, it for those of ordinary skill in the art, without creative efforts, can also be according to these attached drawings Obtain other relevant attached drawings.
Fig. 1 shows a kind of flow diagram of the method for determining network topology provided by the disclosure;
Fig. 2 shows the flow diagrams that another kind provided by the disclosure determines the method for network topology;
Fig. 3 shows the flow diagram of the method for another determination network topology provided by the disclosure;
Fig. 4 shows a kind of the functional block diagram of the device of determining network topology provided by the disclosure;
Fig. 5 shows the functional block diagram that another kind provided by the disclosure determines the device of network topology;
Fig. 6 shows the functional block diagram of the device of another determination network topology provided by the disclosure;
Fig. 7 shows the functional block diagram of the device of another determination network topology provided by the disclosure;
Fig. 8 shows the functional block diagram of the device of another determination network topology provided by the disclosure;
Fig. 9 shows a kind of the functional block diagram of electronic device provided by the disclosure.
Specific embodiment
Below in conjunction with attached drawing in the disclosure, the technical solution in the disclosure is clearly and completely described.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
Before the disclosure is explained in detail, first the application environment of the disclosure is explained.Network system It may include topology server and multiple service servers, wherein topology server and multiple service servers can pass through Network connection.
Service server is used to complete one or more services, the service server can in network system at least One service server is directly connected to by network, wherein the business service being directly connected to the service server by network Device, as neighbours' service server of the service server.
It should be noted that industry corresponding to the quantity of service server included by network system and each service server Business, can be by determining according to the function of network system in advance.For example it when the network system is ad delivery systems, can wrap Include multiple service servers such as traffic distribution, advertising business, keyed advertising, advertisement filter and order ads.
Topology server is used to determine the network topology in the network system, provide and the network topology to service server Relevant information.
Wherein, network topology is arrangement true or virtual between each equipment in network system by transmission medium interconnection Mode.
It should be noted that topology server or service server may include in server module or server cluster Server.
It should also be noted that, in practical applications, topology server also can integrate on service server.
Fig. 1 is please referred to, is a kind of flow diagram of the method for determining network topology provided by the disclosure.This method is answered For in service server.It should be noted that the method for determination network topology described in the disclosure is not with Fig. 1 and following The specific order be limitation, it should be understood that in other embodiments, the method for determination network topology described in the disclosure its The sequence of middle part steps can be exchanged with each other according to actual needs or part steps therein also can be omitted or delete. Process shown in FIG. 1 will be described in detail below.
Step 101, based on default RPC agreement, the service address of each neighbours' service server is obtained.
Reliability is lower caused by network topology problem, each business are determined in order to avoid exploring script by topology Server can acquire service server neighbours' service server, to determine neighbours' service server, really by RPC Protecting subsequent topology server can determine neighbours' service server of each service server in network system, and then determine the network The network topology of system.
RPC agreement is that one kind requests to service from remote computer program by network, is not required to it is to be understood that bottom-layer network skill The agreement of art.In the embodiments of the present disclosure, preset RPC agreement can by being arranged to obtain in advance, and for service server with Communication between service server, between service server and topology server.
Service address (server_uri) is the information on services interface of service server, by the information on services Location, the information on services of the available service server service provided.
For example, service address can be http: // 192.168.0.1:8888/rpc-node.
Wherein, information on services is the relevant information of service server service provided, may include the clothes of service server Business title, address of service and service address.
Server name (server_name) is the title of service server, which can be by setting in advance It sets to obtain.
Server address (server_address) is the address of service server.For example, server address can be http://192.168.0.1:8888。
Service server can be communicated, to acquire based on default RPC agreement with each neighbours' service server The service address of each neighbours' service server.For example, service server can be based on default RPC agreement, to neighbours' business Server sends RPC request, and neighbours' service server receives the RPC and requests and return RPC response, wraps in the RPC response Include the requested data of the service server.
It should be noted that when service server sends RPC request to neighbours' service server, can by get or The mode of post is requested to send RPC.
It should also be noted that, the data format that neighbours' service server is returned can be JSONS (JavaScript Object Notation, JS object numbered musical notation).
Step 102, the information on services of service server is obtained.
The information on services of each service server is obtained for the ease of topology server, and then determines that the network of network system is opened up It flutters, the information on services of the available service server of service server.
Wherein, the information on services of service server includes service name, address of service and the information on services of service server Address.
Service server can obtain the service of the service server by preset storage location in the service server Information.
It should be noted that in practical applications, service server can also first obtain the service letter of the service server Breath, then based on default RPC agreement, the service address of each neighbours' service server is obtained, alternatively, obtaining business clothes simultaneously The information on services of business device and the service address that each neighbours' service server is obtained based on default RPC agreement, that is to say, this Open service address and step 102 acquisition for obtaining each neighbours' service server based on default RPC agreement to step 101 The execution order of the information on services of service server is without limitation.
Step 103, based on default RPC agreement, by the clothes of the information on services of service server and each neighbours' service server Business message address, is sent to topology server, the service letter of the information on services of the service server and each neighbours' service server Breath address determines network topology for topology server.
When each service server by the information on services of the information on services of the service server and each neighbours' service server When location is sent to topology server, topology server can determine the industry being directly connected between any two by network in network system Business server, so that it is determined that the network topology of the network system.
In addition, topology server determine the mode of network topology referring also to the associated description in subsequent, herein no longer It repeats one by one.
In the embodiments of the present disclosure, service server can obtain each neighbours' service server based on default RPC agreement Service address, and the information on services of the service server is obtained, based on default RPC agreement, by the clothes of the service server The service address for the information and each neighbours' service server of being engaged in, is sent to topology server, so that it is guaranteed that topology server energy Enough according to the information on services of service server and the service address of each neighbours' service server, network topology is determined.Due to It does not need topology and explores script to determine network topology, also there is no need to construct harsh fortune during determining network topology Row condition, for example service name, login account that each service server is set in topology exploration script in advance are not needed, also not It is necessary to ensure that the service name of each service server does not repeat, reduces the difficulty of determining network topology, to improve determination The reliability of network topology.
It referring to figure 2., is a kind of flow diagram of the method for determining network topology provided by the disclosure.This method is answered For topology server.It should be noted that the method for determination network topology described in the disclosure is not with Fig. 2 and following institute The specific order stated is limitation, it should be understood that in other embodiments, the method for determination network topology described in the disclosure is wherein The sequence of part steps can be exchanged with each other according to actual needs or part steps therein also can be omitted or delete.Under Process shown in Fig. 2 will be described in detail in face.
Step 201, based on default RPC agreement, the information on services of the service server and each is obtained from each service server The information on services of the service address of neighbours' service server, the service server includes the Service name of the service server Title, address of service and service address.
Reliability is lower caused by network topology problem, topology clothes are determined in order to avoid exploring script by topology Be engaged in device can by RPC, from each service server acquire the service server information on services and each neighbours' business service The service address of device, it is ensured that subsequent topology server can determine neighbours' business clothes of each service server in network system Business device.
Topology server can be communicated, to acquire each industry by presetting RPC agreement with each service server The information on services of business server and the service address of each neighbours' service server.
Step 202, service name, address of service, service address and each neighbours' business based on each service server The service address of server determines network topology.
Topology server can determine in network system between any two according to neighbours' service server of each service server The service server being directly connected to by network, so that it is determined that the network topology of the network system.
Wherein, for the service server being arbitrarily directly connected to two-by-two by network, topology server can be two by this The service name of service server, address of service, service address are associated and store (for example generating network topological diagram), To obtain network topology.
For example, topology server is got, the service name of service server A is service1, address of service is Http: // 192.168.1.1:8888, service address http: // 192.168.1.1:8888/rpc-node, Lin Juye The service address of business server is http: // 192.168.1.2:8888/rpc-node and http: // 192.168.1.3: 8889/rpc-node;The service name of service server B is service2, address of service http: // 192.168.1.2: 8888, service address http: the information on services of // 192.168.1.2:8888/rpc-node, neighbours' service server Address includes http: // 192.168.1.1:8888/rpc-node and http: // 192.168.1.4:8889/rpc-node;Industry Be engaged in server C service name be service3, address of service http: // 192.168.1.3:8888, service address Service address for http: // 192.168.1.3:8888/rpc-node, neighbours' service server includes http: // 192.168.1.1:8888/rpc-nod;The service name of service server D is service4, address of service http: // 192.168.1.4:8888, service address http: // 192.168.1.4:8888/rpc-node, neighbours' business service The service address of device includes http: // 192.168.1.2:8888/rpc-nod;Therefore, network topological diagram is generated, wherein Service server A is adjacent with service server B and service server C respectively, service server B respectively with service server A and Service server D is adjacent, and service server C is adjacent with service server A, and service server D is adjacent with service server B, and Service server A, service server B, service server C and service server D pass through service name, address of service kimonos respectively Business message address label.
In the embodiments of the present disclosure, topology server can obtain the industry from each service server based on default RPC agreement The information on services of business server and the service address of each neighbours' service server, the information on services of the service server include Service name, address of service and the service address of the service server, thus the Service name based on each service server Title, address of service, service address and each neighbours' service server service address, determine network topology.Due to It does not need topology and explores script to determine network topology, also there is no need to construct harsh fortune during determining network topology Row condition, reduces the difficulty of determining network topology, to improve the reliability of determining network topology.
It referring to figure 3., is a kind of flow diagram of the method for determining network topology provided by the disclosure.This method is answered For in the interaction between service server and topology server.It should be noted that determination network topology described in the disclosure Method be not limitation with Fig. 3 and specific order as described below, it should be understood that in other embodiments, disclosure institute The sequence of the method part step for the determination network topology stated can be exchanged with each other according to actual needs or portion therein Also it can be omitted or delete step by step.Process shown in Fig. 3 will be described in detail below.
Step 301, service server is based on default RPC agreement, obtains the service address of each neighbours' service server.
Optionally, by RPC data packet, service address is obtained from each neighbours' service server, wherein RPC data Packet includes packet header and backpack body, and packet header includes the RPC interface volume of RPC protocol-identifier, RPC protocol version, purpose service server Number, the RPC interface index of source service server, transparent transmission sequence number and backpack body length.
In order to ensure the reliability communicated between service server and neighbours' service server, can be determined in advance The format of RPC data packet communicates to pass through the RPC data packet of the format with neighbours' service server.
For RPC protocol-identifier for illustrating that the data packet is RPC data packet, which can be by being arranged in advance Character or string representation.
RPC protocol version is used to illustrate the version of the used RPC agreement of present communications.
RPC interface index is in server for the number of interface set by RPC related service.It can by RPC interface To receive RPC request, and feed back corresponding RPC response.
Wherein, the RPC interface index of source service server is the RPC interface (i.e./rpc-node) of current business server Number, the RPC interface index of purpose service server are the RPC interface index of neighbours' service server.
It should be noted that the RPC interface index for working as source service server in the request of RPC transmitted by service server is When empty, neighbours' service server can not return to corresponding RPC response to the service server.
Transparent transmission sequence number is used to correspond RPC request with corresponding RPC response.Wherein, same transparent transmission sequence is carried Number RPC request and RPC response, as corresponding RPC request and RPC response.
Backpack body length is used to illustrate the length of backpack body in RPC data packet.
Backpack body is for carrying transmitted data.
For example, RPC data packet may include N number of byte, N is the integer more than or equal to 36.Wherein, 0-15 byte is RPC protocol-identifier, byte number 16, data type is BYTES (byte), and RPC protocol-identifier is CC30FF8230D311E8 9F32F2801F1B9FD1;16-19 byte is RPC protocol version, and byte number 4, data type is UINTEGER (from 0 Signless integer to 4,294,967,295), and the value of the RPC protocol version be 0X00000001, whenever RPC agreement more New primary, which increases by 1;20-23 byte is the RPC interface index of purpose service server, and byte number is 4, data type UINTEGER;24-27 byte is, the RPC interface index of source service server, byte number 4, data class Type is UINTEGER;28-31 byte is transparent transmission sequence number, byte number 4, data type UINTEGER;32-35 byte For backpack body length, byte number 4, data type UINTEGER;36-N byte is backpack body, byte number N-36+1, data Type is BYTES.
It can be communicated by way of asynchronous communication to be based on RPC agreement.When service server receives completely When RPC data packet, parse RPC entrained by the RPC data packet to the RPC data packet according to RPC interface number and request and locate Reason, searches the RPC interface index whether the RPC data packet carries source service server, if it is, please seek survival for the RPC At and return and carry the data packet of RPC response, and received RPC number is also carried in the data packet of carrying RPC response According to the transparent transmission sequence number in packet.
It should be noted that, for the data of integer type, can be deposited by network bytes sequence in the RPC data packet Store up the data, such as data or USHORT (from 0 to 65,535 signless integer) type of aforementioned middle UINTEGER type Data.
Optionally, it when establishing communication connection with each neighbours' service server, exchanges and services with each neighbours' service server Message address stores the service address of each neighbours' service server.
For the ease of in the new access service server of network system, the service server newly accessed is notified to opening up in time Server is flutterred, to be updated in time to the network topology of the network system, improves the accuracy of network topology, each business clothes Service address can be interchanged when establishing communication connection with neighbours' service server in business device.
Wherein, since TCP (Transmission Control Protocol, transmission control protocol) corresponds to transmit Therefore the agreement of layer, holding that can be more permanent in order to reduce the delay in communication process, improve communication efficiency, communication link Connecing may include TCP connection.
The service address of the service server can be sent to neighbours' service server by service server, as the neighbour When occupying service server and receiving the service address, the service address of neighbours' service server is sent to the industry Business server.
Optionally, after the service address for storing each neighbours' service server, at interval of the second preset duration, weight Service address newly is exchanged with each neighbours' service server, based on the service address exchanged again, to each neighbour of storage The service address for occupying service server is updated.
Since the communication connection between service server and neighbours' service server may disconnect, i.e. the service server Neighbours' service server may change, correspondingly, the network topology of the network system where the service server can also It can change, therefore, in order to determine neighbours' service server of service server, and then ensure the accurate of network topology Property, which can be at interval of the second preset duration, by exchanging service address with neighbours' service server Mode reaffirms current neighbours' service server.
Second preset duration can be by being arranged to obtain in advance.
For example, the second preset duration can be 15 seconds.
The service address of stored neighbours' service server can be replaced with and newly be got by service server The service address of neighbours' service server.
Optionally, when with the communication connection of each neighbours' service server disconnection, the clothes of each neighbours' service server are deleted Business message address.
When being disconnected due to the communication connection between service server and neighbours' service server, where the service server The network topology of network system can also change, therefore, so in order to avoid subsequent neighbours' service server by inaccuracy It is supplied to topology server, and then improves the reliability for determining network topology, it can be by already off neighbours' business service The service address of device is deleted.
Optionally, it when the broken communication connection with each neighbours' service server, at interval of the first preset duration, builds again The vertical communication connection with each neighbours' service server.
In order to ensure the reliability communicated between service server and each neighbours' service server, service server can After the broken communication connection between neighbours' service server, re-establish and leading between neighbours' service server Letter connection.
First preset duration can be by presetting to obtain.
For example, the first preset duration can be 5 seconds.
Optionally, after the service address for storing each neighbours' service server, if currently away from last update The duration when service address of each neighbours' service server is greater than third preset duration, then deletes each neighbours' service server Service address.
When neighbours' service server of storage, which obtains service address, not to be updated in a long time, the possible neighbours Service server is already off or other exceptions occurs, so neighbours' service server of service server may have occurred and that Change, so in order to avoid subsequent neighbours' service server by inaccuracy is supplied to topology server, and then improve and determine net The reliability of network topology can delete the service address for failing the neighbours' service server to timely update.
Third preset duration can by presetting to obtain, and third preset duration can be greater than the first preset duration and Second preset duration.
For example, third preset duration can be 45 seconds.
Step 302, service server obtains the information on services of service server.
Wherein, the information on services of the service server includes service name, address of service and the service letter of service server Cease address.
Optionally, the information on services of service server further includes the service release number of service server, service describing kimonos It is engaged at least one of time started.
Service release number (server_version) is used to illustrate the software version of service server service provided.
Service describing (server_desc) is for illustrating business provided by service server.
For example, the service describing of the service server for traffic distribution is " traffic distribution clothes in ad delivery systems Business ".
Service start times (start_time) are the time that the service server brings into operation.
Step 303, service server is based on default RPC agreement, by the information on services of service server and each neighbours' business The service address of server, is sent to topology server.
Wherein, the service address of the information on services of service server and each neighbours' service server is used for Topology service Device determines network topology.
For example, in ad delivery systems, topology server based on server 1 service address " http: // 192.168.0.1:8888/rpc-node ", the information on services and each neighbours' industry that server 1 provides are acquired from server 1 Business server service address include:
Wherein, the service name of server 1 is ssp_service, and service release number is 1.0.2, and service describing is flow Distribution service, address of service 192.168.0.1:8888, service address http: // 192.168.0.1:8888/ Rpc-node, service start times 1541409592, the service address of neighbours' service server are " http: // 192.168.0.2:8888/rpc-node"、"http://192.168.0.3:8889/rpc-node"、"http:// 192.168.0.4:8890/rpc-node"、"http://192.168.0.5:8891/rpc-node"、"http:// 192.168.0.6:8892/rpc-node"。
Step 304, topology server is based on default RPC agreement, and the clothes of the service server are obtained from each service server The service address for the information and each neighbours' service server of being engaged in.
Wherein, the information on services of the service server includes service name, address of service and the service letter of service server Cease address.
Optionally, the service address of each neighbours' service server of each service server, by service server and respectively Neighbours' service server is based on default RPC agreement Exchange Service message address and obtains.
Topology server can obtain in advance (for example to be obtained or is established at least one service server logical by default Letter connection obtains) service address of at least one service server in network system, later, can based on this at least one The service address of a service server obtains the information on services and each service server of at least one service server Neighbours' service server service address, then the service address based on each neighbours' service server, according to identical Mode, obtain the information on services of neighbours' service server and the service address of neighbours' service server, until obtain To the service of each neighbours' service server of the information on services and service server of each service server of the network system Message address.
Step 305, service name of the topology server based on each service server, address of service, service address and The service address of each neighbours' service server determines network topology.
Wherein, service name, address of service, service address and each neighbour of the topology server based on each service server The service address for occupying service server determines the mode of network topology, and the correlation that may refer in abovementioned steps 202 is retouched It states, no longer repeats one by one herein.
In the embodiments of the present disclosure, firstly, service server can obtain each neighbours' business service based on default RPC agreement The service address of device, and the information on services of the service server is obtained, based on default RPC agreement, by the service server Information on services and each neighbours' service server service address, topology server is sent to, correspondingly, topology server The information on services of the service server and the service address of each neighbours' service server can be obtained from each service server, To the service of service name, address of service, service address and each neighbours' service server based on each service server Message address determines network topology.Network topology is determined due to not needing topology exploration script, and also there is no need in determination Harsh service condition is constructed during network topology, reduces the difficulty of determining network topology, to improve determining net The reliability of network topology.
Secondly, service server can be with each neighbours' service server by exchanging service address, so that it is guaranteed that energy It is enough to notify to carry out more to topology server with the network topology in time to the network system by the service server newly accessed in time Newly, the accuracy of network topology is improved,
It referring to figure 4., is a kind of the functional block diagram of the device 400 of determining network topology provided by the disclosure. The device 400 of the determination network topology is applied to service server.It should be noted that determining network provided by the present embodiment The technical effect of the device 400 of topology, basic principle and generation is identical as aforementioned corresponding embodiment of the method, briefly to retouch It states, does not refer to part in the present embodiment, can refer to the corresponding contents in embodiment of the method.The device 400 of the determination network topology Include:
First obtains module 401, for being based on default RPC agreement, with obtaining the information on services of each neighbours' service server Location;
Second obtains module 402, for obtaining the information on services of the service server, the information on services of the service server Service name, address of service and service address including the service server;
Sending module 403, for based on the default RPC agreement, by the information on services of the service server and each neighbours The service address of service server, is sent to topology server, the information on services of the service server and respectively neighbours' industry The service address of business server determines network topology for the topology server.
Optionally, which is specifically used for:
When establishing communication connection with respectively neighbours' service server, information on services is exchanged with respectively neighbours' service server Address;
Store the service address of respectively neighbours' service server.
Optionally, referring to figure 5., the device further include:
Module 404 is established, for being preset when with the respectively broken communication connection of neighbours' service server at interval of first Duration re-establishes the communication connection with respectively neighbours' service server.
Optionally, which is specifically used for:
At interval of the second preset duration, service address is exchanged with respectively neighbours' service server again;
Based on the service address exchanged again, to the service address of respectively neighbours' service server of storage into Row updates.
Optionally, Fig. 6 is please referred to, the device further include:
First removing module 405, for deleting the respectively neighbour when with the communication connection of respectively neighbours' service server disconnection Occupy the service address of service server.
Optionally, Fig. 7 is please referred to, the device further include:
Second removing module 406, if for the information on services currently away from each neighbours' service server of last update Duration when address is greater than third preset duration, then deletes the service address of respectively neighbours' service server.
Optionally, which is specifically used for:
By RPC data packet, service address is obtained from respectively neighbours' service server;
Wherein, which includes packet header and backpack body, which includes RPC protocol-identifier, RPC protocol version, mesh The RPC interface index of service server, the RPC interface index of source service server, transparent transmission sequence number and backpack body length.
Optionally, the information on services of the service server further includes the service release number of the service server, service describing At least one of with service start times.
The method that above-mentioned apparatus is used to execute previous embodiment offer, it is similar that the realization principle and technical effect are similar, herein not It repeats again.
Fig. 8 is please referred to, is a kind of the functional block diagram of the device 800 of determining network topology provided by the disclosure. The device 800 of the determination network topology is applied to topology server.It should be noted that determining network provided by the present embodiment The technical effect of the device 800 of topology, basic principle and generation is identical as aforementioned corresponding embodiment of the method, briefly to retouch It states, does not refer to part in the present embodiment, can refer to the corresponding contents in embodiment of the method.The device 900 of the determination network topology Include:
Module 801 is obtained, for obtaining the service of the service server from each service server based on default RPC agreement The service address of information and each neighbours' service server, the information on services of the service server include the service server Service name, address of service and service address;
Determining module 802, for based on the respectively service server service name, address of service, service address and The respectively service address of neighbours' service server determines network topology.
Optionally, each service address of each neighbours' service server of the service server, by the service server The default RPC agreement Exchange Service message address is based on respectively neighbours' service server to obtain.
The method that above-mentioned apparatus is used to execute previous embodiment offer, it is similar that the realization principle and technical effect are similar, herein not It repeats again.
The above module can be arranged to implement one or more integrated circuits of above method, such as: one Or multiple specific integrated circuits (Application Specific Integrated Circuit, abbreviation ASIC), or, one Or multi-microprocessor (digital singnal processor, abbreviation DSP), or, one or more field programmable gate Array (Field Programmable Gate Array, abbreviation FPGA) etc..For another example, when some above module passes through processing elements When the form of part scheduler program code is realized, which can be general processor, such as central processing unit (Central Processing Unit, abbreviation CPU) or it is other can be with the processor of caller code.For another example, these modules can integrate Together, it is realized in the form of system on chip (system-on-a-chip, abbreviation SOC).
Fig. 9 is please referred to, is the functional block diagram of a kind of electronic equipment provided by the disclosure.The electronic equipment can be with Computer readable storage medium 901 and processor 902 including being stored with computer program, processor 902 can call calculating The computer program that machine readable storage medium storing program for executing 901 stores.When the computer program is read and is run by processor 902, Ke Yishi Existing above method embodiment.Specific implementation is similar with technical effect, and which is not described herein again.
Optionally, the disclosure also provides a computer readable storage medium, is stored thereon with computer program, the computer When program is read out by the processor and runs, above method embodiment may be implemented.
In several embodiments provided by the disclosure, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
Above-mentioned integrated unit both can take the form of hardware realization, can also add SFU software functional unit using hardware Form is realized.
It should be noted that, in this document, the relational terms of such as " first " and " second " or the like are used merely to one A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to Cover non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or setting Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing is merely preferred embodiment of the present disclosure, are not limited to the disclosure, for the skill of this field For art personnel, the disclosure can have various modifications and variations.It is all within the spirit and principle of the disclosure, it is made any to repair Change, equivalent replacement, improvement etc., should be included within the protection scope of the disclosure.

Claims (20)

1. a kind of method of determining network topology, which is characterized in that be applied to service server, which comprises
Based on default remote procedure call agreement, the service address of each neighbours' service server is obtained;
The information on services of the service server is obtained, the information on services of the service server includes the service server Service name, address of service and service address;
Based on the default RPC agreement, by the clothes of the information on services of the service server and each neighbours' service server It is engaged in message address, is sent to topology server, the information on services of the service server and each neighbours' service server Service address determines network topology for the topology server.
2. determining the method for network topology as described in claim 1, which is characterized in that it is described based on default RPC agreement, it obtains The service address of each neighbours' service server, comprising:
When establishing communication connection with each neighbours' service server, information on services is exchanged with each neighbours' service server Address;
Store the service address of each neighbours' service server.
3. determining the method for network topology as claimed in claim 2, which is characterized in that the method also includes:
When the broken communication connection with each neighbours' service server, at interval of the first preset duration, re-establish with respectively The communication connection of neighbours' service server.
4. determining the method for network topology as claimed in claim 2, which is characterized in that in each neighbours' business of storage It is described based on default RPC agreement after the service address of server, with obtaining the information on services of each neighbours' service server Location, further includes:
At interval of the second preset duration, service address is exchanged with each neighbours' service server again;
Based on the service address exchanged again, the service address of each neighbours' service server of storage is carried out It updates.
5. determining the method for network topology as claimed in claim 2, which is characterized in that in each neighbours' business of storage After the service address of server, the method also includes:
When with the communication connection of each neighbours' service server disconnection, the service letter of each neighbours' service server is deleted Cease address.
6. determining the method for network topology as claimed in claim 2, which is characterized in that in each neighbours' business of storage After the service address of server, the method also includes:
If it is pre- that duration when service address currently away from each neighbours' service server of last update is greater than third If duration, then the service address of each neighbours' service server is deleted.
7. determining the method for network topology as claimed in claim 1 or 2, which is characterized in that it is described to be based on default RPC agreement, Obtain the service address of each neighbours' service server, comprising:
By RPC data packet, service address is obtained from each neighbours' service server;
Wherein, the RPC data packet includes packet header and backpack body, and the packet header includes RPC protocol-identifier, RPC protocol version, mesh The RPC interface index of service server, the RPC interface index of source service server, transparent transmission sequence number and backpack body length.
8. determining the method for network topology as described in claim 1, which is characterized in that the information on services of the service server It further include at least one of the service release number, service describing and service start times of the service server.
9. a kind of method of determining network topology, which is characterized in that be applied to topology server, which comprises
Based on default RPC agreement, the information on services and each neighbours' business clothes of the service server are obtained from each service server The service address of business device, the information on services of the service server include the service name of the service server, service Address and service address;
Service name, address of service, service address and each neighbours' business service based on each service server The service address of device determines network topology.
10. determining the method for network topology as claimed in claim 9, which is characterized in that each neighbour of each service server The service address for occupying service server is based on described default by the service server and each neighbours' service server RPC agreement Exchange Service message address obtains.
11. a kind of device of determining network topology, which is characterized in that be applied to service server, described device includes:
First obtains module, for obtaining the service address of each neighbours' service server based on default RPC agreement;
Second obtains module, for obtaining the information on services of the service server, the information on services packet of the service server Include service name, address of service and the service address of the service server;
Sending module, for being based on the default RPC agreement, by the information on services of the service server and each neighbours' industry The service address of business server, is sent to topology server, the information on services of the service server and each neighbours The service address of service server determines network topology for the topology server.
12. determining the device of network topology as claimed in claim 11, which is characterized in that the first acquisition module is specifically used In:
When establishing communication connection with each neighbours' service server, information on services is exchanged with each neighbours' service server Address;
Store the service address of each neighbours' service server.
13. determining the device of network topology as claimed in claim 12, which is characterized in that described device further include:
Module is established, for when the broken communication connection with each neighbours' service server, at interval of the first preset duration, Re-establish the communication connection with each neighbours' service server.
14. determining the device of network topology as claimed in claim 12, which is characterized in that the first acquisition module is specifically used In:
At interval of the second preset duration, service address is exchanged with each neighbours' service server again;
Based on the service address exchanged again, the service address of each neighbours' service server of storage is carried out It updates.
15. determining the device of network topology as claimed in claim 12, which is characterized in that described device further include:
First removing module, for deleting each neighbours when with the communication connection of each neighbours' service server disconnection The service address of service server.
16. determining the device of network topology as claimed in claim 12, which is characterized in that described device further include:
Second removing module, if when for service address currently away from each neighbours' service server of last update Duration be greater than third preset duration, then delete the service address of each neighbours' service server.
17. the device of the determination network topology as described in claim 11 or 12, which is characterized in that described first obtains module tool Body is used for:
By RPC data packet, service address is obtained from each neighbours' service server;
Wherein, the RPC data packet includes packet header and backpack body, and the packet header includes RPC protocol-identifier, RPC protocol version, mesh The RPC interface index of service server, the RPC interface index of source service server, transparent transmission sequence number and backpack body length.
18. determining the device of network topology as claimed in claim 11, which is characterized in that the service of the service server is believed Breath further includes at least one of service release number, service describing and service start times of the service server.
19. a kind of device of determining network topology, which is characterized in that be applied to topology server, described device includes:
Obtain module, for based on default RPC agreement, from each service server obtain the service server information on services and The service address of each neighbours' service server, the information on services of the service server include the clothes of the service server Business title, address of service and service address;
Determining module, for the service name based on each service server, address of service, service address and each described The service address of neighbours' service server determines network topology.
20. determining the device of network topology as claimed in claim 19, which is characterized in that each neighbour of each service server The service address for occupying service server is based on described default by the service server and each neighbours' service server RPC agreement Exchange Service message address obtains.
CN201910134995.3A 2019-02-20 2019-02-20 Method and device for determining network topology Active CN109660410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910134995.3A CN109660410B (en) 2019-02-20 2019-02-20 Method and device for determining network topology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910134995.3A CN109660410B (en) 2019-02-20 2019-02-20 Method and device for determining network topology

Publications (2)

Publication Number Publication Date
CN109660410A true CN109660410A (en) 2019-04-19
CN109660410B CN109660410B (en) 2022-02-01

Family

ID=66122992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910134995.3A Active CN109660410B (en) 2019-02-20 2019-02-20 Method and device for determining network topology

Country Status (1)

Country Link
CN (1) CN109660410B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5892903A (en) * 1996-09-12 1999-04-06 Internet Security Systems, Inc. Method and apparatus for detecting and identifying security vulnerabilities in an open network computer communication system
KR20090052512A (en) * 2007-11-21 2009-05-26 주식회사 케이티 System and method for discovering network topology, storage medium recording that method program
CN101714942A (en) * 2009-11-12 2010-05-26 中国人民解放军国防科学技术大学 BGP-guided method for discovering real-time autonomous system-level topology
CN102647312A (en) * 2012-05-09 2012-08-22 浙江宇视科技有限公司 Method and device for whole network multicast topology
CN104518927A (en) * 2014-12-15 2015-04-15 清华大学 Detecting method and device of error connection in data center network
US20180205613A1 (en) * 2017-01-17 2018-07-19 Electronics And Telecommunications Research Institute Method for automatically allocating ip address for distributed storage system in large-scale torus network and apparatus using the same
CN109327342A (en) * 2018-11-27 2019-02-12 哈尔滨理工大学 A kind of the adaptive SD N analogue system and emulation platform of task based access control driving

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5892903A (en) * 1996-09-12 1999-04-06 Internet Security Systems, Inc. Method and apparatus for detecting and identifying security vulnerabilities in an open network computer communication system
KR20090052512A (en) * 2007-11-21 2009-05-26 주식회사 케이티 System and method for discovering network topology, storage medium recording that method program
CN101714942A (en) * 2009-11-12 2010-05-26 中国人民解放军国防科学技术大学 BGP-guided method for discovering real-time autonomous system-level topology
CN102647312A (en) * 2012-05-09 2012-08-22 浙江宇视科技有限公司 Method and device for whole network multicast topology
CN104518927A (en) * 2014-12-15 2015-04-15 清华大学 Detecting method and device of error connection in data center network
US20180205613A1 (en) * 2017-01-17 2018-07-19 Electronics And Telecommunications Research Institute Method for automatically allocating ip address for distributed storage system in large-scale torus network and apparatus using the same
CN109327342A (en) * 2018-11-27 2019-02-12 哈尔滨理工大学 A kind of the adaptive SD N analogue system and emulation platform of task based access control driving

Also Published As

Publication number Publication date
CN109660410B (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN103618800B (en) The implementation method and device of subscribing notification
Peterson et al. Computer networks: a systems approach
EP1139674B1 (en) Signaling server
CN103312615B (en) Use the longest prefix match search of variable number prefix
CN104639596B (en) System and method for supporting multiple transmitters in the low latency FIFO information receiving and transmitting using RDMA
US8903972B2 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN108200165A (en) Ask Transmission system, method, apparatus and storage medium
CN103825826B (en) The implementation method and device of a kind of dynamic routing
EP2919426B1 (en) Concurrent hashes and sub-hashes on data streams
CN109922144A (en) Method and apparatus for handling data
CN112822115B (en) Service framework construction method and system based on plug-in engine
CN106330610A (en) Load balance processing system and method
CN101110780A (en) Method, device and system for transmitting control data flow
CN109379764A (en) File transmitting method and device
CN101127768A (en) Method, device and system for creating multi-dimension inter-network protocol
CN109639767A (en) A kind of Service Gateway data processing method, device, equipment
CN109660410A (en) Determine the method and device of network topology
Schneidewind Interconnecting local networks to long-distance networks
CN109831473A (en) Logistics service providing method and equipment
CN110535959A (en) A kind of method, apparatus and computer readable storage medium for transmitting data
TWI222289B (en) System for returning rates back to content providers, gateway used for the system, and method of doing the same
CN104822140B (en) A kind of method and network communicating system of data query
CN101110828A (en) Method, device and system for establishing process-to-process communication
Britton et al. TCP/IP: The next generation
CN104243522B (en) Method and wideband network gateway for HTTP network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant