WO2021018297A1 - 一种基于p2p的服务通信方法、装置及系统 - Google Patents
一种基于p2p的服务通信方法、装置及系统 Download PDFInfo
- Publication number
- WO2021018297A1 WO2021018297A1 PCT/CN2020/106333 CN2020106333W WO2021018297A1 WO 2021018297 A1 WO2021018297 A1 WO 2021018297A1 CN 2020106333 W CN2020106333 W CN 2020106333W WO 2021018297 A1 WO2021018297 A1 WO 2021018297A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- identifier
- service
- message
- module
- link
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000004891 communication Methods 0.000 title claims abstract description 47
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012544 monitoring process Methods 0.000 abstract description 8
- 230000001934 delay Effects 0.000 abstract 1
- 238000012806 monitoring device Methods 0.000 description 11
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000004044 response Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000012528 membrane Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- G—PHYSICS
- G08—SIGNALLING
- G08B—SIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
- G08B13/00—Burglar, theft or intruder alarms
- G08B13/18—Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength
- G08B13/189—Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems
- G08B13/194—Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems using image scanning and comparing systems
- G08B13/196—Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems using image scanning and comparing systems using television cameras
- G08B13/19654—Details concerning communication with a camera
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/632—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing using a connection between clients on a wide area network, e.g. setting up a peer-to-peer communication via Internet for retrieving video segments from the hard-disk of other client devices
Definitions
- This application relates to the field of monitoring, in particular to a P2P-based service communication method, device and system.
- an alarm center will manage the monitoring equipment of many homes or shops, and the monitoring equipment can provide one or more services.
- the alarm center can receive alarms from monitoring equipment, and the alarm center can notify users.
- the user uses the terminal to request the monitoring device to provide services.
- the monitoring equipment can be a camera installed at home, which can provide services such as video surveillance.
- the monitoring equipment sends an alarm to the alarm center when it detects that someone breaks into the home.
- the alarm center informs the user.
- the user can use a mobile phone or computer to request Surveillance equipment provides surveillance video.
- the terminal can establish a peer-to-peer (P2P) link with the monitoring device, use the P2P link to request the monitoring device to provide a service, and the monitoring device uses the P2P link to send the service data to the terminal.
- P2P peer-to-peer
- the terminal needs to establish multiple P2P links with the monitoring device, and request one service from the monitoring device on one P2P link.
- each terminal establishes a P2P link with the monitoring device.
- the monitoring device needs to establish a large number of P2P links, and the monitoring device requires a lot of resources to maintain the P2P link, which increases the network delay.
- the embodiments of the present application provide a P2P-based service communication method, device, and system to reduce network delay.
- the technical solution is as follows:
- this application provides a P2P-based service communication method, the method includes:
- a first message is received, the first message includes a first identifier and first data, the first identifier is used to identify a device and a service in the device, and the first data is used to request the device
- the service module used to provide the service in the execution operation
- this application provides a P2P-based service communication method, the method includes:
- the P2P module receives the second packet through the P2P link between the device and the proxy server.
- the device includes the P2P module and at least one service module. Each service module is used to provide services.
- the second packet is The proxy server is sent when the terminal requests the device to provide a service, and the second message includes the service type of the service requested by the terminal and the first data;
- the P2P module sends a fifth message to a target service module through a second connection, where the target service module is a service module corresponding to the service type, and the fifth message includes the first data, the The first data is used by the target service module to obtain second data belonging to the service, and the second connection is a virtual connection between the P2P module and the target service module.
- this application provides a P2P-based service communication device, the device includes:
- the receiving module is configured to receive a first message, the first message includes a first identifier and first data, the first identifier is used to identify a device and a service in the device, and the first data is used Requesting a service module in the device for providing the service to perform an operation;
- a determining module configured to determine the device identifier and service type corresponding to the service identified by the first identifier
- the sending module is configured to send a second message to the device through the P2P link when there is a P2P link between the devices corresponding to the device identifier, the second message including the service type and The first data.
- this application provides a P2P-based service communication device, the device includes:
- the receiving module is configured to receive a second packet through the P2P link between the device and the proxy server, the device includes the P2P module and at least one service module, each service module is used to provide services, and the second packet
- the message is sent by the proxy server when the terminal requests the device to provide a service, and the second message includes the service type and first data of the service requested by the terminal;
- the sending module is configured to send a fifth message to a target service module through a second connection, where the target service module is a service module corresponding to the service type, and the fifth message includes the first data, so The first data is used to request the target service module to perform an operation, and the second connection is a virtual connection between the P2P module and the target service module.
- the present application provides a P2P-based service communication system, which includes the device described in one aspect and the device described in the other aspect.
- the present application provides a non-volatile computer-readable storage medium for storing a computer program that is loaded by a processor to execute the instructions of the above-mentioned P2P-based service method.
- the present application provides an electronic device that includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor, so as to implement the above-mentioned P2P-based Service method.
- the present application provides a non-volatile computer-readable storage medium for storing at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned P2P-based service communication method.
- the computer program product includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the above-mentioned P2P-based service communication. method.
- the device ID and service type corresponding to the service identified by the first ID included in the first message are determined, so that when there is a P2P link between the devices corresponding to the device ID, pass The P2P link sends a second message to the device.
- the second message includes the service type and the first data.
- the device only needs to establish a P2P link, which avoids establishing a large number of P2P links for the device. Few resources are needed to maintain this P2P link to avoid the increase of network delay.
- FIG. 1 is a schematic structural diagram of a P2P-based service communication system provided by an embodiment of the present application
- FIG. 2 is a schematic structural diagram of another P2P-based service communication system provided by an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of another P2P-based service communication system provided by an embodiment of the present application.
- FIG. 4 is a flowchart of a P2P-based service communication method provided by an embodiment of the present application.
- FIG. 5 is a flowchart of another P2P-based service communication method provided by an embodiment of the present application.
- Fig. 6 is a flowchart of another P2P-based service communication method provided by an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a P2P-based service communication device provided by an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of another P2P-based service communication device provided by an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of a P2P-based service communication system provided by an embodiment of the present application.
- FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
- an embodiment of the present application provides a P2P-based service communication system, the communication system including:
- the device 3 can provide at least one service.
- the proxy server 2 can assign a first identifier to each service in the device 3, and combine the device identifier of the device 3 and each service in the device 3
- the corresponding service type and the first identifier are correspondingly stored in the corresponding relationship between the device identifier, the service type and the first identifier.
- the first identifier of the service is the port number corresponding to the service in the proxy server 2, or the identifier assigned to the service by the proxy server 2.
- the assigned identifier may be a character string.
- the character string may include at least one number, at least one letter, or the character string is a combination of at least one number and at least one character, and so on.
- the device 3 can provide three types of services, and the three types of services are network (Web) services, real-time streaming protocol (RTSP) services, and private protocol services.
- the proxy server 2 assigns first identifiers 10080, 10554, and 18000 to the Web service, RTSP service, and private protocol service of the device 3, respectively.
- the device ID of device 3 is 894EAW, 894EAW, the first ID "10080" corresponding to the Web service, and the service type "Web protocol" are stored in the device ID, service type, and first ID as shown in Table 1 below. Corresponding relationship.
- the first identifier "10554" corresponding to the 894EAW and RTSP service and the service type "RTDP protocol” are correspondingly stored in the corresponding relationship between the device identifier, service type and the first identifier as shown in Table 1 below.
- 894EAW, the first identifier "18000” corresponding to the private protocol service, and the service type "private protocol” are correspondingly stored in the corresponding relationship between the device identifier, service type and the first identifier as shown in Table 1 below.
- Each service in the device 3 corresponds to a service type, and the service type corresponding to the service may be the protocol type corresponding to the service.
- the service type may be RTSP, hypertext transfer protocol (hypertext transfer protocol, HTTP), and private protocol.
- RTSP, HTTP, and private protocol correspond to RTSP service, Web service, and private protocol service in device 3, respectively.
- the proxy server 2 stores the device identifier, the correspondence relationship 22 between the service type and the first identifier, and the P2P module 21.
- the device 3 includes a P2P module 31 and at least one service module 32, and each service module 32 is used to provide services.
- the service module corresponds to the service type corresponding to the service provided by the service module.
- the device 3 shown in FIG. 2 includes a Web service module 321, an RTSP service module 322, and a private protocol module 323.
- the Web service module 321 is used to provide Web services and corresponds to the service type "HTTP"; the RTSP service module 322 uses To provide RTSP service, it corresponds to the service type "RTSP"; the private protocol module 323 is used to provide private protocol services, which corresponds to the service type "private protocol”.
- the communication system may also include an alarm center 4, and the alarm center 4 may be connected to each device 3 and each terminal 1.
- the device 3 can report to the alarm center 4, and the alarm center 4 can notify the terminal 1 so that the terminal 1 requests to communicate with the device 3.
- the device 3 can be a camera or an access control system installed at home, which can provide services such as video surveillance.
- the device 3 sends an alarm to the alarm center 4 when it detects an intrusion, and the alarm center 4 can send a notification to the terminal 1.
- the notification includes the device identification of the device 3, and the terminal 1 may be a terminal such as a mobile phone or a computer.
- the terminal 1 may send a query request to the proxy server 2, the query request carrying the device identification of the device 3 and the service type corresponding to the service requested by the terminal 1.
- the proxy server 2 receives the query request, obtains the corresponding first identifier from the corresponding relationship between the device identifier, service type, and the first identifier according to the device identifier and service type of the device carried in the query request, and sends a query response to the terminal 1.
- the query response carries the first identifier.
- the terminal 1 may establish a first connection with the proxy server 2 for transmitting the service corresponding to the service type.
- the first connection may be a transmission control protocol (transmission control protocol, TCP) connection or an HTTP connection.
- TCP transmission control protocol
- the terminal 1 receives the query response, and sends a first message in the first format to the proxy server 2 through the first connection, the first message including the first identifier and the first data.
- the first identifier is used to identify the device 3 and a service in the device 3, and the first data is used to request the service module of the device 3 for providing the service to perform an operation.
- the first data may be a request message used to request the service or may be an upgrade package used to upgrade the service module.
- the request message may be a request message of a Web page, a video request message, or the like.
- the service module for providing the service in the device 3 can provide the data requested by the request message.
- the service module used for providing the service in the device 3 is upgraded based on the first data.
- the header of the first message includes the first identifier, and the payload part of the first message includes the first data.
- the first format may be a real-time transport protocol (RTP) or RTSP message format.
- RTP real-time transport protocol
- the proxy server 2 receives the first message, and according to the first identifier, obtains the service type corresponding to the service requested by the terminal 1 and the device identifier of the device 3 from the corresponding relationship between the device identifier, the service type, and the first identifier, and according to the device identifier , To determine whether there is a P2P link with device 3.
- a second packet is sent to the device 3 through the P2P link, and the second packet includes the service type.
- a P2P link with device 3 is established, and a second packet is sent to device 3 through the established P2P link.
- the second packet includes the service type and the first packet.
- the proxy server 2 may store a corresponding relationship between a device identifier and a link identifier. Each record in the corresponding relationship includes a device identifier and the current existing relationship between the proxy server 2 and the device corresponding to the device identifier.
- Link ID of the P2P link For example, referring to the corresponding relationship between the device identifier and the link identifier shown in Table 2 below, the link identifier of the P2P link in the corresponding relationship may be the port number corresponding to the P2P link, and the port number is the P2P link The port number of the corresponding port in the proxy server 2. The port is the end point of the P2P link on the proxy server 2.
- the proxy server 2 can query the corresponding relationship between the device ID and the link ID according to the device ID of the device 3.
- the corresponding link ID is queried, it can be determined that there is a link ID corresponding to the proxy server 2 and the device 3.
- P2P link when the corresponding link identifier is not found out, it is determined that there is no P2P link between the proxy server and the device 3.
- the proxy server 2 includes a register corresponding to an existing P2P link, and the register corresponding to the P2P link is used to store the device identification of the device that has established the P2P link with the proxy server 2. For example, for a device corresponding to the device identifier "894EAW", the proxy server 2 includes a register corresponding to the P2P link between the devices, and the register stores the device identifier "894EAW”.
- the proxy server 2 searches for the register corresponding to the currently existing P2P link according to the device ID of the device 3; when inquiring about the register holding the device ID of the device 3, it determines the P2P link corresponding to the register, and the proxy server
- the P2P link existing between 2 and device 3 is a certain P2P link; when the register storing the device identification of device 3 is not queried, it is determined that there is no P2P link with device 3.
- the communication system further includes a P2P server 5.
- the proxy server 2 determines that there is no P2P link with the device 3, it establishes a P2P link with the device 3 through the P2P server 5.
- the proxy server 2 may also assign a second identifier, which is used to identify the terminal 1 and the service requested by the terminal 1.
- the second identifier is a character string allocated by the proxy server 2.
- the character string may include at least one number, at least one letter, or the character string is a combination of at least one number and at least one character, and so on.
- the proxy server 2 stores the second identifier, the device identifier, and the connection identifier of the first connection between the terminal 1 and the proxy server 2 in the corresponding relationship between the second identifier, the device identifier and the connection identifier; and through the P2P link
- the device 3 sends a second message in the second format, the message header of the second message includes the second identifier and the service type, and the payload part of the second message includes the first data.
- the second format is different from the first format.
- the second format may be a message format transmitted on the P2P link, and the first format may be a message format transmitted on the first connection.
- the P2P module 21 in the proxy server 2 may send the second packet in the second format to the device 3 through the P2P link.
- the P2P module 31 of the device 3 receives the second message through the P2P link, determines the target service module corresponding to the service type, and sends the format to the target service module through the second connection between the P2P module 31 and the target service module.
- the fifth message includes first data so that the target service module obtains the second data belonging to the service according to the first data.
- the second connection is the connection between the P2P module 31 and the target service module. Virtual connection.
- the target service module obtains the second data belonging to the service as a web page according to the request message of the web page .
- the request message is a video request message
- the target service module obtains the second data belonging to the service as video data according to the video request message.
- the target service module is upgraded according to the upgrade package.
- the second data obtained is the upgrade result.
- the payload part of the fifth message includes the first data; the P2P module 31 stores the second identifier and the connection identifier of the second connection in the corresponding relationship between the second identifier and the connection identifier.
- connection type of the second connection is the same as the connection type of the first connection, so the first format is the same as the message format of the message transmitted on the second connection.
- the target service module can send second data to terminal 1.
- the second data belongs to the service of the service type.
- the sending process is as follows:
- the target service module sends a sixth packet in the first format to the P2P module 31 through the second connection between the P2P module 31 and the target service module, and the payload of the sixth packet includes the second data.
- the P2P module 31 obtains the second identifier from the corresponding relationship between the second identifier and the connection identifier according to the connection identifier of the second connection; and sends a third packet in the second format to the proxy server 2 through the P2P link.
- the message header of the message includes the second identifier, and the payload part of the third message includes the second data.
- the proxy server 2 receives the third message sent by the device 3 through the P2P link, the header of the third message includes the second identifier, and the payload part of the third message includes the second data; according to the second identifier and the device 3, the connection identifier of the first connection is obtained from the second identifier, the corresponding relationship between the device identifier and the connection identifier; the first connection corresponding to the connection identifier of the first connection sends the first connection in the first format to the terminal 1 Four messages, the payload part of the fourth message includes the second data.
- connection identifier of the first connection may be the connection socket of the first connection
- connection identifier of the second connection may be the connection socket of the second connection
- the present application provides a P2P-based service communication method, the method includes:
- Step 101 Receive a first message.
- the first message includes a first identifier and first data.
- the first identifier is used to identify a device and a service in the device, and the first data is used to request the device to provide The service module of the service performs the operation.
- Step 102 Determine the device identifier and service type corresponding to the service identified by the first identifier.
- Step 103 When there is a P2P link between the devices corresponding to the device identifier, send a second message to the device through the P2P link, the second message including the service type and the first data.
- the first message is received, and the device ID and service type corresponding to the service identified by the first ID in the first message are determined, so that there is a P2P link between the devices corresponding to the device ID
- the P2P link sends a second message to the device
- the second message includes the service type and the first data, so the device only needs to establish a P2P link, avoiding the establishment of a large number of P2P links for the device , Thereby avoiding the increase of network delay.
- the present application provides a P2P-based service communication method, which is applied to a device including a P2P module and at least one service module, each service module is used to provide services, and the method includes:
- Step 201 The P2P module receives a second message through the P2P link between the device and the proxy server, the device includes the P2P module and at least one service module, each service module is used to provide services, and the second message is the proxy server Sent when the terminal requests the device to provide a service, the second message includes the service type of the service requested by the terminal and the first data.
- Step 202 The P2P module sends a fifth message to the target service module through the second connection.
- the target service module is a service module corresponding to the service type.
- the fifth message includes first data, and the first data is used to request the target service.
- the module performs the operation, and the second connection is a virtual connection between the P2P module and the target service module.
- the P2P module receives the second packet through a P2P link between the device and the proxy server, so that the device only needs to establish one P2P link, which avoids establishing a large number of P2P links for the device , Thereby avoiding the increase of network delay.
- this application provides a P2P-based service communication method, which can be applied to the communication system shown in FIG. 1, including:
- Step 301 The terminal sends a query request to the proxy server.
- the query request carries the device identifier of the device and the service type corresponding to the service requested by the terminal.
- the communication system includes an alarm center, which can receive equipment alarms, and the alarm center informs users so that the user can handle equipment alarms.
- the alarm center sends a notification to the terminal corresponding to the user, and the notification includes the device identification of the device.
- the terminal receives the notification and displays the notification to the user.
- the user can input the service type corresponding to the service provided by the request device to the terminal.
- the terminal sends a query request to the proxy server through the first connection, and the query request carries the device identifier of the device and the service type corresponding to the service requested by the terminal.
- Step 302 The proxy server receives the query request, obtains the first identifier according to the device identifier and service type carried in the query request, and sends a query response to the terminal, where the query response carries the first identifier.
- the first identifier is used to identify the device and the service corresponding to the service type provided in the device.
- the proxy server may assign a first identifier to each service in the device in advance, and store the device identifier of the device, the service type corresponding to each service in the device, and the first identifier in the correspondence between the device identifier, service type and the first identifier. relationship.
- the device may send a registration request message for allocating the first identifier to the proxy server when it is powered on, and the registration request message includes the service type corresponding to each service in the device.
- the proxy server receives the registration request message, and assigns a first identifier to each service in the device according to the service type corresponding to each service in the device.
- the first identifier of the service can uniquely identify the service in the proxy server.
- the first identifier allocated for the service may be a port number.
- the proxy server may establish the first connection with the terminal based on the port number.
- the first connection between the terminal and the proxy server may be a TCP connection or an RTSP connection.
- the proxy server obtains the corresponding first identifier from the corresponding relationship between the device identifier, service type, and the first identifier according to the device identifier and service type carried in the query request, and sends a query response to the terminal.
- the query response carries the The first logo.
- the terminal After receiving the first identifier, the terminal uses the first identifier to send a message to the device.
- the detailed implementation process is as follows:
- Step 303 The terminal sends a first message to the proxy server, where the first message includes the first identifier and the first data.
- the header of the first message may include the first identifier, and the payload part of the first message may include the first data.
- the header of the first message includes a port number field, and the port number field carries the first identifier.
- the message format of the first message is the first format, and the first format may be the message format of RTP or RTSP.
- the first identifier is used to identify a device and a service in the device.
- the first data can be used to request a service module in the device for providing the service to perform an operation.
- the first data may be a request message, for example, a request message of a Web page, a video request message, etc.
- the first data is used to request the service module to provide data belonging to the service. or,
- the first data is an upgrade package used to upgrade the service module, and the first data is used to request the service module to upgrade.
- the header and payload components of the first message in the first format includes an internet protocol address (IP) header and a TCP header.
- IP internet protocol address
- the first format may be a message format of a message transmitted on the first connection.
- the first format may be a message format of the RTP or RTSP protocol. Therefore, the terminal can send the first message in the first format to the proxy server through the first connection.
- Step 304 The proxy server receives the first message, and determines the device identifier and service type corresponding to the service identified by the first identifier.
- the proxy server may obtain the service type corresponding to the service requested by the terminal and the device identifier of the device from the corresponding relationship between the first identifier, the service type, and the device identifier according to the first identifier.
- the proxy server obtains the corresponding relationship from the device identifier, service type and the first identifier according to the first identifier 10554 as shown in Table 1.
- the device identification of the device is "894EAW" and the service type is RTSP protocol.
- Step 305 The proxy server allocates a second identifier, which is used to identify the terminal and the service requested by the terminal.
- the terminal can request the device to provide multiple services, and the proxy server can transmit a message for requesting each service on the P2P link.
- multiple terminals may request the device to provide services, and the proxy server may transmit a service request message for each terminal on the P2P link. Therefore, the one P2P link can be used to transmit data of multiple services or data of services requested by multiple terminals.
- the second identifier can be used to identify the terminal and the service provided by the terminal, so that the second identifier can be used to distinguish different services requested by different terminals, so as to achieve multiple transmissions on the one P2P link. Data for one service or data for multiple terminals requesting services.
- the assigned second identifier is a character string, and the character string is used to identify the terminal and the service requested by the terminal on the proxy server.
- Step 306 The proxy server saves the second identifier, the device identifier, and the connection identifier of the first connection between the terminal and the proxy server in the corresponding relationship between the second identifier, the device identifier, and the connection identifier.
- connection identifier of the first connection may be a connection socket of the first connection or the like.
- Step 307 The proxy server judges whether there is a P2P link with the device according to the device identification. When there is a P2P link with the device, it executes the following step 308. When there is no P2P link with the device, it establishes a connection with the device. P2P link between.
- the proxy server may store a corresponding relationship between a device identifier and a link identifier, and each record in the corresponding relationship includes a device identifier and a link identifier of a P2P link currently existing between the devices corresponding to the device identifier.
- the proxy server can query the corresponding relationship between the device identifier and the link identifier according to the device identifier of the device, and when querying the corresponding link identifier, it determines that there is a link identifier corresponding to the device.
- P2P link when the corresponding link identifier is not queried, it is determined that there is no P2P link with the device. or,
- the proxy server includes a register corresponding to the currently existing P2P link, and the register corresponding to the P2P link is used to store the device identification of the device that establishes the P2P link with the proxy server.
- the proxy server searches for the register corresponding to the currently existing P2P link according to the device ID of the device; when inquiring the register holding the device ID of the device, it determines that there is a registered register with the device. Corresponding P2P link; when the register holding the device identification of the device is not found, it is determined that there is no P2P link with the device.
- Step 308 The proxy server sends a second message to the device through the P2P link, the second message including the second identifier, the service type, and the first data.
- the message header of the second message includes the second identifier and the service type, and the payload part of the second message includes the first data.
- the message format of the second message may be a second format, the first format is different from the second format, and the second format may be a message format transmitted on the P2P link.
- the header and payload part of the second message in the second format includes an IP header, a user datagram protocol (UDP) header, a P2P header, and Agency agreement header.
- the proxy protocol header may include the second identifier and the service type.
- Step 309 The P2P module of the device receives the second message through the P2P link, determines the target service module corresponding to the service type, and sends the fifth message to the target service module through the second connection between the P2P module and the target service module. Message.
- the P2P module of the device receives the second message, converts the second message into a fifth message in the first format, and the payload part of the fifth message includes the first data.
- the P2P module After determining the target service module corresponding to the service type, the P2P module establishes a second connection between the P2P module and the target service module.
- the second connection is used to transmit data belonging to the service currently requested by the terminal.
- the second connection may be a virtual connection or the like.
- the message format of the fifth message is the first format, which can be transmitted on the second connection between the P2P module and the target service module.
- Step 310 The P2P module correspondingly saves the second identifier and the connection identifier of the second connection in the corresponding relationship between the second identifier and the connection identifier.
- connection identifier of the second connection may be a connection socket of the second connection, etc.
- the target service module receives the fifth message, and performs an operation according to the first data included in the payload part of the fifth message.
- the target service module When the first data is a request message for requesting the service, the target service module obtains the second data belonging to the service according to the first data, and sends a sixth packet in the first format to the P2P module through the second connection,
- the payload part of the sixth message includes the second data.
- the request message is a request message of a Web page
- the target service module obtains the second data belonging to the service as the Web page according to the request message of the Web page.
- the request message is a video request message
- the target service module obtains the second data belonging to the service as video data according to the video request message. or,
- the target service module When the first data is an upgrade package for upgrading the target service module, the target service module is upgraded according to the upgrade package. After the upgrade is completed, the target service module can send a sixth packet in the first format to the P2P module through the second connection.
- the payload of the sixth packet includes the second data, and the second data is the upgrade result.
- Step 311 The P2P module receives the sixth message sent by the target service module through the second connection with the target service module.
- Step 312 The P2P module obtains the second identifier from the corresponding relationship between the second identifier and the connection identifier according to the connection identifier of the second connection.
- Step 313 The P2P module sends a third message in the second format to the proxy server through the P2P link, where the third message includes the device identifier, the second identifier and the second data of the device.
- the P2P module converts the sixth message into a third message in the second format.
- the header of the third message may include the second identifier, and the third message
- the payload part of the message may include the second data.
- Step 314 The proxy server receives the third message through the P2P link, and obtains the first identifier from the second identifier, the correspondence relationship between the device identifier and the connection identifier according to the second identifier included in the third message and the device identifier of the device.
- the connection ID of the connection The connection ID of the connection.
- Step 315 The proxy server sends a fourth packet in the first format to the terminal through the first connection corresponding to the connection identifier of the first connection, and the payload part of the fourth packet includes the second data.
- the proxy server after receiving the third message, the proxy server converts the third message into a fourth message in the first format.
- the terminal receives the fourth message from the first connection.
- the proxy server when the proxy server receives the first message sent by the terminal, it allocates a second identifier for identifying the terminal and the service requested by the terminal, and the second identifier, the device identifier, and the connection identifier of the first connection are assigned It is stored in the corresponding relationship between the second identifier, the device identifier, and the connection identifier.
- the proxy server sends a second message including the second identifier and the service type to the device through the P2P link, so that the third message sent by the device to the proxy server may include the device identifier and the second identifier, and the proxy server receives After the third message, the connection identifier of the first connection may be obtained based on the device identifier and the second identifier, so that the message is sent to the terminal based on the first connection corresponding to the connection identifier.
- an embodiment of the present application provides a P2P-based service communication device 400.
- the device 400 can be deployed in the proxy server provided in any of the foregoing embodiments, including:
- the receiving module 401 is configured to receive a first message, where the first message includes a first identifier and first data, where the first identifier is used to identify a device and a service in the device, and the first data Used to request the service module used to provide the service in the device to perform an operation;
- the determining module 402 is configured to determine the device identifier and service type corresponding to the service identified by the first identifier;
- the sending module 403 is configured to send a second packet to the device through the P2P link when there is a P2P link between the devices corresponding to the device identifier, and the second packet includes the service type And the first data.
- the device 400 further includes:
- An establishment module configured to establish a P2P link with the device when there is no P2P link between the device corresponding to the device identifier
- the sending module 403 is further configured to send the second packet to the device through the established P2P link.
- the device 400 further includes:
- the first query module is configured to query the corresponding relationship between the device identifier and the link identifier according to the device identifier of the device.
- Each record in the corresponding relationship includes a device identifier and the relationship between the device identifier and the device identifier.
- the link identifier of the P2P link currently existing between the two; when the corresponding link identifier is queried, it is determined that there is a P2P link corresponding to the link identifier between the devices, and the corresponding link identifier is not queried When it is determined that there is no P2P link with the device.
- the device further includes:
- the second query module is used to query the register corresponding to the currently existing P2P link according to the device identifier of the device; when the register holding the device identifier of the device is inquired, it is determined that there is a connection with the device The P2P link corresponding to the queried register; when no register storing the device identifier of the device is queried, it is determined that there is no P2P link with the device.
- the second message further includes a second identifier, and the second identifier is used to identify the terminal that sends the first message and the service;
- the apparatus 400 further includes:
- the first saving module is configured to allocate the second identifier, and save the second identifier, the device identifier, and the connection identifier of the first connection in the corresponding relationship between the first identifier, the device identifier, and the connection identifier.
- the first connection is a connection with the terminal for transmitting the first message.
- the device 400 further includes an acquisition module,
- the receiving module 401 is further configured to receive a third message sent by the device through the P2P link, where the third message includes the second identifier, the device identifier of the device, and the device belonging to the service The second data;
- the determining module is configured to obtain the connection identifier of the first connection from the second identifier, the corresponding relationship between the device identifier and the connection identifier according to the second identifier and the device identifier of the device;
- the sending module 403 is further configured to send the fourth message to the terminal through the first connection corresponding to the connection identifier, where the fourth message includes the second data.
- the message format of the first message and the third message is a first format, and the first format is a message format transmitted on the first connection;
- the message format of the second message is a second format
- the second format is a message format transmitted on the P2P link
- the first format is different from the second format
- the device 400 further includes: a second storage module,
- the receiving module 401 is further configured to receive a registration request message sent by the device, the registration request message including the device identifier of the device and the service type of the service provided by the device;
- the second storage module is configured to allocate a first identifier, and store the first identifier, the device identifier of the device, and the service type of the service provided by the device in the corresponding storage of the first identifier, device identifier, and service type. Corresponding relationship.
- the determining module allocates a second identifier for identifying the terminal and the service requested by the terminal, and the saving module assigns the second identifier, the device identifier, and the first connection
- the connection identifier of is stored in the corresponding relationship between the second identifier, the device identifier, and the connection identifier.
- the sending module sends a second message including the second identifier, the service type, and the first data to the device through the P2P link
- the receiving module receives the device returned by the device that carries the device identifier and the second identifier Message
- the connection identifier of the first connection may be obtained based on the device identifier and the second identifier, so that the message is sent to the terminal based on the first connection corresponding to the connection identifier.
- an embodiment of the present application provides a P2P-based service communication device 500.
- the device 500 is used for equipment including the device 500 and at least one service module. Each service module is used to provide services.
- the device 500 includes:
- the receiving module 501 is configured to receive a second message through the P2P link between the device and the proxy server.
- the second message is sent by the proxy server when the terminal requests the device to provide services.
- the message includes the service type and first data of the service requested by the terminal;
- the sending module 502 is configured to send a fifth message to a target service module through a second connection, where the target service module is a service module corresponding to the service type, and the fifth message includes the first data, The first data is used to request the target service module to perform an operation, and the second connection is a virtual connection with the target service module.
- the message header of the second message further includes a second identifier, and the second identifier is used to identify the terminal and the service requested by the terminal;
- the apparatus 500 further includes:
- the saving module is configured to save the second identifier and the connection identifier of the second connection in the corresponding relationship between the second identifier and the connection identifier.
- the device 500 further includes an acquisition module,
- the receiving module 501 is further configured to receive a sixth packet through the second connection, where the sixth packet includes the second data;
- the acquiring module is configured to acquire the second identifier from the corresponding relationship between the second identifier and the connection identifier according to the connection identifier of the second connection;
- the sending module 502 is further configured to send a third message to the proxy server through the P2P link, the third message including the device identifier of the device, the second identifier, and the second data.
- the message formats of the fifth message and the sixth message are a first format, and the first format is a message format transmitted on the second connection;
- the message format of the second message is a second format
- the second format is a message format transmitted on the P2P link
- the first format is different from the second format
- the receiving module receives the second message including the second identifier and the service type through the P2P link between the device and the proxy server, so that when the message is sent to the proxy server, the message may include
- the device identifier and the second identifier enable the proxy server to obtain the connection identifier of the first connection based on the device identifier and the second identifier, and thereby send the message to the terminal based on the first connection corresponding to the connection identifier.
- the second identifier is used to identify the terminal and the service requested by the terminal, so that the second identifier can be used to distinguish multiple services requested by the terminal or services requested by multiple terminals transmitted on the P2P link between the proxy server and the device
- the device only needs to establish one P2P link, which avoids establishing a large number of P2P links for the device, thereby avoiding the phenomenon of increased network delay.
- an embodiment of the present application provides a communication system 600 that includes the device described in FIG. 6 and the device described in FIG. 7.
- the device described in FIG. 6 may be a proxy server 601, and the device described in FIG. 7 may be a device 602.
- FIG. 10 shows a structural block diagram of an electronic device 700 provided by an exemplary embodiment of the present application.
- the electronic device 700 may be a terminal, such as a smart phone, a tablet computer, a notebook computer, or a desktop computer.
- the electronic device 700 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
- the electronic device 700 includes a processor 701 and a memory 702.
- the processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
- the processor 701 can use at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). achieve.
- the processor 701 may also include a main processor and a coprocessor.
- the main processor is a processor used to process data in the awake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
- the processor 701 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used to render and draw content that needs to be displayed on the display screen.
- the processor 701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
- AI Artificial Intelligence
- the memory 702 may include one or more computer-readable storage media, which may be non-transitory.
- the memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
- the non-transitory computer-readable storage medium in the memory 702 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 701 to implement a method provided in the method embodiment of the present application. P2P-based service communication method.
- the electronic device 700 may optionally further include: a peripheral device interface 703 and at least one peripheral device.
- the processor 701, the memory 702, and the peripheral device interface 703 may be connected by a bus or a signal line.
- Each peripheral device can be connected to the peripheral device interface 703 through a bus, a signal line or a circuit board.
- the peripheral device includes: at least one of a radio frequency circuit 704, a touch display screen 705, a camera 706, an audio circuit 707, a positioning component 708, and a power supply 709.
- the peripheral device interface 703 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 701 and the memory 702.
- the processor 701, the memory 702, and the peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 701, the memory 702, and the peripheral device interface 703 or The two can be implemented on separate chips or circuit boards, which are not limited in this embodiment.
- the radio frequency circuit 704 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
- the radio frequency circuit 704 communicates with a communication network and other communication devices through electromagnetic signals.
- the radio frequency circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
- the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on.
- the radio frequency circuit 704 can communicate with other terminals through at least one wireless communication protocol.
- the wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network.
- the radio frequency circuit 704 may also include NFC (Near Field Communication) related circuits, which is not limited in this application.
- the display screen 705 is used to display UI (User Interface, user interface).
- the UI can include graphics, text, icons, videos, and any combination thereof.
- the display screen 705 also has the ability to collect touch signals on or above the surface of the display screen 705.
- the touch signal may be input to the processor 701 as a control signal for processing.
- the display screen 705 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
- the display screen 705 may be a flexible display screen, which is arranged on a curved surface or a folding surface of the electronic device 700. Furthermore, the display screen 705 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen.
- the display screen 705 may be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
- the camera assembly 706 is used to capture images or videos.
- the camera assembly 706 includes a front camera and a rear camera.
- the front camera is arranged on the front panel of the electronic device 700
- the rear camera is arranged on the back of the electronic device 700.
- the camera assembly 706 may also include a flash.
- the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
- the audio circuit 707 may include a microphone and a speaker.
- the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 701 for processing, or input to the radio frequency circuit 704 to implement voice communication.
- the microphone can also be an array microphone or an omnidirectional acquisition microphone.
- the speaker is used to convert the electrical signal from the processor 701 or the radio frequency circuit 704 into sound waves.
- the speaker can be a traditional membrane speaker or a piezoelectric ceramic speaker.
- the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for purposes such as distance measurement.
- the audio circuit 707 may also include a headphone jack.
- the positioning component 708 is used to locate the current geographic location of the electronic device 700 to implement navigation or LBS (Location Based Service, location-based service).
- the positioning component 708 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.
- the power supply 709 is used to supply power to various components in the electronic device 700.
- the power source 709 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
- the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery.
- a wired rechargeable battery is a battery charged through a wired line
- a wireless rechargeable battery is a battery charged through a wireless coil.
- the rechargeable battery can also be used to support fast charging technology.
- the electronic device 700 further includes one or more sensors 710.
- the one or more sensors 710 include, but are not limited to, an acceleration sensor 711, a gyroscope sensor 712, a pressure sensor 713, a fingerprint sensor 714, an optical sensor 715, and a proximity sensor 716.
- the acceleration sensor 711 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 700.
- the acceleration sensor 711 may be used to detect the components of the gravitational acceleration on three coordinate axes.
- the processor 701 may control the touch screen 705 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 711.
- the acceleration sensor 711 may also be used for the collection of game or user motion data.
- the gyroscope sensor 712 can detect the body direction and the rotation angle of the electronic device 700, and the gyroscope sensor 712 can cooperate with the acceleration sensor 711 to collect the user's 3D actions on the electronic device 700.
- the processor 701 can implement the following functions according to the data collected by the gyroscope sensor 712: motion sensing (for example, changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
- the pressure sensor 713 may be disposed on the side frame of the electronic device 700 and/or the lower layer of the touch screen 705.
- the processor 701 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 713.
- the processor 701 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 705.
- the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
- the fingerprint sensor 714 is used to collect the user's fingerprint.
- the processor 701 can identify the user's identity based on the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 can identify the user's identity based on the collected fingerprint. When it is recognized that the user's identity is a trusted identity, the processor 701 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
- the fingerprint sensor 714 may be provided on the front, back or side of the electronic device 700. When the electronic device 700 is provided with a physical button or a manufacturer logo, the fingerprint sensor 714 may be integrated with the physical button or the manufacturer logo.
- the optical sensor 715 is used to collect the ambient light intensity.
- the processor 701 may control the display brightness of the touch screen 705 according to the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 705 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 705 is decreased.
- the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 according to the ambient light intensity collected by the optical sensor 715.
- the proximity sensor 716 also called a distance sensor, is usually provided on the front panel of the electronic device 700.
- the proximity sensor 716 is used to collect the distance between the user and the front of the electronic device 700.
- the processor 701 controls the touch screen 705 to switch from the on-screen state to the off-screen state; when the proximity sensor 716 When it is detected that the distance between the user and the front of the electronic device 700 is gradually increasing, the processor 701 controls the touch display screen 705 to switch from the on-screen state to the on-screen state.
- FIG. 10 does not constitute a limitation on the electronic device 700, and may include more or fewer components than shown, or combine some components, or adopt different component arrangements.
- the present application also provides a non-volatile computer-readable storage medium in which code instructions are stored, and the code instructions are executed by a processor, To implement the P2P-based service communication method provided in the above embodiment.
- the non-volatile computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
- the second identifier used to identify the terminal and the service requested by the terminal is allocated when the first message sent by the terminal is received, the second identifier, the device identifier, and the connection identifier of the first connection are stored in The second identifier, the corresponding relationship between the device identifier and the connection identifier.
- the connection identifier of the first connection may be obtained based on the device identifier and the second identifier, so that a message is sent to the monitoring terminal based on the first connection corresponding to the connection identifier.
- multiple services requested by the terminal or services requested by multiple terminals transmitted on the P2P link between the device can be distinguished by the first identifier, so that the device only needs to establish a P2P link, avoiding a large number of establishments for the device P2P link to avoid the increase of network delay.
- the present disclosure also provides a computer program product, the computer program product includes a computer program stored in a computer-readable storage medium, and the calculation program is loaded by a processor to implement the above-mentioned implementation Examples provide P2P-based service communication methods.
- the second identifier used to identify the terminal and the service requested by the terminal is allocated, and the second identifier, the device identifier, and the connection identifier of the first connection are stored in The second identifier, the corresponding relationship between the device identifier and the connection identifier.
- the connection identifier of the first connection may be obtained based on the device identifier and the second identifier, so that a message is sent to the terminal based on the first connection corresponding to the connection identifier.
- multiple services requested by the terminal or services requested by multiple terminals transmitted on the P2P link with the device can be distinguished by the first identifier, so that the device only needs to establish a P2P link, which avoids the establishment of the device A large number of P2P links prevent the increase of network delay.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
设备标识 | 服务类型 | 第一标识 |
894EAW | Web协议 | 10080 |
894EAW | RTSP协议 | 10554 |
894EAW | 私有协议 | 18000 |
…… | …… | …… |
设备标识 | 链路标识 |
894EAW | 10090 |
…… | …… |
IP头 | TCP头 | 净荷部分 |
IP头 | UDP头 | P2P头 | 代理协议头 | 净荷部分 |
Claims (21)
- 一种基于P2P的服务通信方法,所述方法包括:接收第一报文,所述第一报文包括第一标识和第一数据,所述第一标识用于标识一设备和所述设备中的服务,所述第一数据用于请求所述设备中的用于提供所述服务的服务模块执行操作;确定所述第一标识所标识的服务对应的设备标识和服务类型;在与所述设备标识对应的设备之间存在P2P链路时,通过所述P2P链路向所述设备发送第二报文,所述第二报文包括所述服务类型和所述第一数据。
- 如权利要求1所述的方法,其中,所述方法还包括:在与所述设备标识对应的设备之间不存在P2P链路时,建立与所述设备之间的P2P链路,通过所述建立的P2P链路向所述设备发送所述第二报文。
- 如权利要求1所述的方法,其中,所述通过所述P2P链路向所述设备发送第二报文之前,还包括:根据所述设备的设备标识,查询设备标识与链路标识的对应关系,所述对应关系中的每条记录包括一设备标识和与所述一设备标识对应的设备之间当前存在的P2P链路的链路标识;在查询出对应的链路标识时,确定与所述设备之间存在所述链路标识对应的P2P链路,在没有查询出对应的链路标识时,确定与所述设备之间不存在P2P链路;或者,根据所述设备的设备标识,查询当前已存在的P2P链路对应的寄存器;在查询出保存有所述设备的设备标识的寄存器时,确定与所述设备之间存在所述查询出的寄存器对应的P2P链路;在没有查询出保存有所述设备的设备标识的寄存器时,确定与所述设备之间不存在P2P链路。
- 如权利要求1所述的方法,其中,所述第二报文还包括第二标识,所述第二标识用于标识发送所述第一报文的终端和所述服务;所述方法还包括:分配所述第二标识,将所述第二标识、所述设备标识、第一连接的连接标识保存在第一标识、设备标识与连接标识的对应关系中,所述第一连接为与所述终端之间的用于传输所述第一报文的连接。
- 如权利要求4所述的方法,其中,所述通过所述P2P链路向所述设备发送第二报文之后,还包括:通过所述P2P链路接收所述设备发送的第三报文,所述第三报文包括所述第二标识、所述设备的设备标识和属于所述服务的第二数据;根据所述第二标识和所述设备的设备标识,从所述第二标识、设备标识与连接标识的对应关系中获取所述第一连接的连接标识;通过所述连接标识对应的第一连接向所述终端发送所述第四报文,所述第四报文包括所述第二数据。
- 如权利要求1至5任一项所述的方法,其中,所述获取所述服务的服务类型和所述设备的设备标识之前,还包括:接收所述设备发送的注册请求消息,所述注册请求消息包括所述设备的设备标识和所述设备提供的服务的服务类型;分配第一标识,将所述第一标识、所述设备的设备标识和所述设备提供的服务的服务类型对应保存在第一标识、设备标识与服务类型的对应关系中。
- 一种基于P2P的服务通信方法,所述方法包括:P2P模块通过设备与代理服务器之间的P2P链路接收第二报文,所述设备包括所述P2P模块和至少一个服务模块,每个服务模块用于提供服务,所述第二报文是所述代理服务器在终端请求所述设备提供服务时发送的,所述第二报文包括所述终端请求的服务的服务类型和第一数据;所述P2P模块通过第二连接向目标服务模块发送第五报文,所述目标服务模块是与所述服务类型相对应的服务模块,所述第五报文包括所述第一数据,所述第一数据用于请求所述目标服务模块执行操作,所述第二连接为所述P2P模块与目标服务模块之间的虚拟连接。
- 如权利要求7所述的方法,其中,所述第二报文的报文头还包括第二标识,所述第二标识用于标识所述终端和所述终端请求的服务;所述P2P模块通过设备与代理服务器之间的P2P链路接收第二报文之后,还包括:所述P2P模块将所述第二标识和所述第二连接的连接标识对应保存在第一标识与连接标识的对应关系中。
- 如权利要求8所述的方法,其中,所述P2P模块通过第二连接向所述目标服务模块发送第五报文之后,还包括:所述P2P模块通过所述第二连接接收第六报文,所述第六报文包括所述第二数据;所述P2P模块根据所述第二连接的连接标识,从所述第二标识与连接标识的对应关系中获取所述第二标识;所述P2P模块通过所述P2P链路向所述代理服务器发送第三报文,所述第三报文包括所述设备的设备标识、所述第二标识和所述第二数据。
- 一种基于P2P的服务通信装置,所述装置包括:接收模块,用于接收第一报文,所述第一报文包括第一标识和第一数据,所述第一标识用于标识一设备和所述设备中的服务,所述第一数据用于请求所述设备中的用于提供所述服务的服务模块执行操作;确定模块,用于确定所述第一标识所标识的服务对应的设备标识和服务类型;发送模块,用于在与所述设备标识对应的设备之间存在P2P链路时,通过所述P2P链路向所述设备发送第二报文,所述第二报文包括所述服务类型和所述第一数据。
- 如权利要求12所述的装置,其中,所述装置还包括:建立模块,用于在与所述设备标识对应的设备之间不存在P2P链路时,建立与所述设备之间的P2P链路;所述发送模块,还用于通过所述建立的P2P链路向所述设备发送所述第二报文。
- 如权利要求10所述的装置,其中,所述装置还包括:第一查询模块,用于根据所述设备的设备标识,查询设备标识与链路标识的对应关系,所述对应关系中的每条记录包括一设备标识和与所述一设备标识对应的设备之间当前存在的P2P链路的链路标识;在查询出对应的链路标识时,确定与所述设备之间存在所述链路标识对应的P2P链路,在没有查询出对应的链路标识时,确定与所述设备之间不存在P2P链路;或者,第二查询模块,用于根据所述设备的设备标识,查询当前已存在的P2P链路对应的寄存器;在查询出保存有所述设备的设备标识的寄存器时,确定与所述设备之间存在所述查询出的寄存器对应的P2P链路;在没有查询出保存有所述设备的设备标识的寄存器时,确定与所述设备之间不存在P2P链路。
- 如权利要求10所述的装置,其中,所述第二报文还包括第二标识,所述第二标识用于标识发送所述第一报文的终端和所述服务;所述装置还包括:第一保存模块,用于分配所述第二标识,将所述第二标识、所述设备标识、第一连接的连接标识保存在第一标识、设备标识与连接标识的对应关系中,所述第一连接为与所述终端之间的用于传输所述第一报文的连接。
- 如权利要求13所述的装置,其中,所述装置还包括获取模块,所述接收模块,还用于通过所述P2P链路接收所述设备发送的第三报文,所述第三报文包括所述第二标识、所述设备的设备标识和属于所述服务的第二数据;所述获取模块,用于根据所述第二标识和所述设备的设备标识,从所述第二标识、设备标识与连接标识的对应关系中获取所述第一连接的连接标识;所述发送模块,还用于通过所述连接标识对应的第一连接向所述终端发送所述第四报文,所述第四报文包括所述第二数据。
- 如权利要求10至14任一项所述的装置,其中,所述装置还包括:第二保存模块,所述接收模块,还用于接收所述设备发送的注册请求消息,所述注册请求消息包括所述设备的设备标识和所述设备提供的服务的服务类型;所述第二保存模块,用于分配第一标识,将所述第一标识、所述设备的设备标识和所述设备提供的服务的服务类型对应保存在第一标识、设备标识与服务类型的对应关系中。
- 一种基于P2P的服务通信装置,所述装置包括:接收模块,用于通过设备与代理服务器之间的P2P链路接收第二报文,所述设备包括至少一个服务模块,每个服务模块用于提供服务,所述第二报文是所述代理服务器在终端请求 所述设备提供服务时发送的,所述第二报文包括所述终端请求的服务的服务类型和第一数据;发送模块,用于通过第二连接向目标服务模块发送第五报文,所述目标服务模块是与所述服务类型相对应的服务模块,所述第五报文包括所述第一数据,所述第一数据用于请求所述目标服务模块执行操作,所述第二连接为与目标服务模块之间的虚拟连接。
- 如权利要求16所述的装置,其中,所述第二报文的报文头还包括第二标识,所述第二标识用于标识所述终端和所述终端请求的服务;所述装置还包括:保存模块,用于将所述第二标识和所述第二连接的连接标识保存在第二标识与连接标识的对应关系中。
- 如权利要求17所述的装置,其中,所述装置还包括获取模块,所述接收模块,还用于通过所述第二连接接收第六报文,所述第六报文包括所述第二数据;所述获取模块,用于根据所述第二连接的连接标识,从第二标识与连接标识的对应关系中获取所述第二标识;所述发送模块,还用于通过所述P2P链路向所述代理服务器发送第三报文,所述第三报文包括所述设备的设备标识、所述第二标识和所述第二数据。
- 一种基于P2P的服务通信系统,所述系统包括如权利要求10至15任一项所述的装置和如权利要求16至18任一项所述的装置。
- 一种非易失性计算机可读存储介质,用于存储至少一个指令,所述至少一个指令被处理器加载并运行,以实现如权利要求1至9任一项所述的方法。
- 一种计算机程序产品,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现如权利要求1至9任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910708630.7 | 2019-08-01 | ||
CN201910708630.7A CN111355774B (zh) | 2019-08-01 | 2019-08-01 | 一种基于p2p的服务通信方法、装置及系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021018297A1 true WO2021018297A1 (zh) | 2021-02-04 |
Family
ID=71196773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/106333 WO2021018297A1 (zh) | 2019-08-01 | 2020-07-31 | 一种基于p2p的服务通信方法、装置及系统 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111355774B (zh) |
WO (1) | WO2021018297A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113055494A (zh) * | 2021-03-30 | 2021-06-29 | 中国工商银行股份有限公司 | 通讯方法及通讯装置 |
CN114679471A (zh) * | 2022-02-17 | 2022-06-28 | 许强 | 一种基于云端业务处理的数据匹配方法 |
CN114679496A (zh) * | 2022-02-17 | 2022-06-28 | 许强 | 一种基于云端业务处理的用户筛选方法 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111355774B (zh) * | 2019-08-01 | 2021-10-29 | 杭州海康威视数字技术股份有限公司 | 一种基于p2p的服务通信方法、装置及系统 |
CN115118772A (zh) * | 2022-06-21 | 2022-09-27 | 壹沓科技(上海)有限公司 | 一种消息通信的系统及方法 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2239923A1 (en) * | 2009-04-09 | 2010-10-13 | Research In Motion Limited | Relay access node with separate control and transport signaling for session-based communications |
CN102790803A (zh) * | 2012-07-19 | 2012-11-21 | 南京邮电大学 | 一种基于多终端融合的流媒体业务多流并发传输方法 |
CN104041095A (zh) * | 2012-08-22 | 2014-09-10 | 华为技术有限公司 | 深度报文检测解析结果共享获取方法、系统及其相应设备 |
CN105898750A (zh) * | 2016-05-27 | 2016-08-24 | 北京奇虎科技有限公司 | WiFi接入点设备及WiFi接入鉴权控制方法、装置 |
CN108900549A (zh) * | 2018-08-15 | 2018-11-27 | 深圳区块大陆科技有限公司 | 一种安全的区块链组网技术 |
CN111355774A (zh) * | 2019-08-01 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | 一种基于p2p的服务通信方法、装置及系统 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101616169B (zh) * | 2008-06-23 | 2013-03-13 | 华为技术有限公司 | 选择服务提供实体的方法、系统、服务选择实体、服务管理实体 |
CN102170422A (zh) * | 2010-02-25 | 2011-08-31 | 腾讯科技(深圳)有限公司 | 一种节点查询方法、装置及系统 |
CN103533039B (zh) * | 2013-09-27 | 2017-04-19 | 深圳市瑞彩电子技术有限公司 | P2p数据传输的方法、转发代理服务器与系统 |
US10200370B2 (en) * | 2015-03-20 | 2019-02-05 | Canon Information And Imaging Solutions, Inc. | Apparatus, system, and method for authorizing a service |
CN108683699B (zh) * | 2018-03-29 | 2021-06-18 | 广州华多网络科技有限公司 | 转发业务请求的方法和装置 |
-
2019
- 2019-08-01 CN CN201910708630.7A patent/CN111355774B/zh active Active
-
2020
- 2020-07-31 WO PCT/CN2020/106333 patent/WO2021018297A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2239923A1 (en) * | 2009-04-09 | 2010-10-13 | Research In Motion Limited | Relay access node with separate control and transport signaling for session-based communications |
CN102790803A (zh) * | 2012-07-19 | 2012-11-21 | 南京邮电大学 | 一种基于多终端融合的流媒体业务多流并发传输方法 |
CN104041095A (zh) * | 2012-08-22 | 2014-09-10 | 华为技术有限公司 | 深度报文检测解析结果共享获取方法、系统及其相应设备 |
CN105898750A (zh) * | 2016-05-27 | 2016-08-24 | 北京奇虎科技有限公司 | WiFi接入点设备及WiFi接入鉴权控制方法、装置 |
CN108900549A (zh) * | 2018-08-15 | 2018-11-27 | 深圳区块大陆科技有限公司 | 一种安全的区块链组网技术 |
CN111355774A (zh) * | 2019-08-01 | 2020-06-30 | 杭州海康威视数字技术股份有限公司 | 一种基于p2p的服务通信方法、装置及系统 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113055494A (zh) * | 2021-03-30 | 2021-06-29 | 中国工商银行股份有限公司 | 通讯方法及通讯装置 |
CN114679471A (zh) * | 2022-02-17 | 2022-06-28 | 许强 | 一种基于云端业务处理的数据匹配方法 |
CN114679496A (zh) * | 2022-02-17 | 2022-06-28 | 许强 | 一种基于云端业务处理的用户筛选方法 |
CN114679471B (zh) * | 2022-02-17 | 2023-09-01 | 人民日报媒体技术股份有限公司 | 一种基于云端业务处理的数据匹配方法 |
CN114679496B (zh) * | 2022-02-17 | 2024-03-22 | 上海生慧樘科技有限公司 | 一种基于云端业务处理的用户筛选方法 |
Also Published As
Publication number | Publication date |
---|---|
CN111355774A (zh) | 2020-06-30 |
CN111355774B (zh) | 2021-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021018297A1 (zh) | 一种基于p2p的服务通信方法、装置及系统 | |
CN111225042B (zh) | 数据传输的方法、装置、计算机设备以及存储介质 | |
WO2020001564A1 (zh) | 一种处理任务的方法、装置及系统 | |
CN108833607B (zh) | 物理地址获取方法、装置及可读介质 | |
WO2021120976A2 (zh) | 负载均衡控制方法及服务器 | |
US20210204127A1 (en) | Image Sharing Method and System, and Electronic Device | |
CN109246123B (zh) | 媒体流获取方法及装置 | |
CN111614549B (zh) | 交互处理方法、装置、计算机设备及存储介质 | |
WO2023125946A1 (zh) | 用户访问请求处理方法、装置、设备、介质及产品 | |
CN110636144A (zh) | 数据下载的方法和装置 | |
CN111159604A (zh) | 图片资源加载方法及装置 | |
CN110704324A (zh) | 应用调试方法、装置及存储介质 | |
CN111866140A (zh) | 融合管理设备、管理系统、服务调用方法及介质 | |
WO2019223601A1 (zh) | 一种数据库系统及其建立方法和装置 | |
CN111131392A (zh) | 处理消息的方法、装置、电子设备及介质 | |
CN113144622A (zh) | 节点切换方法、装置、设备及计算机可读存储介质 | |
CN111008083B (zh) | 页面通信方法、装置、电子设备及存储介质 | |
CN110086814B (zh) | 一种数据获取的方法、装置及存储介质 | |
CN112181915B (zh) | 执行业务的方法、装置、终端和存储介质 | |
CN111130985B (zh) | 关联关系建立方法、装置、终端、服务器及存储介质 | |
CN110366044B (zh) | 获取目标物的方法、装置和系统 | |
CN110597840A (zh) | 基于区块链的伴侣关系建立方法、装置、设备及存储介质 | |
WO2022247750A1 (zh) | 访问请求的处理方法、电子装置、电子设备以及介质 | |
CN114785766A (zh) | 智能设备的控制方法、终端及服务器 | |
CN114329292A (zh) | 资源信息的配置方法、装置、电子设备以及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20847782 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20847782 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15/05/2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20847782 Country of ref document: EP Kind code of ref document: A1 |