Summary of the invention
The technical problem to be solved by the present invention is to overcome deficiency in the prior art, provide and visit under a kind of more domain environmentThe method for asking equipment.The key point of the invention is to obtain access routing automatically under more domain environment, realizes the mesh of access equipment's.
In order to solve the above technical problems, the solution that the present invention uses is:
A kind of method of access equipment under more domain environment is provided, is included the following steps:
(1) deployment access path control deivce in the domain locating for equipment to be visited, accesses and is prefixed in path control deivceDomain mark, for identifying mapping address of the equipment to be visited under different network domains;
(2) when user needs access equipment, access request first is sent to access path control deivce;
(3) access path control deivce identifies domain belonging to request initiating terminal through taking, returning equipment is in the net according to request contentAccess address under domain;
(4) user requests the equipment access address, realizes the access to equipment.
In the present invention, user initiate request when,
(1) if the address of request initiating terminal through taking can be customized, the domain of affix request initiating terminal through taking address is indicated;Access roadBy controller after receiving access request, the request is directly identified as domain belonging to request initiating terminal through taking;
(2) if the address of request initiating terminal through taking cannot be customized, the request initiating terminal through taking address in address field is browsed with regard to affixAs parameter;Access path control deivce is identified using preset domain, and is identified belonging to the request initiating terminal through takingDomain;
(3) if not adding any additional information in the request, access path control deivce will be attempted to use following twoParameter request.getServerName and request.getServerPort;Known in combination with preset domainNot, and domain belonging to the request initiating terminal through taking is identified.
Compared with prior art, the solution have the advantages that:
By using method of the invention, user only needs to remember the ground of the access path control deivce under different network domainsLocation can obtain access address of each equipment to be visited under different network domains by requesting the address automatically.
Specific embodiment
With reference to the accompanying drawing, specific embodiments of the present invention will be described in detail.
" more domains " of the present invention refers to that different network areas, each network area take with independent network siteBusiness, the same equipment have different domain mapping address under different domains.For example internet and private network are exactly 2 differentDomain.
The method of access equipment, includes the following steps under more domain environment of the present invention:
(1) deployment access path control deivce in the domain locating for equipment to be visited, accesses and is prefixed in path control deivceDomain mark, for identifying mapping address of the equipment to be visited under different network domains;
(2) when user needs access equipment, access request first is sent to access path control deivce;Access path control deivce rootAccording to request content, domain belonging to request initiating terminal through taking, access address of the returning equipment under the domain are identified;
When user is when initiating request, if the address of request initiating terminal through taking can be customized, with regard to affix request initiating terminal through taking addressDomain mark;Path control deivce is accessed after receiving access request, directly the request is identified as belonging to request initiating terminal through takingDomain;If the address of request initiating terminal through taking cannot be customized, the request initiating terminal through taking address in address field is browsed as ginseng with regard to affixNumber;Access path control deivce is identified using preset domain, and identifies domain belonging to the request initiating terminal through taking;Such asFruit does not add any additional information in the request, and access path control deivce will be attempted to use following two parametersRequest.getServerName and request.getServerPort;It is identified in combination with preset domain,And identify domain belonging to the request initiating terminal through taking.
(3) user requests the equipment access address, realizes the access to equipment.
Concrete application example:
As shown in Figure 1, user PC1 wishes to obtain and be accessed automatically at domain A being accessed under another domainEquipment.
(1) initial setting up is done in access path control deivce in advance, setting domain indicates { domainA:{URL:URLA},domainB:{URL:URLB } }, access address of the equipment under each domain is set and maps { device1:{domainA:URLA1,domainB:URLB1},device2:{domainA:URLA2,domainB:URLB 2}};
(2) user first requests access to path control deivce, and request address is by the address under the domain A after network mapping;
(3) content of access path control deivce follow-up request, identifies that current request is initiated from which domain, in turnGet mapping address of the equipment under the domain;
(3.1) when initiating request, if request address can customize, domain=can be indicated with affix domaindomainA;The request is directly identified as domain A by access path control deivce;
(3.2) when initiating request, if request address cannot be customized, the request address in address field can be browsed with affixWindow.location.href is as parameter domainURL=URLA;Accessing path control deivce can be by preconfiguredDomain identifies { domainA:{URL:URLA},domainB:{URL:URLB }, identifying and identifying be the request is domain A;
(3.3) it when initiating request, if request does not add any additional information, can be tasted in access path control deivceExamination uses request.getServerName, request.getServerPort parameter, and combines preconfigured domain markKnow { domainA:{URL:URLA},domainB:{URL:URLB }, identifying and identifying be the request is domain A;
(4) path control deivce is accessed, according to the domain A recognized, is mapped from pre-configured device address domain{device1:{domainA:URLA1,domainB:URLB1},device2:{domainA:URLA2,domainB:URLB2 } corresponding access address URLA1 is obtained in }, and is returned;
(5) user/browser gets the equipment access address URLA1 under the domain;
(6) user/browser uses URLA1, access equipment.