CN110351146A - A kind of server-side example determines method, system, client and storage medium - Google Patents

A kind of server-side example determines method, system, client and storage medium Download PDF

Info

Publication number
CN110351146A
CN110351146A CN201910655790.XA CN201910655790A CN110351146A CN 110351146 A CN110351146 A CN 110351146A CN 201910655790 A CN201910655790 A CN 201910655790A CN 110351146 A CN110351146 A CN 110351146A
Authority
CN
China
Prior art keywords
server
service end
connection
connectivity
client
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.)
Pending
Application number
CN201910655790.XA
Other languages
Chinese (zh)
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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910655790.XA priority Critical patent/CN110351146A/en
Publication of CN110351146A publication Critical patent/CN110351146A/en
Pending legal-status Critical Current

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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • 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/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

A kind of server-side example provided by the present application determines method, is applied to client, comprising: obtains the configuration information of the corresponding all server-side examples of destination service;According to configuration information, connection server-side example is attempted, and obtains the connectivity connecting with client and connection delay data;According to connectivity and connection delay data, destination service end example is determined.This method obtains the connectivity connecting with client and connection delay data, and determines destination service end example.Since connectivity and connection delay data reflect the connection delay state between client and server-side example, therefore determine that destination service end example can determine more preferably server-side example compared with prior art according to connectivity and connection delay data, and then improve the transmission efficiency with the connectivity of client, the stability that service provides and information exchange.Disclosed herein as well is a kind of server-side examples to determine system and a kind of client and a kind of computer readable storage medium, all has above-mentioned beneficial effect.

Description

A kind of server-side example determines method, system, client and storage medium
Technical field
This application involves server-side examples to determine technical field, more specifically to a kind of server-side example determination side Method, system and a kind of client and a kind of computer readable storage medium.
Background technique
With the increasingly prosperity of micro services framework, more enterprises select micro services frameworks to dispose business on line, with The continuous growth of business, service fragmentation is serious, and server-side instance number increases significantly, and multimachine device is disposed across computer room, cross operator The case where it is more and more.Wherein, server-side example refers to the program of deployment on the server.Such as client passes through http The program of request user information, the processing request disposed in the server-side that domain name is directed toward is exactly a server-side example.
Micro services framework is a kind of architecture mode, it is advocated single application procedure division into one group of small service, service Between it is mutually coordinated, work in coordination, provide final value for user.Each service operation in its independent process, service and (the Restful API for being normally based on HTTP) is communicated with each other using the communication mechanism of lightweight between service.Each service It is constructed around specific business, and production environment, class production environment etc. can be deployed to by independent.Namely It says, micro services framework refers to that each server-side example for servicing and having more parts to be deployed on different server, client need to visit When asking the service, wherein any one server-side example is arbitrarily connected.
It is current in the related technology, client is when determining server-side example, also simply by poll, random or press weight The modes such as random determine server-side example, which is often poor server-side example, is caused and client Connectivity, service provide stability and information exchange transmission efficiency it is poor, practical application scene and across computer room across fortune It seeks in the deployed environment of quotient, in order to guarantee connectivity, stability and efficiency of transmission, needs artificially to carry out intervention configuration.
Therefore, how to determine more preferably server-side example, and then the stabilization provided with the connectivity of client, service is provided Property and information exchange transmission efficiency, avoid human intervention configuration the technical issues of being those skilled in the art's urgent need to resolve.
Summary of the invention
A kind of server-side example of being designed to provide of the application determines method, system and a kind of client and a kind of calculating Machine readable storage medium storing program for executing, can determine more preferably server-side example, so improve with the connectivity of client, service offer it is steady Qualitative and information exchange transmission efficiency, avoids human intervention from configuring.
To achieve the above object, this application provides a kind of server-side examples to determine method, is applied to client, comprising:
Obtain the configuration information of the corresponding all server-side examples of destination service;
According to the configuration information, attempt to connect the server-side example, and obtain the connection connecting with the client Property and connection delay data;
According to the connectivity and the connection delay data, destination service end example is determined.
Preferably, described according to the configuration information, it attempts to connect the server-side example and obtain and the client The connection delay data of the server-side example of successful connection, comprising:
According to the configuration information, first service end example is filtered out from all server-side examples;Wherein, described First service end example is to be deployed in load lower than the server-side example on the server of preset threshold, and the configuration information includes Server load information;
It attempts to connect each first service end example, and obtains the connectivity and connection delay of second service end example Data;Wherein, second service end example is the first service end example with the client successful connection.
Preferably, the trial connects each first service end example, and obtains the connection of second service end example Property and connection delay data, comprising:
Whether the quantity of the IP address of server is greater than 1 where judging any first service end example;
If the quantity of the IP address of the server is greater than 1 where the example of the first service end, it tries connection All IP address, and obtain the connection state information of each IP address;
According to the connection state information, the target ip address in all IP address is determined;
The corresponding target ip address of first service end example is connected, and obtains the described of second service end example Connect delay data.
Preferably, described according to the connectivity and the connection delay data, determine destination service end example, comprising:
According to the connectivity, each connection delay data is ranked up, and picks out and meets preset condition Server-side example is as destination service end example.
Preferably, described to be ranked up each connection delay data according to the connectivity, and pick out satisfaction The server-side example of preset condition is as destination service end example, comprising:
According to the connectivity, each connection delay data is ranked up, and the server-side for being delayed minimum is real Example is used as destination service end example.
Preferably, described according to the connectivity and the connection delay data, after determining destination service end example, also Include:
In real time according to Network status and load state, destination service end example is adaptively changed.
Preferably, real-time foundation Network status and the load state, adaptively change destination service end example, wrap It includes:
Judge whether the time interval of the last change destination service end example of distance reaches prefixed time interval threshold Value;
If the time interval apart from last change destination service end example reaches the prefixed time interval threshold value, Then according to the Network status and the load state, switch destination service end example.
To achieve the above object, present invention also provides a kind of server-side examples to determine system, is applied to client, packet It includes:
Configuration information obtains module, for obtaining the configuration information of the corresponding all server-side examples of destination service;
It connects delay data and obtains module, for attempting to connect the server-side example, and obtain according to the configuration information Take the connectivity connecting with the client and connection delay data;
Destination service end example determining module, for determining target according to the connectivity and the connection delay data Server-side example.
To achieve the above object, present invention also provides a kind of clients, comprising:
Memory and processor;Wherein, the memory is for storing computer program, and the processor is for executing institute The step of server-side example described above determines method is realized when stating computer program.
To achieve the above object, described computer-readable to deposit present invention also provides a kind of computer readable storage medium Storage media is stored with computer program, and the computer program realizes that server-side example described above is true when being executed by processor The step of determining method.
By above scheme it is found that a kind of server-side example provided by the present application determines method, it is applied to client, packet It includes: obtaining the configuration information of the corresponding all server-side examples of destination service;According to the configuration information, attempt to connect the clothes Business end example, and obtain the connectivity connecting with the client and connection delay data;According to the connectivity and the company Delay data is connect, determines destination service end example.
This method obtains the connectivity connecting with client and connection delay data, and according to connectivity and connection delay number According to determining destination service end example.Since connectivity and connection delay data reflect between client and server-side example Delay state is connected, therefore determines destination service end example compared to passing through in the related technology according to connectivity and connection delay data Poll, random or modes determine server-side example by weight is random etc., can determine more preferably server-side example, so improve with Connectivity, the stability of service offer and the transmission efficiency of information exchange of client, avoid human intervention from configuring.The application is also It discloses a kind of server-side example and determines system and a kind of client and a kind of computer readable storage medium, all having above-mentioned has Beneficial effect, details are not described herein.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of server-side example deployment schematic diagram disclosed in the embodiment of the present application;
Fig. 2 determines the flow chart of method for a kind of server-side example disclosed in the embodiment of the present application;
Fig. 3 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method;
Fig. 4 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method;
Fig. 5 is the preferred schematic diagram of a kind of single service circuit disclosed in the embodiment of the present application;
Fig. 6 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method;
Fig. 7 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method;
Fig. 8 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method;
Fig. 9 is a kind of live streaming dispatch service schematic diagram disclosed in the embodiment of the present application;
Figure 10 determines the structural block diagram of system for a kind of server-side example disclosed in the embodiment of the present application;
Figure 11 is a kind of structural schematic diagram of client disclosed in the embodiment of the present application.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
The description and claims of this application and the term " first " in above-mentioned attached drawing, " second " are for distinguishing class As object, rather than be used to describe a particular order or precedence order.It should be understood that the data used in this way are in appropriate situation Under can be interchanged, so that the embodiments described herein can be real with the sequence other than the content for illustrating or describing herein It applies.In addition, term " includes " and " having " and their any deformation, it is intended that cover it is non-exclusive include, for example, packet The process, method, system, product or equipment for having contained a series of steps or units those of be not necessarily limited to be clearly listed step or Unit, but may include other steps being not clearly listed or intrinsic for these process, methods, product or equipment or Unit.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims Protection scope within.
With the increasingly prosperity of micro services framework, more enterprises select micro services frameworks to dispose business on line, with The continuous growth of business, service fragmentation is serious, and server-side instance number increases significantly, and multimachine device is disposed across computer room, cross operator The case where it is more and more.Wherein, server-side example refers to the program of deployment on the server.Such as client passes through http The program of request user information, the processing request disposed in the server-side that domain name is directed toward is exactly a server-side example.
Micro services framework refers to that each server-side example for servicing and having more parts to be deployed on different server, client need When accessing the service, wherein any one server-side example is arbitrarily connected.Specifically referring to Figure 1, Fig. 1 is that the application is real A kind of server-side example deployment schematic diagram disclosed in example is applied, as shown in Figure 1, in the dotted line frame (indicating " service A- cluster ") on the left side Comprising two solid box, it is " server-side A- example 1 " and " server-side A- example 2 " respectively in two solid box, indicates that service A has Two server-side examples (server-side example 1 and server-side example 2);Include in the dotted line frame (indicating " service B- cluster ") on the right Two solid box are " server-side B- example 1 " and " server-side B- example 2 " respectively in two solid box, indicate there are two service B Server-side example (server-side example 1 and server-side example 2);In Fig. 1 " client " respectively with " server-side A- example 1 ", " service It holds B- example 1 " to connect, indicates that client is connected to the server-side example 1 of the server-side example 1 of service A, service B respectively.
It is current in the related technology, client is when determining server-side example, also simply by poll, random or press weight The modes such as random determine server-side example, which is often poor server-side example, is caused and client Connectivity, service provide stability and information exchange transmission efficiency it is poor, practical application scene and across computer room across fortune It seeks in the deployed environment of quotient, in order to guarantee connectivity, stability and efficiency of transmission, needs artificially to carry out intervention configuration.
Therefore, a kind of server-side example of being designed to provide of the application determines method, can determine more preferably server-side Example, and then the transmission efficiency with the connectivity of client, the stability that service provides and information exchange is improved, it avoids artificially dry It is pre-configured.Fig. 2 is specifically referred to, Fig. 2 determines the flow chart of method for a kind of server-side example disclosed in the embodiment of the present application, should Server-side example determines that method specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
The executing subject of the present embodiment is client, and client obtains matching for the corresponding all server-side examples of destination service Confidence breath.Destination service is not especially limited at this, destination service is one of all services or a variety of, usually according to real Depending on the demand of border.For example, destination service is statistical fractals and/or log services.Each service all has at least one server-side Example, and each server-side example deployment of same service is on a different server, each server-side example all has configuration Information.Configuration information is not especially limited at this, corresponding setting should be made according to the actual situation by those skilled in the art, The configuration information generally includes: place server name, service name, server ip list, listening port, server load etc. One of information is a variety of.The acquisition object of the configuration information of each server-side example is not especially limited herein, visitor Family end directly can obtain configuration information from the server where each server-side example respectively;It can also be from central server Central database obtains the configuration information of all server-side examples, on condition that each server-side example matches confidence for respective in advance Breath reports to central server, then is summarized by central server homogeneous classification.The configuration information of all server-side examples is in After central server homogeneous classification summarizes, not only error is smaller, and shared device resource is smaller, therefore client is usually therefrom genuinely convinced The central database of business device obtains the configuration information of all server-side examples.
S2, the connectivity being connect according to configuration information, trial connection server-side example, and acquisition with client and connection are prolonged When data;
Client, according to configuration information, is tasted after the configuration information for obtaining the corresponding all server-side examples of destination service Examination connection server-side example simultaneously obtains the connectivity connecting with client and connection delay data.In step sl, client obtains What is taken is the configuration information of all server-side examples, and in step s 2, the server-side example that client attempts connection can be All server-side examples in step S1 are also possible to the partial service end example filtered out from all server-side examples.If Client attempt connection server-side example be the partial service end example filtered out from all server-side examples, herein for Screening criteria is not especially limited, and corresponding setting, such as screening mark should be made according to the actual situation by those skilled in the art Whether will definitely be lower than preset threshold with the load for the server disposed by server-side example.
Either all server-side examples, or the part clothes filtered out from all server-side examples according to screening criteria Business end example, during client is its trial connection it is possible that with some server-side example connection failures, but no matter Corresponding connection delay data is all had whether successful connection, which is used to characterize client and attempts connection Connection delay state between server-side example.
S3, according to connectivity and connection delay data, determine destination service end example.
Client is delayed after obtaining the connectivity connecting with client and connection delay data according to connectivity and connection Data determine destination service end example.From the foregoing, it can be understood that the connection delay data is used to characterize client and attempt the clothes of connection Connection delay state between end example of being engaged in can determine more preferably server-side example (i.e. target based on this connection delay data Server-side example).It is understood that the destination service end example is in all server-side examples with client successful connection A server-side example.The present embodiment determines that the mode of destination service end example does not limit specifically to based on connection delay data It is fixed, such as can be and be ranked up each connection delay data, then taken the server-side example for being delayed minimum as target Business end example;The some clothes for meeting default time delay condition can also be filtered out after being ranked up each connection delay data Business end example, then a server-side example is selected at random as destination service end example from these server-side examples.
This method obtains the connectivity connecting with client and connection delay data, and according to connectivity and connection delay number According to determining destination service end example.Since connectivity and connection delay data reflect between client and server-side example Delay state is connected, therefore determines destination service end example compared to passing through in the related technology according to connectivity and connection delay data Poll, random or modes determine server-side example by weight is random etc., can determine more preferably server-side example, so improve with Connectivity, the stability of service offer and the transmission efficiency of information exchange of client, avoid human intervention from configuring.
Based on the above embodiment, above-mentioned according to configuration information in the present embodiment, attempt connection server-side example, and obtain with The connectivity and connection delay data of client connection, generally include: according to configuration information, screening from all server-side examples First service end example out;Wherein, first service end example is to be deployed in load lower than the service on the server of preset threshold Example is held, configuration information includes server load information;Connection each first service end example is attempted, and obtains second service end The connectivity and connection delay data of example;Wherein, second service end example is the first service end with client successful connection Example.Fig. 3 is specifically referred to, Fig. 3 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method, should Server-side example determines that method specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
S21, according to configuration information, first service end example is filtered out from all server-side examples;Wherein, first service End example is to be deployed in load lower than the server-side example on the server of preset threshold, and configuration information includes server load letter Breath;
S22, connection each first service end example is attempted, and obtains the connectivity and connection delay of second service end example Data;Wherein, second service end example is the first service end example with client successful connection;
S3, according to connectivity and connection delay data, determine destination service end example.
The server-side example (i.e. first service end example) for defining that client attempts connection in the present embodiment is to be deployed in Load is herein not especially limited the preset threshold of load, answers lower than the server-side example on the server of preset threshold It makes corresponding setting according to the actual situation by those skilled in the art, such as the preset threshold can be set as to 80%, i.e. portion Affixing one's name to the server-side example on server of the load lower than 80% is first service end example;If not loading the clothes lower than 80% Business device, then according to load by server orders, filtering out the server-side example loaded on lower server is first service end Example.It is screened it is understood that the present embodiment will be deployed in load lower than the server-side example on the server of preset threshold Out, then by client with it attempts to connect, obtains first service end example (the i.e. second service end with client successful connection Example) connectivity and connection delay data, be equivalent to the preliminary screening for having carried out determining destination service end example.
Based on the above embodiment, above-mentioned trial connects each first service end example in the present embodiment, and obtains the second clothes The connectivity and connection delay data for end example of being engaged in, generally include: the IP of server where judging any first service end example Whether the quantity of address is greater than 1;If the quantity of the IP address of server is greater than 1 where the example of first service end, it tries connection All IP address, and obtain the connection state information of each IP address;According to connection state information, determine in all IP address Target ip address;The corresponding target ip address of first service end example is connected, and obtains the connection delay of second service end example Data.Fig. 4 is specifically referred to, Fig. 4 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method, should Server-side example determines that method specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
S21, according to configuration information, first service end example is filtered out from all server-side examples;Wherein, first service End example is to be deployed in load lower than the server-side example on the server of preset threshold, and configuration information includes server load letter Breath;
S221, judge whether the quantity of the IP address of any first service end example place server is greater than 1;
If the quantity of the IP address of server is greater than 1 where S222, first service end example, it tries with connecting all IP Location, and obtain the connection state information of each IP address;
S223, according to connection state information, determine the target ip address in all IP address;
S224, the corresponding target ip address of connection first service end example, and the connection for obtaining second service end example is prolonged When data;
S3, according to connectivity and connection delay data, determine destination service end example.
The present embodiment is defined step S22 in above-described embodiment, and client is attempting connection first service end reality When example, whether the quantity of the IP address of server is greater than 1 where judging any first service end example.If first service end example The quantity of the IP address of place server is not more than 1, since the quantity of IP address is greater than 0, therefore quantity of the IP address etc. In 1, client can only be attempted to connect with the IP address;If the quantity of the IP address of server is greater than where the example of first service end 1, it tries connect all IP address, and obtain the connection state information of each IP address.Herein for the quantity of IP address and Each IP address institute home-operator is not especially limited, and should be made according to the actual situation by those skilled in the art corresponding Setting.For example, the quantity of IP address there are 2, and it is respectively belonging to mobile and telecommunications (moving IP address, telecommunications IP address); The quantity of IP address has 3, and is respectively belonging to movement, telecommunications and connection and (moves IP address, telecommunications IP address, connection IP Address).Since each IP address corresponds to a connection state information, therefore according to connection state information, all IP address are determined In target ip address.Wherein, connection state information generally includes connectivity and connection duration.If where the example of first service end The quantity of the IP address of server is 1, then can only determine it as target ip address according to connection state information;If first service The quantity of the IP address of server is greater than 1 where holding example, then according to the connection state information of each IP address, therefrom determines one A IP address is as target ip address.For example, as shown in figure 5, Fig. 5 is that a kind of single service circuit disclosed in the embodiment of the present application is excellent Schematic diagram is selected, there are three types of the IP address of different operators (telecommunications IP address, connection for 1 place server of server-side A- example tool in Fig. 5 Logical IP address, mobile IP address), client is attempted to connect all IP address, and connection status is 7 milliseconds, 5 milliseconds and connection respectively Failure, selects connection IP address as target ip address according to result.
Further, if the quantity of the IP address of server where the example of above-mentioned first service end is greater than 1, it tries connection All IP address, and the connection state information of each IP address is obtained, it generally includes: if server where the example of first service end The quantity of IP address be greater than 1, and respectively telecommunications IP address, connection IP address, mobile IP address, it tries connection telecommunications IP Address, connection IP address and mobile IP address;The connectivity of letter IP address and the company of connection duration, connection IP address are obtained respectively The general character and connection duration, the connectivity of mobile IP address and connection duration.Embodiment defines where the example of first service end The quantity of the IP address of server is greater than 1, and respectively telecommunications IP address, connection IP address, mobile IP address.
Based on above-mentioned any embodiment, in the present embodiment it is above-mentioned according to connectivity and connection delay data, determine target take Business end example, generally includes: according to connectivity, each connection delay data being ranked up, and picks out and meets preset condition Server-side example as destination service end example.The present embodiment is defined step S3 in above-mentioned any embodiment, This is defined step S3 by taking above-mentioned a certain embodiment as an example, and above-mentioned other embodiments are similar, specifically refers to Fig. 6, Fig. 6 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method, which determines method It specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
S2, the connectivity being connect according to configuration information, trial connection server-side example, and acquisition with client and connection are prolonged When data;
S31, according to connectivity, each connection delay data is ranked up, and pick out the service for meeting preset condition Hold example as destination service end example.
Each connection delay data is ranked up in the present embodiment, and picks out the server-side example for meeting preset condition As destination service end example, sortord is not especially limited at this, each connection delay data sequence can be arranged, Each connection delay data can also be reversed.Preset condition is also not especially limited at this, it should be by art technology Personnel make corresponding setting according to the actual situation, such as preset condition can be delay time less than 10 milliseconds, then can be first All server-side examples of the delay time less than 10 milliseconds are filtered out, if the quantity for meeting the server-side example of the preset condition is 1, then the server-side example is determined as destination service end example;If the quantity for meeting the server-side example of the preset condition is greater than 1, then determine that destination service end example, specific method of determination are also not construed as limiting from these server-side examples again, it can be from this Determine a server-side example as destination service end example at random in a little server-side examples.
It is above-mentioned according to connectivity in the present embodiment based on above-mentioned any embodiment, each connection delay data is arranged Sequence, and the server-side example for meeting preset condition is picked out as destination service end example, it generally includes:, will according to connectivity Each connection delay data is ranked up, and using the server-side example for being delayed minimum as destination service end example.The present embodiment Above-mentioned steps S31 is further limited, Fig. 7 is specifically referred to, Fig. 7 is the clothes of another kind disclosed in the embodiment of the present application Business end example determines the flow chart of method, which determines that method specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
S2, the connectivity being connect according to configuration information, trial connection server-side example, and acquisition with client and connection are prolonged When data;
S311, according to connectivity, each connection delay data is ranked up, and by the server-side example for being delayed minimum make For destination service end example.
The server-side example for meeting preset condition in step S31 is limited to the server-side for being delayed minimum reality by the present embodiment Example, therefore the destination service end example determined is optimal server-side example, can be further increased and the connectivity of client, clothes The transmission efficiency for the stability provided and the information exchange of being engaged in.
Based on above-mentioned any embodiment, in the present embodiment it is above-mentioned according to connectivity and connection delay data, determine target take It usually can also include: real-time according to Network status and load state, adaptive change destination service end is real after end example of being engaged in Example.Fig. 8 is specifically referred to, Fig. 8 is the flow chart that another kind server-side example disclosed in the embodiment of the present application determines method, the clothes Business end example determines that method specifically includes:
S1, the configuration information for obtaining the corresponding all server-side examples of destination service;
S2, the connectivity being connect according to configuration information, trial connection server-side example, and acquisition with client and connection are prolonged When data;
S3, according to connectivity and connection delay data, determine destination service end example;
S4, in real time foundation Network status and load state, it is adaptive to change destination service end example.
The present embodiment, can be in real time according to Network status and load state, adaptively after determining destination service end example Change destination service end example.It is understood that the present embodiment meeting real-time detection Network status and load state, then according to net Network situation and load state, it is adaptive to change destination service end example.At this to each adjacent detection Network status twice and negative The duration of load situation is not especially limited, can all adjacent durations for detecting Network status and load state twice be identical (for example, at interval of 5 seconds detection Network status and load state, it is adaptive to change then according to Network status and load state Destination service end example), can also be with each adjacent duration for detecting Network status and load state twice part it is identical or It is different, corresponding setting should be made according to the actual situation by those skilled in the art.
It is above-mentioned real-time according to Network status and load state, adaptive strain in the present embodiment based on above-mentioned any embodiment More destination service end example, comprising: judge whether the time interval of the last change destination service end example of distance reaches default Time interval threshold value;If the time interval apart from last change destination service end example reaches prefixed time interval threshold value, According to Network status and load state, switch destination service end example.
Network status and load state are not especially limited herein, need according to the actual situation depending on, for example, network compared with Poor and load is larger, network is preferable and load is smaller, network is poor but load is smaller, network is preferable but load is larger.It is above-mentioned from Adapt to change destination service end example, it is main according to Network status and load state depending on, for example, if network is poor and load compared with Greatly, then destination service end example is changed;If network is preferably and load is smaller, without changing destination service end example.Preferably, In the use process of client connection service, the primary above-mentioned server-side example of trial in 5 seconds can be spaced and determine method, selected again Best server-side example (i.e. destination service end example), if being more than 1 point apart from last time switching destination service end example time Clock, it tries switching service better destination service end example does not switch if be lower than 1 minute apart from switching time last time, Frequent switching route caused by preventing because of network jitter.In the passive disconnection of connection, determined at once according to above-mentioned server-side example Method redefines out destination service end example.
The present embodiment can configure, dynamically adapting compared to the relevant technologies to avoid human intervention, with network condition and bear The variation of situation is carried, client can be adaptive, changes server-side example at any time, achievees the purpose that efficient stable, and embody The flexibility of micro services and dynamic extending.
Below for dispatch service is broadcast live, achieve the purpose that cluster stablizes service, such as Fig. 9 under complicated deployed environment Shown, Fig. 9 is a kind of live streaming dispatch service schematic diagram disclosed in the embodiment of the present application, as shown in Figure 9, the shared " system of present case one Meter service " and " log services " two services, each there are two server-side examples, are distributed in two computer rooms of A, B.Wherein, " statistics clothes Two server-side examples of business " are respectively example D and example H, two server-side examples of " log services " be respectively example F and Example K.There are server C and server E in A computer room, server C can provide statistical fractals, the server-side example specifically disposed For example D, IP address is divided into telecommunications IP address and connection IP address;Server E can provide log services, the clothes specifically disposed Business end example is example F, and IP address is divided into mobile IP address and telecommunications IP address.There are server G, server J kimonos in B computer room Be engaged in device L, and server G can provide statistical fractals, and the server-side example specifically disposed is example H, and IP address is mobile IP address; Server J can provide log services, and the server-side example specifically disposed is example K, and IP address is telecommunications IP address;Server L is center server, is equipped with database.
Respective configuration information is reported to number respectively by four server-side examples (example D, example H, example F and example K) According to library, client is connected to database, obtains these configuration informations.For " statistical fractals ", example D, example H are separately detected Connectivity and delay, the telecommunications IP address of final choice example D is as tie point.For " log services ", example is separately detected F, the connectivity and delay of example K, the telecommunications IP address of final choice example K is as tie point.As the example K of " log services " When connection is abnormal, client is reselected, and is switched to the telecommunications IP address of example F.
System, which is introduced, to be determined to a kind of server-side example provided by the embodiments of the present application below, one kind described below Server-side example determines that system determines that method can be cross-referenced with a kind of above-described server-side example.
Referring to Figure 10, Figure 10 determines the structural block diagram of system for a kind of server-side example disclosed in the embodiment of the present application, such as Shown in Figure 10, comprising:
Configuration information obtains module 1001, for obtaining the configuration information of the corresponding all server-side examples of destination service;
Connect delay data and obtain module 1002, for according to configuration information, attempting connection server-side example, and obtain with The connectivity and connection delay data of client connection;
Destination service end example determining module 1003, for determining destination service according to connectivity and connection delay data Hold example.
Based on the above embodiment, delay data is connected in the present embodiment obtain module 1002, comprising:
Server-side example screens submodule, for filtering out the first clothes from all server-side examples according to configuration information Business end example;Wherein, first service end example is to be deployed in load lower than the server-side example on the server of preset threshold, is matched Confidence breath includes server load information;
Delay data acquisition submodule is connected, for attempting connection each first service end example, and obtains second service Hold the connectivity and connection delay data of example;Wherein, second service end example is the first service with client successful connection Hold example.
Based on the above embodiment, delay data acquisition submodule is connected in the present embodiment, comprising:
IP address quantity judging unit, the quantity of the IP address for server where judging any first service end example Whether 1 is greater than;
Connection state information acquiring unit, if the quantity of the IP address for server where the example of first service end is greater than 1, it tries connect all IP address, and obtain the connection state information of each IP address;
Target ip address determination unit, for determining the target ip address in all IP address according to connection state information;
Delay data acquiring unit is connected, for connecting the corresponding target ip address of first service end example, and obtains the The connection delay data of two server-side examples.
Based on above-mentioned any embodiment, destination service end example determining module 1003 in the present embodiment, comprising:
Destination service end example determines submodule, for according to connectivity, each connection delay data to be ranked up, and The server-side example for meeting preset condition is picked out as destination service end example.
Based on the above embodiment, destination service end example determines submodule in the present embodiment, comprising:
Destination service end example determination unit, for according to connectivity, each connection delay data to be ranked up, and will The server-side example for being delayed minimum is as destination service end example.
Based on the above embodiment, server-side example determines system in the present embodiment further include:
Destination service end example changes module, for according to Network status and load state, adaptively changing target in real time Server-side example.
Based on the above embodiment, destination service end example changes module in the present embodiment, comprising:
Time interval judging submodule, for whether judging the last time interval for changing destination service end example of distance Reach prefixed time interval threshold value;
Destination service end example switching submodule, if for the time interval apart from last change destination service end example Reach prefixed time interval threshold value, then according to Network status and load state, switches destination service end example.
The application also provides a kind of client, comprising: memory and processor;Wherein, memory is for storing computer Program, processor is for realizing the step of server-side example of above-mentioned any embodiment determines method when executing computer program. The client can be PC (Personal Computer, PC), be also possible to smart phone, tablet computer, palm electricity The terminal devices such as brain, portable computer.Referring to Figure 11, Figure 11 is a kind of structural representation of client disclosed in the embodiment of the present application Figure, may include memory 11, processor 12 and bus 13 as shown in figure 11.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11 It can be the internal storage unit of client, such as the hard disk of the client in some embodiments.Memory 11 is at other It is also possible to the External memory equipment of client in embodiment, such as the plug-in type hard disk being equipped in client, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Into One step, memory 11 can also both internal storage units including client or including External memory equipment.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11 Code or processing data, the server-side example for realizing that above-mentioned any embodiment provides determine method.
Bus 13 can be Peripheral Component Interconnect standard (peripheral component interconnect, abbreviation PCI) bus or expanding the industrial standard structure (extended industry standard architecture, abbreviation EISA) Bus etc..The bus can be divided into address bus, data/address bus, control bus etc..For convenient for indicating, in Figure 11 only with one slightly Line indicates, it is not intended that an only bus or a type of bus.
Figure 11 illustrates only the client with component 11-13, it will be appreciated by persons skilled in the art that Figure 11 is shown Structure do not constitute the restriction to client, may include than illustrating less perhaps more components or the certain portions of combination Part or different component layouts.
The application also provides a kind of computer readable storage medium, and computer-readable recording medium storage has computer journey Sequence realizes the step of server-side example of above-mentioned any embodiment determines method when computer program is executed by processor.The meter Calculation machine readable storage medium storing program for executing includes that flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetism are deposited Reservoir, disk, CD etc..
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present invention.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave) mode to another website Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit Any usable medium of storage either includes that the data storages such as one or more usable mediums integrated server, data center are set It is standby.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or partly lead Body medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description Specific work process, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system and method can pass through it Its mode is realized.For example, system embodiment described above is only schematical, 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.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit Letter connection can be electrical property, mechanical or other forms.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the application Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of server-side example determines method, it is applied to client characterized by comprising
Obtain the configuration information of the corresponding all server-side examples of destination service;
According to the configuration information, attempt to connect the server-side example, and obtain the connectivity being connect with the client and Connect delay data;
According to the connectivity and the connection delay data, destination service end example is determined.
2. server-side example determines method according to claim 1, which is characterized in that it is described according to the configuration information, it tastes Examination connects the server-side example, and obtains the connectivity connecting with the client and connection delay data, comprising:
According to the configuration information, first service end example is filtered out from all server-side examples;Wherein, described first Server-side example is to be deployed in load lower than the server-side example on the server of preset threshold, and the configuration information includes service Device load information;
It attempts to connect each first service end example, and obtains the connectivity and connection delay number of second service end example According to;Wherein, second service end example is the first service end example with the client successful connection.
3. server-side example determines method according to claim 2, which is characterized in that the trial connection each described first Server-side example, and obtain the connectivity and connection delay data of second service end example, comprising:
Whether the quantity of the IP address of server is greater than 1 where judging any first service end example;
If the quantity of the IP address of the server is greater than 1 where the example of the first service end, it tries connection is all The IP address, and obtain the connection state information of each IP address;
According to the connection state information, the target ip address in all IP address is determined;
The corresponding target ip address of first service end example is connected, and obtains the connection of second service end example Delay data.
4. server-side example determines method according to any one of the claim 1 to 3, which is characterized in that described according to the company The general character and the connection delay data, determine destination service end example, comprising:
According to the connectivity, each connection delay data is ranked up, and picks out the service for meeting preset condition Hold example as destination service end example.
5. server-side example determines method according to claim 4, which is characterized in that it is described according to the connectivity, it will be each A connection delay data is ranked up, and picks out the server-side example for meeting preset condition as the destination service end Example, comprising:
According to the connectivity, each connection delay data is ranked up, and the server-side example for being delayed minimum is made For destination service end example.
6. server-side example determines method according to claim 1, which is characterized in that described according to the connectivity and described Delay data is connected, after determining destination service end example, further includes:
In real time according to Network status and load state, destination service end example is adaptively changed.
7. server-side example determines method according to claim 6, which is characterized in that described real-time according to Network status and negative Load situation adaptively changes destination service end example, comprising:
Judge whether the time interval of the last change destination service end example of distance reaches prefixed time interval threshold value;
If the time interval apart from last change destination service end example reaches the prefixed time interval threshold value, according to According to the Network status and the load state, switch destination service end example.
8. a kind of server-side example determines system, it is applied to client characterized by comprising
Configuration information obtains module, for obtaining the configuration information of the corresponding all server-side examples of destination service;
Connect delay data and obtain module, connect the server-side example for attempting according to the configuration information, and obtain with The connectivity and connection delay data of the client connection;
Destination service end example determining module, for determining destination service according to the connectivity and the connection delay data Hold example.
9. a kind of client characterized by comprising
Memory and processor;Wherein, the memory is for storing computer program, the processor by execute it is described based on The step of server-side example as described in any one of claim 1 to 7 determines method is realized when calculation machine program.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence, the computer program realize server-side example as described in any one of claim 1 to 7 determination side when being executed by processor The step of method.
CN201910655790.XA 2019-07-19 2019-07-19 A kind of server-side example determines method, system, client and storage medium Pending CN110351146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910655790.XA CN110351146A (en) 2019-07-19 2019-07-19 A kind of server-side example determines method, system, client and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910655790.XA CN110351146A (en) 2019-07-19 2019-07-19 A kind of server-side example determines method, system, client and storage medium

Publications (1)

Publication Number Publication Date
CN110351146A true CN110351146A (en) 2019-10-18

Family

ID=68179386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910655790.XA Pending CN110351146A (en) 2019-07-19 2019-07-19 A kind of server-side example determines method, system, client and storage medium

Country Status (1)

Country Link
CN (1) CN110351146A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437137A (en) * 2020-11-12 2021-03-02 翱捷科技(深圳)有限公司 Internet of things data connection method and system
CN113411265A (en) * 2021-06-09 2021-09-17 南方电网数字电网研究院有限公司 Power grid monitoring system preposition service channel dynamic adjusting method based on risk prediction

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103560943A (en) * 2013-10-31 2014-02-05 北京邮电大学 Network analytic system and method supporting real-time mass data processing
CN104769919A (en) * 2012-10-05 2015-07-08 甲骨文国际公司 Load balancing access to replicated databases
CN105577819A (en) * 2016-01-26 2016-05-11 杭州碧创科技有限公司 Sharing system, sharing method and sharing device for virtual desktop
CN108206852A (en) * 2016-12-20 2018-06-26 杭州华为数字技术有限公司 A kind of dialogue-based Service Instance management method and equipment under micro services frame

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104769919A (en) * 2012-10-05 2015-07-08 甲骨文国际公司 Load balancing access to replicated databases
CN103560943A (en) * 2013-10-31 2014-02-05 北京邮电大学 Network analytic system and method supporting real-time mass data processing
CN105577819A (en) * 2016-01-26 2016-05-11 杭州碧创科技有限公司 Sharing system, sharing method and sharing device for virtual desktop
CN108206852A (en) * 2016-12-20 2018-06-26 杭州华为数字技术有限公司 A kind of dialogue-based Service Instance management method and equipment under micro services frame

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437137A (en) * 2020-11-12 2021-03-02 翱捷科技(深圳)有限公司 Internet of things data connection method and system
CN113411265A (en) * 2021-06-09 2021-09-17 南方电网数字电网研究院有限公司 Power grid monitoring system preposition service channel dynamic adjusting method based on risk prediction
CN113411265B (en) * 2021-06-09 2022-07-29 南方电网数字电网研究院有限公司 Power grid monitoring system preposition service channel dynamic adjusting method based on risk prediction

Similar Documents

Publication Publication Date Title
CN107995215B (en) Control method and device of intelligent household equipment and cloud platform server
CN104639913B (en) A kind of network video recorder and its method for automatically accessing IPC
CN111865736B (en) Equipment control method and device
CN112015544A (en) Load balancing method, device and equipment of k8s cluster and storage medium
CN110278568A (en) Method, network system based on network equipment building networking
CN111629371B (en) Screen projection method and system
CN107919971A (en) Method, apparatus and system for audio/video communication connection disaster tolerance
CN110351146A (en) A kind of server-side example determines method, system, client and storage medium
CN110166524A (en) Switching method, device, equipment and the storage medium of data center
CN106713684A (en) Method and equipment for binding unified communication client account number with phone number
CN107168853A (en) A kind of server performance information acquisition method, system and substrate control manager
CN110475091A (en) The processing method and processing device of video conference
CN109547524A (en) User behavior storage method, device, equipment and storage medium based on Physical Network
CN103731562A (en) Method and device for adaptively matching bluetooth device with smart devices
CN110311938A (en) Request processing method, device, gateway and system based on redis
CN107800777A (en) Long-distance monitoring method, device, storage medium and equipment
CN109600278A (en) A kind of data communications method, device, equipment and medium
CN103581107A (en) Server and working mode setting method thereof
CN110334896A (en) State affairs management method, device, equipment and computer storage medium
CN115834434A (en) Network device control method, control server, proxy device and communication network
CN106686697B (en) The method of zigbee terminal device node administration
CN105357078A (en) Detection method and system of network state of intelligent equipment
CN108616870A (en) The method and apparatus for identifying the terminal preferentially customized
CN108449562A (en) A kind of method and device for adding web camera in network hard disk video recorder
CN104579793B (en) The dispatching method and system of Internet resources

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191018