CN107276873A - A kind of method and device for accessing service - Google Patents

A kind of method and device for accessing service Download PDF

Info

Publication number
CN107276873A
CN107276873A CN201610217189.9A CN201610217189A CN107276873A CN 107276873 A CN107276873 A CN 107276873A CN 201610217189 A CN201610217189 A CN 201610217189A CN 107276873 A CN107276873 A CN 107276873A
Authority
CN
China
Prior art keywords
terminal
tunnel
service access
service
tcp
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.)
Granted
Application number
CN201610217189.9A
Other languages
Chinese (zh)
Other versions
CN107276873B (en
Inventor
朱力
刘靖康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Insta360 Innovation Technology Co Ltd
Original Assignee
Beijing Lan Feng Chong View Network Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Lan Feng Chong View Network Technology Co Ltd filed Critical Beijing Lan Feng Chong View Network Technology Co Ltd
Priority to CN201610217189.9A priority Critical patent/CN107276873B/en
Publication of CN107276873A publication Critical patent/CN107276873A/en
Application granted granted Critical
Publication of CN107276873B publication Critical patent/CN107276873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

In the embodiment of the present invention, a kind of method for accessing service is proposed:First terminal sets up the tunnel that can be communicated with second terminal;First terminal sends service access request by tunnel to second terminal, and service access request uses TCP and/or udp protocol;First terminal receives the service access response that second terminal is sent by tunnel, and performs associative operation according to service access response, and service access response uses TCP and/or udp protocol;In this scenario, first terminal and second terminal are communicated by tunnel, and the service access request by tunnel transmission and service access response use TCP and/or udp protocol, and TCP and udp protocol are the more commonly used in the communications field, and the storehouse of increasing income based on these agreements, framework, program are very common, new agreement need not be defined, therefore, it can solve to access the relatively low defect of efficiency of service present in prior art.

Description

A kind of method and device for accessing service
Technical field
The present invention relates to communication technical field, more particularly to a kind of method and device for accessing service.
Background technology
At present, terminal has a variety of connected modes with associating accessory, such as with bluetooth approach, WiFi (Wireless-Fidelity, Wireless Fidelity) mode, or USB (Universal Serial Bus, USB) mode.Accessory can be standardization accessory, and such as bluetooth mouse, USB flash disk is moved Dynamic equipment can be by driving directly and terminal communication.An also class is the independently developed base of each company In the nonstandardized technique accessory of the offer specific use of these communication modes, match somebody with somebody for these nonstandardized techniques Without driving accordingly, it is necessary to self-defining communication data format in part, terminal, accessory end, The program of mobile device end is required for this customized communication mode to develop.
For nonstandardized technique accessory, it is necessary to define the instruction for relating to terminal device interoperability one by one And data, the definition of its agreement is very cumbersome, and development efficiency is low, therefore, currently in nonstandard There is less efficient defect in standardization accessory, the service of access.
The content of the invention
In view of the above problems, it is proposed that the present invention, above mentioned problem or at least portion are overcome to provide one kind The method and apparatus of a kind of access service solved the above problems with dividing, for solving to deposit in the prior art Less efficient defect.
According to the first aspect of the present invention there is provided a kind of method for accessing service, including:
First terminal sets up the tunnel that can be communicated with second terminal;
The first terminal sends service access request by the tunnel to the second terminal, described Service access request uses transmission control protocol TCP and/or user datagram udp protocol;
The first terminal receives the service access response that the second terminal is sent by the tunnel, And associative operation is performed according to service access response, the service access response uses the TCP And/or udp protocol.
In one embodiment, method described according to the abovementioned embodiments of the present invention, described first Terminal sends service access request by the tunnel to the second terminal, including:
The application layer of the first terminal is set up TCP with the tunnel layer of the first terminal and is connected;
The tunnel layer of the first terminal determines TCP service requests port;
The service access request is passed through the TCP linkup transmits by the application layer of the first terminal To the tunnel layer of the first terminal;
The tunnel layer of the first terminal is by the service access request from the TCP service request terminals Mouth is sent to the tunnel layer of the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Service providing end mouthful in agreement and the second terminal that TCP service requests port is used is adopted Agreement is identical.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The port of service providing end mouthful in the port numbering and the second terminal of TCP service requests port Number identical or difference.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The application layer of first terminal and the tunnel layer of the first terminal are set up after TCP is connected, and described Before the service access that the one terminal reception second terminal is sent by the tunnel is responded, the side Method also includes:
The tunnel layer of the first terminal please by the TCP marks connected and/or TCP services The port numbering of port is asked to send to the tunnel layer of the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described First terminal sends service access request by the tunnel to the second terminal, including:
The tunnel layer of the first terminal determines UDP service requests port;
The application layer of the first terminal sends the service access request to the first terminal Tunnel layer;
The tunnel layer of the first terminal is by the service access request from the UDP service request terminals Mouth is sent to the tunnel layer of the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Service providing end mouthful in agreement and the second terminal that UDP service requests port is used is adopted Agreement is identical.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The port of service providing end mouthful in the port numbering and the second terminal of UDP service requests port Number identical or difference.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The tunnel layer of first terminal determines after UDP service requests port that the first terminal receives described Before the service access that second terminal is sent by the tunnel is responded, methods described also includes:
The tunnel layer of the first terminal by the port numbering of the UDP service requests port send to The tunnel layer of the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, according to The service access response performs associative operation, including:
The number for receiving the carrying connection identifier that the second terminal is sent is responded according to the service access According to;
Fed back by being sent with the connection corresponding to the connection identifier to the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described First terminal sends service access request by the tunnel to the second terminal, including:
The first terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, by the tunnel to the second terminal send service access request;
The first terminal receives the service access response that the second terminal is sent by the tunnel, Including:
The first terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, receive the service access that the second terminal sent by the tunnel and respond.
According to the second aspect of the present invention there is provided a kind of method for accessing service, including:
Second terminal sets up the tunnel that can be communicated with first terminal;
The second terminal receives the service access request that the first terminal is sent by the tunnel, The service access request uses transmission control protocol TCP and/or user datagram udp protocol;
The second terminal is according to the service access request by the tunnel to the first terminal Service access response is sent, the service access response uses the TCP and/or udp protocol.
In one embodiment, method described according to the abovementioned embodiments of the present invention, described second Terminal is received by the tunnel after the service access request that the first terminal is sent, methods described Also include:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal is set up TCP with the service layer of the second terminal and is connected;
The tunnel layer of the second terminal is sent the service access request by the TCP connections To the service providing end mouthful of the service layer of the second terminal.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Adopted TCP service requests port in agreement and the first terminal that service providing end mouth is used Agreement is identical.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The port of TCP service requests port in the port numbering and the first terminal of service providing end mouthful Number identical or difference.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Second terminal is sent to the first terminal by the tunnel according to the service access request and serviced Before access response, methods described also includes:
The tunnel layer of the second terminal receives the mark for the TCP connections that the first terminal is sent Knowledge and/or the port numbering of the TCP service requests port.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Second terminal receives the service access request that the first terminal is sent by the tunnel, including:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal sends the service access request to the second terminal Under the service providing end mouthful of service layer.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Adopted UDP service requests port in agreement and the first terminal that service providing end mouth is used Agreement is identical.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described The port of UDP service requests port in the port numbering and the first terminal of service providing end mouthful Number identical or difference.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Second terminal is sent to the first terminal by the tunnel according to the service access request and serviced Before access response, methods described also includes:
The tunnel layer of the second terminal receives the UDP service requests that the first terminal is sent The port numbering of port.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Second terminal is sent to the first terminal by the tunnel according to the service access request and serviced After access response, methods described also includes:
The data for carrying connection identifier are sent to first terminal;
By receiving the feedback that the first terminal is sent with the connection corresponding to the connection identifier.
In certain embodiments, the method according to any of the above-described embodiment of the present invention, described Second terminal receives the service access request that the first terminal is sent by the tunnel, including:
The second terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, pass through the tunnel and receive the service access request that the first terminal is sent;
The second terminal is according to the service access request by the tunnel to the first terminal Service access response is sent, including:
The second terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, according to the service access request by the tunnel to the first terminal send take Business access response.
According to the third aspect of the present invention there is provided a kind of first terminal, including:
Unit is set up, for setting up the tunnel that the first terminal can be communicated with second terminal;
Transmitting element, for sending service access request, institute to the second terminal by the tunnel Service access request is stated using transmission control protocol TCP and/or user datagram udp protocol;
Receiving unit, rings for receiving the service access that the second terminal is sent by the tunnel Should;
Processing unit, for performing associative operation, the service access according to service access response Response uses the TCP and/or udp protocol.
In one embodiment, device described according to the abovementioned embodiments of the present invention, the foundation Unit is additionally operable to, and controls the application layer of the first terminal to be set up with the tunnel layer of the first terminal TCP connections;
The processing unit is additionally operable to, and controls the tunnel layer of the first terminal to determine that TCP services please Ask port;
The transmitting element is additionally operable to, and controls the application layer of the first terminal please by the service access Seek the tunnel layer by the TCP linkup transmits to the first terminal;
The transmitting element is additionally operable to, and controls the tunnel layer of the first terminal please by the service access Ask and sent from the TCP service requests port to the tunnel layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Service providing end mouthful in agreement and the second terminal that TCP service requests port is used is adopted Agreement is identical.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described The port of service providing end mouthful in the port numbering and the second terminal of TCP service requests port Number identical or difference.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Transmitting element is additionally operable to, control mark that the tunnel layer of the first terminal connects the TCP and/ Or the port numbering of the TCP service requests port is sent to the tunnel layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Processing unit is additionally operable to, and controls the tunnel layer of the first terminal to determine UDP service requests port;
The transmitting element is additionally operable to, and controls the application layer of the first terminal please by the service access Ask and send to the tunnel layer of the first terminal;
The transmitting element is additionally operable to, and controls the tunnel layer of the first terminal please by the service access Ask and sent from the UDP service requests port to the tunnel layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Service providing end mouthful in agreement and the second terminal that UDP service requests port is used is adopted Agreement is identical.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described The port of service providing end mouthful in the port numbering and the second terminal of UDP service requests port Number identical or difference.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Transmitting element is additionally operable to, and controls the tunnel layer of the first terminal by the UDP service requests port Port numbering send to the tunnel layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Receiving unit is additionally operable to, and is responded according to the service access and is received the carrying company that the second terminal is sent Connect the data of mark;The transmitting element is additionally operable to, by with the connection corresponding to the connection identifier Send and feed back to the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Transmitting element by the tunnel to the second terminal send service access request when, be specially:
Using the communication mode corresponding to the connected mode of the first terminal and the second terminal, lead to Cross the tunnel and send service access request to the second terminal;
The receiving unit receives the service access response that the second terminal is sent by the tunnel When, it is specially:
Using the communication mode corresponding to the connected mode of the first terminal and the second terminal, connect Receive the service access response that the second terminal is sent by the tunnel.
According to the third aspect of the present invention there is provided a kind of second terminal, including:
Unit is set up, for setting up the tunnel that the second terminal can be communicated with first terminal;
Receiving unit, the service access for receiving the first terminal transmission by the tunnel please Ask, the service access request is assisted using transmission control protocol TCP and/or user datagram UDP View;
Transmitting element, for according to the service access request by the tunnel to the first terminal Service access response is sent, the service access response uses the TCP and/or udp protocol.
In one embodiment, device described according to the abovementioned embodiments of the present invention, the reception Unit is additionally operable to, and controls the tunnel layer of the second terminal to receive the service access by the tunnel Request;
The unit of setting up is additionally operable to, and controls the tunnel layer and the second terminal of the second terminal Service layer sets up TCP connections;
The transmitting element is additionally operable to, and controls the tunnel layer of the second terminal to connect by the TCP Connect and send the service access request to the service providing end mouthful of the service layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Adopted TCP service requests port in agreement and the first terminal that service providing end mouth is used Agreement is identical.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described The port of TCP service requests port in the port numbering and the first terminal of service providing end mouthful Number identical or difference.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Receiving unit is additionally operable to, and controls the tunnel layer of the second terminal to receive the institute that the first terminal is sent State the mark of TCP connections and/or the port numbering of the TCP service requests port.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Receiving unit is additionally operable to, and controls the tunnel layer of the second terminal to receive the service by the tunnel Access request;
The transmitting element is additionally operable to, and controls the tunnel layer of the second terminal please by the service access Ask and send to the service providing end mouthful of the service layer of the second terminal.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Adopted UDP service requests port in agreement and the first terminal that service providing end mouth is used Agreement is identical.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described The port of UDP service requests port in the port numbering and the first terminal of service providing end mouthful Number identical or difference.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Receiving unit is additionally operable to, and controls the tunnel layer of the second terminal to receive the institute that the first terminal is sent State the port numbering of UDP service requests port.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described Transmitting element is additionally operable to, and the data for carrying connection identifier are sent to first terminal;
The receiving unit is additionally operable to, by receiving described the with the connection corresponding to the connection identifier The feedback that one terminal is sent.
In certain embodiments, the device according to any of the above-described embodiment of the present invention, described When receiving unit receives the service access request that the first terminal is sent by the tunnel, specifically For:
The receiving unit is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, pass through the tunnel and receive the service access request that the first terminal is sent;
The transmitting element is according to the service access request by the tunnel to the first terminal When sending service access response, it is specially:
The transmitting element is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, according to the service access request by the tunnel to the first terminal send take Business access response.
In the embodiment of the present invention, a kind of method for accessing service is proposed:First terminal is set up can be with second The tunnel that terminal is communicated;The first terminal is sent to the second terminal by the tunnel and serviced Access request, using TCP, (Transmission Control Protocol are passed the service access request Transport control protocol is discussed) and/or UDP (User Datagram Protocol, User Data Protocol) agreement; The service access that the first terminal reception second terminal is sent by the tunnel is responded, and according to Service access response performs associative operation, the service access response using the TCP and/or Udp protocol;In this scenario, first terminal sets up the tunnel that can be communicated with second terminal; Communicated by tunnel, and the service access request and the service access by tunnel transmission are rung TCP and/or udp protocol should be used, and TCP and udp protocol are the more commonly used in the communications field, And the storehouse of increasing income based on these agreements, framework, program are very common, it is not necessary to define new association View, therefore, it can solve to access the relatively low defect of efficiency of service present in prior art.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the skill of the present invention Art means, and can be practiced according to the content of specification, and in order to allow the present invention's above and other Objects, features and advantages can become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are for this Field those of ordinary skill will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, And it is not considered as limitation of the present invention.And in whole accompanying drawing, be denoted by the same reference numerals Identical part.In the accompanying drawings:
Fig. 1 is a kind of flow chart for the access service that embodiments in accordance with the present invention are proposed;
Fig. 2 is another flow chart for the access service that embodiments in accordance with the present invention are proposed;
Fig. 3 is the flow chart of the embodiment for the access service that embodiments in accordance with the present invention are proposed;
Fig. 4 is the schematic diagram for the first terminal that embodiments in accordance with the present invention are proposed;
Fig. 5 is the schematic diagram for the second terminal that embodiments in accordance with the present invention are proposed.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although being shown in accompanying drawing The exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure without It should be limited by embodiments set forth here.Conversely it is able to more thoroughly there is provided these embodiments Understand the disclosure, and can by the scope of the present disclosure completely convey to those skilled in the art.
Fig. 1 schematically shows the stream of the method 10 of the access service according to embodiment of the present invention Journey schematic diagram.As shown in figure 1, this method can include step 100,110 and 120.
Step 100:First terminal sets up the tunnel that can be communicated with second terminal;
Step 110:The first terminal sends service access by the tunnel to the second terminal Request, the service access request uses TCP and/or udp protocol;
Step 120:The first terminal receives the service that the second terminal is sent by the tunnel Access response, and associative operation is performed according to service access response, the service access response is adopted With the TCP and/or udp protocol.
In the embodiment of the present invention, second terminal is interacted with supplementary mode with first terminal.Second eventually End is interacted with supplementary mode with first terminal to be understood that:First terminal is an independence Equipment, possesses one or more functions, and can be independently operated, second terminal has whole for first End provides the effect of additional function or miscellaneous function, and function is more single, and generally requires connection First terminal could be used, above-mentioned to only describe a kind of implementation, may be used also in actual applications There can be a variety of situations, be not specifically limited herein.
In the embodiment of the present invention, first terminal and second terminal will be with a set patterns by the data of tunnel transmission Model is encapsulated, such as defines packet specification in tunnel, the 0th~3 whole data packet length of byte representation, For operation, (each agreement operates one corresponding with state to 4th~5 byte, such as with status identifier 0x01 represents that TCP connections are set up in request, and 0x02 represents to close TCP connections, 0x04 tables Registration is according to transmission, and 0x08 represents connection error etc.), the 6th~9 byte representation TCP connections mark Know, for being made a distinction with other TCP connection datas, the 10th~17 byte representation current tunnel Layer can receive at present from receive first character joint number according to start counting up expiration data skew, Receive sliding window, the data that the 18th byte representation sends for request application.
In the embodiment of the present invention, the first terminal is sent to the second terminal by the tunnel and taken During access request of being engaged in, it is alternatively possible in the following way:
The application layer of the first terminal is set up TCP with the tunnel layer of the first terminal and is connected;
The tunnel layer of the first terminal determines TCP service requests port;
The service access request is passed through the TCP linkup transmits by the application layer of the first terminal To the tunnel layer of the first terminal;
The tunnel layer of the first terminal is by the service access request from the TCP service request terminals Mouth is sent to the tunnel layer of the second terminal.
In the embodiment of the present invention, alternatively, agreement that the TCP service requests port is used and The agreement that service providing end mouth in the second terminal is used is identical.
For example, if service providing end mouthful uses Transmission Control Protocol, TCP service requests port is used Agreement be Transmission Control Protocol.
In the embodiment of the present invention, alternatively, the port numbering of the TCP service requests port and institute State service providing end in second terminal mouthful port numbering is identical or difference.
In the embodiment of the present invention, further, the application layer of the first terminal and the first terminal Tunnel layer set up after TCP connections, the first terminal receive the second terminal pass through it is described Before the service access response that tunnel is sent, methods described also includes following operation:
The tunnel layer of the first terminal please by the TCP marks connected and/or TCP services The port numbering of port is asked to send to the tunnel layer of the second terminal.
In the embodiment of the present invention, the first terminal is sent to the second terminal by the tunnel and taken During access request of being engaged in, it is alternatively possible in the following way:
The tunnel layer of the first terminal determines UDP service requests port;
The application layer of the first terminal sends the service access request to the first terminal Tunnel layer;
The tunnel layer of the first terminal is by the service access request from the UDP service request terminals Mouth is sent to the tunnel layer of the second terminal.
In the embodiment of the present invention, alternatively, agreement that the UDP service requests port is used and The agreement that service providing end mouth in the second terminal is used is identical.
In the embodiment of the present invention, alternatively, the port numbering of the UDP service requests port and institute State service providing end in second terminal mouthful port numbering is identical or difference.
In the embodiment of the present invention, further, the tunnel layer of the first terminal determines that UDP is serviced Ask after port, the first terminal receives the service that the second terminal is sent by the tunnel Before access response, methods described also includes following operation:
The tunnel layer of the first terminal by the port numbering of the UDP service requests port send to The tunnel layer of the second terminal.
In the embodiment of the present invention, when performing associative operation according to service access response, alternatively, Can be in the following way:
The number for receiving the carrying connection identifier that the second terminal is sent is responded according to the service access According to;
Fed back by being sent with the connection corresponding to the connection identifier to the second terminal.
In the embodiment of the present invention, the first terminal is sent to the second terminal by the tunnel and taken During access request of being engaged in, it is alternatively possible in the following way:
The first terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, by the tunnel to the second terminal send service access request;
The first terminal receives the service access response that the second terminal is sent by the tunnel, Including:
The first terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, receive the service access that the second terminal sent by the tunnel and respond.
For example, being connected between first terminal and second terminal with USB, then first terminal is used Usb communication mode, service access request is sent by tunnel to the second terminal, or, receive The service access response that the second terminal is sent.
In the embodiment of the present invention, service access response can connect for return data, closing connection, refusal The operation such as connect.
In this scenario, first terminal and second terminal are communicated by tunnel, and pass through tunnel transmission Service access request and service access response use TCP and/or udp protocol, and TCP with Udp protocol is the more commonly used in the communications field, and the storehouse of increasing income based on these agreements, framework, journey Sequence is very common, it is not necessary to define new agreement, therefore, it can solve present in prior art Access the relatively low defect of efficiency of service.
In the embodiment of the present invention, due to the physical communication layer between service layer and two terminals being carried out Separation, so, when the communication mode between first terminal and second terminal changes not Need to redefine new agreement, for example, the communication mode between first terminal and second terminal by When USB modes are converted to bluetooth approach, it is not necessary to redefine new agreement.
Fig. 2 schematically shows the stream of the method 20 of the access service according to embodiment of the present invention Journey schematic diagram.As shown in Fig. 2 this method can include step 200,210 and 220.
Step 200:Second terminal sets up the tunnel that can be communicated with first terminal;
Step 210:The second terminal receives the service that the first terminal is sent by the tunnel Access request, the service access request uses transmission control protocol TCP and/or user datagram Udp protocol;
Step 220:The second terminal is according to the service access request by the tunnel to described First terminal sends service access response, and the service access response uses the TCP and/or UDP Agreement.
In the embodiment of the present invention, second terminal is interacted with supplementary mode with first terminal.Second eventually End is interacted with supplementary mode with first terminal to be understood that:First terminal is an independence Equipment, possesses one or more functions, and can be independently operated, second terminal has whole for first End provides the effect of additional function or miscellaneous function, and function is more single, and generally requires connection First terminal could be used, above-mentioned to only describe a kind of implementation, may be used also in actual applications There can be a variety of situations, be not specifically limited herein.
In the embodiment of the present invention, first terminal and second terminal will be with a set patterns by the data of tunnel transmission Model is encapsulated, such as defines packet specification in tunnel, the 0th~3 whole data packet length of byte representation, For operation, (each agreement operates one corresponding with state to 4th~5 byte, such as with status identifier 0x01 represents that TCP connections are set up in request, and 0x02 represents to close TCP connections, 0x04 tables Registration is according to transmission, and 0x08 represents connection error etc.), the 6th~9 byte representation TCP connections mark Show, for being made a distinction with other TCP connection datas, the 10th~17 byte representation current tunnel Hold can receive at present from receive first character joint number according to start counting up expiration data skew, Receive sliding window, the data that the 18th byte representation sends for request application.
In the embodiment of the present invention, the second terminal receives the first terminal by the tunnel and sent Service access request after, further, methods described also includes following operation:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal is set up TCP with the service layer of the second terminal and is connected;
The tunnel layer of the second terminal is sent the service access request by the TCP connections To the service providing end mouthful of the service layer of the second terminal.
In the embodiment of the present invention, alternatively, agreement that service providing end mouth is used and described the The agreement that TCP service requests port in one terminal is used is identical.
For example, if service providing end mouthful uses Transmission Control Protocol, TCP service requests port is used Agreement be Transmission Control Protocol.
In the embodiment of the present invention, alternatively, the port numbering and described first of the service providing end mouthful The port numbering of TCP service requests port in terminal is identical or difference.
In the embodiment of the present invention, further, the second terminal is logical according to the service access request Cross the tunnel to the first terminal send service access response before, methods described also include it is as follows Operation:
The tunnel layer of the second terminal receives the mark for the TCP connections that the first terminal is sent Knowledge and/or the port numbering of the TCP service requests port.
In the embodiment of the present invention, the second terminal receives the first terminal by the tunnel and sent Service access request when, it is alternatively possible in the following way:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal sends the service access request to the second terminal Under the service providing end mouthful of service layer.
In the embodiment of the present invention, alternatively, agreement that service providing end mouth is used and described the The agreement that UDP service requests port in one terminal is used is identical.
In the embodiment of the present invention, alternatively, the port numbering and described first of the service providing end mouthful The port numbering of UDP service requests port in terminal is identical or difference.
In the embodiment of the present invention, further, the second terminal is logical according to the service access request Cross the tunnel to the first terminal send service access response before, methods described also include it is as follows Operation:
The tunnel layer of the second terminal receives the UDP service requests that the first terminal is sent The port numbering of port.
In the embodiment of the present invention, the second terminal passes through the tunnel according to the service access request After sending service access response to the first terminal, methods described also includes following operation:
The data for carrying connection identifier are sent to first terminal;
By receiving the feedback that the first terminal is sent with the connection corresponding to the connection identifier.
In the embodiment of the present invention, the second terminal receives the first terminal by the tunnel and sent Service access request when, it is alternatively possible in the following way:
The second terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, pass through the tunnel and receive the service access request that the first terminal is sent;
The second terminal is according to the service access request by the tunnel to the first terminal Service access response is sent, including:
The second terminal is using corresponding to the connected mode of the first terminal and the second terminal Communication mode, according to the service access request by the tunnel to the first terminal send take Business access response.
For example, being connected between first terminal and second terminal with USB, then first terminal is used Usb communication mode, service access request is sent by tunnel to the second terminal, or, receive The service access response that the second terminal is sent.
In the embodiment of the present invention, service access response can connect for return data, closing connection, refusal The operation such as connect.
In this scenario, first terminal and second terminal are communicated by tunnel, and pass through tunnel transmission Service access request and service access response use TCP and/or udp protocol, and TCP/UDP Agreement is the more commonly used in the communications field, and the storehouse of increasing income based on these agreements, framework, program are non- Usually see, it is not necessary to define new agreement, therefore, it can solve to access present in prior art The relatively low defect of efficiency of service.
In the embodiment of the present invention, due to the physical communication layer between service layer and two terminals being carried out Separation, so, when the communication mode between first terminal and second terminal changes not Need to redefine new agreement, for example, the communication mode between first terminal and second terminal by When USB modes are converted to bluetooth approach, it is not necessary to redefine new agreement.
The embodiment of the present invention, it is also proposed that the embodiment of service is accessed, refering to shown in Fig. 3.
Step 300:First terminal sets up the tunnel that can be communicated with second terminal.
Wherein, second terminal in be connected or data such as service providing ends mouthful to provide service, first Terminal selects idle, an agreement identical that the agreement of use is used with service providing end mouth Intercept or wait pending data in TCP service requests port.
Step 310:The tunnel layer of the first terminal is sent to the second terminal by the tunnel and taken Business access request, the service access request uses TCP and/or udp protocol.
In the step, first terminal and second terminal will be sealed by the data of tunnel transmission with certain specification Dress, such as define packet specification in tunnel, the 0th~3 whole data packet length of byte representation, the 4~5 bytes are operation and status identifier (each one corresponding with state of agreement operation, such as 0x01 Represent that TCP connections are set up in request, 0x02 represents to close TCP connections, and 0x04 represents data Transmission, 0x08 represents connection error etc.), the 6th~9 byte representation TCP connection identifier is used Made a distinction in other TCP connection datas, the 10th~17 byte representation current tunnel layer is at present Can receive from receive first character joint number according to start counting up expiration data skew, that is, receive Sliding window, the data that the 18th byte representation sends for request application.
Step 320:The tunnel layer of second terminal is received after service access request, according to the envelope of agreement Specification decapsulation is filled, initiates to operate to service layer port, such as sets up TCP connections, transmit TCP Data etc..
Step 330:Second terminal sends service access to first terminal by tunnel and responded.
Wherein, service access response can be the packages such as return data, closing connection, refusal connection.
First terminal and second terminal are according to the continuous interactive communication of above-mentioned steps.
It should be noted that above-mentioned steps are a concrete case for accessing service, according to It is actually needed, first terminal can provide multiple service providing ends mouthful, Huo Zhe in a service Two terminals have multiple service providing ends mouthful to provide service, as long as pressing above-mentioned steps in first terminal The mapping one by one of port and port is set up in the TCP service requests port opened as much.
As shown in fig.4, in the embodiment of the present invention, it is also proposed that a kind of first terminal 40, including:
Unit 400 is set up, for setting up the tunnel that the first terminal can be communicated with second terminal Road;
Transmitting element 410, for sending service access request to the second terminal by the tunnel, The service access request uses transmission control protocol TCP and/or user datagram udp protocol;
Receiving unit 420, for receiving the service access that the second terminal is sent by the tunnel Response;
Processing unit 430, for performing associative operation, the service according to service access response Access response uses the TCP and/or udp protocol.
In the embodiment of the present invention, second terminal is interacted with supplementary mode with first terminal.Second eventually End is interacted with supplementary mode with first terminal to be understood that:First terminal is an independence Equipment, possesses one or more functions, and can be independently operated, second terminal has whole for first End provides the effect of additional function or miscellaneous function, and function is more single, and generally requires connection First terminal could be used, above-mentioned to only describe a kind of implementation, may be used also in actual applications There can be a variety of situations, be not specifically limited herein.
In the embodiment of the present invention, first terminal and second terminal will be with a set patterns by the data of tunnel transmission Model is encapsulated, such as defines packet specification in tunnel, the 0th~3 whole data packet length of byte representation, For operation, (each agreement operates one corresponding with state to 4th~5 byte, such as with status identifier 0x01 represents that TCP connections are set up in request, and 0x02 represents to close TCP connections, 0x04 tables Registration is according to transmission, and 0x08 represents connection error etc.), the 6th~9 byte representation TCP connections mark Show, for being made a distinction with other TCP connection datas, the 10th~17 byte representation current tunnel Layer can receive at present from receive first character joint number according to start counting up expiration data skew, Receive sliding window, the data that the 18th byte representation sends for request application.
In the embodiment of the present invention, further, the unit 400 of setting up is additionally operable to, and controls described the The application layer of one terminal is set up TCP with the tunnel layer of the first terminal and is connected;
The processing unit 430 is additionally operable to, and controls the tunnel layer of the first terminal to determine that TCP takes Business request port;
The transmitting element 410 is additionally operable to, and controls the application layer of the first terminal to visit the service Ask tunnel layer of the request by the TCP linkup transmits to the first terminal;
The transmitting element 410 is additionally operable to, and controls the tunnel layer of the first terminal to visit the service Ask that request is sent to the tunnel layer of the second terminal from the TCP service requests port.
In the embodiment of the present invention, alternatively, agreement that the TCP service requests port is used and The agreement that service providing end mouth in the second terminal is used is identical.
For example, if service providing end mouthful uses Transmission Control Protocol, TCP service requests port is used Agreement be Transmission Control Protocol.
In the embodiment of the present invention, alternatively, the port numbering of the TCP service requests port and institute State service providing end in second terminal mouthful port numbering is identical or difference.
In the embodiment of the present invention, further, the transmitting element 410 is additionally operable to, and controls described the The tunnel layer of one terminal is by the TCP marks connected and/or the end of the TCP service requests port Mouth numbering is sent to the tunnel layer of the second terminal.
In the embodiment of the present invention, further, the processing unit 430 is additionally operable to, and controls described the The tunnel layer of one terminal determines UDP service requests port;
The transmitting element 410 is additionally operable to, and controls the application layer of the first terminal to visit the service Ask that request is sent to the tunnel layer of the first terminal;
The transmitting element 410 is additionally operable to, and controls the tunnel layer of the first terminal to visit the service Ask that request is sent to the tunnel layer of the second terminal from the UDP service requests port.
In the embodiment of the present invention, alternatively, agreement that the UDP service requests port is used and The agreement that service providing end mouth in the second terminal is used is identical.
In the embodiment of the present invention, alternatively, the port numbering of the UDP service requests port and institute State service providing end in second terminal mouthful port numbering is identical or difference.
In the embodiment of the present invention, further, the transmitting element 410 is additionally operable to, and controls described the The tunnel layer of one terminal sends the port numbering of the UDP service requests port to described second eventually The tunnel layer at end.
In the embodiment of the present invention, further, the receiving unit 420 is additionally operable to, according to the clothes Access response of being engaged in receives the data for the carrying connection identifier that the second terminal is sent;The transmitting element 410 are additionally operable to, and are fed back by being sent with the connection corresponding to the connection identifier to the second terminal.
In the embodiment of the present invention, alternatively, the transmitting element 410 is by the tunnel to described When two terminals send service access request, it is specially:
Using the communication mode corresponding to the connected mode of the first terminal and the second terminal, lead to Cross the tunnel and send service access request to the second terminal;
The receiving unit 420 receives the service access that the second terminal is sent by the tunnel During response, it is specially:
Using the communication mode corresponding to the connected mode of the first terminal and the second terminal, connect Receive the service access response that the second terminal is sent by the tunnel.
For example, being connected between first terminal and second terminal with USB, then first terminal is used Usb communication mode, service access request is sent by tunnel to the second terminal, or, receive The service access response that the second terminal is sent.
In the embodiment of the present invention, service access response can connect for return data, closing connection, refusal The operation such as connect.
In this scenario, first terminal and second terminal are communicated by tunnel, and pass through tunnel transmission Service access request and service access response use TCP and/or udp protocol, and TCP/UDP Agreement is the more commonly used in the communications field, and the storehouse of increasing income based on these agreements, framework, program are non- Usually see, it is not necessary to define new agreement, therefore, it can solve to access present in prior art The relatively low defect of efficiency of service.
In the embodiment of the present invention, due to the physical communication layer between service layer and two terminals being carried out Separation, so, when the communication mode between first terminal and second terminal changes not Need to redefine new agreement, for example, the communication mode between first terminal and second terminal by When USB modes are converted to bluetooth approach, it is not necessary to redefine new agreement.
As shown in fig.5, in the embodiment of the present invention, it is also proposed that a kind of second terminal 50, including:
Unit 500 is set up, for setting up the tunnel that the second terminal can be communicated with first terminal Road;
Receiving unit 510, for receiving the service access that the first terminal is sent by the tunnel Request, the service access request is assisted using transmission control protocol TCP and/or user datagram UDP View;
Transmitting element 520, for according to the service access request by the tunnel to described first Terminal sends service access response, and the service access response is assisted using the TCP and/or UDP View.
In the embodiment of the present invention, second terminal is interacted with supplementary mode with first terminal.Second eventually End is interacted with supplementary mode with first terminal to be understood that:First terminal is an independence Equipment, possesses one or more functions, and can be independently operated, second terminal has whole for first End provides the effect of additional function or miscellaneous function, and function is more single, and generally requires connection First terminal could be used, above-mentioned to only describe a kind of implementation, may be used also in actual applications There can be a variety of situations, be not specifically limited herein.
In the embodiment of the present invention, first terminal and second terminal will be with a set patterns by the data of tunnel transmission Model is encapsulated, such as defines packet specification in tunnel, the 0th~3 whole data packet length of byte representation, For operation, (each agreement operates one corresponding with state to 4th~5 byte, such as with status identifier 0x01 represents that TCP connections are set up in request, and 0x02 represents to close TCP connections, 0x04 tables Registration is according to transmission, and 0x08 represents connection error etc.), the 6th~9 byte representation TCP connections mark Show, for being made a distinction with other TCP connection datas, the 10th~17 byte representation current tunnel Layer can receive at present from receive first character joint number according to start counting up expiration data skew, Receive sliding window, the data that the 18th byte representation sends for request application.
In the embodiment of the present invention, further, the receiving unit 510 is additionally operable to, and controls described the The tunnel layer of two terminals receives the service access request by the tunnel;
The unit 500 of setting up is additionally operable to, and controls the tunnel layer and described second of the second terminal eventually The service layer at end sets up TCP connections;
The transmitting element 520 is additionally operable to, and controls the tunnel layer of the second terminal to pass through the TCP Connect and send the service access request to the service providing end mouthful of the service layer of the second terminal.
In the embodiment of the present invention, alternatively, agreement that service providing end mouth is used and described the The agreement that TCP service requests port in one terminal is used is identical.
For example, if service providing end mouthful uses Transmission Control Protocol, TCP service requests port is used Agreement be Transmission Control Protocol.
In the embodiment of the present invention, alternatively, the port numbering and described first of the service providing end mouthful The port numbering of TCP service requests port in terminal is identical or difference.
In the embodiment of the present invention, further, the receiving unit 510 is additionally operable to, and controls described the The tunnel layers of two terminals receives the marks of the TCP connections that the first terminal is sent and/or described The port numbering of TCP service requests port.
In the embodiment of the present invention, further, the receiving unit 510 is additionally operable to, and controls described the The tunnel layer of two terminals receives the service access request by the tunnel;
The transmitting element 520 is additionally operable to, and controls the tunnel layer of the second terminal to visit the service Ask that request is sent to the service providing end mouthful of the service layer of the second terminal.
In the embodiment of the present invention, alternatively, agreement that service providing end mouth is used and described the The agreement that UDP service requests port in one terminal is used is identical.
In the embodiment of the present invention, alternatively, the port numbering and described first of the service providing end mouthful The port numbering of UDP service requests port in terminal is identical or difference.
In the embodiment of the present invention, further, the receiving unit 510 is additionally operable to, and controls described the The tunnel layer of two terminals receives the port for the UDP service requests port that the first terminal is sent Numbering.
In the embodiment of the present invention, further, member 520 is additionally operable to, and the company of carrying is sent to first terminal Connect the data of mark;
The receiving unit 510 is additionally operable to, by receiving institute with the connection corresponding to the connection identifier State the feedback of first terminal transmission.
In the embodiment of the present invention, alternatively, the receiving unit 510 receives described by the tunnel During the service access request that first terminal is sent, it is specially:
The receiving unit 510 is using the first terminal and the connected mode institute of the second terminal Corresponding communication mode, the service access request that the first terminal is sent is received by the tunnel;
The transmitting element 520 is according to the service access request by the tunnel to described first When terminal sends service access response, it is specially:
The transmitting element 520 is using the first terminal and the connected mode institute of the second terminal Corresponding communication mode, is sent out according to the service access request by the tunnel to the first terminal Take business access response.
For example, being connected between first terminal and second terminal with USB, then first terminal is used Usb communication mode, service access request is sent by tunnel to the second terminal, or, receive The service access response that the second terminal is sent.
In the embodiment of the present invention, service access response can connect for return data, closing connection, refusal The operation such as connect.
In this scenario, first terminal and second terminal are communicated by tunnel, and pass through tunnel transmission Service access request and service access response use TCP and/or udp protocol, and TCP/UDP Agreement is the more commonly used in the communications field, and the storehouse of increasing income based on these agreements, framework, program are non- Usually see, it is not necessary to define new agreement, therefore, it can solve to access present in prior art The relatively low defect of efficiency of service.
In the embodiment of the present invention, due to the physical communication layer between service layer and two terminals being carried out Separation, so, when the communication mode between first terminal and second terminal changes not Need to redefine new agreement, for example, the communication mode between first terminal and second terminal by When USB modes are converted to bluetooth approach, it is not necessary to redefine new agreement.
Method and apparatus are not solid with any certain computer, virtual system or miscellaneous equipment provided herein There is correlation.Various general-purpose systems can also be used together with based on teaching in this.As described above, It is obvious to construct the structure required by this kind of device.In addition, the present invention is not also for any specific Programming language.It is understood that, it is possible to use various programming languages realize the content of invention described herein, And the description done above to language-specific be in order to disclose the present invention preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that this The embodiment of invention can be put into practice in the case of these no details.In some instances, not Known method, structure and technology are shown specifically, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one in each inventive aspect Or it is multiple, above in the description of the exemplary embodiment of the present invention, each feature of the invention is sometimes It is grouped together into single embodiment, figure or descriptions thereof.However, should not be by the disclosure Method be construed to reflect following intention:That is the present invention for required protection requirement is than in each claim The middle more features of feature be expressly recited.More precisely, as the following claims reflect, Inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows specific implementation Thus claims of mode are expressly incorporated in the embodiment, wherein each claim is in itself All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out certainly to the module in the device in embodiment Adaptively change and they are arranged in one or more devices different from the embodiment.Can be with Some block combiners in embodiment into a module or unit or component, and in addition can be them It is divided into multiple submodule or subelement or sub-component.Except in such feature and/or process or module It is at least some exclude each other outside, can be using any combinations to this specification (including adjoint power Profit is required, summary and accompanying drawing) disclosed in all features and so disclosed any method or equipment All processes or unit be combined.Unless expressly stated otherwise, this specification (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer Alternative features are replaced.
Although in addition, it will be appreciated by those of skill in the art that some embodiments described herein include it Included some features rather than further feature in its embodiment, but the not group of the feature of be the same as Example Conjunction means to be within the scope of the present invention and forms different embodiments.For example, in claim In book, the one of any of embodiment claimed mode can use in any combination.
The present invention each device embodiment can be realized with hardware, or with one or more processing The software module run on device is realized, or is realized with combinations thereof.Those skilled in the art should Understand, basis can be realized using microprocessor or digital signal processor (DSP) in practice The some or all functions of some or all modules in the device of the embodiment of the present invention.The present invention is also It can be implemented as some or all program of device (examples for performing method as described herein Such as, computer program and computer program product).Such program for realizing the present invention can be stored in On computer-readable medium, or there can be the form of one or more signal.Such signal can Obtained, either provided or in any other form on carrier signal with being downloaded from internet website There is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, And those skilled in the art can design replacement without departing from the scope of the appended claims Embodiment.In the claims, any reference symbol between bracket should not be configured to right It is required that limitation.Word "comprising" does not exclude the presence of element or step not listed in the claims.It is located at Word "a" or "an" before element does not exclude the presence of multiple such elements.The present invention can be by Realized in the hardware for including some different elements and by means of properly programmed computer.Enumerating If in the unit claim of equipment for drying, several in these devices can be by same hardware Embody.The use of word first, second, and third does not indicate that any order.Can be by These words are construed to title.

Claims (10)

1. a kind of method for accessing service, including:
First terminal sets up the tunnel that can be communicated with second terminal;
The first terminal sends service access request by the tunnel to the second terminal, described Service access request uses transmission control protocol TCP and/or user datagram udp protocol;
The first terminal receives the service access response that the second terminal is sent by the tunnel, And associative operation is performed according to service access response, the service access response uses the TCP And/or udp protocol.
2. the method as described in claim 1, the first terminal is by the tunnel to described Two terminals send service access request, including:
The application layer of the first terminal is set up TCP with the tunnel layer of the first terminal and is connected;
The tunnel layer of the first terminal determines TCP service requests port;
The service access request is passed through the TCP linkup transmits by the application layer of the first terminal To the tunnel layer of the first terminal;
The tunnel layer of the first terminal is by the service access request from the TCP service request terminals Mouth is sent to the tunnel layer of the second terminal.
3. method as claimed in claim 1 or 2, the application layer of the first terminal and described first The tunnel layer of terminal is set up after TCP connections, and the first terminal receives the second terminal and passed through Before the service access response that the tunnel is sent, methods described also includes:
The tunnel layer of the first terminal please by the TCP marks connected and/or TCP services The port numbering of port is asked to send to the tunnel layer of the second terminal.
4. the method as described in claim 1, the first terminal is by the tunnel to described second Terminal sends service access request, including:
The tunnel layer of the first terminal determines UDP service requests port;
The application layer of the first terminal sends the service access request to the first terminal Tunnel layer;
The tunnel layer of the first terminal is by the service access request from the UDP service request terminals Mouth is sent to the tunnel layer of the second terminal.
5. a kind of method for accessing service, including:
Second terminal sets up the tunnel that can be communicated with first terminal;
The second terminal receives the service access request that the first terminal is sent by the tunnel, The service access request uses transmission control protocol TCP and/or user datagram udp protocol;
The second terminal is according to the service access request by the tunnel to the first terminal Service access response is sent, the service access response uses the TCP and/or udp protocol.
6. method as claimed in claim 5, the second terminal receives described the by the tunnel After the service access request that one terminal is sent, methods described also includes:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal is set up TCP with the service layer of the second terminal and is connected;
The tunnel layer of the second terminal is sent the service access request by the TCP connections To the service providing end mouthful of the service layer of the second terminal.
7. the method as described in claim 5 or 6, the second terminal please according to the service access Ask before sending service access response to the first terminal by the tunnel, methods described is also wrapped Include:
The tunnel layer of the second terminal receives the mark for the TCP connections that the first terminal is sent Knowledge and/or the port numbering of the TCP service requests port.
8. method as claimed in claim 5, the second terminal receives described the by the tunnel The service access request that one terminal is sent, including:
The tunnel layer of the second terminal receives the service access request by the tunnel;
The tunnel layer of the second terminal sends the service access request to the second terminal Under the service providing end mouthful of service layer.
9. a kind of first terminal, including:
Unit is set up, for setting up the tunnel that the first terminal can be communicated with second terminal;
Transmitting element, for sending service access request, institute to the second terminal by the tunnel Service access request is stated using transmission control protocol TCP and/or user datagram udp protocol;
Receiving unit, rings for receiving the service access that the second terminal is sent by the tunnel Should;
Processing unit, for performing associative operation, the service access according to service access response Response uses the TCP and/or udp protocol.
10. a kind of second terminal, including:
Unit is set up, for setting up the tunnel that the second terminal can be communicated with first terminal;
Receiving unit, the service access for receiving the first terminal transmission by the tunnel please Ask, the service access request is assisted using transmission control protocol TCP and/or user datagram UDP View;
Transmitting element, for according to the service access request by the tunnel to the first terminal Service access response is sent, the service access response uses the TCP and/or udp protocol.
CN201610217189.9A 2016-04-08 2016-04-08 Method and device for accessing service Active CN107276873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610217189.9A CN107276873B (en) 2016-04-08 2016-04-08 Method and device for accessing service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610217189.9A CN107276873B (en) 2016-04-08 2016-04-08 Method and device for accessing service

Publications (2)

Publication Number Publication Date
CN107276873A true CN107276873A (en) 2017-10-20
CN107276873B CN107276873B (en) 2020-03-24

Family

ID=60052857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610217189.9A Active CN107276873B (en) 2016-04-08 2016-04-08 Method and device for accessing service

Country Status (1)

Country Link
CN (1) CN107276873B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870568A (en) * 2005-05-23 2006-11-29 华为技术有限公司 Method for implementing network address conversion anti-virus transition
CN101626337A (en) * 2009-06-18 2010-01-13 南京联创科技股份有限公司 Multiple tunnel concurrent model implementation method based on virtual network card technology
CN103392316A (en) * 2013-01-11 2013-11-13 华为技术有限公司 Method of traversing firewall, client, and media traversing server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870568A (en) * 2005-05-23 2006-11-29 华为技术有限公司 Method for implementing network address conversion anti-virus transition
CN101626337A (en) * 2009-06-18 2010-01-13 南京联创科技股份有限公司 Multiple tunnel concurrent model implementation method based on virtual network card technology
CN103392316A (en) * 2013-01-11 2013-11-13 华为技术有限公司 Method of traversing firewall, client, and media traversing server

Also Published As

Publication number Publication date
CN107276873B (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN108769165B (en) Data processing method in Internet of things and Internet of things access system
CN111400237B (en) Method for providing multi-lease support for RDMA
US10374947B2 (en) Method and apparatus for encapsulating / decapsulating data packets at a radio access node
US10666718B2 (en) Dynamic data transport between enterprise and business computing systems
CN105723674B (en) For the dynamically method of binding head field specifier in Network Control Protocol
CN106464564B (en) Method, system and the computer-readable medium for encapsulating and routing for network packet
US10735373B2 (en) Communications over multiple protocol interfaces in a computing environment
CN101262478A (en) Method and device for penetrating NAT
CN102821082A (en) Data transmission method, device and system
CN107070765A (en) Virtual client end equipment
CN105554540B (en) The implementation method and device of a kind of network interface in condition receiving card
CN107508907A (en) A kind of data transmission method and device
CN106102018A (en) Communication configuration method in the trunking communication of a kind of broadband and device
CN103117881A (en) Resource management system of Internet of Things
CN105323229A (en) CPE-based data transmission method, network element, platform and system
CN103095608B (en) A kind of agency retransmission method of DNS data bag
US20060165119A1 (en) Communicating between communications components having differing protocols absent component modifications
CN104348728B (en) Generate the method and apparatus of forwarding information
CN107733765B (en) Mapping method, system and related equipment
US9871666B2 (en) Intermediate unicast network and method for multicast data networks
CN106657377B (en) A kind of WIA-PA/ interconnects manufacture network information service adapter and implementation method entirely
CN102821055B (en) Method for inter-board communication
CN107276873A (en) A kind of method and device for accessing service
US11216424B2 (en) Dynamically rendering an application programming interface for internet of things applications
CN108307286A (en) It is a kind of to realize the method and system communicated between Android device based on NFC

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20180605

Address after: 518000 601/603/605, 6 floor, A tower, Dragon Street Century Towers, 23 Xin'an street, Baoan District, Shenzhen, Guangdong

Applicant after: Arashi Vision Co., Ltd.

Address before: Room A231, two Xiangshan Road, Haidian District, Beijing, Beijing

Applicant before: Beijing LAN Feng Chong View Network Technology Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 518000 601/603/605, 6 floor, A tower, Dragon Street Century Towers, 23 Xin'an street, Baoan District, Shenzhen, Guangdong

Patentee after: Yingshi Innovation Technology Co., Ltd

Address before: 518000 601/603/605, 6 floor, A tower, Dragon Street Century Towers, 23 Xin'an street, Baoan District, Shenzhen, Guangdong

Patentee before: SHENZHEN ARASHI VISION Co.,Ltd.

CP01 Change in the name or title of a patent holder