CN105721566B - A kind of method of port redirection, server - Google Patents
A kind of method of port redirection, server Download PDFInfo
- Publication number
- CN105721566B CN105721566B CN201610067163.0A CN201610067163A CN105721566B CN 105721566 B CN105721566 B CN 105721566B CN 201610067163 A CN201610067163 A CN 201610067163A CN 105721566 B CN105721566 B CN 105721566B
- Authority
- CN
- China
- Prior art keywords
- port
- server
- physical port
- mark
- physical
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000013507 mapping Methods 0.000 claims abstract description 211
- 230000027455 binding Effects 0.000 claims abstract description 119
- 238000009739 binding Methods 0.000 claims abstract description 119
- 230000005540 biological transmission Effects 0.000 claims description 6
- 230000002159 abnormal effect Effects 0.000 abstract description 6
- 238000013461 design Methods 0.000 description 34
- 101000746134 Homo sapiens DNA endonuclease RBBP8 Proteins 0.000 description 21
- 101000969031 Homo sapiens Nuclear protein 1 Proteins 0.000 description 21
- 102100021133 Nuclear protein 1 Human genes 0.000 description 21
- 230000005055 memory storage Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000007726 management method Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 101150091027 ale1 gene Proteins 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000000149 penetrating effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 241000209140 Triticum Species 0.000 description 1
- 235000021307 Triticum Nutrition 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 239000003607 modifier Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000704 physical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/08—Protocols specially adapted for terminal emulation, e.g. Telnet
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/663—Transport layer addresses, e.g. aspects of transmission control protocol [TCP] or user datagram protocol [UDP] ports
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer And Data Communications (AREA)
Abstract
This application discloses a kind of method of port redirection, server and system, the application method includes: that server is identified according to the virtual port that PORT BINDING RELATIONSHIP corresponding with target application in the mapping relations allocation list is recorded, and creates destination virtual port;Server generates mapping table according to mapping relations allocation list, and the mapping table includes PORT BINDING RELATIONSHIP corresponding with destination virtual port in mapping relations allocation list;Server is when preset condition meets, if destination virtual port is opened by the target application, notifies terminal to open target physical port corresponding with the destination virtual port according to mapping table.The application, using before opening virtual port, creates virtual port in the server in advance, avoids application in server and turns on virtual port before working normally prior to port redirection, leads to the abnormal problem of follow-up work.
Description
Technical field
The present invention relates to field of communication technology, in particular to a kind of method of port redirection, server and system.
Background technique
Remote virtual desktop refers to that calculating and storage resource concentrate on remote server (generally data center), passes through
Remote Desktop Protocol by the interface delivery of remote virtual desktop to local various terminals (such as: thin client, desktop computer, just
Take computer, mobile terminal PAD, smart phone etc.) on show, while can be the various input-output equipment of local terminal
(such as: keyboard, mouse, universal serial bus (USB, Universal Serial Bus) peripheral hardware, serial paralled interface peripheral hardware, earphone and wheat
Gram wind etc.) it is mapped to remote server.
With one or more " port (hardware) " in general terminal, operating system will recognise that these serial communication ends
Mouthful, successively loading system included " port driving ", and default and be created that corresponding " port device file ", referred to as " port "
(such as COM1, COM2) is corresponding to it.In subsequent operation system, all operations for " port " (such as COM1), actually
Exactly " the ports physical equipment " that is connected on " port (hardware) " is operated.
In remote virtual desktop system, terminal and server is generally comprised, if server needs using terminal side
The ports physicals equipment such as port printer, a kind of mode are can then to be passed through by first using USB to turn access terminal in a manner of port lines
USB redirects mode and the physical equipment of terminal side is mapped in remote server, as shown in Figure 1, as above " USB client
Several parts such as end ", " USB server-side ", " USB always turns serial port drive " constitute USB and redirect chassis body, are responsible for completion USB and set
Standby redirection map work, the physical USB device of local terminal side, has successfully been mapped to the remote virtual desktop of server
In system, then the USB installed in remote desktop is cooperated to turn port driving, is created that the visible port device in equipment manager
Object and the associated port (such as COM1) for application operating are come, the subsequent read-write operation for this port, actually
The ports physical equipment of read-write operation terminal side.
The above-mentioned mode using port device, certain applications (usually servicing) during installation, need to bind specific void
Quasi- port (such as COM1), and during os starting, the application automatic running and will open immediately this port, and this
When desktop user not yet by terminal log in remote desktop, that is, terminal side port not yet mapped in remote desktop
Out, also meaning that may be not present using the virtual port opened at this time, or possible virtual port (such as COM1) exists,
But pointed by it is not that actual user thinks that ports physical equipment in terminal side to be used, final desktop user log in remote desktop
Afterwards, cisco unity malfunction can be found when use.
Summary of the invention
This application provides a kind of method of port redirection, terminal and server, avoid in server application prior to
Port is turned on before port redirection, leads to the abnormal problem of follow-up work.
On the one hand, embodiments herein provides a kind of method of port redirection, which is applied to
In cloud interactive system (such as remote virtual desktop system), includes server and user equipment in the cloud interactive system, servicing
Mapping relations allocation list is preset in device, which includes at least one PORT BINDING RELATIONSHIP, wherein port can
To be that serial ports (mark is generally COM and adds digital number, such as COM1) or parallel port (identify generally LPT and add digital number, such as
LPT1), each PORT BINDING RELATIONSHIP records the binding relationship of a virtual port mark and physical port mark, and port is tied up
The virtual port mark of relation record is determined for the virtual port in identification server, which is identified as Differentiated services device
The unique identification of the virtual port of foundation, the physical port mark of PORT BINDING RELATIONSHIP record are used to identify the physics end of terminal
Mouthful, which is identified as the unique identification of the physical port of difference terminal;
At least one application is installed in the server, wherein each application can respectively correspond one or more ports
Binding relationship, which includes target application, such as documents editing application word, destination virtual port refer to service
The virtual port used in device for target application, target physical port refer to that target application it is expected the physics end used in terminal
Mouthful, destination virtual port is corresponding with target physical port, for example, virtual port COM1 is corresponding with physical port COM1, this method
Include:
The virtual terminal that server is recorded according to PORT BINDING RELATIONSHIP corresponding with target application in mapping relations allocation list
Mouth mark creates destination virtual port, and generates mapping table according to mapping relations allocation list, wherein mapping table packet
Include PORT BINDING RELATIONSHIP corresponding with destination virtual port in mapping relations allocation list;
Server is when preset condition meets, in the case where the destination virtual port is opened by target application, according to
Mapping table notifies terminal to open target physical port corresponding with the destination virtual port, after terminal receives notice,
The corresponding target physical port in destination virtual port is opened, such as destination virtual port COM1 is opened by word, at this point, according to
The mapping table can notify terminal to open the corresponding target physical port COM1 of destination virtual port COM1, and terminal receives
After notice, i.e. the corresponding target physical port COM1 of unlatching destination virtual port COM1.
The above process, using before opening virtual port, is advanced by creation virtual port, avoids in the server
Application turns on virtual port before working normally prior to port redirection in server, leads to the abnormal problem of follow-up work.
In a possible design, server generates mapping table according to mapping relations allocation list, specifically can be
Following process is realized:
In terminal login service device, terminal can be sent the port-mark of at least one physical port to server,
The port-mark of at least one physical port can be the physical port mark of the port-mark including at least one physical port
Know list, server obtains the physical port mark of at least one physical port of terminal, the physical port got from terminal
Mark includes that the first physical port identifies, wherein the first physical port mark refers to reflects in the physical port mark got
The physical port mark that relationship allocation list record has is penetrated, for example, target physical port is identified with first physical port;
Server ties up the corresponding port of all first physical ports mark institute according to the mapping relations allocation list
Determine relationship and inserts mapping table, for example, the port-mark of at least one physical port includes physical port COM1, COM2,
In, COM1 is the physical port mark that mapping relations allocation list record has, and COM2 is not recorded, then COM1 is the first physical port
Mark, inserts mapping table for the corresponding PORT BINDING RELATIONSHIP of COM1 at this time.
During this, mapping relations allocation list records the physical port mark having in the physical port mark that server is got
Know, the corresponding PORT BINDING RELATIONSHIP of all first physical ports mark institute is inserted into the mapping table, realizes binding
The mapping of relationship.
In another possible design, the physical port mark got includes that the second physical port identifies, the second object
Reason port-mark refers to the physical port mark that mapping relations allocation list does not record in the physical port mark got, i.e.,
Mapping relations allocation list as described above records the COM2 having;
The method also includes: server creates the port binding of the second physical port mark with default virtual port mark
Relationship, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table.
Wherein, default virtual port can be in the virtual port that server is created according to mapping relations allocation list, reserve
Virtual port, be also possible to preparatory newly created virtual port.
For example, by taking the physical port got is identified as physical port identification list as an example, in physical port identification list
It include above-mentioned object such as in port information list when the middle physical port mark not recorded there are the mapping relations allocation list
It further include physical port mark COM 3, COM4 in port information list, due to upper on the basis of managing port-mark COM1, COM2
State the binding of the virtual port of physical port mark COM3, COM4 and server side for not having terminal side in mapping relations allocation list
Relationship, it is therefore desirable to create or distribute to again the corresponding virtual port of physical port COM 3, COM4, the binding for creating them is closed
System, and the PORT BINDING RELATIONSHIP of creation is inserted into mapping table.
When being identified in physical port identification list there are the physical port that the mapping relations allocation list does not record, also
The mark for the virtual port that server is created according to mapping relations allocation list and the second physical port mark can be bound, without
With new virtual port is created again again, for example, the object of the virtual port mark not specified terminal side COM2 of above-mentioned server side
Port is managed, does not have direct virtual port to correspond to since the physical port of terminal side identifies COM3, then the physical port of terminal side
Mark COM3 preferentially can go matching to bind from idle virtual port mark, can match virtual port mark COM2 herein, when
When server side leisureless virtual port mark, it can just go to create new virtual port and identify to the physical port mark of terminal side
Know COM3 matching.
In this way, server is for the physics that does not record of mapping relations allocation list described in the physical port mark that gets
Port-mark can create corresponding PORT BINDING RELATIONSHIP, and be added to mapping table.
In another possible design, preset condition satisfaction refers to the automatic connection switch in the preset port of the server
It is in close state, wherein the automatic connection switch in port has opening state and closed state two states.
In another possible design, equally it is being in close state the automatic connection switch feelings in the preset port of server
Under condition, if destination virtual port is opened by target application, just terminal is notified to open and the destination virtual according to mapping table
The corresponding target physical port in port.
In another possible design, the preset condition is unsatisfactory for refer to the preset port of the server certainly
Dynamic connection switch is in the open state;
The method also includes: server notifies terminal to open every PORT BINDING RELATIONSHIP record in the mapping table
The specified physical port of physical port mark.
In this case, server directly notifies the terminal to open every PORT BINDING RELATIONSHIP in the mapping table
The specified physical port of the physical port mark of record, without being opened just in destination virtual port by the target application
It goes to open corresponding physical port, improves subsequent port data write efficiency.
In another possible design, it is corresponding with the destination virtual port to notify that terminal is opened according to mapping table
Target physical port, comprising: server when getting the data of target application target physical port to be written, inquiry mapping
The state of target physical port notifies terminal to beat if the state for inquiring target physical port is in off state in relation table
Target physical port is opened, after terminal receives corresponding notice, i.e., opening target physical port, terminal are opening target physical port
The state that can also notify target physical port in server update mapping table afterwards, more if any closed state (such as true is indicated)
It is changed to opening state (such as false is indicated).
In another possible design, it is corresponding with the destination virtual port to notify that terminal is opened according to mapping table
Target physical port, comprising:
Server is inquired in mapping table when getting the data of target application target physical port to be written
The state of target physical port notifies terminal to open the mesh if the state for inquiring target physical port is in off state
Physical port is marked, at this point, just going to open corresponding target physical when application there are the data of the target physical port to be written
Port avoids the waste of resource.
In another possible design, server is when knowing that terminal opens target physical port, to destination virtual end
Mouth sends data to be written, and data to be written, the target physical end of terminal are forwarded to target physical port through destination virtual port
Mouth receives the data to be written, that is, the data to be written are written, and realizes using the use to physical port.
In another possible design, server is when knowing that terminal opens the target physical port, more new mappings
The state of target physical port is in an open state in relation table, realizes the automatic dynamic management of mapping table, is improved easily
The property used.
For example, the automatic connection switch in preset port in the server, in port, automatic connection switch is in the open state,
The physical port mark that server notifies the terminal to open every PORT BINDING RELATIONSHIP record in the mapping table is signified
In the case where fixed physical port, after knowing that terminal opens corresponding physical port, by the object of terminal in mapping table
Reason port status modification is in an open state, i.e., is revised as true by false;In another example getting target application in server
When the data of the target physical port to be written, in the case where notifying the terminal to open the target physical port, it will reflect
The target physical port status for penetrating terminal side in relation table also corresponds to modification and is in an open state, i.e., is also revised as true by false.
In another possible design, if the state of target physical port is in an open state, server is empty to target
Quasi- port sends data to be written, forwards data to be written to the target physical port through destination virtual port.
In another possible design, the mapping relations allocation list further includes preset forbidding creating corresponding virtual terminal
The physical port mark of mouth, at this point, can not be wished for some reason to avoid the physical port of terminal by mapping relations allocation list
The problem of hoping port is directed toward to be changed, and causing port collision.
In another possible design, the preset condition is unsatisfactory for can also be preset port weight in the server
Orientation master switch is in close state, i.e., does not allow to redirect terminals physical port, at this point, the method also includes:
The data that the server will acquire the target application target physical port to be written directly abandon, and improve processing
Using the efficiency of corresponding port data.
In another possible design, mapping relations allocation list can be fixed static table, and mapping table can be with
It is renewable dynamic table, above-mentioned server generates mapping table according to the mapping relations allocation list, due to mapping relations
Allocation list can be fixed up as needed, and mapping table is subsequent automatically updated, mapping movement be completed, so that resetting in port
Xiang Shi is avoided and is needed the problem of frequently establishing by hand or adjust mapping relations in the prior art, improves ease for use, reduce
Requirement.
In another possible design, the port is serial ports or parallel port.
On the other hand, embodiments herein provides a kind of server, presets mapping relations allocation list in server, reflects
The relationship allocation list of penetrating includes at least one PORT BINDING RELATIONSHIP, and each PORT BINDING RELATIONSHIP records virtual port mark and one
The binding relationship of a physical port mark, the virtual port of PORT BINDING RELATIONSHIP record are identified as the virtual of Differentiated services device foundation
The unique identification of port, the physical port of PORT BINDING RELATIONSHIP record are identified as the unique identification of the physical port of difference terminal;
At least one application is installed in server, each application at least one application respectively corresponds one or more ports
Binding relationship;At least one application includes the target application, and destination virtual port refers in server for the target application
The virtual port used, target physical port refer to that target application it is expected the physical port used, the destination virtual in terminal
Port is corresponding with target physical port, and the server includes:
Creating unit, for according to PORT BINDING RELATIONSHIP corresponding with the target application in the mapping relations allocation list
The virtual port mark recorded, creates the destination virtual port;
Generation unit, for generating mapping table according to the mapping relations allocation list, the mapping table includes
PORT BINDING RELATIONSHIP corresponding with the destination virtual port in the mapping relations allocation list;
Notification unit, for when preset condition meets, if the destination virtual port is opened by the target application, root
The terminal is notified to open target physical port corresponding with the destination virtual port according to the mapping table.
In a possible design, the generation unit is specifically used for when the terminal logs in the server, from
The terminal obtains the physical port mark of at least one physical port of the terminal, and the physical port mark got includes
First physical port mark, the first physical port mark refer to the mapping relations described in the physical port mark got
The physical port mark that allocation list record has, wherein the target physical port is identified with first physical port;According to
The corresponding PORT BINDING RELATIONSHIP of all first physical ports mark institute is inserted the mapping by the mapping relations allocation list
Relation table.
In another possible design, the physical port mark got further includes the second physical port mark,
The second physical port mark refers to what the mapping relations allocation list described in the physical port mark got did not recorded
Physical port mark;
The creating unit is also used to create the port that the second physical port mark is identified with default virtual port and ties up
Determine relationship, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table.
In another possible design, the preset condition satisfaction refers to that the preset port of the server connects automatically
Switch is in close state.
In another possible design, the preset condition is unsatisfactory for referring to that the preset port of the server connects automatically
It is in the open state to connect switch;
The notification unit is also used to that the terminal is notified to open every PORT BINDING RELATIONSHIP note in the mapping table
The specified physical port of the physical port mark of record.
In another possible design, the notification unit is specifically used for getting target application institute to be written
When stating the data of target physical port, the state of target physical port described in the mapping table is inquired, if inquiring institute
The state for stating target physical port is in off state, then the terminal is notified to open the target physical port.
In another possible design, the server further include:
Transmission unit, for when knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port
Data to be written are sent, forward data to be written to the target physical port through the destination virtual port.
In another possible design, the server further include:
Updating unit, for updating the mapping table when knowing that the terminal opens the target physical port
Described in the state of target physical port be in an open state.
In another possible design, the transmission unit is also used in the state of the target physical port be opening
When state, Xiang Suoshu destination virtual port sends data to be written, through the destination virtual port to the target physical port
Forward data to be written.
In another possible design, the mapping relations allocation list further includes preset forbidding creating corresponding virtual terminal
The physical port mark of mouth.
In another possible design, the port is serial ports or parallel port.
On the other hand, embodiments herein also provides a kind of server, the server include receiver, transmitter,
Processor, memory and bus;It is connected with each other between the transmitter, the receiver, processor and memory by bus
It communicates, is stored with mapping relations allocation list in the memory, the mapping relations allocation list includes at least one port binding
Relationship, each PORT BINDING RELATIONSHIP record the binding relationship of a virtual port mark and physical port mark, institute
The virtual port for stating PORT BINDING RELATIONSHIP record is identified as the unique identification for distinguishing the virtual port that the server is established, described
The physical port of PORT BINDING RELATIONSHIP record is identified as the unique identification of the physical port of difference terminal;It is installed in the server
There is at least one application, each application at least one described application respectively corresponds one or more port bindings and closes
System;At least one described application includes the target application, and destination virtual port refers in server and makes for the target application
Virtual port, target physical port refer to that target application described in terminal it is expected the physical port used, and the target is empty
Quasi- port is corresponding with the target physical port, wherein by calling the operational order of the memory storage, the processor
For executing following steps:
It is recorded according to PORT BINDING RELATIONSHIP corresponding with the target application in the mapping relations allocation list virtual
Port-mark creates the destination virtual port;
Mapping table is generated according to the mapping relations allocation list, the mapping table includes that the mapping relations are matched
Set PORT BINDING RELATIONSHIP corresponding with the destination virtual port in table;
When preset condition meets, if the destination virtual port is opened by the target application, closed according to the mapping
It is table, notifies the terminal to open target physical port corresponding with the destination virtual port by the transmitter.
In a possible design, by calling the operational order of the memory storage, the processing implement body is used
In execution following steps:
When the terminal logs in the server, the terminal is obtained at least from the terminal by the receiver
The physical port mark of one physical port, the physical port mark got include that the first physical port identifies, and described first
Physical port mark refers to that the mapping relations allocation list described in the physical port mark got records the physical port mark having
Know, wherein the target physical port is identified with first physical port;According to the mapping relations allocation list, by institute
There is the corresponding PORT BINDING RELATIONSHIP of the first physical port mark institute to insert the mapping table.
In another possible design, the physical port mark got further includes the second physical port mark,
The second physical port mark refers to what the mapping relations allocation list described in the physical port mark got did not recorded
Physical port mark;
By calling the operational order of the memory storage, the processor is also used to execute following steps:
Create the PORT BINDING RELATIONSHIP of second physical port mark with default virtual port mark, and by the end of creation
Mouth binding relationship inserts the mapping table.
In another possible design, the preset condition satisfaction refers to that the preset port of the server connects automatically
Switch is in close state.
In another possible design, the preset condition is unsatisfactory for referring to that the preset port of the server connects automatically
It is in the open state to connect switch;
By calling the operational order of the memory storage, the processor is also used to execute following steps:
The terminal is notified to open what every PORT BINDING RELATIONSHIP in the mapping table recorded by the transmitter
The specified physical port of physical port mark.
In another possible design, by calling the operational order of the memory storage, the processing implement body
For executing following steps:
When getting the data of the target application target physical port to be written, the mapping table is inquired
Described in target physical port state, if the state for inquiring the target physical port is in off state, by described
Transmitter notifies the terminal to open the target physical port.
In another possible design, by calling the operational order of the memory storage, the processing implement body
For executing following steps:
When knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port sends number to be written
According to forwarding data to be written to the target physical port through the destination virtual port by the transmitter.
In another possible design, by calling the operational order of the memory storage, the processor is also used
In execution following steps:
When knowing that the terminal opens the target physical port, target physical described in the mapping table is updated
The state of port is in an open state.
In another possible design, by calling the operational order of the memory storage, the processor is also used
In execution following steps:
When state in the target physical port is in an open state, Xiang Suoshu destination virtual port sends number to be written
According to forwarding data to be written to the target physical port through the destination virtual port by the transmitter.
In another possible design, the mapping relations allocation list further includes preset forbidding creating corresponding virtual terminal
The physical port mark of mouth.
In another possible design, the port is serial ports or parallel port.
On the other hand, embodiments herein also provides a kind of server, and the server includes processor and memory,
The processor is connect with the memory by bus;
The memory is for storing computer executed instructions, and when server operation, the processor reads institute
The computer executed instructions of memory storage are stated, so that the server executes any of the above-described port redirection
Method.
On the other hand, embodiments herein provides a kind of port redirection system, including terminal and server, the clothes
Device be engaged in as the server as described in any one of second aspect or the third aspect.
As can be seen from the above technical solutions, the embodiment of the present application has the advantage that
The application, using before opening virtual port, creates virtual port in advance, avoids service in the server
Application turns on virtual port before working normally prior to port redirection in device, leads to the abnormal problem of follow-up work.
Detailed description of the invention
Fig. 1 is the schematic diagram of existing USB serial ports reorientation method;
Fig. 2 is remote virtual desktop system schematic;
Fig. 3 is remote virtual desktop system architecture schematic diagram;
Fig. 4 is one embodiment schematic diagram for the method that the embodiment of the present application middle port redirects;
Fig. 5 is one embodiment schematic diagram of server in the embodiment of the present application;
Fig. 6 is another embodiment schematic diagram of server in the embodiment of the present application;
Fig. 7 is another embodiment schematic diagram of server in the embodiment of the present application.
Specific embodiment
This application provides a kind of method of port redirection, terminal and server, avoid in server application prior to
Port redirection turns on port before working normally, and leads to the abnormal problem of follow-up work.
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction with the attached drawing in the application,
Technical solution in the application is clearly and completely described, it is clear that described embodiment is only present invention a part
Embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making
Every other embodiment obtained, should fall within the scope of the present invention under the premise of creative work.
Description and claims of this specification and the (if present)s such as term " first " in above-mentioned attached drawing, " second "
It is to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that the number used in this way
According to being interchangeable under appropriate circumstances, so as to the embodiments described herein can in addition to the content for illustrating or describing herein with
Outer sequence is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover non-exclusive packet
Contain, for example, what the process, method, system, product or equipment for containing a series of steps or units were not necessarily limited to be clearly listed
Those step or units, but may include be not clearly listed or it is intrinsic for these process, methods, product or equipment
Other step or units.
As shown in Fig. 2, being general remote virtual desktop system schematic, remote data center has concentrated server resource
With storage resource 100;Multiple virtual machines (full name in English: Virtual Machine, English letter is fictionalized by virtualization technology
Claim: VM) VM1, VM2 in 120, such as Fig. 2, or physical computer 121 is directly used without virtualization technology, in Fig. 2
PM3 installs operating system 130 on these virtual machines or physical computer, and will be long-range empty by Remote Desktop Protocol 150
The interface delivery of quasi- desktop is shown on local terminal 160, while the input-output equipment on local terminal is mapped to
The server end of remote virtual desktop.
It is illustrated in figure 3 remote virtual desktop system architecture, including terminal 170 (including various input-output equipment), table
Face management system 171, remote virtual desktop computer (including virtual machine 172,173 and physical computer 174,175) three parts
Composition;Desktop management system 171 mainly manage remote virtual desktop computer (172,173,174,175 etc. in such as Fig. 3) and
The registration of remote terminal 170 and user log in the management of remote virtual desktop;Remote Desktop Protocol is by client and server-side
Composition, it is internal that different service realizations, such as USB/ serial paralled interface service client and server end are divided into according to different function
Interaction realizes that the mapping of various peripheral hardwares redirects;Show that service client and server end interaction realize that remote virtual desktop is delivered
To terminal display;Two way audio mapping is realized in the interaction of audio service client and server end;Multimedia service client and
The broadcasting and recording of multimedia service are realized in server end interaction;Key mouse service client and server end realize keyboard and mouse
It is mapped to remote virtual desktop.
In the application, usually " port " (such as serial ports COM1 or parallel port LPT1) is i.e. " port device file ", real
It is a symbol connection on border, its direction is it can be defined and be modified with the API that call operation system provides, with
Subject to last direction;And object pointed by this " port " is not necessarily intended to be the equipment pair shown in equipment manager
As, it is specifically related with realization, in addition, an object can only be directed toward for one " port ", but different " ports " can be directed toward with a pair
As.
Program is normally applied at opening " port ", the object of operation is object pointed by " port " at this time, subsequent
If object pointed by this port is replaced, is had already turned on before not influencing, only influence subsequent opening.
The embodiment of the method for the application middle port redirection, in the embodiment of the present application, port redirection is described below
Method can be applied to remote virtual desktop system, and server can be the virtual machine or physical computing in remote data center
Machine, terminal can be thin client or physical computer etc..
Referring to Fig. 4, a kind of one embodiment of the method for port redirection in the application, presets mapping in server
Relationship allocation list, the mapping relations allocation list include at least one PORT BINDING RELATIONSHIP, each PORT BINDING RELATIONSHIP note
Record the binding relationship of a virtual port mark and physical port mark, the virtual port of the PORT BINDING RELATIONSHIP record
It is identified as the unique identification for distinguishing the virtual port that the server is established, the physical port mark of the PORT BINDING RELATIONSHIP record
Know the unique identification of the physical port for difference terminal;At least one application is installed in the server, it is described at least one
Each application in respectively corresponds one or more PORT BINDING RELATIONSHIPs;At least one described application includes the mesh
Mark application, destination virtual port refer to the virtual port used in server for the target application, and target physical port refers to
Target application described in terminal it is expected the physical port used, and the destination virtual port is corresponding with the target physical port,
The described method includes:
401, server is according to PORT BINDING RELATIONSHIP corresponding with the target application in mapping relations allocation list institute
The virtual port of record identifies, and creates the destination virtual port;
In the present embodiment, the port can be serial ports or parallel port.The port may include virtual port, for example including
Destination virtual port;The port can also include physical port, for example including target physical port.
It include at least one PORT BINDING RELATIONSHIP in the mapping relations allocation list.Each PORT BINDING RELATIONSHIP record has
Virtual port mark;The virtual port mark creation virtual port that PORT BINDING RELATIONSHIP is recorded can be used in server, such as
Creation destination virtual port is identified using virtual port corresponding with target application.
In the server of remote virtual desktop system, various types of port drivings, such as serial port drive are configured with, and
Mouth driving etc., after creating corresponding destination virtual port, according to mesh described in port drive load preset in the server
The corresponding port driving of virtual port is marked, realizes that destination virtual port is in serviceable condition, for example, creating destination virtual string
After mouthful, the corresponding serial port drive of the destination virtual serial ports is loaded according to serial port drive preset in the server.
402, server generates mapping table according to the mapping relations allocation list;
Wherein, the mapping table includes end corresponding with the destination virtual port in the mapping relations allocation list
Mouth binding relationship.
Mapping relations allocation list includes at least one PORT BINDING RELATIONSHIP in the embodiment of the present application, each port binding
The binding relationship of relation record one virtual port mark and physical port mark, specifically, may include configuration format
Information and at least one PORT BINDING RELATIONSHIP, by taking port is serial ports as an example, mapping relations allocation list may include such as following table 1-1
(configuration format information) and table 1-2 (PORT BINDING RELATIONSHIP):
Table 1-1
Table 1-2
It can be as shown in table 2 below according to the mapping table that mapping relations allocation list generates;
Table 2
Wherein, false represents closed state, and true represents opening state.
403, server is when preset condition meets, if the destination virtual port is opened by the target application, according to
The mapping table notifies the terminal to open target physical port corresponding with the destination virtual port.
The application, using before opening port, creates virtual port in advance, avoids in server in the server
Port is turned on using before working normally prior to port redirection, leads to the abnormal problem of follow-up work.
Meanwhile third party's component (such as USB turns Serial Port Line) Lai Shixian port redirection is not needed in the embodiment of the present application, it mentions
The high ease for use and global reliability of port device.
Optionally, the server generates mapping table according to the mapping relations allocation list, can specifically include:
When the terminal logs in the server, the server obtains at least one of the terminal from the terminal
The physical port of physical port identifies, and the physical port mark got includes that the first physical port identifies, first physics
Port-mark refers to the physical port mark that the mapping relations allocation list record described in the physical port mark got has,
In, the target physical port is identified with first physical port;
The server is according to the mapping relations allocation list, by the corresponding end of all first physical ports mark institute
Mouth binding relationship inserts the mapping table.
In the present embodiment, the server obtains the physics end of at least one physical port of the terminal from the terminal
Mouth mark can be one of the following two kinds mode: (1) server is sent to the terminal for inquiring the terminal prot
Query information so that the physical port of the terminal inquiry itself identifies to obtain the physics of at least one physical port
Port-mark, and the server is returned to, the server receives at least one described physical port that the terminal returns
Physical port mark;(2) terminal identifies the physical port of at least one physical port of itself to the server
It sends, the server receives the physical port mark at least one physical port that the terminal returns, and does not make herein
It is specific to limit.
Optionally, the physical port mark of at least one physical port is added into physical port mark by the terminal
List sends physical port identification list to server.In the present embodiment, the physical port identification list includes including first
Physical port mark, the first physical port mark can be one or more, and first physical port mark is
It is recorded in the mapping relations allocation list.
For example, it is assumed that server receives the physical port identification list that the terminal returns, the physical port identification list
In include the first physical port identify: COM1 and COM2, the server is according to the mapping relations allocation list (table as above at this time
1-2), the corresponding PORT BINDING RELATIONSHIP of all first physical ports mark institute is inserted into the mapping table, obtain as
Shown in the following table 3:
Table 3
The packet in the physical port mark (the physical port mark of at least one i.e. described physical port) got
The second physical port mark is included, the second physical port mark, which refers to map described in the physical port mark got, closes
It is the physical port mark that allocation list does not record, i.e., the described physical port mark got exists without corresponding binding relationship
Physical port when, the method can also include: the server create the second physical port mark with it is default virtual
The PORT BINDING RELATIONSHIP of port-mark, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table.
Wherein, default virtual port, which can be, reserves in the virtual port that server is created according to mapping relations allocation list
Virtual port is also possible to preparatory newly created virtual port.
When the default virtual port is to identify the new virtual port being pre-created according to the second physical port, in institute
Before stating the PORT BINDING RELATIONSHIP that server creates the second physical port mark and default virtual port mark, the method
It can also include: that the server creates the corresponding virtual port of the second physical port mark.
For example, by taking the physical port got is identified as physical port identification list as an example, in the physical port
When being identified in identification list there are the physical port that the mapping relations allocation list does not record, such as wrapped in port information list
On the basis of including above-mentioned physical port mark COM1, COM2, further include in port information list physical port mark COM 3,
COM4, due to not having the void of the physical port of terminal side mark COM3, COM4 and server side in above-mentioned mapping relations allocation list
The binding relationship of quasi- port, it is therefore desirable to create or distribute to again the corresponding virtual port of physical port COM 3, COM4, create
Their binding relationship, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table, it specifically can be as shown in table 4 below.
There are the physical port marks that the mapping relations allocation list does not record in the physical port identification list
When, the mark for the virtual port that server is created according to mapping relations allocation list and the second physical port mark can also be tied up
It is fixed, and do not have to create new virtual port again again, in table 3 as above, the virtual port of server side identifies COM2 not specified end
The physical port of end side, since the physical port mark COM3 of terminal side does not have that direct virtual port is corresponding, then terminal side
Physical port mark COM3 preferentially can go matching to bind from idle virtual port mark, can match virtual port mark herein
COM2 can just go to create new virtual port and identify to the object of terminal side when server side leisureless virtual port mark
Manage port-mark COM3 matching.
Table 4
After terminal and server disconnect, server can also delete the virtual serial port of those non-pre-published creations (such as
The corresponding virtual port of creation COM 3, COM4 of upper subsequent creation), reduction mapping table to original state.
In the embodiment of the present application, the preset condition satisfaction can refer to that the preset port of the server connects automatically and open
Pass is in close state, i.e. the preset automatic connection switch in port in the server, and in port, automatic connection switch, which is in, closes
When state, if the destination virtual port is opened by the target application, the terminal is just notified according to the mapping table
Open target physical port corresponding with the destination virtual port.
In the server in the case where the automatic connection switch in preset port, optionally, the preset condition is unsatisfactory for can
To refer to that the automatic connection switch in the preset port of the server is in the open state, at this point, the method can also include: institute
Stating server notifies the terminal to open the physical port mark institute of every PORT BINDING RELATIONSHIP record in the mapping table
Specified physical port, i.e. notice terminal open the physical port mark for having binding relationship to record all in the mapping table
Know specified physical port, such situation is suitable for the relatively high scene of port utilization, is not needed in this case in mesh
Mark virtual port is just gone to open corresponding physical port by target application opening, improves efficiency.
Optionally, described to notify the terminal to open and the mesh according to the mapping table in the embodiment of the present application
The corresponding target physical port of virtual port is marked, can specifically include:
The server is when getting the data of the target application target physical port to be written, described in inquiry
The state of target physical port described in mapping table, if the state for inquiring the target physical port is in off state,
The terminal is then notified to open the target physical port.
I.e. when application there are the data of the target physical port to be written, just go to open corresponding target physical port,
Avoid the waste of resource.
Optionally, the server is when knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual
Port sends data to be written, forwards data to be written to the target physical port through the destination virtual port.
Optionally, the server updates the mapping and closes when knowing that the terminal opens the target physical port
It is that the state of target physical port described in table is in an open state, realizes the automatic dynamic management of mapping table, improve
Ease for use.
For example, the automatic connection switch in preset port in the server, in port, automatic connection switch is in the open state,
The server notifies the terminal to open the physical port mark of every PORT BINDING RELATIONSHIP record in the mapping table
In the case where specified physical port, after knowing that terminal opens corresponding physical port, by terminal in mapping table
Physical port status modifier be in an open state, i.e., true is revised as by false;In another example server get it is described
When the data of the target application target physical port to be written, the case where notifying the terminal to open the target physical port
Under, the target physical port status of terminal side in mapping table also corresponding modification is in an open state, i.e., is also modified by false
For true.
Optionally, if the state of the target physical port is in an open state, the server is to the destination virtual
Port sends data to be written, forwards data to be written to the target physical port through the destination virtual port.
In the embodiment of the present application, the preset condition is unsatisfactory for can also be that preset port redirection is total in the server
Switch is in close state, i.e., does not allow to redirect terminals physical port, at this point, the method also includes: the clothes
The data that business device will acquire the target application target physical port to be written directly abandon, and improve processing application pair
The efficiency for the port data answered.
Optionally, the mapping relations allocation list can also include the preset physics end for forbidding creating corresponding virtual port
Mouth mark, at this point, port can be not intended to be directed toward for some reason to avoid the physical port of terminal by mapping relations allocation list
The problem of being changed, and causing port collision.
In the embodiment of the present application, mapping relations allocation list can be fixed static table, and mapping table can be can be more
New dynamic table, above-mentioned server generates mapping table according to the mapping relations allocation list, due to mapping relations allocation list
It can be fixed up as needed, mapping table is subsequent automatically updated, mapping movement is completed, so that in port redirection,
It avoids and needs the problem of frequently establishing by hand or adjust mapping relations in the prior art, improve ease for use, reduce use
It is required that.
The embodiment of server in the embodiment of the present application is described below.
Referring to Fig. 5, mapping relations allocation list is preset in server for one embodiment of server in the application,
The mapping relations allocation list includes at least one PORT BINDING RELATIONSHIP, and each PORT BINDING RELATIONSHIP records a virtual terminal
The binding relationship of mouth mark and physical port mark, the virtual port of the PORT BINDING RELATIONSHIP record, which is identified as, distinguishes institute
The unique identification of the virtual port of server foundation is stated, the physical port of the PORT BINDING RELATIONSHIP record is identified as difference terminal
Physical port unique identification;Each of at least one application, at least one application are installed in the server
Using respectively corresponding one or more PORT BINDING RELATIONSHIPs;At least one described application includes the target application, target
Virtual port refers to the virtual port used in server for the target application, and target physical port refers to mesh described in terminal
The physical port that mark is used using expectation, the destination virtual port is corresponding with the target physical port, the server packet
It includes:
Creating unit 501, for according to port binding corresponding with the target application in the mapping relations allocation list
The virtual port mark that relationship is recorded, creates the destination virtual port;
Generation unit 502, for generating mapping table, the mapping table packet according to the mapping relations allocation list
Include PORT BINDING RELATIONSHIP corresponding with the destination virtual port in the mapping relations allocation list;
Notification unit 503, for when preset condition meets, if the destination virtual port is beaten by the target application
It opens, notifies the terminal to open target physical port corresponding with the destination virtual port according to the mapping table.
Optionally, the generation unit 502 is specifically used for obtaining when the terminal logs in the server from the terminal
The physical port of at least one physical port of the terminal is taken to identify, the physical port mark got includes the first physics end
Mouth mark, the first physical port mark refer to the mapping relations allocation list record described in the physical port mark got
Some physical port marks, wherein the target physical port is identified with first physical port;It is closed according to the mapping
It is allocation list, the corresponding PORT BINDING RELATIONSHIP of all first physical ports mark institute is inserted into the mapping table.
Optionally, the physical port mark got further includes the second physical port mark, second physics end
Mouth mark refers to the physical port mark that the mapping relations allocation list described in the physical port mark got does not record;
The creating unit 501 is also used to create the port of the second physical port mark and default virtual port mark
Binding relationship, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table.
Optionally, the preset condition satisfaction refers to that the automatic connection switch in the preset port of the server is in closing shape
State.
Optionally, the preset condition is unsatisfactory for referring to that the automatic connection switch in the preset port of the server is in opening
State;
The notification unit 503 is also used to that the terminal is notified to open every PORT BINDING RELATIONSHIP in the mapping table
The specified physical port of the physical port mark of record.
Optionally, the notification unit 503 is specifically used for getting the target application target physical to be written
When the data of port, the state of target physical port described in the mapping table is inquired, if inquiring the target physical
The state of port is in off state, then the terminal is notified to open the target physical port.
Optionally, the server further include:
Transmission unit, for when knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port
Data to be written are sent, forward data to be written to the target physical port through the destination virtual port.
Optionally, the server further include:
Updating unit, for updating the mapping table when knowing that the terminal opens the target physical port
Described in the state of target physical port be in an open state.
Optionally, the transmission unit is also used to when the state of the target physical port is in an open state, Xiang Suoshu
Destination virtual port sends data to be written, forwards number to be written to the target physical port through the destination virtual port
According to.
Optionally, the mapping relations allocation list further includes the preset physical port mark for forbidding creating corresponding virtual port
Know.
Optionally, the port is serial ports or parallel port.
The server in the embodiment of the present invention is described from the angle of blocking functional entity above, below from hard
The server in the embodiment of the present invention is described in the angle of part processing, referring to Fig. 6, the server in the embodiment of the present invention
600 include:
(wherein the quantity of processor 603 can be with one for receiver 601, transmitter 602, processor 603 and memory 604
Or it is multiple, in Fig. 6 by taking a processor 603 as an example).In some embodiments of the invention, receiver 601, transmitter 602,
Processor 603 and memory 604 can be connected by bus or other means, wherein in Fig. 6 for being connected by bus.
Mapping relations allocation list is stored in the memory 604, the mapping relations allocation list includes at least one end
Mouth binding relationship, each PORT BINDING RELATIONSHIP record the binding pass of a virtual port mark with a physical port mark
The virtual port of system, the PORT BINDING RELATIONSHIP record is identified as the unique mark for distinguishing the virtual port that the server is established
Know, the physical port of the PORT BINDING RELATIONSHIP record is identified as the unique identification of the physical port of difference terminal;In the clothes
Business device is equipped at least one application, and each application at least one described application respectively corresponds one or more ports
Binding relationship;At least one described application includes the target application, and destination virtual port refers in server for the target
Using virtual port, target physical port refers to that target application described in terminal it is expected the physical port that uses, described
Destination virtual port is corresponding with the target physical port, wherein by calling the operational order of the storage of memory 604,
The processor 603 is for executing following steps:
It is recorded according to PORT BINDING RELATIONSHIP corresponding with the target application in the mapping relations allocation list virtual
Port-mark creates the destination virtual port;
Mapping table is generated according to the mapping relations allocation list, the mapping table includes that the mapping relations are matched
Set PORT BINDING RELATIONSHIP corresponding with the destination virtual port in table;
When preset condition meets, if the destination virtual port is opened by the target application, closed according to the mapping
It is table, notifies the terminal to open target physical port corresponding with the destination virtual port by the transmitter.
Optionally, by the operational order for calling the memory 604 to store, the processor 603 is specifically used for executing
Following steps:
When the terminal logs in the server, the terminal is obtained from the terminal by the receiver 601
The physical port of at least one physical port identifies, and the physical port mark got includes that the first physical port identifies, described
First physical port mark refers to that the mapping relations allocation list described in the physical port mark got records the physics end having
Mouth mark, wherein the target physical port is identified with first physical port;According to the mapping relations allocation list,
The corresponding PORT BINDING RELATIONSHIP of all first physical ports mark institute is inserted into the mapping table.
Optionally, the physical port mark got further includes the second physical port mark, second physics end
Mouth mark refers to the physical port mark that the mapping relations allocation list described in the physical port mark got does not record;
By the operational order for calling the memory 604 to store, the processor 603 is also used to execute following steps:
Create the PORT BINDING RELATIONSHIP of second physical port mark with default virtual port mark, and by the end of creation
Mouth binding relationship inserts the mapping table.
Optionally, the preset condition satisfaction refers to that the automatic connection switch in the preset port of the server is in closing shape
State.
Optionally, the preset condition is unsatisfactory for referring to that the automatic connection switch in the preset port of the server is in opening
State;
By the operational order for calling the memory 604 to store, the processor 603 is also used to execute following steps:
The terminal is notified to open every PORT BINDING RELATIONSHIP record in the mapping table by the transmitter 602
The specified physical port of physical port mark.
Optionally, by the operational order for calling the memory 604 to store, the processor 603 is specifically used for executing
Following steps:
When getting the data of the target application target physical port to be written, the mapping table is inquired
Described in target physical port state, if the state for inquiring the target physical port is in off state, by described
Transmitter 602 notifies the terminal to open the target physical port.
Optionally, by the operational order for calling the memory 604 to store, the processor 603 is specifically used for executing
Following steps:
When knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port sends number to be written
According to forwarding data to be written to the target physical port through the destination virtual port by the transmitter.
Optionally, by the operational order for calling the memory 604 to store, the processor 603 is also used to execute such as
Lower step:
When knowing that the terminal opens the target physical port, target physical described in the mapping table is updated
The state of port is in an open state.
Optionally, by the operational order for calling the memory 604 to store, the processor 603 is also used to execute such as
Lower step:
When state in the target physical port is in an open state, Xiang Suoshu destination virtual port sends number to be written
According to forwarding data to be written to the target physical port through the destination virtual port by the transmitter.
Optionally, the mapping relations allocation list further includes the preset physical port mark for forbidding creating corresponding virtual port
Know.
Optionally, the port is serial ports or parallel port.
The present embodiments relate to server can have than more or fewer components illustrated in fig. 6, can group
Close two or more components, or can have different components and configure or set up, all parts can include one or
The combination of hardware, software or hardware and software including multiple signal processings and/or specific integrated circuit is realized.
Embodiments herein also provides a kind of server, and the server as shown in Figure 7 includes processor 701 and storage
Device 702, the processor 701 are connect with the memory 702 by bus;
The memory 702 is for storing computer executed instructions, when server operation, the processor 701
The computer executed instructions that the memory 702 stores are read, so that the server executes any of the above-described end
The method of salty orientation.
A kind of port redirection system, including terminal and server are provided in the embodiment of the present application, the server is upper
State server described in any case.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some ports, device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into 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, technical solution of the present invention 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 present invention
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, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (22)
1. a kind of method of port redirection, which is characterized in that preset mapping relations allocation list in server, the mapping is closed
It is allocation list include at least one PORT BINDING RELATIONSHIP, each PORT BINDING RELATIONSHIP records virtual port mark and one
The binding relationship of a physical port mark, the virtual port of the PORT BINDING RELATIONSHIP record are identified as the difference server and build
The physical port of the unique identification of vertical virtual port, the PORT BINDING RELATIONSHIP record is identified as the physical port of difference terminal
Unique identification;At least one application is installed in the server, each application at least one described application is right respectively
Answer one or more PORT BINDING RELATIONSHIPs;At least one described application includes target application, and destination virtual port refers to clothes
The virtual port used in business device for the target application, target physical port refer to that the expectation of target application described in terminal uses
Physical port, the destination virtual port is corresponding with the target physical port, which comprises
The server is recorded according to PORT BINDING RELATIONSHIP corresponding with the target application in the mapping relations allocation list
Virtual port mark, create the destination virtual port;
The server generates mapping table according to the mapping relations allocation list, and the mapping table includes the mapping
PORT BINDING RELATIONSHIP corresponding with the destination virtual port in relationship allocation list;
The server is when preset condition meets, if the destination virtual port is opened by the target application, according to described
Mapping table notifies the terminal to open target physical port corresponding with the destination virtual port.
2. the method according to claim 1, wherein the server is generated according to the mapping relations allocation list
Mapping table specifically includes:
When the terminal logs in the server, the server obtains at least one physics of the terminal from the terminal
The physical port of port identifies, and the physical port mark got includes that the first physical port identifies, first physical port
Mark refers to the physical port mark that the mapping relations allocation list record described in the physical port mark got has, wherein
The target physical port is identified with first physical port;
The server ties up the corresponding port of all first physical ports mark institute according to the mapping relations allocation list
Determine relationship and inserts the mapping table.
3. according to the method described in claim 2, it is characterized in that, the physical port mark got includes the second physics
Port-mark, the second physical port mark refer to the mapping relations allocation list described in the physical port mark got not
Record the physical port mark having;
The method also includes:
The server creates the PORT BINDING RELATIONSHIP of the second physical port mark and default virtual port mark, and will wound
The PORT BINDING RELATIONSHIP built inserts the mapping table.
4. according to the method in any one of claims 1 to 3, which is characterized in that the preset condition satisfaction refers to described
The automatic connection switch in the preset port of server is in close state.
5. the method according to claim 1, wherein
The preset condition is unsatisfactory for referring to that the automatic connection switch in the preset port of the server is in the open state;
The method also includes:
The server notifies the terminal to open the physical port that every PORT BINDING RELATIONSHIP records in the mapping table
The specified physical port of mark.
6. the method according to claim 1, wherein
It is described to notify the terminal to open target physical end corresponding with the destination virtual port according to the mapping table
Mouthful, comprising:
The server inquires the mapping when getting the data of the target application target physical port to be written
The state of target physical port described in relation table is led to if the state for inquiring the target physical port is in off state
Know that the terminal opens the target physical port.
7. according to the method described in claim 6, it is characterized in that, which comprises
When knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port sends to be written the server
Data, forward data to be written to the target physical port through the destination virtual port.
8. the method according to the description of claim 7 is characterized in that the described method includes:
The server updates mesh described in the mapping table when knowing that the terminal opens the target physical port
The state of mark physical port is in an open state.
9. method according to claim 6 or 7, which is characterized in that the method also includes:
If the state of the target physical port is in an open state, the server sends to be written to the destination virtual port
Data, forward data to be written to the target physical port through the destination virtual port.
10. according to claim 1 to method described in any one of 3 or 5 to 8, which is characterized in that
The mapping relations allocation list further includes the preset physical port mark for forbidding creating corresponding virtual port.
11. the method according to claim 1, wherein
The port is serial ports or parallel port.
12. a kind of server, which is characterized in that preset mapping relations allocation list, the mapping relations allocation list in server
Including at least one PORT BINDING RELATIONSHIP, each PORT BINDING RELATIONSHIP records a virtual port mark and a physics end
The binding relationship of mouth mark, the virtual port of the PORT BINDING RELATIONSHIP record are identified as the virtual of the difference server foundation
The unique identification of port, the physical port of the PORT BINDING RELATIONSHIP record are identified as unique mark of the physical port of difference terminal
Know;At least one application is installed in the server, each application at least one described application respectively correspond one or
Multiple PORT BINDING RELATIONSHIPs;At least one described application includes target application, and destination virtual port, which refers in server, to be supplied
The virtual port that the target application uses, target physical port refer to that target application described in terminal it is expected the physics end used
Mouthful, the destination virtual port is corresponding with the target physical port, and the server includes:
Creating unit, for being remembered according to PORT BINDING RELATIONSHIP corresponding with the target application in the mapping relations allocation list
The virtual port of record identifies, and creates the destination virtual port;
Generation unit, for generating mapping table according to the mapping relations allocation list, the mapping table includes described
PORT BINDING RELATIONSHIP corresponding with the destination virtual port in mapping relations allocation list;
Notification unit, for when preset condition meets, if the destination virtual port is opened by the target application, according to institute
Stating mapping table notifies the terminal to open target physical port corresponding with the destination virtual port.
13. server according to claim 12, which is characterized in that the generation unit is specifically used for stepping in the terminal
When recording the server, the physical port mark of at least one physical port of the terminal is obtained from the terminal, is got
Physical port mark include that the first physical port identifies, first physical port mark refers in the physical port got
The physical port mark that the record of mapping relations allocation list described in mark has, wherein the target physical port has described the
One physical port mark;According to the mapping relations allocation list, by the corresponding port of all first physical ports mark institute
Binding relationship inserts the mapping table.
14. server according to claim 13, which is characterized in that the physical port mark got further includes the
Two physical ports mark, the second physical port mark refer to that the mapping relations described in the physical port mark got are matched
Set the physical port mark that table does not record;
The port binding that the creating unit is also used to create the second physical port mark and default virtual port mark closes
System, and the PORT BINDING RELATIONSHIP of creation is inserted into the mapping table.
15. server described in any one of 2 to 14 according to claim 1, which is characterized in that the preset condition satisfaction refers to
The automatic connection switch in the preset port of the server is in close state.
16. server according to claim 12, which is characterized in that the preset condition is unsatisfactory for referring to the server
The automatic connection switch in preset port is in the open state;
The notification unit is also used to that the terminal is notified to open what every PORT BINDING RELATIONSHIP in the mapping table recorded
The specified physical port of physical port mark.
17. server according to claim 12, which is characterized in that
The notification unit is specifically used for when getting the data of the target application target physical port to be written, looks into
The state of target physical port described in the mapping table is ask, if inquiring the state of the target physical port to close
State then notifies the terminal to open the target physical port.
18. server according to claim 17, which is characterized in that the server further include:
Transmission unit, for when knowing that the terminal opens the target physical port, Xiang Suoshu destination virtual port to be sent
Data to be written forward data to be written to the target physical port through the destination virtual port.
19. server according to claim 18, which is characterized in that the server further include:
Updating unit, for updating institute in the mapping table when knowing that the terminal opens the target physical port
The state for stating target physical port is in an open state.
20. server according to claim 18, which is characterized in that the transmission unit is also used in the target physical
When the state of port is in an open state, Xiang Suoshu destination virtual port sends data to be written, through the destination virtual port to
The target physical port forwards data to be written.
21. server according to claim 12, which is characterized in that the mapping relations allocation list further includes preset taboo
Only create the physical port mark of corresponding virtual port.
22. a kind of server, which is characterized in that the server includes processor and memory, and the processor is deposited with described
Reservoir is connected by bus;
The memory is for storing computer executed instructions, when server operation, deposits described in the processor reading
The computer executed instructions of reservoir storage, so that the server perform claim requires 1 to 11 described in any item ports
The method of redirection.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610067163.0A CN105721566B (en) | 2016-01-29 | 2016-01-29 | A kind of method of port redirection, server |
PCT/CN2016/096567 WO2017128710A1 (en) | 2016-01-29 | 2016-08-24 | Port redirection method, server and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610067163.0A CN105721566B (en) | 2016-01-29 | 2016-01-29 | A kind of method of port redirection, server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105721566A CN105721566A (en) | 2016-06-29 |
CN105721566B true CN105721566B (en) | 2019-05-24 |
Family
ID=56155229
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610067163.0A Active CN105721566B (en) | 2016-01-29 | 2016-01-29 | A kind of method of port redirection, server |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105721566B (en) |
WO (1) | WO2017128710A1 (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105721566B (en) * | 2016-01-29 | 2019-05-24 | 华为技术有限公司 | A kind of method of port redirection, server |
CN107612702A (en) * | 2016-07-12 | 2018-01-19 | 中兴通讯股份有限公司 | A kind of method for configuring routers and device |
KR20180074151A (en) * | 2016-12-23 | 2018-07-03 | 에이치피프린팅코리아 주식회사 | Image forming apparatus and method for setting up a network in thereof |
CN107066409A (en) * | 2017-03-31 | 2017-08-18 | 福建升腾资讯有限公司 | Port based on operation system redirects the method with communication data after-treatment |
CN108809672B (en) * | 2017-04-26 | 2022-04-19 | 中兴通讯股份有限公司 | Virtual port management method and device |
CN107483538B (en) * | 2017-07-06 | 2021-01-01 | 聚好看科技股份有限公司 | Method and device for processing access request packet on node of micro-service cluster |
CN107395423A (en) * | 2017-07-28 | 2017-11-24 | 郑州云海信息技术有限公司 | The method and apparatus for binding the network port and network card interface |
CN110115835B (en) * | 2018-02-05 | 2022-12-20 | 网宿科技股份有限公司 | Cloud game running method based on Android system and server |
CN108696437B (en) * | 2018-06-22 | 2021-05-28 | 新华三技术有限公司 | Flow forwarding method and device |
CN109144592B (en) * | 2018-09-10 | 2022-03-22 | 郑州云海信息技术有限公司 | Port mode-based driving service execution system and method |
CN109309635A (en) * | 2018-09-28 | 2019-02-05 | 新华三云计算技术有限公司 | Virtual machine elastic telescopic method, apparatus, host equipment and computer-readable medium |
CN110231923B (en) * | 2019-05-31 | 2020-05-29 | 浙江口碑网络技术有限公司 | Data management method and device |
CN112699071A (en) * | 2020-12-14 | 2021-04-23 | 北京握奇智能科技有限公司 | Linux system based USB port binding structure and method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1825272A (en) * | 2005-02-22 | 2006-08-30 | 中国科学院计算技术研究所 | Remote printing method for multi-node intelligent network application service system |
CN101296185A (en) * | 2008-06-05 | 2008-10-29 | 杭州华三通信技术有限公司 | Flow control method and device of equalization group |
CN101329639A (en) * | 2008-07-24 | 2008-12-24 | 武汉理工大学 | Method for implementing application program sharing under graticule manufacturing environment |
CN102508795A (en) * | 2011-10-14 | 2012-06-20 | 深圳市京华科讯科技有限公司 | Parallel port redirection method and system |
CN102508796A (en) * | 2011-10-14 | 2012-06-20 | 深圳市京华科讯科技有限公司 | Serial port redirection method and system |
CN103051716A (en) * | 2012-12-25 | 2013-04-17 | 中标软件有限公司 | Method and system for redirecting network-oriented serial device |
CN104410668A (en) * | 2014-10-31 | 2015-03-11 | 国云科技股份有限公司 | Virtual machine remote desktop management method suitable for public cloud |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8397092B2 (en) * | 2010-03-24 | 2013-03-12 | Emulex Design & Manufacturing Corporation | Power management for input/output devices by creating a virtual port for redirecting traffic |
KR20140011539A (en) * | 2012-07-02 | 2014-01-29 | 한국전자통신연구원 | System and method of virtualization for network application and the apparatus |
CN103530159A (en) * | 2013-10-21 | 2014-01-22 | 深圳市中兴物联科技有限公司 | Upgrading method and system of wireless communication module |
CN105721566B (en) * | 2016-01-29 | 2019-05-24 | 华为技术有限公司 | A kind of method of port redirection, server |
-
2016
- 2016-01-29 CN CN201610067163.0A patent/CN105721566B/en active Active
- 2016-08-24 WO PCT/CN2016/096567 patent/WO2017128710A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1825272A (en) * | 2005-02-22 | 2006-08-30 | 中国科学院计算技术研究所 | Remote printing method for multi-node intelligent network application service system |
CN101296185A (en) * | 2008-06-05 | 2008-10-29 | 杭州华三通信技术有限公司 | Flow control method and device of equalization group |
CN101329639A (en) * | 2008-07-24 | 2008-12-24 | 武汉理工大学 | Method for implementing application program sharing under graticule manufacturing environment |
CN102508795A (en) * | 2011-10-14 | 2012-06-20 | 深圳市京华科讯科技有限公司 | Parallel port redirection method and system |
CN102508796A (en) * | 2011-10-14 | 2012-06-20 | 深圳市京华科讯科技有限公司 | Serial port redirection method and system |
CN103051716A (en) * | 2012-12-25 | 2013-04-17 | 中标软件有限公司 | Method and system for redirecting network-oriented serial device |
CN104410668A (en) * | 2014-10-31 | 2015-03-11 | 国云科技股份有限公司 | Virtual machine remote desktop management method suitable for public cloud |
Also Published As
Publication number | Publication date |
---|---|
WO2017128710A1 (en) | 2017-08-03 |
CN105721566A (en) | 2016-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105721566B (en) | A kind of method of port redirection, server | |
US11409719B2 (en) | Co-locating microservice persistence containers within tenant-specific database | |
CN106301829B (en) | A kind of method and apparatus of network service dilatation | |
EP3554010B1 (en) | Method and system for use in constructing content delivery network platform on heterogeneous resources | |
CN107515776A (en) | The uninterrupted upgrade method of business, node to be upgraded and readable storage medium storing program for executing | |
CN107707622A (en) | A kind of method, apparatus and desktop cloud controller for accessing desktop cloud virtual machine | |
CN105024839B (en) | A kind of method and device of software release upgrade | |
CN109766199A (en) | Node communication method and device in a kind of robot operating system | |
CN112698838B (en) | Multi-cloud container deployment system and container deployment method thereof | |
CN102611754A (en) | Management method of client in cloud storage based on iSCSI (internet small computer system interface) | |
CN109547243B (en) | DDS-based cross-network-segment communication method | |
CN112600903B (en) | Elastic virtual network card migration method | |
CN109194589B (en) | MDC (media data center) implementation method and device | |
CN110213391A (en) | A kind of configuration method and device of internet protocol address | |
CN110728558A (en) | Virtual article package sending method, device, equipment and storage medium | |
CN110928554A (en) | Deployment method, device, equipment and storage medium | |
CN108304270B (en) | Communication method, device and computer readable storage medium | |
CN106980531A (en) | Input method operation processing method and device | |
CN108540408B (en) | Openstack-based distributed virtual switch management method and system | |
CN109857553A (en) | EMS memory management process and device | |
CN112583655B (en) | Data transmission method and device, electronic equipment and readable storage medium | |
CN113220432A (en) | Multi-cloud interconnection method, device, equipment, storage medium and product | |
CN109587185A (en) | Object processing method in cloud storage system and cloud storage system | |
CN108418857B (en) | Zookeeper cluster system and connection method and device thereof | |
CN109948994A (en) | A kind of instant communicating method, device, computer system and readable storage medium storing program for executing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220228 Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province Patentee after: Huawei Cloud Computing Technology Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
TR01 | Transfer of patent right |