CN106201930B - A kind of device port determining device, terminal and method - Google Patents
A kind of device port determining device, terminal and method Download PDFInfo
- Publication number
- CN106201930B CN106201930B CN201610597301.6A CN201610597301A CN106201930B CN 106201930 B CN106201930 B CN 106201930B CN 201610597301 A CN201610597301 A CN 201610597301A CN 106201930 B CN106201930 B CN 106201930B
- Authority
- CN
- China
- Prior art keywords
- port
- equipment
- jump
- physical interface
- interface position
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/122—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware performs an I/O function other than control of data transfer
Abstract
The invention discloses a kind of device port determining device, terminal and methods, when the old port for detecting at least two equipment while jumping, then match the physical interface position of port new after jump with the physical interface position for jumping preceding old port;If the physical interface location matches success of the physical interface position of new port and the preceding old port of jump after jump, it is determined that after the jump new port is device port, so that equipment passes through the device port and terminal progress data communication.The scheme provided through the invention, the corresponding new port of equipment after port-hopping is determined according to the constant characteristic in physical interface position, to can effectively determine the corresponding new port of equipment after guaranteeing port-hopping, so that between equipment and terminal data communication can be carried out by appropriate ports, complete the work such as corresponding downloading, backup, meanwhile also the user experience is improved.
Description
Technical field
The present invention relates to network communication technology field, more specifically to a kind of device port determining device, terminal and
Method.
Background technique
Currently, on windows platform use USB device port during, USB device be inserted into USB physical interface with
Computer connection carries out data communication by port numbers corresponding with USB device and computer.However, once equipment is restarted, port numbers
Jump (such as COM1 becomes COM2) may occur, cause computer to find the corresponding new port of the equipment, for example, a computer is same
When connect multiple devices, if these equipment simultaneously originating port jump, can not determine the corresponding relationship of equipment Yu new port,
Also it can not determine which the corresponding new port of some equipment is, to cannot achieve the data communication of computer and equipment room, drop
The usage experience of low user.
Summary of the invention
The technical problem to be solved in the present invention is that multiple equipment port jumps simultaneously in the prior art, lead to terminal
The corresponding relationship of new port after can not determining equipment and jumping, to influence user experience.For the technical problem, one kind is provided
Device port determining device, terminal and method.
In order to solve the above technical problems, the embodiment of the present invention provides a device port determining device, comprising:
Interface position matching module, if will be jumped for detecting the old port of at least two equipment while jumping
The physical interface position of new port is matched with the physical interface position for jumping preceding old port after change;
Device port determining module, if the physics for old port before the physical interface position of port new after jumping and jump
Interface position successful match, it is determined that after the jump new port is device port.
Wherein, if the interface position matching module is used to detect the old port of at least two equipment while jumping
Become, then obtain the physical interface position of each new port after jump, by the physical interface position of new port any after jump and jump
The physical interface position of preceding each old port successively matches;
The physical interface position of the new port and jump preceding wherein one after if the device port determining module is used to jump
The physical interface location matches success of Geju City port, it is determined that the after the jump new port is device port.
Wherein, further includes:
Memory module, in the old port that detects at least two equipment while before jumping, by the old port
Physical interface position is stored.
Wherein, the interface position matching module is used to detect whether each equipment connecting with terminal restarts simultaneously, if with
At least two equipment of terminal connection are restarted simultaneously, it is determined that the old port of at least two equipment jumps simultaneously.
Further, the present invention provides a kind of terminals, including device port determining device as described above;
The device port determining device determines after the jump device port;
The terminal carries out data communication by the device port and equipment.
Further, the present invention also provides a kind of device ports to determine method, comprising:
If detect the old port of at least two equipment while jumping, by the physical interface position of port new after jump
It sets and is matched with the physical interface position for jumping preceding old port;
If the physical interface location matches success of the physical interface position of new port and the preceding old port of jump after jump, really
Fixed after the jump new port is device port.
Wherein, which comprises
If detect the old port of at least two equipment while jumping, the physics for obtaining each new port after jumping is connect
Mouth position;
The physical interface position of each old port is successively by the physical interface position of new port any after jump and before jumping
Match;
If the physical interface position of the physical interface position of the new port and one of them preceding old port of jump after jump
With success, it is determined that the after the jump new port is device port.
Wherein, the physical interface position of new port includes: after the acquisition jump
Obtain after the jump new port;
The physical interface position of new port is determined according to after the jump new port.
Wherein, in the old port for detecting at least two equipment while before jumping, further includes:
The physical interface position of the old port is stored.
Wherein, the old port of at least two equipment of the detection jumps simultaneously includes:
Detect whether each equipment connecting with terminal restarts simultaneously;
If at least two equipment connecting with terminal are restarted simultaneously, it is determined that the old port of at least two equipment is simultaneously
It jumps.
Beneficial effect
Device port determining device, terminal and the method that the embodiment of the present invention proposes, when detecting at least two equipment
Old port jumps simultaneously, then by the physical interface position of old port before the physical interface position of port new after jump and jump
It is matched;If the physical interface location matches success of the physical interface position of new port and the preceding old port of jump after jump,
Determine that after the jump new port is device port, so that equipment carries out data communication by the device port and terminal.Pass through this
The scheme provided is provided, the corresponding new port of equipment after port-hopping is determined according to the constant characteristic in physical interface position, from
And the corresponding new port of equipment can be effectively determined after guaranteeing port-hopping, so that can be by matched between equipment and terminal
Port carries out data communication, completes the work such as corresponding downloading, backup, meanwhile, also the user experience is improved.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
The hardware structural diagram of Fig. 1 each one mobile terminal of embodiment to realize the present invention;
Fig. 2 is the device port determining device schematic diagram that first embodiment of the invention provides;
Fig. 3 is the tree-like structure chart in physical interface position before the port-hopping that first embodiment of the invention provides;
Fig. 4 is the terminal and external equipment connection schematic diagram that second embodiment of the invention provides;
Fig. 5 is that the device port that third embodiment of the invention provides determines method flow diagram.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
The terminal of each embodiment of the present invention is realized in description with reference to the drawings.In subsequent description, using being used for
Such as suffix of " module " or " unit " of element is indicated only for being conducive to explanation of the invention, there is no specific for itself
Meaning.Therefore, " module " can be used mixedly with " unit ".
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as smart phone,
The mobile terminal of laptop, PAD (tablet computer) etc. and such as number TV, desktop computer etc. are fixed eventually
End.Hereinafter it is assumed that terminal is mobile terminal.However, it will be understood by those skilled in the art that in addition to being used in particular for mobile purpose
Element except, can also apply to the terminal of fixed type according to the construction of the present embodiment.
The hardware structural diagram of Fig. 1 each one mobile terminal of embodiment to realize the present invention.
Mobile terminal 100 includes user input unit 130, output unit 150, memory 160, interface unit 170, control
Device 180 and power supply unit 190 etc..Fig. 1 shows the mobile terminal with various assemblies, it should be understood that simultaneously should not
It is realistic to apply all components shown.More or fewer components can alternatively be implemented.Mobile terminal will be discussed in more detail below
Element.
The order that user input unit 130 can be inputted according to user generates key input data to control each of mobile terminal
Kind operation.User input unit 130 allows user to input various types of information, and may include keyboard, metal dome, touch
Plate (for example, the sensitive component of detection due to the variation of resistance, pressure, capacitor etc. caused by being contacted), idler wheel, rocking bar etc.
Deng.Particularly, when touch tablet is superimposed upon in the form of layer on display unit 151, touch screen can be formed.
Interface unit 170 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Identification module can be storage and use each of mobile terminal 100 for verifying user
It plants information and may include subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM)
Etc..In addition, the device (hereinafter referred to as " identification device ") with identification module can take the form of smart card, therefore, know
Other device can be connect via port or other attachment devices with mobile terminal 100.Interface unit 170, which can be used for receiving, to be come from
The input (for example, data information, electric power etc.) of external device (ED) and the input received is transferred in mobile terminal 100
One or more elements can be used for transmitting data between mobile terminal and external device (ED).
In addition, when mobile terminal 100 is connect with external base, interface unit 170 may be used as allowing will be electric by it
Power, which is provided from pedestal to the path or may be used as of mobile terminal 100, allows the various command signals inputted from pedestal to pass through it
It is transferred to the path of mobile terminal.The various command signals or electric power inputted from pedestal, which may be used as mobile terminal for identification, is
The no signal being accurately fitted on pedestal.Output unit 150 is configured to provide with vision, audio and/or tactile manner defeated
Signal (for example, audio signal, vision signal, alarm signal, vibration signal etc.) out.Output unit 150 may include display
Module 151, audio output module 152, alarm modules 153 etc..
Display module 151 may be displayed on the information handled in mobile terminal 100.For example, when mobile terminal 100 is in electricity
When talking about call mode, display module 151 can show and converse or other communicate (for example, text messaging, multimedia file
Downloading etc.) relevant user interface (UI) or graphic user interface (GUI).When mobile terminal 100 is in video calling mode
Or when image capture mode, display module 151 can show captured image and/or received image, show video or figure
Picture and the UI or GUI of correlation function etc..
Memory 160 can store the software program etc. of the processing and control operation that are executed by controller 180, Huo Zheke
Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And
And memory 160 can store about the vibrations of various modes and audio signal exported when touching and being applied to touch screen
Data.
Memory 160 may include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, more
Media card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access storage
Device (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory
(PROM), magnetic storage, disk, CD etc..Moreover, mobile terminal 100 can execute memory with by network connection
The network storage device of 160 store function cooperates.
The overall operation of the usually control mobile terminal of controller 180.For example, controller 180 executes and voice communication, data
Communication etc. relevant control and processing.
Power supply unit 190 receives external power or internal power under the control of controller 180 and provides operation each member
Electric power appropriate needed for part and component.
Various embodiments described herein can be to use the calculating of such as computer software, hardware or any combination thereof
Machine readable medium is implemented.Hardware is implemented, embodiment described herein can be by using application-specific IC
(ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can
Programming gate array (FPGA), controller, microcontroller, microprocessor, is designed to execute function described herein processor
At least one of electronic unit is implemented, and in some cases, such embodiment can be implemented in controller 180.
For software implementation, the embodiment of such as process or function can with allow to execute the individual of at least one functions or operations
Software module is implemented.Software code can by the software application (or program) write with any programming language appropriate Lai
Implement, software code can store in memory 160 and be executed by controller 180.
So far, oneself is through describing mobile terminal according to its function.In the following, for the sake of brevity, will description such as folded form,
Slide type mobile terminal in various types of mobile terminals of board-type, oscillating-type, slide type mobile terminal etc., which is used as, to be shown
Example.Therefore, the present invention can be applied to any kind of mobile terminal, and be not limited to slide type mobile terminal.
It is described in detail below by way of specific embodiment.
First embodiment
A kind of device port determining device is present embodiments provided, the application scenarios of the device port determining device are,
Multiple equipment is connected simultaneously in one terminal, originating port jumps simultaneously if there is at least two equipment, then terminal can not be true
Which after the jump new port locking equipment corresponds to.Namely equipment and terminal pass through physical interface during using device port
Connection, when external equipment is restarted, jump (such as being jumped by COM1 into COM2) will occur for device port, cause terminal can not
The corresponding new port of the equipment is found, so that data communication can not be carried out with equipment, influences the usage experience of user.Based on before this
It puts, by device port determining device provided by the embodiment, can be determined according to the constant characteristic of physical interface in terminal
The corresponding relationship of equipment and new port after port-hopping also determines which the corresponding new port of the equipment is, to guarantee
Data communication is carried out between terminal and equipment, is promoted with mutually experience.
Fig. 2 is referred to, Fig. 2 is device port determining device schematic diagram provided in this embodiment, which determines dress
It sets and includes:
Interface position matching module 21, if for detecting the old port of at least two equipment while jumping, it will
The physical interface position of new port is matched with the physical interface position for jumping preceding old port after jump;
Device port determining module 22, if the object for old port before the physical interface position of port new after jumping and jump
Manage interface position successful match, it is determined that after the jump new port is device port.
Wherein, if interface position matching module 21 is also used to detect the old port of at least two equipment while jumping
Become, then obtain the physical interface position of each new port after jump, by the physical interface position of new port any after jump and jump
The physical interface position of preceding each old port successively matches.
After if device port determining module 22 is also used to jump wherein one before the physical interface position of the new port and jump
The physical interface location matches success of Geju City port, it is determined that the after the jump new port is device port.
Further, the device port determining device further include:
Memory module 23, in the old port that detects at least two equipment while before jumping, by the object of old port
Reason interface position is stored.
Further, interface position matching module 21 is also used to detect whether each equipment connecting with terminal weighs simultaneously
It opens, if at least two equipment connecting with terminal are restarted simultaneously, it is determined that the old port of at least two equipment occurs simultaneously
Jump.
The function that above-mentioned each functional module executes can be realized by the fractional hardware in Fig. 1, and in subsequent descriptions with
Particular hardware is illustrated various embodiments of the present invention, and certainly, the function that each hardware executes can also be by above-mentioned Implement of Function Module.
The function of above-mentioned each functional module is specifically by following hardware realization:
The function that interface position matching module 21 and device port determining module 22 execute can be by controller 180 come real
It is existing, it detects whether port jumps by controller 180, when port jumps, determines which after the jump port has,
Then the physical interface position for obtaining jump rear port passes through each port before jumping the physical interface position of rear port and jumping
Physical interface position matched, until successful match, then it is assumed that the corresponding equipment of jump front port and jump rear port pair
The equipment answered is same equipment, and correspondingly, the corresponding new port of the equipment is the jump rear port of above-mentioned successful match.
The function that memory module 23 executes can realize that the memory 160 can store by controller by memory 160
The software programs etc. of 180 processing executed and control operation, or can temporarily store oneself and be exported or will be exported
Data (for example, the physical interface location information of jump front port, the physical interface location information for jumping rear port etc.).
Terminal can be completed when being attached with equipment by interface unit 170, can be complete by the interface unit 170
At the data communication of terminal and equipment, which may include the data-interfaces such as USB, memory card interface, external power supply
Interface etc..
Specifically, in the case where terminal (hereafter by taking computer as an example) is connect with equipment by physical interface, when an electricity
When connecting multiple equipment simultaneously on brain, memory 160 saves the physical interface position of equipment, if controller 180 is examined
After measuring at least two equipment originating ports jump in multiple equipment, by the physical interface position of preservation and rear port is jumped
Physical interface position is matched, if the two successful match, then it is assumed that the corresponding equipment of jump front port and jump rear port pair
The equipment answered is same equipment, then after the jump port is the new port of the equipment, computer by the new port and equipment after
It is continuous to carry out data communication.User can will need the file transmitted to be sent to by user input unit 130 (such as mouse and keyboard)
Equipment completes data communication.It need to understand, physical interface can be USB (Universal Serial Bus, universal serial bus)
Physical interface etc..
More specifically, a computer is equipped at least two physical interfaces, then the computer can insert the progress of at least two equipment
Data transmission, the physical interface position of each equipment is saved to memory 160.When the equipment that controller 180 detects insertion
In at least two simultaneously when restarting, the corresponding port of aforementioned at least two equipment jumps, and after the jump port is newly to hold
Mouthful, correspondingly, the port before jump is old port, which is equal with old port number, equipment number.In this feelings
Under condition, controller 180 obtains the physical interface position of all new ports, any one new end in all new ports is corresponding
Physical interface position is matched with the physical interface position of had been friends in the past port, if successful match, new port is corresponding sets for this
Standby equipment corresponding with the old port of successful match is same equipment, thus can determine that the equipment new port be match at
The new port of function.
When terminal for multiple equipment simultaneously carry out data backup or simultaneously into multiple equipment download file after, Duo Geshe
Standby the case where restarting so that multiple equipment port jumps simultaneously, controller 180 obtains first jump after occur it is new
Port, then by the physical interface position progress of all of the port before the physical interface position of either port after jump and jump
Match, the physical interface location matches success of the physical interface position of the port and the preceding one of port of jump after jump, then
It determines that the after the jump port is device port, data communication can be carried out by the device port.It is aforementioned " multiple " to be
Refer to two or more.
Further, said physical interface position can embody the corresponding relationship of physical interface and device port, the two one
One corresponding mapping relations can determine the new port of equipment by the comparison of the mapping table to jump front and back, certainly,
The mapping relations are based on same PCI (Peripheral Component Interconnect, Peripheral Component Interconnect standard) interface
Bus.The mapping relations that jump front and back physical interface and equipment interface will be respectively indicated with two tables below, specifically refer to
Tables 1 and 2.
The mapping table of physical interface and device port before table 1 jumps
In table 1, including two physical interface USB1 and USB2 and two device port COM44 and COM53, wherein
USB1 is corresponding with COM44, and USB2 is corresponding with COM53.The physical interface position of physical interface USB1 as a result, are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(1)/Port(COM44);
The physical interface position of physical interface USB2 are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(2)/Port(COM53)。
Above-mentioned physical interface position can be indicated by tree structure, specifically refer to Fig. 3, and Fig. 3 is provided in this embodiment
The tree-like structure chart in physical interface position before port-hopping can intuitively embody the preceding physical interface of jump by the tree structure figure
With the corresponding relationship of device port.It need to understand, the tree-like structure chart in physical interface position and Fig. 3 type after port-hopping, therefore this
It is not repeated.
The mapping table of physical interface and device port after table 2 jumps
Physical interface | Device port |
USB1 | COM69 |
USB2 | COM28 |
In table 2, including two physical interface USB1 and USB2 and two device port COM69 and COM28, wherein
USB1 is corresponding with COM69, and USB2 is corresponding with COM28.
Since an equipment is connect by a USB physical interface with computer, then Tables 1 and 2 reflects that there are two
A equipment, correspondingly, there are two USB physical interfaces on computer.
For device port COM69, when determining the corresponding equipment in the port, by the USB2 of the USB1 of COM69 and COM44
It is compared, finds two USB differences, then it is assumed that the corresponding equipment of COM69 equipment corresponding with COM44 is distinct device, then
COM69 is not the port of the corresponding equipment of COM44;Then the USB1 of COM69 is compared with the USB1 of COM53, discovery two
A USB is identical, then it is assumed that the corresponding equipment of COM69 equipment corresponding with COM53 is same equipment, then COM69 is the equipment
New port.
For device port COM28, when determining the corresponding equipment in the port, by the USB2 of the USB2 of COM28 and COM44
It is compared, it is found that two USB are identical, then it is assumed that it is same equipment that COM28, which corresponds to equipment equipment corresponding with COM44, then
COM28 is the new port of the equipment.After determining the corresponding new port of equipment, this matching no longer is carried out to subsequent port.
Before port jumps, the USB physical interface position of equipment is stored in memory first by controller 180,
Then the new port occurred after jump is obtained.When multiple ports simultaneously jump when, computer to equipment send data when without
Method is determined to be sent by which new port, the functions such as correspondingly downloads or back up to be unable to complete, influence user uses body
It tests.The problem of passing through above-mentioned way of contrast as a result, port-hopping can be solved with USB physical interface constant characteristic, to protect
File can be transferred to corresponding equipment to promote user experience by card computer.
Further, when whether detection port jumps, controller 180 detects each equipment connecting with terminal first
Whether restart simultaneously, if detecting, at least two equipment connecting with terminal are restarted simultaneously, it is determined that at least two equipment
Old port simultaneously jump.After detecting that port jumps, complete subsequent according to physical interface location determining device
The step of new port.
The device port determining device provided through this embodiment when the old port for detecting at least two equipment while being sent out
Raw jump then matches the physical interface position of port new after jump with the physical interface position for jumping preceding old port;If
The physical interface location matches success of the physical interface position of new port and the preceding old port of jump after jump, it is determined that after the jump
New port is device port, so that equipment carries out data communication by the device port and terminal.The side provided through the invention
Case determines the corresponding new port of equipment after port-hopping according to the constant characteristic in physical interface position, to guarantee that port is jumped
The corresponding new port of equipment can be effectively determined after change, so that between equipment and terminal data can be carried out by appropriate ports
The work such as corresponding downloading, backup are completed in communication, meanwhile, also the user experience is improved.
Second embodiment
Fig. 4 is referred to, Fig. 4 is mobile terminal provided in this embodiment and external equipment connection schematic diagram.The mobile terminal
41 include the device port determining device in first embodiment, for the related description of device port determining device, the present embodiment
It will no longer be described in detail, and specifically refer to first embodiment.The control of power supply unit 190 in mobile terminal 41 in controller 180
Appropriate electric power needed for receiving external power or internal power under system and providing each element of operation and component moves in the case
Device port determining device in dynamic terminal 41 passes through old port before the physical interface position of port new after jumping and jump
Physical interface position is matched the corresponding relationship to determine equipment Yu new port, so that the data for completing equipment and terminal room pass
It is defeated.
In Fig. 4, including two external equipments (i.e. equipment) and two USB physical interfaces, respectively 42 He of USB physical interface
USB physical interface 43, external equipment 44 and external equipment 45.External equipment 44 passes through USB physical interface 42 and mobile terminal 41
Connection, external equipment 45 are connect by USB physical interface 43 with mobile terminal 41.It is determined by mobile terminal 41 outer after jumping
45 corresponding two ports of portion's equipment 44 and external equipment, then mobile terminal 41 is set by two ports with outside respectively
Data communication is carried out for 44 and external equipment 45.
It need to understand, aforementioned port is device port, can distinguish each external equipment, i.e. port numbers by equipment end slogan
As the unique identification of each external equipment, mobile terminal can find corresponding external equipment according to the port numbers and complete data
Transmission;Said physical interface is generally equipped with one or more objects for connecting mobile terminal and external equipment on mobile terminals
Interface is managed, multiple external equipments are connected on mobile terminal.
Mobile terminal provided by the embodiment passes through device port determining device for the physical bit of the new port occurred after jump
It sets and is matched with the physical location for jumping preceding old port, can effectively determine the corresponding new end of equipment after guaranteeing port-hopping
Mouthful, it is kept away so that between equipment and terminal data communication can be carried out by appropriate ports to promote the usage experience of user
The problem of exempting from port-hopping appearance.
3rd embodiment
As shown in figure 5, Fig. 5 is that device port provided in this embodiment determines method flow diagram, it is provided in this embodiment to set
Standby port determines that method device port determining device corresponding with first embodiment is corresponding, therefore no longer does specifically to partial content
It is bright, illustrate the relevant portion for referring to first embodiment.Method includes the following steps:
S51 connects the physics of port new after jump if detect the old port of at least two equipment while jumping
Mouth position is matched with the physical interface position for jumping preceding old port.
Specifically, in the case where terminal (hereafter by taking computer as an example) is connect with equipment by physical interface, when an electricity
When connecting multiple equipment simultaneously on brain, memory 160 saves the physical interface position of equipment, if controller 180 is examined
After measuring at least two equipment originating ports jump in multiple equipment, by the physical interface position of preservation and rear port is jumped
Physical interface position is matched.
More specifically, as at least two in the equipment that controller 180 detects insertion while when restarting, aforementioned at least two
The corresponding port of a equipment jumps, and after the jump port is new port, and correspondingly, the port before jump is old port, should
New port number is equal with old port number, equipment number.In the case, controller 180 obtains the object of all new ports
Manage interface position, by all new ports the corresponding physical interface position in any one new end and the physics of had been friends in the past port connect
Mouth position is matched, so that it is determined that the corresponding new port of equipment out.
The case where equipment is restarted can be terminal and be multiple equipment while carry out data backup or setting simultaneously toward multiple
Then standby middle downloading file needs to restart equipment to complete subsequent operation, it is aforementioned it is " multiple " refer to two or two with
On.
S52, if the physical interface position of new port and the physical interface location matches success for jumping preceding old port after jump,
Then determine that after the jump new port is device port.
Specifically, if the physical interface position of new port does not match with the physical interface position of old port after jump after jump
The physical interface position of new port then is continued to match the physical interface position of old port with him is asked by success, until jump
The physical interface position consistency of front and back end ports is to judge that jump front and back belongs to same equipment.
Further, said physical interface position can embody the corresponding relationship of physical interface and device port, the two one
One corresponding mapping relations can determine the new port of equipment by the comparison of the mapping table to jump front and back, certainly,
The mapping relations are based on same pci interface bus.Jump front and back physical interface and equipment will be respectively indicated with two tables below
The mapping relations of interface specifically refer to the Tables 1 and 2 in embodiment one.
In table 1, including two physical interface USB1 and USB2 and two device port COM44 and COM53, wherein
USB1 is corresponding with COM44, and USB2 is corresponding with COM53.The physical interface position of physical interface USB1 as a result, are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(1)/Port(COM44);
The physical interface position of physical interface USB2 are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(2)/Port(COM53)。
Above-mentioned physical interface position can be indicated by tree structure, specifically refer to Fig. 3, pass through the tree structure in Fig. 3
Figure can intuitively embody the corresponding relationship for jumping preceding physical interface and device port.It need to understand, physical interface after port-hopping
The tree-like structure chart in position and Fig. 3 type, therefore this is not repeated.
In table 2, including two physical interface USB1 and USB2 and two device port COM69 and COM28, wherein
USB1 is corresponding with COM69, and USB2 is corresponding with COM28.
Since an equipment is connect by a USB physical interface with computer, then Tables 1 and 2 reflects that there are two
A equipment, correspondingly, there are two USB physical interfaces on computer.
For device port COM69, when determining the corresponding equipment in the port, by the USB2 of the USB1 of COM69 and COM44
It is compared, finds two USB differences, then it is assumed that the corresponding equipment of COM69 equipment corresponding with COM44 is distinct device, then
COM69 is not the port of the corresponding equipment of COM44;Then the USB1 of COM69 is compared with the USB1 of COM53, discovery two
A USB is identical, then it is assumed that the corresponding equipment of COM69 equipment corresponding with COM53 is same equipment, then COM69 is the equipment
New port.
For device port COM28, when determining the corresponding equipment in the port, by the USB2 of the USB2 of COM28 and COM44
It is compared, it is found that two USB are identical, then it is assumed that it is same equipment that COM28, which corresponds to equipment equipment corresponding with COM44, then
COM28 is the new port of the equipment.After determining the corresponding new port of equipment, this matching no longer is carried out to subsequent port.
Before port jumps, the USB physical interface position of equipment is stored in memory first by controller 180,
Then the new port occurred after jump is obtained.When multiple ports simultaneously jump when, computer to equipment send data when without
Method is determined to be sent by which new port, the functions such as correspondingly downloads or back up to be unable to complete, influence user uses body
It tests.The problem of passing through above-mentioned way of contrast as a result, port-hopping can be solved with USB physical interface constant characteristic, to protect
File can be transferred to corresponding equipment to promote user experience by card computer.
Further, when whether detection port jumps, controller 180 detects each equipment connecting with terminal first
Whether restart simultaneously, if detecting, at least two equipment connecting with terminal are restarted simultaneously, it is determined that at least two equipment
Old port simultaneously jump.After detecting that port jumps, complete subsequent according to physical interface location determining device
The step of new port.
Method is determined by above equipment port, when the old port for detecting at least two equipment while being jumped, then
The physical interface position of port new after jump is matched with the physical interface position for jumping preceding old port;If newly being held after jump
Mouthful physical interface position and jump before old port physical interface location matches success, it is determined that after the jump new port be set
Standby port so that equipment carries out data communication by the device port and terminal, while also promoting the usage experience of user.
Fourth embodiment
Based on the present embodiment determines method by the device port that 3rd embodiment provides, with two external equipments and computer
For the present invention will be described, it is specific as follows:
Before port-hopping, the port of each external equipment can determine when being inserted into two external equipments on computers, outside
The port of portion's equipment 1 is COM44, and the port of external equipment 2 is COM53.
Computer obtains the physical interface position of jump front port COM44 (external equipment 1) are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(1)/Port(COM44);
Computer obtains the physical interface position of jump front port COM53 (external equipment 2) are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(2)/Port(COM53)。
Then, computer detection is restarted simultaneously to external equipment 1 and external equipment 2, so that port COM44 and port COM53
It jumps simultaneously, occurs new port COM28 and COM69 after jump.
Computer obtains the physical interface position of jump rear port COM28 are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(2)/Port(COM28);
Computer obtains the physical interface position of jump rear port COM69 are as follows:
PCIROOT(0)/PCI(27CC)/USBROOT(0)/USB(1)/Port(COM69)。
Finally, for before jump and after the jump physical interface position, no matter how port changes, the physical interface of equipment
Position does not change, in the case, by the object of all of the port before the physical interface position of port each after jump and jump
Reason interface position is successively matched, physical interface position and after the jump physical interface position consistency before jump, then
Both think to belong to same external equipment, so as to the new corresponding relationship of port and equipment after jump:
The after the jump new port 1 port COM44 of equipment is COM69;
The after the jump new port 2 port COM53 of equipment is COM28.
It need to understand, device port method of determination provided in this embodiment is solved according to the constant characteristic in physical interface position
Certainly the problem of port-hopping, namely before port jumps the physical interface position of each equipment is saved.Once end
Mouth jumps, so that it may obtain the physical interface position of new port after all jumps, and the object with each port before jump one by one
Reason interface position is matched, as long as the new physical interface position of port and the physical interface position consistency of old port, can sentence
Both fixed is the same equipment.Said physical interface position is consistent, refer to PCIROOT (0)/PCI (27CC)/USBROOT (0)/
This part physical position consistency of USB (2) or PCIROOT (0)/PCI (27CC)/USBROOT (0)/USB (1), which being capable of body
The position for revealing USB physical interface is believed that as long as the position consistency of this part physical interface of jump front and back and belongs to same set
It is standby.The part and do not include port position including, since port position can jump, the physical interface comprising port position
It is different always before and after position hopping.
The problem of device port provided through this embodiment determines method, can efficiently solve port-hopping determines
The corresponding new port of equipment promotes the usage experience of user to complete the data communication of terminal and equipment after item becomes.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.
Claims (10)
1. a kind of device port determining device characterized by comprising
Interface position matching module, if for detecting the old port of at least two equipment while jumping, after jumping
The physical interface position of new port is matched with the physical interface position for jumping preceding old port;
Device port determining module, if the physical interface for old port before the physical interface position of port new after jumping and jump
Location matches success, it is determined that after the jump new port is device port, unique mark of the device port as the equipment
Know.
2. device port determining device as described in claim 1, which is characterized in that if the interface position matching module is used for
It detects the old port of at least two equipment while jumping, then obtain the physical interface position of each new port after jump, it will
The physical interface position of any new port is successively matched with the physical interface position for jumping preceding each old port after jump;
After if the device port determining module is used to jump the physical interface position of the new port with jump that preceding one of them is old
The physical interface location matches success of port, it is determined that the after the jump new port is device port.
3. device port determining device as described in claim 1, which is characterized in that further include:
Memory module, in the old port that detects at least two equipment while before jumping, by the physics of the old port
Interface position is stored.
4. device port determining device as described in any one of claims 1-3, which is characterized in that the interface position matches mould
Block is for detecting whether each equipment connecting with terminal restarts simultaneously, if at least two equipment connecting with terminal are restarted simultaneously,
It then determines the old port of at least two equipment while jumping.
5. a kind of terminal, which is characterized in that including device port determining device according to any one of claims 1-4;
The device port determining device determines after the jump device port;
The terminal carries out data communication by the device port and equipment.
6. a kind of device port determines method characterized by comprising
If detect the old port of at least two equipment while jumping, by the physical interface position of port new after jump with
The physical interface position of old port is matched before jumping;
If the physical interface location matches success of the physical interface position of new port and the preceding old port of jump after jump, it is determined that jump
Device port is in new port after change, unique identification of the device port as the equipment.
7. device port as claimed in claim 6 determines method, which is characterized in that the described method includes:
If detect the old port of at least two equipment while jumping, the physical interface position of each new port after jump is obtained
It sets;
The physical interface position of new port any after jump is successively matched with the physical interface position for jumping preceding each old port;
If jump after the new port physical interface position and jump before one of them old port physical interface location matches at
Function, it is determined that the after the jump new port is device port.
8. device port as claimed in claim 7 determines method, which is characterized in that the physics of new port after the acquisition jump
Interface position includes:
Obtain after the jump new port;
The physical interface position of new port is determined according to after the jump new port.
9. device port as claimed in claim 6 determines method, which is characterized in that at least two equipment of detecting
Before old port jumps simultaneously, further includes:
The physical interface position of the old port is stored.
10. device port as claim in any one of claims 6-9 determines method, which is characterized in that the detection at least two
The old port of equipment jumps simultaneously
Detect whether each equipment connecting with terminal restarts simultaneously;
If at least two equipment connecting with terminal are restarted simultaneously, it is determined that the old port of at least two equipment occurs simultaneously
Jump.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610597301.6A CN106201930B (en) | 2016-07-26 | 2016-07-26 | A kind of device port determining device, terminal and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610597301.6A CN106201930B (en) | 2016-07-26 | 2016-07-26 | A kind of device port determining device, terminal and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106201930A CN106201930A (en) | 2016-12-07 |
CN106201930B true CN106201930B (en) | 2019-09-13 |
Family
ID=57496360
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610597301.6A Active CN106201930B (en) | 2016-07-26 | 2016-07-26 | A kind of device port determining device, terminal and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106201930B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108021520A (en) * | 2017-11-30 | 2018-05-11 | 深圳市华德安科技有限公司 | Display methods, device and the computer-readable recording medium of access device title |
CN115277135B (en) * | 2022-07-15 | 2023-10-27 | 中国人民解放军国防科技大学 | Dynamic safety protection method based on tunnel technology and application |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101287219A (en) * | 2008-04-15 | 2008-10-15 | 深圳华为通信技术有限公司 | Method and apparatus for automatic switching port of terminal apparatus, and automatic switching system |
CN101963950B (en) * | 2010-09-30 | 2012-02-29 | 飞天诚信科技股份有限公司 | Method for positioning USB port in connection of device |
-
2016
- 2016-07-26 CN CN201610597301.6A patent/CN106201930B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106201930A (en) | 2016-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11055238B2 (en) | Electronic device and method for recognizing accessories | |
EP3197059A1 (en) | Method for controlling sim card and sd card and electronic device implementing the same | |
US9626505B2 (en) | Method and apparatus for managing authentication | |
US20160157033A1 (en) | Method and apparatus for identifying foreign substances in connectors | |
CN105549858A (en) | Display method and user terminal | |
KR20150029495A (en) | Method and apparatus for outputting recognized error of sensor in a electronic device | |
US9986082B2 (en) | Interface device and method between electronic device and external device using ear jack of the electronic device | |
KR20150062686A (en) | Spam filtering method of electronic apparatus and electronic appparatus thereof | |
CN107871015B (en) | Log data processing method and device, terminal and readable storage medium | |
KR20160001438A (en) | Apparatas and method for preventing malfunction in an electronic device | |
CN106201930B (en) | A kind of device port determining device, terminal and method | |
KR102538837B1 (en) | Electrnic device for overvoltage prevention | |
CN108009096B (en) | Test method and terminal | |
CN107548055B (en) | Multi-region SIM card selection method, system and device and industrial personal computer | |
US20160065727A1 (en) | Electronic device and method for configuring message, and wearable electronic device and method for receiving and executing the message | |
CN104933340A (en) | Message sending method and mobile terminal | |
US10977350B2 (en) | Contact information display method and device, and information display method and device | |
CN112711955A (en) | NFC information transmission method, NFC information transmission device and NFC terminal | |
CN113453214A (en) | Communication control method and electronic device | |
US9973869B2 (en) | Electronic device and noise canceling method thereof | |
US20110195750A1 (en) | Application expanding docking apparatus and electrical system thereof | |
CN107968799B (en) | Information acquisition method, terminal equipment and system | |
CN108668236B (en) | Tracking method and device of terminal equipment and terminal equipment | |
CN108574503B (en) | Setting method of interception setting option and related equipment | |
CN111626223A (en) | Equipment state detection method and device, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |