It is a kind of for educating the intranet and extranet means of communication and system of cloud platformTechnical field
The present invention relates to communication technique field more particularly to a kind of intranet and extranet means of communication for educating cloud platform and it isSystem.
Background technique
With the fast development of internet, communication is carried out using internet and is widely used.In the logical of internetIn news, the both sides of communication are with specific Internet protocol address, source and destination address as confirmation communication two party, i.e. networkEach communication terminal of communication need requires a public IP (Public IP), using as recognizing destination in network communicationLocation is used, and network here refers to public network (Public Network), also known as outer net.With the development of enterprise, localNetwork (Local Area Network), also known as Intranet, gradually rise, the user in Intranet can phase interconnections lead toLetter.
Such as it in education cloud platform, for secrecy principle, is typically chosen service arrangement in Intranet.In education cloudTerminals, the terminals such as the number of taking device, information publication screen is provided in platform to be generally arranged in Intranet.Since Intranet and outer net cannot be straightNews are connected, when being safeguarded to terminal, can only be operated in Intranet, inconvenience is brought for terminal maintenance, increases maintenanceDifficulty.
Therefore, the existing technology needs to be improved and developed.
Summary of the invention
In view of above-mentioned deficiencies of the prior art, the purpose of the present invention is to provide a kind of for educating the intranet and extranet of cloud platformThe means of communication and system, it is intended to which solving to educate the terminal in the Intranet in cloud platform in the prior art can not ask with what outer net communicatedTopic.
Technical scheme is as follows:
It is a kind of for educating the intranet and extranet communication system of cloud platform, the system comprises client, external network server, agenciesServer and terminal, the client and the external network server are arranged in outer net, the proxy server and terminal settingIn Intranet, the client is connect with the external network server, and the proxy server is connect with the terminal, the outer netServer is also connect with the proxy server;
The client sends the first data request information to external network server;External network server sends described the to IntranetOne data request information;Proxy server sends the second data transfer request message;It is asked according to the pairing that proxy server is sentMessage is sought, establishes connection between the external network server and proxy server;The data information of the client transmissions is received,According to the connection established between the external network server and proxy server, the data information is sent to the agency serviceDevice;The data information is sent to terminal by the proxy server.
Optionally, the system also includes temporary server, the temporary server is arranged in Intranet, the temporary clothesBusiness device is connect with the proxy server and the terminal respectively;
The temporary server, for the proxy server transmitting order to lower levels to the terminal, and the terminal is not onlineWhen, transmitting order to lower levels is stored to the temporary server.
Optionally, the connection between the client and the external network server is HTTP connection.
Optionally, it is connected between the external network server and the proxy server by socket.
Optionally, the terminal is used to request command being sent to the proxy server, and the proxy server is by instituteIt states request command and is sent to the external network server.
Optionally, the temporary server is also used to store when detecting that terminal and proxy server establish connectionTransmitting order to lower levels be sent to terminal.
Further embodiment of this invention additionally provides a kind of for educating the intranet and extranet means of communication of cloud platform, the method packetIt includes:
The first data are sent to the external network server for being located at outer net by the first HTTP request positioned at the client of outer net to askSeek message;
External network server sends first data request information to Intranet by first set of words socket;
Terminal positioned at Intranet sends the second data transfer request message by the 2nd socket;
The proxy server receives socket pairing request message, generates the first socket and described secondMapping between socket;
The proxy server receives the external network server and passes through the data information of first socket transmission;According toThe data information is sent to the terminal positioned at Intranet by the mapping of the first socket and the 2nd socket.
Optionally, the client positioned at outer net is sent by the first HTTP request to the external network server for being located at outer netBefore first data request information, comprising:
Http is established with the external network server for being located at outer net in advance positioned at the client of outer net to connect,
Another embodiment of the present invention additionally provides a kind of non-volatile computer readable storage medium storing program for executing, which is characterized in thatThe non-volatile computer readable storage medium storing program for executing is stored with computer executable instructions, and the computer executable instructions are by oneOr multiple processors are when executing, and it is above-mentioned for educating the intranet and extranet of cloud platform to may make that one or more of processors executeThe means of communication.
Another embodiment of the invention provides a kind of computer program product, and the computer program product includes depositingThe computer program on non-volatile computer readable storage medium storing program for executing is stored up, the computer program includes program instruction, works as instituteWhen stating program instruction and being executed by processor, execute the processor above-mentioned for educating the intranet and extranet communication side of cloud platformMethod.
The utility model has the advantages that the invention discloses a kind of for educating the intranet and extranet means of communication and system of cloud platform, the present inventionEmbodiment realizes intranet and extranet linkage by proxy server, so that the client of outer net is also can control the terminal in Intranet, simultaneouslyCommunication is carried out for the different terminals in Intranet and linkage provides convenience.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is that a kind of hardware configuration for educating the intranet and extranet communication system preferred embodiment of cloud platform of the present invention is illustratedFigure;
Fig. 2 is that the present invention is a kind of for educating the flow chart of the intranet and extranet means of communication preferred embodiment of cloud platform.
Specific embodiment
To make the purpose of the present invention, technical solution and effect clearer, clear and definite, below to the present invention further specificallyIt is bright.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.BelowThe embodiment of the present invention is introduced in conjunction with attached drawing.
Referring to Fig. 1, Fig. 1 is that the present invention is a kind of for educating the hard of the intranet and extranet communication system preferred embodiment of cloud platformPart structural schematic diagram.The system is for educating in cloud platform.As shown in Figure 1, system 10 includes client 100, external network server200, proxy server 300 and terminal 400, the client 100 and the external network server 200 are arranged in outer net, describedProxy server 300 and terminal 400 are arranged in Intranet, and the client 100 is connect with the external network server 200, describedProxy server 300 is connect with the terminal 400, and the external network server 200 is also connect with the proxy server 300;
The client sends the first data request information to external network server;External network server sends described the to IntranetOne data request information;Proxy server sends the second data transfer request message;It is asked according to the pairing that proxy server is sentMessage is sought, establishes connection between the external network server and proxy server;The data information of the client transmissions is received,According to the connection established between the external network server and proxy server, the data information is sent to the agency serviceDevice;The data information is sent to terminal by the proxy server.
When it is implemented, client is denoted as client, external network server is denoted as public server, proxy serverIt is denoted as proxy server, terminal is denoted as terminal.
Connection between client and the external network server is network connection.I.e. preferably, client, publicIt is transmitted between server by http, that is, uses http connection.
It is connected between external network server and the proxy server by socket.Pass through between outer net and IntranetSocket.io transmission, realizes duplex, terminal can activly request public server obtain information, client can issueIt orders, issuing the documents forms control of which to terminal.Node.js provides efficient server-side running environment, stillSince support of the browser end to HTML5 is different, in order to be compatible with all browsers, brilliant real-time user experience is provided, andAnd client and the consistent programming experience of server-side are provided for programmer, then socket.io is born.Socket.io willWebsocket and poll (Polling) mechanism and other real time communication modes have been packaged into general interface, and are takingBusiness end realizes the respective code of these real-time mechanisms.
Wherein public server is used to complete the work to the general rear end web of CDN, database, client etc.Make, and realize the server of socket.io, provides service to proxy controller.Proxy controller isThe controller of proxy server.
Wherein proxy server is for realizing bi-directional proxy, and main provide forwards control work, asking for terminalAsk and be transmitted to public server, proxy server (Proxy Server) is a kind of important server security function, itWork is mainly in the session layer of Open System Interconnection (OSI) model, to play the role of firewall.Proxy server quilt mostlyFor connecting INTERNET (Internet) and Local Area Network (local area network).
Further, terminal is used to for request command being sent to the proxy server, and the proxy server will be describedRequest command is sent to the external network server.
It when it is implemented, terminal is provided with display screen, can be used for showing, information publication be provided, provides clothes for userBusiness is lined up area code etc. work.
Further, system 10 further includes temporary server 500, and the temporary server 500 is arranged in Intranet, describedTemporary server is connect with the proxy server and the terminal respectively;
The temporary server, for the proxy server transmitting order to lower levels to the terminal, and the terminal is not onlineWhen, transmitting order to lower levels is stored to the temporary server.
Further, temporary server is also used to when detecting that terminal and proxy server establish connection, by storageTransmitting order to lower levels is sent to terminal.
When it is implemented, temporary server is denoted as temp server, temp server is as socket.io'sClient connects public server, and does disconnection reconnecting mechanism.Temporary service, such as public can also be done in the machineIt issues the documents to terminal, but terminal is not online, then the local data base of transmitting order to lower levels storage to temp serverIn, wait until terminal reconnection, request service, whether public server it is all inessential provide service at this time.
Further, in the system embodiment, pass through the first HTTP request to positioned at outer net positioned at the client of outer netExternal network server send the first data request information;External network server is by first set of words socket to described in Intranet transmissionFirst data request information;Terminal positioned at Intranet sends the second data transfer request message by the 2nd socket;The generationIt manages server and receives socket pairing request message, generate the mapping between the first socket and the 2nd socket;The proxy server receives the external network server and passes through the data information of first socket transmission;Proxy server rootAccording to the mapping of the first socket and the 2nd socket, the data information is sent to the terminal positioned at Intranet.
Referring to Fig. 2, Fig. 2 is that the present invention is a kind of for educating the stream of the intranet and extranet means of communication preferred embodiment of cloud platformCheng Tu, as shown in Fig. 2, itself comprising steps of
Step S100, the is sent to the external network server for being located at outer net by the first HTTP request positioned at the client of outer netOne data request information;
Step S200, external network server sends first request of data to Intranet by first set of words socket and disappearsBreath;
Step S300, the second data transfer request message is sent by the 2nd socket positioned at the terminal of Intranet;
Step S400, the described proxy server receives socket pairing request message, generates the first socket and instituteState the mapping between the 2nd socket;
Step S500, the described proxy server receives the external network server and passes through the data of first socket transmissionInformation;According to the mapping of the first socket and the 2nd socket, the data information is sent to positioned at IntranetTerminal.
When it is implemented, outer net is referred to as public network, Intranet is referred to as local area network.Client is denoted asClient, external network server are denoted as public server, and proxy server is denoted as proxyserver, and terminal is denoted asterminal。
It is connected between external network server and the proxy server by socket.Pass through between outer net and IntranetSocket.io transmission, realizes duplex, terminal can activly request public server obtain information, client can issueIt orders, issuing the documents forms control of which to terminal.Node.js provides efficient server-side running environment, stillSince support of the browser end to HTML5 is different, in order to be compatible with all browsers, brilliant real-time user experience is provided, andAnd client and the consistent programming experience of server-side are provided for programmer, then socket.io is born.Socket.io willWebsocket and poll (Polling) mechanism and other real time communication modes have been packaged into general interface, and are takingBusiness end realizes the respective code of these real-time mechanisms.
Wherein public server is used to complete the work to the general rear end web of CDN, database, client etc.Make, and realize the server of socket.io, provides service to proxy controller.Proxy controller isThe controller of proxy server.
Wherein proxy server is for realizing bi-directional proxy, and main provide forwards control work, asking for terminalAsk and be transmitted to public server, proxy server (Proxy Server) is a kind of important server security function, itWork is mainly in the session layer of Open System Interconnection (OSI) model, to play the role of firewall.Proxy server quilt mostlyFor connecting INTERNET (Internet) and Local Area Network (local area network).
The method of the present embodiment specifically: outside the client for being located at outer net will control the terminal in Intranet, be located atThe client of net actively accesses Intranet, to control the terminal in Intranet.Here first data transmission request messageThe first data information interaction channel for establishing between external network server and proxy server: the second data transfer requestMessage is used for the second data information interaction channel established between terminal and proxy server, and the first data information interaction channel isFirst socket, the second data information interaction channel are the 2nd socket.
In order to realize the data transmission being located between the client and intranet server of outer net, in the first socket and secondAfter socket is established.Proxy server receive socket pairing request message, establish the first socket and the 2nd socket itBetween mapping.
Because the interaction for being located at data information between the client and terminal of outer net is to forward to complete by proxy server, the client for being located at outer net can be passed through first by the mapping between the first socket and the 2nd socket in this wayThe data information that socket is sent is sent to terminal by the 2nd socket.
Proxy server generates the mapping between the first socket and the 2nd socket, therefore is located at the client of outer netThe interaction of data information can be carried out between intranet server.Client can be sent data information by the first socketTo proxy server, proxy server according to the mapping between the first socket of generation and the 2nd socket, search this first2nd socket of socket mapping, is sent to intranet server by the 2nd socket for the data information, data informationInteraction is two-way, naturally it is also possible to it is data information by the 2nd socket is sent to proxy server by intranet server,Proxy server searches the of the 2nd socket mapping according to the mapping between the first socket of generation and the 2nd socketThe data information is sent to terminal by the first socket by one socket.
Further, include: before step S100
Http is established with the external network server for being located at outer net in advance positioned at the client of outer net to connect.When it is implemented, objectiveConnection between family end and the external network server is network connection.I.e. preferably, lead between client, public serverHttp transmission is crossed, that is, uses http connection.
Further, the order that the client of terminal terminal both available outer net issues, can also be as neededActively information is obtained to the client request of outer net.Realize the communication of Intranet and outer net.
Still further, step S600 is specifically included when proxy server sends message to terminal, if terminal and agencyServer is in connection status, i.e., when terminal is online, message is sent directly to terminal by proxy server.If terminal and agency takeBeing engaged in, device is not connected, and proxy server sends a message to temporary server, and temporary server keeps in message, such as can depositIt stores up in the local data base of temporary server.When detecting that terminal is online, i.e., when terminal is connect with proxy server, keep in clothesTemporary message is sent to terminal by business device.
The embodiment of the invention provides a kind of non-volatile computer readable storage medium storing program for executing, computer readable storage medium is depositedComputer executable instructions are contained, which is executed by one or more processors, for example, executing above retouchMethod and step S100 to step S500 in the Fig. 2 stated.
As an example, non-volatile computer readable storage medium storing program for executing can include read-only memory (ROM), programming ROM(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory can includeRandom access memory (RAM) as external cache.By illustrate it is beautiful unrestricted, RAM can with it is all asWalk RAM (SRAM), dynamic ram, (DRAM), synchronous dram (SDRAM), double data rate SDRAM (DDR SDRAM), enhancedSDRAM (ESDRAM), Synchlink DRAM (SLDRAM) and directly Rambus (blue Bath) RAM's (DRRAM) etc is permittedIt is multi-form to obtain.The disclosed memory assembly or memory of operating environment described herein be intended to include these and/Or any other is suitble to one or more of the memory of type.
Another embodiment of the invention provides a kind of computer program product, and computer program product includes being stored inComputer program on non-volatile computer readable storage medium storing program for executing, computer program include program instruction, when program instruction quiltWhen processor executes, the processor is made to execute the intranet and extranet means of communication for being used to educate cloud platform of above method embodiment.For example, executing the method and step S100 to step S500 in Fig. 2 described above.
Embodiments described above is only schematical, wherein as illustrated by the separation member unit can be orIt may not be and be physically separated, component shown as a unit may or may not be physical unit, it canIt is in one place, or may be distributed over multiple network units.Can select according to actual needs part therein orPerson's whole module achieves the purpose of the solution of this embodiment.
By the description of above embodiment, those skilled in the art can be understood that each embodiment can be bySoftware adds the mode of general hardware platform to realize, naturally it is also possible to pass through hardware realization.Based on this understanding, above-mentioned technologyScheme substantially in other words can be embodied in the form of software products the part that the relevant technologies contribute, the computerSoftware product can reside in computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions toSo that computer equipment (can be personal computer, server or the network equipment etc.) execute each embodiment orThe method of certain parts of embodiment.
Among other things, such as " can ', " energy ", " possibility " or " can be with " etc conditional statement unless in addition specificGround is stated or is otherwise understood in context as used, is otherwise generally intended to convey particular implementation energyIncluding (however other embodiments do not include) special characteristic, element and/or operation.Therefore, such conditional statement is generallyIt is not intended to imply that feature, element and/or operation are all needed one or more embodiments or one anywayOr multiple embodiments must include for determining these features, element in the case where being with or without user's input or promptAnd/or the logic whether operation is included or will be performed in any particular implementation.
The content described in the present description and drawings herein include be capable of providing intelligent cabinet method for customizing andThe example of system.Certainly, each of element and/or method can not be described for the purpose of the various features of the description disclosureThe combination being envisioned that, it can be appreciated that, many other combinations and displacement of disclosed feature are possible.CauseThis, it is obvious that without departing from the scope or spirit of the present disclosure various modifications can be made to the disclosure.ThisOutside, or in alternative solution, the considerations of other embodiments of the disclosure are to the specification and drawings and as being in hereinIt may be obvious in the practice of the existing disclosure.It is intended that example proposed in the specification and drawings is allAspect is considered illustrative and not restrictive.Although using specific term herein, they general andThe purpose of limitation is used and is not used in descriptive sense.