A kind of method and apparatus of cloud desktop multinode connection
Technical field
The invention belongs to the method and apparatus that cloud desktop technology field more particularly to a kind of cloud desktop multinode connect.
Background technique
Currently, in the cloud desktop system based on cloud computing management platform construction, if client wants access to cloud desktop,
Need to be in the network interface card of the newly-increased connection external network of calculate node of operation cloud desktop, the port of such calculate node can be exposed to
Client allows client directly to access cloud desktop.However, the prior art needs all calculate nodes all to increase a company newly
The network interface card of external network is connect, calculate node has with external network directly to be contacted, and is reduced the safety of calculate node, is increased
The lower deployment cost of cloud desktop system.
Therefore, it is necessary to propose a kind of new technical solution, to solve the above technical problems.
Summary of the invention
In consideration of it, the embodiment of the present invention provides a kind of method and apparatus of cloud desktop multinode connection, to avoid section is calculated
Point is directly contacted with external network, is improved the safety of calculate node, is reduced the lower deployment cost of cloud desktop system.
The embodiment of the present invention in a first aspect, providing a kind of method of cloud desktop multinode connection, which comprises
The cloud desktop access solicited message that client is sent is received, the cloud desktop access solicited message includes the client
The unique identifier at end;
According to the unique identifier of the client, calculating corresponding with the cloud desktop that the client to be accessed is obtained
The port information of node;
According to the network address forward rule of setting, control node corresponding with the port information of the calculate node is obtained
External network port information;
The external network port information of the control node is sent to the client, so that the client passes through institute
The external network port for stating control node accesses the cloud desktop.
The second aspect of the embodiment of the present invention, provides a kind of device of cloud desktop multinode connection, and described device includes:
Receiving module, first obtain module, the second acquisition module and sending module;
The receiving module, for receiving the cloud desktop access solicited message of client transmission, the cloud desktop access is asked
Seeking information includes the unique identifier of the client;
Described first obtains module, and for the unique identifier according to the client, acquisition is wanted with the client
The port information of the corresponding calculate node of cloud desktop of access;
Described second obtains module, for the network address forward rule according to setting, obtains and the calculate node
The external network port information of the corresponding control node of port information;
The sending module, for the external network port information of the control node to be sent to the client, with
The client is set to access the cloud desktop by the external network port of the control node.
Existing beneficial effect is the embodiment of the present invention compared with prior art: the embodiment of the present invention is according to the network of setting
Address forward rule obtains the external network port information of control node corresponding with the port information of calculate node, client
The cloud desktop in calculate node is accessed by the external network port of control node, avoids the straight of calculate node and external network
Contact, improves the safety of calculate node, while decreasing the network interface card quantity of calculate node, reduces cloud desktop system
Lower deployment cost.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the implementation flow chart of the method for the cloud desktop multinode connection that the embodiment of the present invention one provides;
Fig. 2 is the implementation flow chart of the method for cloud desktop multinode connection provided by Embodiment 2 of the present invention;
Fig. 3 is the composition schematic diagram of the device for the cloud desktop multinode connection that the embodiment of the present invention three provides;
Fig. 4 is the composition schematic diagram of the device for the cloud desktop multinode connection that the embodiment of the present invention four provides.
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 the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Embodiment one:
Fig. 1 shows the implementation process of the method for the cloud desktop multinode connection of the offer of the embodiment of the present invention one, the reality
Details are as follows for existing process:
In step s101, the cloud desktop access solicited message that client is sent, the cloud desktop access request letter are received
Breath includes the unique identifier of the client;
In embodiments of the present invention, cloud desktop system receives the cloud desktop access solicited message that client is sent, the cloud
Desktop system include a control node and multiple calculate nodes, each node be one can independently operated computer,
Each node is interconnected by the network equipment.Control node receives the cloud desktop access that client is sent and asks for interacting with client
It seeks information and is transmitted to calculate node, receive the access process result of calculate node and return to client, calculate node is used for
Storing data simultaneously executes access process task.
In embodiments of the present invention, the unique identifier of the client includes but is not limited to the user name of the client
With password etc..
In step s 102, it according to the unique identifier of the client, obtains and the client cloud to be accessed
The port information of the corresponding calculate node of desktop;
Further, the unique identifier according to the client obtains and the client cloud to be accessed
The port information of the corresponding calculate node of desktop includes:
According to the unique identifier of the client, the database of the control node is inquired, to obtain and the cloud table
The port information of the corresponding calculate node in face.
In embodiments of the present invention, according to the unique identifier of the client, the database of the control node is inquired,
The unique identifier for obtaining the cloud desktop that the client to be accessed inquires institute according to the unique identifier of the cloud desktop
State the database of control node, obtain the port information of calculate node corresponding with the cloud desktop, the cloud desktop it is unique
Identifier includes but is not limited to the username and password etc. of the cloud desktop.
In embodiments of the present invention, the port information of the calculate node includes the IP and port numbers of the calculate node,
The cloud desktop operates in the calculate node.
In step s 103, according to the network address forward rule of setting, the port information with the calculate node is obtained
The external network port information of corresponding control node;
In embodiments of the present invention, network address forward rule is set when client request access cloud desktop, access terminates
After delete the network address forward rule.
Further, the network address forward rule according to setting obtains the port information with the calculate node
The external network port information of corresponding control node includes:
According to the network address forward rule of setting, control node corresponding with the port information of the calculate node is obtained
Available port information;
The external network port information of control node is obtained from the available port information of the control node.
In embodiments of the present invention, the available port information of the control node includes the external network port of control node
The internal network port information of information and control node, the external network port information of the control node include the control section
The external network IP and port numbers, the internal network port information of the control node of point include the intranet of the control node
Network IP and port numbers.
The forwarded rule of the setting specifically includes:
The external network port information mapping of the control node is forwarded to the port information of the calculate node;
The port information mapping of the calculate node is forwarded to the internal network port information of the control node.
In embodiments of the present invention, by the way that the external network port information mapping of the control node is forwarded to the meter
The port information of operator node realizes client by the external network port information of the access control node, visits indirectly
The cloud desktop in the calculate node is asked;By the way that the port information mapping of the calculate node is forwarded to the control node
Internal network port information, the access process result of client is sent to the control node by the calculate node, described
The access process result is sent to client again by control node, ensure that being isolated for the calculate node and external network,
The network interface card quantity of calculate node is decreased simultaneously, reduces the lower deployment cost of cloud desktop system.
In step S104, the external network port information of the control node is sent to the client, so that institute
It states client and the cloud desktop is accessed by the external network port of the control node.
The embodiment of the present invention obtains the port information pair with calculate node by the network address forward rule according to setting
The external network port information for the control node answered, client are accessed in calculate node by the external network port of control node
Cloud desktop, avoid directly contacting for calculate node and external network, improve the safety of calculate node, while also reducing
The network interface card quantity of calculate node, reduces the lower deployment cost of cloud desktop system.
Embodiment two:
Fig. 2 shows the implementation process of the method for cloud desktop multinode provided by Embodiment 2 of the present invention connection, the realities
Details are as follows for existing process:
In step s 201, the cloud desktop access solicited message that client is sent, the cloud desktop access request letter are received
Breath includes the unique identifier of the client;
In embodiments of the present invention, cloud desktop system receives the cloud desktop access solicited message that client is sent, the cloud
Desktop system include a control node and multiple calculate nodes, each node be one can independently operated computer,
Each node is interconnected by the network equipment.Control node receives the cloud desktop access that client is sent and asks for interacting with client
It seeks information and is transmitted to calculate node, receive the access process result of calculate node and return to client, calculate node is used for
Storing data simultaneously executes access process task.
In embodiments of the present invention, the unique identifier of the client includes but is not limited to the cloud desktop client
Username and password etc..
In step S202, according to the unique identifier of the client, obtain and the client cloud to be accessed
The port information of the corresponding calculate node of desktop;
Further, the unique identifier according to the client obtains and the client cloud to be accessed
The port information of the corresponding calculate node of desktop includes:
According to the unique identifier of the client, the database of the control node is inquired, to obtain and the cloud table
The port information of the corresponding calculate node in face.
In embodiments of the present invention, according to the unique identifier of the client, the database of the control node is inquired,
The unique identifier for obtaining the cloud desktop that the client to be accessed inquires institute according to the unique identifier of the cloud desktop
The database of control node is stated, to obtain the port information of calculate node corresponding with the cloud desktop, the cloud desktop is only
One identifier includes but is not limited to the username and password etc. of the cloud desktop.
In embodiments of the present invention, the port information of the calculate node includes the IP and port numbers of the calculate node,
The cloud desktop operates in the calculate node.
In step S203, the available port of control node is inquired, to obtain the available port information of the control node;
In embodiments of the present invention, the port of control node sequentially uses, and need to know which current port is not used for
Mapping network addresses forwarding, could obtain the available port of the control node.
Further, the available port of the inquiry control node, to obtain the available port information of the control node,
It specifically includes:
The network address forward rule being arranged is inquired, to obtain described in the network address translation rule being arranged
The maximum port numbers of control node;
The maximum port numbers of the control node are carried out to add 1, and using the value after adding 1 as the available of the control node
Port numbers.
In embodiments of the present invention, the network address forward rule being arranged is to believe the port of the control node
Breath mapping is forwarded to the rule of the port information of the calculate node, and the port information of the control node is mapped forwarding by inquiry
To the regular record of the port information of the calculate node, the maximum port numbers of the control node are obtained.
In step S204, according to the network address forward rule of setting, the port information with the calculate node is obtained
The external network port information of corresponding control node;
In embodiments of the present invention, network address forward rule is set when client request access cloud desktop, access terminates
After delete the network address forward rule.
Further, the network address forward rule according to setting obtains the port information with the calculate node
The external network port information of corresponding control node includes:
According to the network address forward rule of setting, control node corresponding with the port information of the calculate node is obtained
Available port information;
The external network port information of control node is obtained from the available port information of the control node.
In embodiments of the present invention, the available port information of the control node includes the external network port of control node
The internal network port information of information and control node, the external network port information of the control node include the control section
The external network IP and port numbers, the internal network port information of the control node of point include the intranet of the control node
Network IP and port numbers.
The forwarded rule of the setting specifically includes:
The external network port information mapping of the control node is forwarded to the port information of the calculate node;
The port information mapping of the calculate node is forwarded to the internal network port information of the control node.
In embodiments of the present invention, by the way that the external network port information mapping of the control node is forwarded to the meter
The port information of operator node realizes client by the external network port information of the access control node, visits indirectly
The cloud desktop in the calculate node is asked;By the way that the port information mapping of the calculate node is forwarded to the control node
Internal network port information, the access process result of client is sent to the control node by the calculate node, described
The access process result is sent to client again by control node, ensure that being isolated for the calculate node and external network,
The network interface card quantity of calculate node is decreased simultaneously, reduces the lower deployment cost of cloud desktop system.
In step S205, the external network port information of the control node is sent to the client, so that institute
It states client and the cloud desktop is accessed by control node external network port.
The embodiment of the present invention obtains the port information pair with calculate node by the network address forward rule according to setting
The external network port information for the control node answered, client are accessed in calculate node by the external network port of control node
Cloud desktop, avoid directly contacting for calculate node and external network, improve the safety of calculate node, while also reducing
The network interface card quantity of calculate node, reduces the lower deployment cost of cloud desktop system.
Embodiment three:
Fig. 3 shows the composition schematic diagram of the device of the cloud desktop multinode connection of the offer of the embodiment of the present invention three, in order to
Convenient for explanation, only parts related to embodiments of the present invention are shown, and details are as follows:
Receiving module 31, for receiving the cloud desktop access solicited message of client transmission, the accessing request information packet
Include the unique identifier of the client;
First obtains module 32, and for the unique identifier according to the client, acquisition to be visited with the client
The port information for the corresponding calculate node of cloud desktop asked;
Further, the first acquisition module 32 is specifically used for:
According to the unique identifier of the client, the database of the control node is inquired, to obtain and the cloud table
The port information of the corresponding calculate node in face.
Second obtains module 33, for the network address forward rule according to setting, obtains the end with the calculate node
Message ceases the external network port information of corresponding control node;
Further, the second acquisition module 33 specifically includes:
First acquisition unit 331 obtains the end with the calculate node for the network address forward rule according to setting
Message ceases the available port information of corresponding control node;
Second acquisition unit 332, for obtaining the outside of control node from the available port information of the control node
Network port information.
Sending module 34, for the external network port information of the control node to be sent to the client, so that
The client accesses the cloud desktop by the external network port of the control node.
The device of cloud desktop multinode connection provided in an embodiment of the present invention can be used to be implemented in aforementioned corresponding method
In example one, details are referring to the description of above-described embodiment one, and details are not described herein.
The embodiment of the present invention is by obtaining and believing with the port of calculate node by the network address forward rule according to setting
The external network port information of corresponding control node is ceased, client calculates section by the external network port access of control node
Cloud desktop on point avoids calculate node and contacts with the direct of external network, improves the safety of calculate node, while
The network interface card quantity for reducing calculate node, reduces the lower deployment cost of cloud desktop system.
Example IV:
Fig. 4 shows the composition schematic diagram of the device of the cloud desktop multinode connection of the offer of the embodiment of the present invention four, in order to
Convenient for explanation, only parts related to embodiments of the present invention are shown, and details are as follows:
Receiving module 41, for receiving the cloud desktop access solicited message of client transmission, the cloud desktop access request
Information includes the unique identifier of the client;
First obtains module 42, and for the unique identifier according to the client, acquisition to be visited with the client
The port information for the corresponding calculate node of cloud desktop asked;
Further, the first acquisition module 42 is specifically used for:
According to the unique identifier of the client, the database of the control node is inquired, to obtain and the cloud table
The port information of the corresponding calculate node in face.
Interface querying module 43, for inquiring the available port of control node, to obtain the available end of the control node
Message breath;
Further, the interface querying module 43 specifically includes:
Query unit 431, for inquiring the network address forward rule being arranged, with obtaining the network being arranged
The maximum port numbers of control node described in the forward rule of location;
Processing unit 432 carries out adding 1 for the maximum port numbers to the control node, and using the value after adding 1 as institute
State the available port number of control node.
Second obtains module 44, for the network address forward rule according to setting, obtains the end with the calculate node
Message ceases the external network port information of corresponding control node;
Further, the second acquisition module 44 includes:
First acquisition unit 441 obtains the end with the calculate node for the network address forward rule according to setting
Message ceases the available port information of corresponding control node;
Second acquisition unit 442, for obtaining the outside of control node from the available port information of the control node
Network port information.
Sending module 45, for the external network port information of the control node to be sent to the client, so that
The client accesses the cloud desktop by the external network port of the control node.
The device of cloud desktop multinode connection provided in an embodiment of the present invention can be used to be implemented in aforementioned corresponding method
In example two, description of the details referring to above-described embodiment two, details are not described herein
The technical staff in the field can be understood that, for convenience and simplicity of description, only with above-mentioned each function
The division progress of module or unit can according to need and for example, in practical application by above-mentioned function distribution by different
Functional module or unit are completed, i.e. the internal structure of described device is divided into different functional module or unit, above-mentioned function mould
Block or unit both can take the form of hardware realization, can also be realized in the form of software.In addition, each functional module or list
The specific name of member is also only to facilitate be mutually distinguishable, the protection scope being not intended to limit this application.
In conclusion network address forward rule of the embodiment of the present invention according to setting, obtains the port with calculate node
The external network port information of the corresponding control node of information, client are accessed by the external network port of control node and are calculated
Cloud desktop on node avoids calculate node and contacts with the direct of external network, improves the safety of calculate node, simultaneously
The network interface card quantity of calculate node is decreased, the lower deployment cost of cloud desktop system is reduced.
Those of ordinary skill in the art be further appreciated that implement the method for the above embodiments be can
It is completed with instructing relevant hardware by program, the program can be stored in a computer-readable storage medium
In, described storage medium, including ROM/RAM, disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.