技术领域technical field
本发明涉及通信技术领域,尤其涉及一种业务处理方法及系统、设备。The present invention relates to the field of communication technologies, and in particular, to a service processing method, system, and device.
背景技术Background technique
网络是信息传输、接收以及共享的虚拟平台,通过它把各个点、面、体的信息联系到一起,从而实现这些资源的共享。在设备通过某一网络与另一设备连接后,两个设备之间可建立基于该网络的某一业务的会话,以建立两个设备的服务模块之间的连接和传输数据,从而实现该业务在设备间的业务传输。The network is a virtual platform for information transmission, reception and sharing. Through it, the information of each point, surface and volume is linked together, so as to realize the sharing of these resources. After a device is connected to another device through a network, a session of a service based on the network can be established between the two devices to establish a connection between the service modules of the two devices and transmit data, thereby realizing the service. Service transmission between devices.
随着网络技术的快速发展,多种网络接入技术相继涌现,设备可以通过多个网络与另一设备连接,上述多个网络可以是多个不同类型的网络,例如,有线网络、WI-FI(Wireless-Fidelity,无线保真)、蓝牙、NFC(Near Field Communication,近距离无线通信技术)和Powerline(输电线等,也可以是同类型但具备不同网络结构的网络,例如基于WI-FI的P2P网络和基于WI-FI的基础设施网络。With the rapid development of network technology, a variety of network access technologies have emerged one after another. A device can be connected to another device through multiple networks. The multiple networks can be multiple different types of networks, such as wired networks, WI-FI (Wireless-Fidelity, wireless fidelity), Bluetooth, NFC (Near Field Communication, short-range wireless communication technology) and Powerline (power lines, etc., can also be the same type of network but with different network structures, such as WI-FI-based P2P network and WI-FI based infrastructure network.
然而,目前设备之间的通信均只考虑了业务在一个网络传输的情况,在该网络出现信号质量不佳或被切换等情况时,设备间的业务会受到影响,甚至中断,而设备有关的其他网络又无法综合利用起来,浪费了多个网络的优势。However, the current communication between devices only considers the transmission of services in one network. When the network has poor signal quality or is switched, the services between devices will be affected or even interrupted. Other networks cannot be used comprehensively, wasting the advantages of multiple networks.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种业务处理方法和设备,可有效提高业务传输质量和资源利用率。Embodiments of the present invention provide a service processing method and device, which can effectively improve service transmission quality and resource utilization.
本发明实施例的第一方面提供一种业务处理方法,第一设备与第二设备之间建立有基于第一网络的第一会话,所述方法包括:当所述第一设备通过第二网络与所述第二设备连接时,A first aspect of the embodiments of the present invention provides a service processing method. A first session based on a first network is established between a first device and a second device. The method includes: when the first device passes through the second network When connected with the second device,
所述第一设备向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The first device sends a request message to the second device; the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, the first cooperation information is used to indicate that the second session and the first session correspond to the same service;
所述第一设备接收所述第二设备根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;receiving, by the first device, a response message responded by the second device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
所述第一设备根据所述响应消息与所述第二设备建立所述第二会话。The first device establishes the second session with the second device according to the response message.
结合本发明实施例的第一方面,在本发明实施例的第一方面的第一种实现方式中,With reference to the first aspect of the embodiment of the present invention, in the first implementation manner of the first aspect of the embodiment of the present invention,
所述第一设备向所述第二设备发送请求消息具体为:The sending of the request message by the first device to the second device is specifically:
所述第一设备的ASP向所述第二设备的ASP发送请求消息;The ASP of the first device sends a request message to the ASP of the second device;
所述第一设备接收所述第二设备根据所述请求消息回应的响应消息具体为:The response message that the first device receives from the second device according to the request message is specifically:
所述第一设备的ASP接收所述第二设备的ASP根据所述请求消息回应的响应消息;The ASP of the first device receives a response message responded by the ASP of the second device according to the request message;
所述第一设备根据所述响应消息与所述第二设备建立所述第二会话具体包括:The first device establishing the second session with the second device according to the response message specifically includes:
所述第一设备的ASP根据所述响应消息与所述第二设备的ASP建立所述第二会话。The ASP of the first device establishes the second session with the ASP of the second device according to the response message.
结合本发明实施例的第一方面的第一种实现方式,在本发明实施例的第一方面的第二种实现方式中,在所述第一设备的ASP根据所述响应消息与所述第二设备的ASP建立所述第二会话之后还包括:With reference to the first implementation of the first aspect of the embodiments of the present invention, in the second implementation of the first aspect of the embodiments of the present invention, the ASP of the first device communicates with the first After the ASP of the second device establishes the second session, the method further includes:
第一设备的ASP向第一设备的服务模块发送第一报告消息,所述第一报告消息用于指示所述第一设备与所述第二设备之间已经建立有所述第二会话。The ASP of the first device sends a first report message to the service module of the first device, where the first report message is used to indicate that the second session has been established between the first device and the second device.
结合本发明实施例的第一方面的第一种或第二种实现方式,在本发明实施例的第一方面的第三种实现方式中,With reference to the first or second implementation manner of the first aspect of the embodiments of the present invention, in the third implementation manner of the first aspect of the embodiments of the present invention,
在所述第一设备的ASP向所述第二设备的ASP发送请求消息之前还包括:Before the ASP of the first device sends the request message to the ASP of the second device, the method further includes:
所述第一设备的ASP向所述第一设备的服务模块发送第二报告消息,所述第二报告消息用于向所述第一设备的服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The ASP of the first device sends a second report message to the service module of the first device, where the second report message is used to report to the service module of the first device that the first device can communicate with the first device. Two devices establish a second session based on the second network, the second report message includes second cooperation information, and the second cooperation information is used to indicate that the second session and the first session correspond to the same service ;
所述第一设备的ASP接收所述第一设备的服务模块根据所述第二报告消息发送的第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;The ASP of the first device receives a first indication message sent by the service module of the first device according to the second report message, where the first indication message is used to indicate the first device and the second device establishing the second session;
所述第一设备的ASP接收所述第二设备的ASP根据所述请求消息回应的响应消息包括:The ASP of the first device receives the response message that the ASP of the second device responds according to the request message, including:
所述第一设备的ASP接收所述第二设备的ASP根据所述请求消息在第二设备进行前处理操作后回应的响应消息;所述前处理操作为:所述第二设备的ASP根据所述请求消息向所述第二设备的服务模块发送第三报告消息,所述第三报告消息用于向所述第二设备的服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第二设备的ASP接收所述第二设备的服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二设备的ASP向第一设备的ASP回应所述响应消息。The ASP of the first device receives a response message that the ASP of the second device responds according to the request message after the second device performs a preprocessing operation; the preprocessing operation is: the ASP of the second device responds according to the request message. The request message sends a third report message to the service module of the second device, and the third report message is used to request the service module of the second device whether to accept the establishment of the second session with the first device. , the third report message includes third cooperation information, where the third cooperation information is used to indicate that the second session and the first session correspond to the same service; the ASP of the second device receives the second The service module of the device sends a second indication message according to the third report message, where the second indication message is used to instruct the ASP of the second device to respond to the response message to the ASP of the first device.
结合本发明实施例的第一方面、本发明实施例的第一方面的第一种至第三种实现方式中的任意一种,在本发明实施例的第一方面的第四种实现方式中,所述第一协作信息包括所述第一设备在所述第一网络中的地址信息、所述第一会话的会话标识和第一标识信息中的一个或多个,其中,所述第一标识信息为根据所述第一设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息。In combination with the first aspect of the embodiments of the present invention and any one of the first to third implementation manners of the first aspect of the embodiments of the present invention, in the fourth implementation manner of the first aspect of the embodiments of the present invention , the first cooperation information includes one or more of address information of the first device in the first network, session identification of the first session, and first identification information, wherein the first The identification information is information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session.
结合本发明实施例的第一方面的第四种实现方式,在本发明实施例的第一方面的第五种实现方式中,所述第二协作信息包括所述第二设备在所述第一网络中的地址信息、所述第一会话的会话标识和第二标识信息中的一个或多个,其中,所述第二标识信息为根据所述第二设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息;所述第三协作信息包括所述第一设备在所述第一网络中的地址信息、所述第一会话的会话标识和第一标识信息中的一个或多个,其中,所述第一标识信息为根据所述第一设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息。With reference to the fourth implementation manner of the first aspect of the embodiments of the present invention, in the fifth implementation manner of the first aspect of the embodiments of the present invention, the second cooperation information includes the first One or more of address information in the network, session identification of the first session, and second identification information, wherein the second identification information is based on the address of the second device in the first network information and/or information obtained by calculating the session ID of the first session; the third cooperation information includes address information of the first device in the first network, session ID of the first session and one or more of the first identification information, wherein the first identification information is calculated according to the address information of the first device in the first network and/or the session identification of the first session information obtained later.
结合本发明实施例的第一方面、本发明实施例的第一方面的第一种至第五种实现方式中的任意一种,在本发明实施例的第一方面的第六种实现方式中,所述方法还包括:With reference to the first aspect of the embodiments of the present invention and any one of the first to fifth implementations of the first aspect of the embodiments of the present invention, in the sixth implementation of the first aspect of the embodiments of the present invention , the method also includes:
当满足预设的第一切换条件时,所述第一设备将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。When the preset first switching condition is satisfied, the first device switches the session used by the service corresponding to the first session from the first session to the second session, so that the first session The service corresponding to the session performs service transmission according to the second session.
结合本发明实施例的第一方面的第六种实现方式,在本发明实施例的第一方面的第七种实现方式中,所述预设的第一切换条件包括:With reference to the sixth implementation manner of the first aspect of the embodiment of the present invention, in the seventh implementation manner of the first aspect of the embodiment of the present invention, the preset first switching condition includes:
所述第一网络的信号质量不满足预设要求或所述第二网络的信号质量优于所述第一网络的信号质量。The signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network.
本发明实施例的第二方面提供一种业务处理方法,第一设备与第二设备之间建立有基于第一网络的第一会话,当所述第一设备还通过第二网络与所述第二设备连接时,所述方法包括:A second aspect of the embodiments of the present invention provides a service processing method. A first session based on a first network is established between a first device and a second device. When the first device also communicates with the first device through the second network When the two devices are connected, the method includes:
所述第二设备接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The second device receives a request message sent by the first device; the request message is used to request the establishment of a second session based on the second network, the request message includes first cooperation information, the first cooperation The information is used to indicate that the second session and the first session correspond to the same service;
所述第二设备根据所述请求消息向所述第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;The second device responds with a response message to the first device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
所述第二设备与所述第一设备建立所述第二会话。The second device establishes the second session with the first device.
结合本发明实施例的第二方面,在本发明实施例的第二方面的第一种实现方式中,With reference to the second aspect of the embodiment of the present invention, in the first implementation manner of the second aspect of the embodiment of the present invention,
所述第二设备接收所述第一设备发送的请求消息具体为:The second device receiving the request message sent by the first device is specifically:
所述第二设备的ASP接收所述第一设备的ASP发送的请求消息;The ASP of the second device receives the request message sent by the ASP of the first device;
所述第二设备根据所述请求消息向第一设备回应响应消息具体为:The second device responding to the first device with a response message according to the request message is specifically:
所述第二设备的ASP根据所述请求消息向第一设备的ASP回应响应消息;The ASP of the second device responds with a response message to the ASP of the first device according to the request message;
所述第二设备根据所述响应消息与所述第一设备建立所述第二会话具体包括:The second device establishing the second session with the first device according to the response message specifically includes:
所述第二设备的ASP与所述第一设备的ASP建立所述第二会话。The ASP of the second device establishes the second session with the ASP of the first device.
结合本发明实施例的第二方面的第一种实现方式,在本发明实施例的第二方面的第二种实现方式中,在所述第二设备的ASP与所述第一设备的ASP建立所述第二会话之后还包括:With reference to the first implementation manner of the second aspect of the embodiment of the present invention, in the second implementation manner of the second aspect of the embodiment of the present invention, the ASP of the second device is established with the ASP of the first device The second session further includes:
第二设备的ASP向第二设备的服务模块发送第一报告消息,所述第一报告消息用于指示所述第二设备与所述第一设备之间已经建立有所述第二会话。The ASP of the second device sends a first report message to the service module of the second device, where the first report message is used to indicate that the second session has been established between the second device and the first device.
结合本发明实施例的第二方面的第一种或第二种实现方式,在本发明实施例的第二方面的第三种实现方式中,With reference to the first or second implementation manner of the second aspect of the embodiments of the present invention, in the third implementation manner of the second aspect of the embodiments of the present invention,
所述第二设备接收所述第一设备发送的请求消息具体为:The second device receiving the request message sent by the first device is specifically:
所述第二设备的ASP接收所述第一设备的ASP在第一设备进行预处理操作后发送的请求消息;所述预处理操作为:所述第一设备的ASP向所述第一设备的服务模块发送第二报告消息,所述第二报告消息用于向所述第一设备的服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第一设备的ASP接收所述第一设备的服务模块根据所述第二报告消息发送的第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;The ASP of the second device receives a request message sent by the ASP of the first device after the first device performs a preprocessing operation; the preprocessing operation is: the ASP of the first device sends the request message to the ASP of the first device. the service module sends a second report message, where the second report message is used to report to the service module of the first device that the first device can establish a second session based on the second network with the second device, The second report message includes second collaboration information, where the second collaboration information is used to indicate that the second session and the first session correspond to the same service; the ASP of the first device receives the first device a first indication message sent by the service module according to the second report message, where the first indication message is used to instruct the first device to establish the second session with the second device;
在所述第二设备的ASP接收所述第一设备的ASP发送的请求消息之后,所述第二设备的ASP根据所述请求消息向第一设备的ASP回应响应消息之前还包括:After the ASP of the second device receives the request message sent by the ASP of the first device, before the ASP of the second device sends a response message to the ASP of the first device according to the request message, the method further includes:
所述第二设备的ASP根据所述请求消息向所述第二设备的服务模块发送第三报告消息,所述第三报告消息用于向所述第二设备的服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The ASP of the second device sends a third report message to the service module of the second device according to the request message, where the third report message is used to request the service module of the second device whether to accept the The first device establishes the second session, and the third report message includes third cooperation information, where the third cooperation information is used to indicate that the second session and the first session correspond to the same service;
所述第二设备的ASP接收所述第二设备的服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二设备的ASP向第一设备的ASP回应所述响应消息。The ASP of the second device receives a second indication message sent by the service module of the second device according to the third report message, where the second indication message is used to instruct the ASP of the second device to report to the first device The ASP responds with the response message.
结合本发明实施例的第二方面、本发明实施例的第二方面的第一种至第三种实现方式中的任意一种,在本发明实施例的第二方面的第四种实现方式中,所述第一协作信息包括所述第一设备在所述第一网络中的地址信息、所述第一会话的会话标识和第一标识信息中的一个或多个,其中,所述标识信息为根据所述第一设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息。In combination with the second aspect of the embodiments of the present invention and any one of the first to third implementations of the second aspect of the embodiments of the present invention, in the fourth implementation of the second aspect of the embodiments of the present invention , the first cooperation information includes one or more of the address information of the first device in the first network, the session identifier of the first session, and the first identifier information, wherein the identifier information It is information obtained after calculation according to the address information of the first device in the first network and/or the session identifier of the first session.
结合本发明实施例的第二方面的第四种实现方式,在本发明实施例的第二方面的第五种实现方式中,所述第二协作信息包括所述第二设备在所述第一网络中的地址信息、所述第一会话的会话标识和第二标识信息中的一个或多个,其中,所述第二标识信息为根据所述第二设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息;所述第三协作信息包括所述第一设备在所述第一网络中的地址信息、所述第一会话的会话标识和第一标识信息中的一个或多个,其中,所述第一标识信息为根据所述第一设备在所述第一网络中的地址信息和/或所述第一会话的会话标识进行计算后得到的信息。With reference to the fourth implementation manner of the second aspect of the embodiments of the present invention, in the fifth implementation manner of the second aspect of the embodiments of the present invention, the second cooperation information includes the first One or more of address information in the network, session identification of the first session, and second identification information, wherein the second identification information is based on the address of the second device in the first network information and/or information obtained by calculating the session ID of the first session; the third cooperation information includes address information of the first device in the first network, session ID of the first session and one or more of the first identification information, wherein the first identification information is calculated according to the address information of the first device in the first network and/or the session identification of the first session information obtained later.
结合本发明实施例的第二方面、本发明实施例的第二方面的第一种至第五种实现方式中的任意一种,在本发明实施例的第二方面的第六种实现方式中,所述方法还包括:In combination with the second aspect of the embodiments of the present invention and any one of the first to fifth implementations of the second aspect of the embodiments of the present invention, in the sixth implementation of the second aspect of the embodiments of the present invention , the method also includes:
当满足预设的第一切换条件时,所述第二设备将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。When the preset first switching condition is satisfied, the second device switches the session used by the service corresponding to the first session from the first session to the second session, so that the first session The service corresponding to the session performs service transmission according to the second session.
结合本发明实施例的第二方面的第六种实现方式,在本发明实施例的第二方面的第七种实现方式中,所述预设的第一切换条件包括:With reference to the sixth implementation manner of the second aspect of the embodiment of the present invention, in the seventh implementation manner of the second aspect of the embodiment of the present invention, the preset first switching condition includes:
所述第一网络的信号质量不满足预设要求或所述第二网络的信号质量优于所述第一网络的信号质量。The signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network.
本发明实施例的第三方面提供一种设备,所述设备为第一设备,所述第一设备与第二设备之间建立有基于第一网络的第一会话,所述第一设备包括:A third aspect of the embodiments of the present invention provides a device, where the device is a first device, a first session based on a first network is established between the first device and a second device, and the first device includes:
发送单元,用于当所述第一设备通过第二网络与所述第二设备连接时,向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;a sending unit, configured to send a request message to the second device when the first device is connected to the second device through the second network; the request message is used to request the establishment of a first device based on the second network Two sessions, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service;
接收单元,用于接收所述第二设备根据请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;a receiving unit, configured to receive a response message responded by the second device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元,用于根据所述响应消息与所述第二设备建立所述第二会话。an establishing unit, configured to establish the second session with the second device according to the response message.
结合本发明实施例的第三方面,在本发明实施例的第三方面的第一种实现方式中,所述第一设备还包括:With reference to the third aspect of the embodiment of the present invention, in a first implementation manner of the third aspect of the embodiment of the present invention, the first device further includes:
第一切换单元,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。A first switching unit, configured to switch the session used by the service corresponding to the first session from the first session to the second session when a preset first switching condition is satisfied, so that the The service corresponding to the first session performs service transmission according to the second session.
本发明实施例的第四方面提供一种设备,所述设备为第一设备,所述第一设备与第二设备之间建立有基于第一网络的第一会话,所述第一设备包括第一ASP;A fourth aspect of the embodiments of the present invention provides a device, where the device is a first device, a first session based on a first network is established between the first device and a second device, and the first device includes a first session an ASP;
所述第一ASP,用于当所述第一设备通过第二网络与所述第二设备连接时,向第二ASP发送请求消息,所述第二ASP为所述第二设备的ASP,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二ASP根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于根据所述响应消息与所述第二ASP建立所述第二会话。The first ASP is configured to send a request message to the second ASP when the first device is connected to the second device through the second network, where the second ASP is the ASP of the second device, and the The request message is used to request the establishment of a second session based on the second network, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; also used for receiving a response message responded by the second ASP according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and and establishing the second session with the second ASP according to the response message.
结合本发明实施例的第四方面,在本发明实施例的第四方面的第一种实现方式中,所述第一设备还包括第一服务模块;With reference to the fourth aspect of the embodiments of the present invention, in a first implementation manner of the fourth aspect of the embodiments of the present invention, the first device further includes a first service module;
所述第一设备中的第一服务模块,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first service module in the first device is configured to switch the session used by the service corresponding to the first session from the first session to the first session when a preset first switching condition is met. Two sessions, so that the service corresponding to the first session performs service transmission according to the second session.
结合本发明实施例的第四方面的第一种实现方式,在本发明实施例的第四方面的第二种实现方式中,With reference to the first implementation manner of the fourth aspect of the embodiments of the present invention, in the second implementation manner of the fourth aspect of the embodiments of the present invention,
所述第一ASP,还用于在所述根据所述响应消息与所述第二ASP建立所述第二会话之后,向所述第一服务模块发送第一报告消息,所述第一报告消息用于指示所述第一设备与所述第二设备之间已经建立有所述第二会话;The first ASP is further configured to send a first report message to the first service module after the second session is established with the second ASP according to the response message, where the first report message for indicating that the second session has been established between the first device and the second device;
所述第一服务模块,还用于接收所述第一ASP发送的所述第一报告消息。The first service module is further configured to receive the first report message sent by the first ASP.
结合本发明实施例的第四方面的第一或第二种实现方式,在本发明实施例的第四方面的第三种实现方式中,With reference to the first or second implementation manner of the fourth aspect of the embodiments of the present invention, in the third implementation manner of the fourth aspect of the embodiments of the present invention,
所述第一ASP,还用于在向所述第二ASP发送请求消息之前,向所述第一服务模块发送第二报告消息,所述第二报告消息用于向所述第一服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The first ASP is further configured to send a second report message to the first service module before sending the request message to the second ASP, where the second report message is used to report to the first service module The first device may establish a second session based on the second network with the second device, the second report message includes second cooperation information, and the second cooperation information is used to represent the second session and the first session corresponds to the same service;
所述第一服务模块,还用于在接收到所述第一ASP发送的第二报告消息之后,根据所述第二报告消息向所述第一ASP发送第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;The first service module is further configured to, after receiving the second report message sent by the first ASP, send a first indication message to the first ASP according to the second report message, where the first indication The message is used to instruct the first device to establish the second session with the second device;
所述第一ASP,还用于接收所述第一服务模块发送的所述第一指示消息;The first ASP is further configured to receive the first indication message sent by the first service module;
所述第一ASP用于接收所述第二ASP根据所述请求消息回应的响应消息,具体为:所述第一ASP用于接收所述第二ASP根据所述请求消息在所述第二设备进行前处理操作后回应的响应消息;所述前处理操作为:所述第二ASP根据所述请求消息向所述第二服务模块发送第三报告消息,所述第二服务模块为所述第二设备的服务模块,所述第三报告消息用于向所述第二服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第二ASP接收所述第一服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二ASP向所述第一ASP回应所述响应消息。The first ASP is configured to receive a response message responded by the second ASP according to the request message, specifically: the first ASP is configured to receive a response message from the second ASP according to the request message on the second device A response message responded after performing a pre-processing operation; the pre-processing operation is: the second ASP sends a third report message to the second service module according to the request message, and the second service module is the second service module. The service module of the second device, the third report message is used to request the second service module whether to accept the establishment of the second session with the first device, and the third report message includes the third cooperation information, so The third cooperation information is used to indicate that the second session and the first session correspond to the same service; the second ASP receives the second indication message sent by the first service module according to the third report message, The second indication message is used to instruct the second ASP to respond to the response message to the first ASP.
本发明实施例的第五方面提供一种设备,所述设备为第二设备,所述第二设备与第一设备之间建立有基于第一网络的第一会话,所述第二设备包括:A fifth aspect of the embodiments of the present invention provides a device, where the device is a second device, a first session based on a first network is established between the second device and the first device, and the second device includes:
接收单元,用于当所述第二设备通过第二网络与所述第一设备连接时,接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;A receiving unit, configured to receive a request message sent by the first device when the second device is connected to the first device through a second network; the request message is used to request the establishment of a a second session, the request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service;
响应单元,用于根据所述请求消息向所述第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;a response unit, configured to respond to the first device with a response message according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元,用于与所述第一设备建立所述第二会话。an establishing unit, configured to establish the second session with the first device.
结合本发明实施例的第五方面,在本发明实施例的第五方面的第一种实现方式中,所述第二设备还包括:With reference to the fifth aspect of the embodiment of the present invention, in a first implementation manner of the fifth aspect of the embodiment of the present invention, the second device further includes:
第一切换单元,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。A first switching unit, configured to switch the session used by the service corresponding to the first session from the first session to the second session when a preset first switching condition is satisfied, so that the The service corresponding to the first session performs service transmission according to the second session.
本发明实施例的第六方面提供一种设备,所述设备为第二设备,所述第二设备与第一设备之间建立有基于第一网络的第一会话,所述第二设备包括第二ASP;A sixth aspect of the embodiments of the present invention provides a device, the device is a second device, a first session based on a first network is established between the second device and the first device, and the second device includes a first session Two ASP;
所述第二ASP,用于当所述第二设备通过第二网络与所述第一设备连接时,接收第一ASP发送的请求消息,所述第一ASP为所述第一设备的ASP,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于根据所述请求消息向所述第一ASP回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于与所述第一ASP建立所述第二会话。the second ASP, configured to receive a request message sent by the first ASP when the second device is connected to the first device through the second network, where the first ASP is the ASP of the first device, The request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session corresponds to the first session in the same service; also used for responding to the first ASP with a response message according to the request message, the response message being used to indicate that the second device accepts the establishment of the second session with the first device; and using on establishing the second session with the first ASP.
结合本发明实施例的第六方面,在本发明实施例的第六方面的第一种实现方式中,所述第二设备还包括第二服务模块;With reference to the sixth aspect of the embodiments of the present invention, in a first implementation manner of the sixth aspect of the embodiments of the present invention, the second device further includes a second service module;
所述第二服务模块,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The second service module is configured to, when a preset first switching condition is satisfied, switch the session used by the service corresponding to the first session from the first session to the second session, so that the The service corresponding to the first session performs service transmission according to the second session.
结合本发明实施例的第六方面的第一种实现方式,在本发明实施例的第六方面的第二种实现方式中,With reference to the first implementation manner of the sixth aspect of the embodiments of the present invention, in the second implementation manner of the sixth aspect of the embodiments of the present invention,
所述第二ASP,还用于向所述第二服务模块发送第一报告消息,所述第一报告消息用于指示所述第二设备与所述第一设备之间已经建立有所述第二会话;The second ASP is further configured to send a first report message to the second service module, where the first report message is used to indicate that the first report message has been established between the second device and the first device. two sessions;
所述第二服务模块,还用于接收所述第二ASP发送的所述第一报告消息。The second service module is further configured to receive the first report message sent by the second ASP.
结合本发明实施例的第六方面的第一或第二种实现方式,在本发明实施例的第六方面的第三种实现方式中,With reference to the first or second implementation manner of the sixth aspect of the embodiments of the present invention, in the third implementation manner of the sixth aspect of the embodiments of the present invention,
所述第二ASP用于接收第一ASP发送的请求消息,具体为:所述第二ASP用于接收所述第一ASP在第一设备进行预处理操作后发送的请求消息;所述预处理操作为:所述第一ASP向第一服务模块发送第二报告消息,所述第一服务模块为所述第一设备的服务模块,所述第二报告消息用于向所述第一服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第一ASP接收所述第一服务模块根据所述第二报告消息发送的第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;The second ASP is configured to receive the request message sent by the first ASP, specifically: the second ASP is configured to receive the request message sent by the first ASP after the first device performs a preprocessing operation; the preprocessing The operation is: the first ASP sends a second report message to a first service module, the first service module is a service module of the first device, and the second report message is used to send a second report message to the first service module reporting that the first device can establish a second session based on the second network with the second device, the second report message includes second cooperation information, and the second cooperation information is used to indicate the second The session and the first session correspond to the same service; the first ASP receives a first indication message sent by the first service module according to the second report message, where the first indication message is used to indicate the first indication message A device establishes the second session with the second device;
所述第二ASP,还用于在所述第二ASP接收到所述第一ASP发送的请求消息之后,所述第二ASP根据所述请求消息向第一ASP回应响应消息之前,根据所述请求消息向所述第二服务模块发送第三报告消息,所述第三报告消息用于向所述第二服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The second ASP is further configured to, after the second ASP receives the request message sent by the first ASP, before the second ASP responds with a response message to the first ASP according to the request message, according to the The request message sends a third report message to the second service module, where the third report message is used to request the second service module whether to accept the establishment of the second session with the first device, and the third report message is used to request the second service module whether to accept the establishment of the second session with the first device. The report message includes third collaboration information, where the third collaboration information is used to indicate that the second session and the first session correspond to the same service;
所述第二服务模块,还用于在接收到所述第二ASP发送的所述第三报告消息后,根据所述第三报告消息向所述第二ASP发送的第二指示消息,所述第二指示消息用于指示所述第二ASP向第一ASP回应所述响应消息;The second service module is further configured to, after receiving the third report message sent by the second ASP, send a second indication message to the second ASP according to the third report message, the The second indication message is used to instruct the second ASP to respond to the response message to the first ASP;
所述第二ASP,还用于接收所述第二服务模块发送的所述第二指示消息。The second ASP is further configured to receive the second indication message sent by the second service module.
本发明实施例的第七方面提供一种业务处理系统,包括:A seventh aspect of the embodiments of the present invention provides a service processing system, including:
第一设备和第二设备;所述第一设备与所述第二设备之间建立有基于第一网络的第一会话;a first device and a second device; a first session based on a first network is established between the first device and the second device;
所述第一设备,用于当所述第一设备通过第二网络与所述第二设备连接时,向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二设备根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于根据所述响应消息与所述第二设备建立所述第二会话。The first device is configured to send a request message to the second device when the first device is connected to the second device through the second network; the request message is used to request to establish a a second session of the network, the request message includes first cooperation information, where the first cooperation information is used to indicate that the second session and the first session correspond to the same service; and is also used to receive the second device A response message responded according to the request message, the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and is used to communicate with the second device according to the response message The second session is established.
所述第二设备,用于当所述设备通过第二网络与所述目标设备连接时,接收所述目标设备发送的请求消息;还用于根据所述请求消息向第一设备回应所述响应消息;以及用于与所述目标设备建立所述第二会话。The second device is configured to receive a request message sent by the target device when the device is connected to the target device through the second network; and is further configured to respond to the first device with the response according to the request message message; and for establishing the second session with the target device.
结合本发明实施例的第七方面,在本发明实施例的第七方面的第一种实现方式中,With reference to the seventh aspect of the embodiment of the present invention, in the first implementation manner of the seventh aspect of the embodiment of the present invention,
所述第一设备或所述第二设备,还用于当满足预设的第一切换条件时将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first device or the second device is further configured to switch the session used by the service corresponding to the first session from the first session to the second session when a preset first switching condition is satisfied. Two sessions, so that the service corresponding to the first session performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一设备在向第二设备发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备回应的响应消息后,与第二设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。因此相对于现有技术,本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the first device includes the first cooperation information in the request message sent to the second device, and the first cooperation information is used It indicates that the second session and the first session correspond to the same service, and after receiving the response message from the second device, the second session is established with the second device, so that the first device and the second device can establish a The second network corresponds to the second session of the service corresponding to the first session. Therefore, compared with the prior art, in the embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the second session between devices can be The service corresponding to a session can continue to run in the second network, so as to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
附图说明Description of drawings
图1为本发明实施例中业务处理方法一个实施例示意图;FIG. 1 is a schematic diagram of an embodiment of a service processing method in an embodiment of the present invention;
图2为本发明实施例中业务处理方法另一实施例示意图;FIG. 2 is a schematic diagram of another embodiment of a service processing method in an embodiment of the present invention;
图3为本发明实施例中业务处理方法另一实施例示意图;FIG. 3 is a schematic diagram of another embodiment of a service processing method in an embodiment of the present invention;
图4为本发明实施例中业务处理方法另一实施例示意图;FIG. 4 is a schematic diagram of another embodiment of a service processing method in an embodiment of the present invention;
图5为本发明实施例中业务处理方法另一实施例示意图;FIG. 5 is a schematic diagram of another embodiment of a service processing method in an embodiment of the present invention;
图6为本发明实施例中业务处理方法另一实施例示意图;FIG. 6 is a schematic diagram of another embodiment of a service processing method in an embodiment of the present invention;
图7为本发明实施例中第一设备一个实施例示意图;FIG. 7 is a schematic diagram of an embodiment of a first device in an embodiment of the present invention;
图8为本发明实施例中第一设备另一实施例示意图;FIG. 8 is a schematic diagram of another embodiment of the first device in the embodiment of the present invention;
图9为本发明实施例中第一设备另一实施例示意图;FIG. 9 is a schematic diagram of another embodiment of the first device in the embodiment of the present invention;
图10为本发明实施例中第一设备另一实施例示意图;10 is a schematic diagram of another embodiment of the first device in the embodiment of the present invention;
图11为本发明实施例中第一设备另一实施例示意图;FIG. 11 is a schematic diagram of another embodiment of the first device in the embodiment of the present invention;
图12为本发明实施例中第二设备一个实施例示意图;12 is a schematic diagram of an embodiment of a second device in an embodiment of the present invention;
图13为本发明实施例中第二设备另一实施例示意图;13 is a schematic diagram of another embodiment of the second device in the embodiment of the present invention;
图14为本发明实施例中第二设备另一实施例示意图;14 is a schematic diagram of another embodiment of the second device in the embodiment of the present invention;
图15为本发明实施例中第二设备另一实施例示意图;FIG. 15 is a schematic diagram of another embodiment of the second device in the embodiment of the present invention;
图16为本发明实施例中第二设备另一实施例示意图;16 is a schematic diagram of another embodiment of the second device in the embodiment of the present invention;
图17为本发明实施例中业务处理系统一个实施例示意图;17 is a schematic diagram of an embodiment of a service processing system in an embodiment of the present invention;
图18为本发明实施例中业务处理系统另一实施例示意图。FIG. 18 is a schematic diagram of another embodiment of a service processing system in an embodiment of the present invention.
具体实施方式Detailed ways
本发明实施例提供了一种业务处理方法及系统、设备,用于提高业务传输质量和资源利用率。Embodiments of the present invention provide a service processing method, system, and device, which are used to improve service transmission quality and resource utilization.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to Describe a particular order or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
首先,需要明确的是,在下述的本发明各个实施例中,第一设备和第二设备之间已经建立有基于第一网络的第一会话。可以理解的是,在第一设备与该第二设备已经建立有基于第一网络的连接时,第一设备和该第二设备可以使用一套基于第一网络的地址,即该第一设备的第一地址和该第二设备的第一地址,并利用基于第一网络的一套地址建立该第一会话。在该第一会话建立后,第一设备与第二设备通过该第一会话进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。可以理解的是,在本发明中,地址可以包括IP地址或者MAC地址等,各实施例可根据实际情况来选择采用哪种类型的地址,具体此处不做限定。需要说明的是,第一网络和第二网络可以是两个不同类型的网络,例如,有线网络、WI-FI、蓝牙、NFC和Powerline等,也可以是同类型但具备不同网络结构的网络,例如基于WI-FI的P2P网络和基于WI-FI的基础设施网络,其中,基于Wi-Fi的P2P网络,可以是基于WFA(Wi-Fi Alliance,Wi-Fi联盟)的Wi-Fi Direct协议建立起来的网络,这种情况下,第一设备和第二设备可以直接连接;基于Wi-Fi的基础设施网络,可以是基于IEEE的802.11协议建立起来的网络,这种情况下,第一设备和第二设备都连接到AP(Access Point,接入点),并且可以通过AP实现两者之间的通信。可以理解的是,在实际应用中,第二网络的数量可以是一个或多个,此处不作限定。First of all, it should be clear that, in the following embodiments of the present invention, a first session based on the first network has been established between the first device and the second device. It can be understood that when the first device and the second device have established a connection based on the first network, the first device and the second device can use a set of addresses based on the first network, that is, the address of the first device. the first address and the first address of the second device, and establish the first session using a set of addresses based on the first network. After the first session is established, the first device and the second device connect and transmit data through the first session, so as to implement service transmission between the first device and the second device for the service corresponding to the first session. It can be understood that, in the present invention, the address may include an IP address or a MAC address, and each embodiment may select which type of address to use according to the actual situation, which is not specifically limited here. It should be noted that the first network and the second network may be two different types of networks, such as wired network, WI-FI, Bluetooth, NFC, Powerline, etc., or may be networks of the same type but with different network structures. For example, a WI-FI-based P2P network and a WI-FI-based infrastructure network, wherein the Wi-Fi-based P2P network can be established based on the Wi-Fi Direct protocol of WFA (Wi-Fi Alliance, Wi-Fi Alliance). In this case, the first device and the second device can be directly connected; the Wi-Fi-based infrastructure network can be a network established based on the IEEE 802.11 protocol. In this case, the first device and the second device can be connected directly. Both the second devices are connected to the AP (Access Point, access point), and the communication between the two can be realized through the AP. It can be understood that, in practical applications, the number of second networks may be one or more, which is not limited here.
需要说明的是,在下述的本发明各个实施例中,第一设备和第二设备可以是具备网络连接功能的设备,例如支持网络连接功能的手机、电视机、服务器、无线路由器、其他各种家用电器或办公设备等。例如,第一设备可以是手机,第二设备可以是电视机,接入点可以是无线路由器,此时,手机跟电视机可以通过无线路由器建立基于Wi-Fi的基础设施网络的连接,并基于该基于Wi-Fi的基础设施网络建立第一会话,以使得手机通过该第一会话把播放内容传输到电视机。需要强调的是,针对上述第一设备和第二设备,每个设备内部都有ASP(Application Service Platform,应用服务平台)和服务模块,这些模块都是设备内部的逻辑实体,通过运行于处理器的软件来实现逻辑功能。在一个设备内,ASP和服务模块之间可以通过内部处理的方式通信。在设备间,一个设备的ASP和其他设备的ASP之间可以通过系统的其他模块以及硬件如天线等方式通信。It should be noted that, in the following embodiments of the present invention, the first device and the second device may be devices with a network connection function, such as a mobile phone, a TV, a server, a wireless router, and other various devices that support the network connection function. Home appliances or office equipment, etc. For example, the first device can be a mobile phone, the second device can be a TV, and the access point can be a wireless router. At this time, the mobile phone and the TV can establish a Wi-Fi-based infrastructure network connection through the wireless router, The Wi-Fi-based infrastructure network establishes a first session, so that the mobile phone transmits the playing content to the TV set through the first session. It should be emphasized that, for the above-mentioned first device and second device, each device has an ASP (Application Service Platform, application service platform) and a service module inside, and these modules are logical entities inside the device. software to implement logic functions. Within a device, ASP and service modules can communicate through internal processing. Between devices, the ASP of one device and the ASP of other devices can communicate through other modules of the system and hardware such as antennas.
请参阅图1,本发明实施例中业务处理方法一个实施例包括:Referring to FIG. 1, an embodiment of a service processing method in an embodiment of the present invention includes:
101、当第一设备通过第二网络与第二设备连接时,第一设备向第二设备发送请求消息;101. When the first device is connected to the second device through the second network, the first device sends a request message to the second device;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business.
102、第一设备接收第二设备根据请求消息回应的响应消息;102. The first device receives a response message responded by the second device according to the request message;
在第一设备向第二设备发送请求消息后,第二设备根据接收到的请求消息进行响应,并向第一设备回应响应消息。在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。After the first device sends the request message to the second device, the second device responds according to the received request message, and responds with a response message to the first device. In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device.
103、第一设备根据响应消息与第二设备建立第二会话;103. The first device establishes a second session with the second device according to the response message;
在第一设备收到第二设备回应的响应消息后,第一设备与第二设备利用基于第二网络的一套地址建立该第二会话,即第一设备和第二设备建立基于第二网络且对应于第一会话所对应的业务的第二会话。After the first device receives the response message responded by the second device, the first device and the second device establish the second session by using a set of addresses based on the second network, that is, the first device and the second device establish a set of addresses based on the second network. and corresponding to the second session of the service corresponding to the first session.
在该第二会话建立后,第一设备与第二设备可以通过该第二会话进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输,但在会话没有从第一会话切换到第二会话前,第一会话所对应的业务所使用的会话保持为第一会话,第二会话可以作为针对该第一会话所对应的业务的备用会话。After the second session is established, the first device and the second device may connect and transmit data through the second session, so as to implement service transmission between the first device and the second device for the service corresponding to the first session, However, before the session is switched from the first session to the second session, the session used by the service corresponding to the first session remains the first session, and the second session can be used as a backup session for the service corresponding to the first session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一设备在向第二设备发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备回应的响应消息后,与第二设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。因此相对于现有技术,本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the first device includes the first cooperation information in the request message sent to the second device, and the first cooperation information is used It indicates that the second session and the first session correspond to the same service, and after receiving the response message from the second device, the second session is established with the second device, so that the first device and the second device can establish a The second network corresponds to the second session of the service corresponding to the first session. Therefore, compared with the prior art, in the embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the second session between devices can be The service corresponding to a session can continue to run in the second network, so as to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
可以理解的是,上述第二会话的建立过程可以基于不同的信令流程,下面对基于第一种信令流程建立第二会话的具体实现方式进行详细说明,请参阅图2,本发明实施例中业务处理方法另一实施例包括:It can be understood that the establishment process of the second session can be based on different signaling processes. The specific implementation of establishing the second session based on the first signaling process is described in detail below. Please refer to FIG. 2 , the implementation of the present invention. Another embodiment of the service processing method in the example includes:
201、当第一设备通过第二网络与第二设备连接时,第一设备的ASP向第二设备的ASP发送确认版本请求消息;201. When the first device is connected to the second device through the second network, the ASP of the first device sends a confirmation version request message to the ASP of the second device;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
在本实施例中,确认版本请求消息包含第一设备的ASP的版本信息,该确认版本请求消息用于向第二设备的ASP确认该第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是否匹配。需要说明的是,在本实施例中,第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配时的情况可以是两者所支持的协议版本一致,也可以是第二设备的ASP在向下兼容机制下其所支持的高协议版本可以匹配第二设备的ASP所支持的低协议版本。在实际应用过程中,第一设备的ASP的版本信息具体可以为ASP定义的合作协议(Coordination protocol)的版本信息。202、第一设备的ASP接收第二设备的ASP根据确认版本请求消息回应的确认版本反馈消息;In this embodiment, the confirm version request message includes version information of the ASP of the first device, and the confirm version request message is used to confirm to the ASP of the second device the protocol version supported by the ASP of the first device and the version of the protocol supported by the ASP of the second device. Whether the protocol versions supported by ASP match. It should be noted that, in this embodiment, when the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device, the protocol versions supported by the two may be the same, or The high protocol version supported by the ASP of the second device may match the low protocol version supported by the ASP of the second device under the backward compatibility mechanism. In an actual application process, the version information of the ASP of the first device may specifically be the version information of a cooperation protocol (Coordination protocol) defined by the ASP. 202. The ASP of the first device receives an acknowledgment version feedback message that the ASP of the second device responds to according to the acknowledgment version request message;
在第一设备的ASP向第二设备的ASP发送确认版本请求消息后,第二设备的ASP对该第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是否匹配进行确认,并在第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配时,向第一设备的ASP回应确认版本反馈消息,该确认版本反馈消息包含第二设备的ASP的版本信息。相应地,在实际应用过程中,第二设备的ASP的版本信息具体可以为ASP定义的合作协议(Coordination protocol)的版本信息,且当第一设备的ASP的版本信息与第二设备的ASP的版本信息相同时,则确认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的。After the ASP of the first device sends a confirmation version request message to the ASP of the second device, the ASP of the second device determines whether the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device. Confirm, and when the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device, respond to the ASP of the first device with a confirmation version feedback message, where the confirmation version feedback message contains the second device's ASP. ASP version information. Correspondingly, in the actual application process, the version information of the ASP of the second device may specifically be the version information of the cooperation protocol (Coordination protocol) defined by the ASP, and when the version information of the ASP of the first device is the same as the version information of the ASP of the second device. When the version information is the same, it is confirmed that the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device.
在本实施例中,步骤201和步骤202用于对第一设备的ASP和第二设备的ASP进行版本确认,以保证第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配。可以理解的是,在某些特定的其他应用场景,也可不对第一设备的ASP和第二设备的ASP进行版本确认,例如,默认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的;而且,本实施例仅以举例的方式对如何进行版本确认进行描述,在实际应用过程中,第一设备的ASP和第二设备的ASP还可以采用其他方式进行版本确认,此处对是否进行版本确认以及如何进行版本确认不作限定。In this embodiment, step 201 and step 202 are used to confirm the version of the ASP of the first device and the ASP of the second device, so as to ensure that the protocol version supported by the ASP of the first device is the same as that supported by the ASP of the second device. The protocol version matches. It can be understood that, in some specific other application scenarios, the version confirmation of the ASP of the first device and the ASP of the second device may not be performed. The protocol versions supported by the ASP are matched; moreover, this embodiment only describes how to perform version confirmation by way of example, and in the actual application process, the ASP of the first device and the ASP of the second device may also adopt other methods Perform version confirmation, here is no limitation on whether to perform version confirmation and how to perform version confirmation.
203、第一设备的ASP向第二设备的ASP发送请求消息;203. The ASP of the first device sends a request message to the ASP of the second device;
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。在本实施例中,第一协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第一协作信息具体参数形式不作限定,只要满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。可以理解的是,第一协作信息还可以同时包含多个满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务的参数,具体此处不作限定。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business. In this embodiment, the first cooperation information may include address information of the first device in the first network (specifically may be the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. The specific parameter form of the first cooperation information is not limited here, as long as the ASP of the second device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It can be understood that the first cooperation information may also include a plurality of parameters satisfying the requirements for enabling the ASP of the second device to identify that the second session to be established corresponds to the service corresponding to the first session, which is not specifically limited here.
可以理解的是,本实施例中的第一协作信息除了包含上述内容之外,还可以进一步包括其他的参数,例如,第一设备在第二网络中的地址信息、第二会话的标识信息或第一会话所对应的业务的业务标识等,具体此处不作限定。在本实施例中,请求消息可以为REQUEST_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不做限定。It can be understood that, in addition to the above content, the first cooperation information in this embodiment may further include other parameters, for example, address information of the first device in the second network, identification information of the second session or The service identifier of the service corresponding to the first session, etc., is not specifically limited here. In this embodiment, the request message may be a REQUEST_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
204、第一设备的ASP接收第二设备的ASP根据请求消息回应的响应消息响应消息;204. The ASP of the first device receives a response message response message responded by the ASP of the second device according to the request message;
在第一设备的ASP向第二设备的ASP发送请求消息后,第二设备的ASP根据接收到的请求消息进行响应,并向第一设备的ASP回应响应消息。在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。需要说明的是,第二设备接受与第一设备建立该第二会话表明第二设备可以根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第一设备。在本实施例中,响应消息可以为ADDED_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。After the ASP of the first device sends the request message to the ASP of the second device, the ASP of the second device responds according to the received request message, and sends a response message to the ASP of the first device. In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device. It should be noted that the acceptance by the second device to establish the second session with the first device indicates that the second device can open a corresponding port according to the service corresponding to the first session, and notify the first device through a message such as ALLOWED_PORT. In this embodiment, the response message may be an ADDED_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
205、第一设备的ASP根据响应消息与第二设备的ASP建立第二会话;205. The ASP of the first device establishes a second session with the ASP of the second device according to the response message;
在第一设备的ASP收到第二设备的ASP回应的响应消息后,第一设备的ASP与第二设备的ASP利用基于第二网络的一套地址建立该第二会话,即第一设备的ASP和第二设备的ASP建立有基于第二网络且对应于第一会话所对应的业务的第二会话。建立第二会话的具体过程可以包括第一设备根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第二设备;同时也可以包括第一设备接收第二设备根据该第一会话所对应的业务打开相应的端口后发送的ALLOWED_PORT消息。该ALLOWED_PORT消息的具体结构可以参考现有相关标准以及后续相关标准中的规定,在本实施例中不做赘述。After the ASP of the first device receives the response message responded by the ASP of the second device, the ASP of the first device and the ASP of the second device establish the second session by using a set of addresses based on the second network, that is, the ASP of the first device The ASP and the ASP of the second device establish a second session based on the second network and corresponding to the service corresponding to the first session. The specific process of establishing the second session may include that the first device opens a corresponding port according to the service corresponding to the first session, and notifies the second device through a message such as ALLOWED_PORT; at the same time, it may also include that the first device receives the second device according to the first session. The ALLOWED_PORT message sent after the service corresponding to a session opens the corresponding port. For the specific structure of the ALLOWED_PORT message, reference may be made to the existing relevant standards and the regulations in subsequent relevant standards, which will not be repeated in this embodiment.
206、第一设备的ASP向第一设备的服务模块发送第一报告消息;206. The ASP of the first device sends a first report message to the service module of the first device;
在本实施例中,该第一报告消息用于指示第一设备与第二设备之间已经建立有该第二会话。可以理解的是,第二设备的ASP也对应向第二设备的服务模块发送一个用于指示第一设备与第二设备之间已经建立有该第二会话的报告消息。在第一设备的服务模块收到该第一报告消息后,第一设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。In this embodiment, the first report message is used to indicate that the second session has been established between the first device and the second device. It can be understood that the ASP of the second device also sends a report message to the service module of the second device to indicate that the second session has been established between the first device and the second device. After the service module of the first device receives the first report message, the service module of the first device can identify that there is the second session that can be used for backup, and communicate with the service module of the second device through the second session as required. Connect and transmit data to implement service transmission between the first device and the second device for the service corresponding to the first session.
可以理解的是,在本实施例中,发送第一报告消息的执行时机可以是在步骤205后立即执行,也可以是在确定满足预设的第一切换条件后才执行,此处不作限定,只需保证在执行会话切换时已经完成后处理操作即可。It can be understood that, in this embodiment, the execution timing of sending the first report message may be executed immediately after step 205, or may be executed after it is determined that the preset first switching condition is satisfied, which is not limited here. Just make sure that the postprocessing is done when you perform the session switch.
可选地,在步骤206之后,本实施例还可进一步包括:Optionally, after step 206, this embodiment may further include:
207、当满足预设的第一切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话;207. When the preset first switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the first session to the second session;
在发送第一报告消息后,第一会话所对应的业务所使用的会话保持为第一会话,第二会话作为针对该第一会话所对应的业务的备用会话。当满足预设的第一切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。可以理解的是,在具体应用过程中,可以先不执行步骤206,而是:当满足预设的第一切换条件时,执行步骤206,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。After the first report message is sent, the session used by the service corresponding to the first session remains the first session, and the second session serves as a backup session for the service corresponding to the first session. When the preset first switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the first session to the second session, so that the service corresponding to the first session is based on the first session. Two sessions carry out service transmission. It can be understood that, in the specific application process, step 206 may not be performed first, but: when the preset first switching condition is satisfied, step 206 is performed, and the service module of the first device will send the service corresponding to the first session. The used session is switched from the first session to the second session, so that the service corresponding to the first session is transmitted according to the second session.
在本实施例中,上述预设的第一切换条件可以包括第一网络的信号质量不满足预设要求或第二网络的信号质量优于第一网络的信号质量,可以理解的是,在实际应用中,预设的第一切换条件还可以包括多种方式,例如第一设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset first switching condition may include that the signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network. In application, the preset first switching condition may also include various manners, for example, the first device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
208、当满足预设的第二切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话;208. When the preset second switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the second session to the first session;
在第一设备将第一会话所对应的业务所使用的会话由第一会话切换至第二会话之后,当满足预设的第二切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话,以使第一会话所对应的业务根据第一会话进行业务传输。After the first device switches the session used by the service corresponding to the first session from the first session to the second session, when the preset second switching condition is satisfied, the service module of the first device switches the session corresponding to the first session to the second session. The session used by the service of the first session is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the first session.
在本实施例中,上述预设的第二切换条件可以包括第二网络的信号质量不满足预设要求或第一网络的信号质量优于第二网络的信号质量,可以理解的是,在实际应用中,预设的第二切换条件还可以包括多种方式,例如第一设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset second switching condition may include that the signal quality of the second network does not meet the preset requirements or the signal quality of the first network is better than the signal quality of the second network. It can be understood that in practice, In application, the preset second switching condition may also include various manners, for example, the first device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一设备的ASP在向第二设备的ASP发送的请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在收到第二设备的ASP回应的响应消息后,与第二网络的ASP设备建立该第二会话,使得第一设备的ASP与第二设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,第一设备的服务模块在接收第一设备的ASP发送的第一报告消息后便可根据需要通过第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。因此相对于现有技术,本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the ASP of the first device includes the first cooperation information in the request message sent to the ASP of the second device, and the A collaboration information is used to indicate that the second session and the first session correspond to the same service, and after receiving the response message responded by the ASP of the second device, the second session is established with the ASP device of the second network, so that the first device A second session based on the second network and corresponding to the service corresponding to the first session is established between the ASP of the second device and the ASP of the second device. After the service module of the first device receives the first report message sent by the ASP of the first device It is possible to connect and transmit data with the service module of the second device through the second session as required, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session. Therefore, compared with the prior art, in the embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the second session between devices can be The service corresponding to a session can continue to run in the second network, so as to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
下面对基于第二种信令流程建立第二会话的具体实现方式进行详细说明,请参阅图3,本发明实施例中业务处理方法另一实施例包括:A specific implementation manner of establishing a second session based on the second signaling process is described in detail below. Referring to FIG. 3, another embodiment of the service processing method in the embodiment of the present invention includes:
301、当第一设备通过第二网络与第二设备连接时,第一设备执行预处理操作;301. When the first device is connected to the second device through the second network, the first device performs a preprocessing operation;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
在本实施例中,预处理操作为:第一设备的ASP向第一设备的服务模块发送第二报告消息,该第二报告消息用于向第一设备的服务模块上报第一设备可以与第二设备建立基于第二网络的第二会话,该第二报告消息包含该第二协作信息;第一设备的ASP接收第一设备的服务模块根据第二报告消息发送的第一指示消息,第一指示消息用于指示第一设备与第二设备建立第二会话。In this embodiment, the preprocessing operation is: the ASP of the first device sends a second report message to the service module of the first device, where the second report message is used to report to the service module of the first device that the first device can communicate with the first device The second device establishes a second session based on the second network, and the second report message contains the second cooperation information; the ASP of the first device receives the first indication message sent by the service module of the first device according to the second report message, and the first The instruction message is used to instruct the first device to establish a second session with the second device.
在本实施例中,该第二协作信息用于表示该第二会话和该第一会话对应于同一业务,第二协作信息包括第二设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第二标识信息中的一个或多个,其中,第二标识信息可以为根据第二设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第二协作信息具体参数形式不作限定,只要满足能让第一设备的服务模块识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。需要说明的是,在第一设备的ASP检测到该第二网络时,第一设备的ASP可以获取第二设备在第一网络中的地址信息,具体获取方式为现有技术,此处不再赘述。In this embodiment, the second cooperation information is used to indicate that the second session and the first session correspond to the same service, and the second cooperation information includes address information of the second device in the first network (specifically, the first one or more of the IP address or MAC address of the device in the first network), the session identifier (session_id) of the first session, and second identification information, where the second identification information The information obtained by calculating the address information in the network and/or the session identifier of the first session may also be identification information generated by the first device according to preset rules, such as a number randomly generated by the first device, or the first device. The device name of the device, etc. The specific parameter form of the second collaboration information is not limited here, as long as the service module of the first device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It should be noted that when the ASP of the first device detects the second network, the ASP of the first device can obtain the address information of the second device in the first network, and the specific obtaining method is the prior art, which is not repeated here. Repeat.
在实际应用中,该第二报告消息可以为SearchResult消息,该第一指示消息可以为ConnectSessions。In practical applications, the second report message may be a SearchResult message, and the first indication message may be ConnectSessions.
302、第一设备的ASP向第二设备的ASP发送确认版本请求消息。302. The ASP of the first device sends a confirmation version request message to the ASP of the second device.
303、第一设备的ASP接收第二设备的ASP根据确认版本请求消息回应的确认版本反馈消息;303. The ASP of the first device receives the confirmation version feedback message responded by the ASP of the second device according to the confirmation version request message;
在本实施例中,步骤302和步骤303用于对第一设备的ASP和第二设备的ASP进行版本确认,其具体过程与图2所示的步骤201和步骤202过程相同,在此不再赘述。可以理解的是,在某些特定的其他应用场景,也可不对第一设备的ASP和第二设备的ASP进行版本确认,例如,默认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的;而且,本实施例仅以举例的方式对如何进行版本确认进行描述,在实际应用过程中,第一设备的ASP和第二设备的ASP还可以采用其他方式进行版本确认,此处对是否进行版本确认以及如何进行版本确认不作限定。In this embodiment, steps 302 and 303 are used to confirm the version of the ASP of the first device and the ASP of the second device, and the specific process is the same as the process of steps 201 and 202 shown in FIG. 2 , which is not repeated here. Repeat. It can be understood that, in some specific other application scenarios, the version confirmation of the ASP of the first device and the ASP of the second device may not be performed. The protocol versions supported by the ASP are matched; moreover, this embodiment only describes how to perform version confirmation by way of example, and in the actual application process, the ASP of the first device and the ASP of the second device may also adopt other methods Perform version confirmation, here is no limitation on whether to perform version confirmation and how to perform version confirmation.
304、第一设备的ASP向第二设备的ASP发送请求消息;304. The ASP of the first device sends a request message to the ASP of the second device;
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。在本实施例中,第一协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第一协作信息具体参数形式不作限定,只要满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。可以理解的是,第一协作信息还可以同时包含多个满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务的参数,具体此处不作限定。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business. In this embodiment, the first cooperation information may include address information of the first device in the first network (specifically may be the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. The specific parameter form of the first cooperation information is not limited here, as long as the ASP of the second device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It can be understood that the first cooperation information may also include a plurality of parameters satisfying the requirements for enabling the ASP of the second device to identify that the second session to be established corresponds to the service corresponding to the first session, which is not specifically limited here.
可以理解的是,本实施例中的第一协作信息除了包含上述内容之外,还可以进一步包括其他的参数,例如,第一设备在第二网络中的地址信息、第二会话的标识信息或第一会话所对应的业务的业务标识等,具体此处不作限定。在本实施例中,请求消息可以为REQUEST_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不做限定。It can be understood that, in addition to the above content, the first cooperation information in this embodiment may further include other parameters, for example, address information of the first device in the second network, identification information of the second session or The service identifier of the service corresponding to the first session, etc., is not specifically limited here. In this embodiment, the request message may be a REQUEST_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
305、第一设备的ASP接收第二设备的ASP根据请求消息在第二设备进行前处理操作后回应的响应消息;305. The ASP of the first device receives a response message that the ASP of the second device responds according to the request message after the second device performs a preprocessing operation;
在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。需要说明的是,第二设备接受与第一设备建立该第二会话表明第二设备可以根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第一设备。In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device. It should be noted that the acceptance by the second device to establish the second session with the first device indicates that the second device can open a corresponding port according to the service corresponding to the first session, and notify the first device through a message such as ALLOWED_PORT.
需要说明的是,在本实施例中,前处理操作具体为:第二设备的ASP根据请求消息向第二设备的服务模块发送第三报告消息,第三报告消息用于向第二设备的服务模块请示是否接受与第一设备建立第二会话,第三报告消息包含第三协作信息,第三协作信息用于表示第二会话和第一会话对应于同一业务;第二设备的ASP接收第二设备的服务模块根据第三报告消息发送的第二指示消息,第二指示消息用于指示第二设备的ASP向第一设备的ASP回应响应消息。It should be noted that, in this embodiment, the preprocessing operation is specifically: the ASP of the second device sends a third report message to the service module of the second device according to the request message, and the third report message is used to provide the service to the second device. The module asks whether to accept the establishment of the second session with the first device, the third report message contains third cooperation information, and the third cooperation information is used to indicate that the second session and the first session correspond to the same service; the ASP of the second device receives the second session. The service module of the device sends a second indication message according to the third report message, where the second indication message is used to instruct the ASP of the second device to respond with a response message to the ASP of the first device.
可以理解的是,上述第三协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。在实际应用中,第三协作信息可以是请求消息里包含的第一协作信息。It can be understood that the above-mentioned third cooperation information may include address information of the first device in the first network (specifically, the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. In practical applications, the third cooperation information may be the first cooperation information contained in the request message.
在实际应用中,该第三报告消息可以为SessionRequest消息,该第二指示消息可以为ConfirmSession消息,该响应消息可以为ADDED_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。In practical applications, the third report message may be a SessionRequest message, the second indication message may be a ConfirmSession message, and the response message may be an ADDED_SESSION message, or a message with other names with the same function, which is not limited here. .
306、第一设备的ASP根据响应消息与第二设备的ASP建立第二会话;306. The ASP of the first device establishes a second session with the ASP of the second device according to the response message;
在第一设备的ASP通过第二设备的ASP收到第二设备的服务模块回应的响应消息后,第一设备的ASP与第二设备的ASP利用基于第二网络的一套地址建立该第二会话,即第一设备的ASP和第二设备的ASP建立有基于第二网络且对应于第一会话所对应的业务的第二会话。建立第二会话的具体过程可以包括第一设备根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第二设备;同时也可以包括第一设备接收第二设备根据该第一会话所对应的业务打开相应的端口后发送的ALLOWED_PORT消息。该ALLOWED_PORT消息的具体结构请见现有技术,在本实施例中不做赘述。After the ASP of the first device receives the response message from the service module of the second device through the ASP of the second device, the ASP of the first device and the ASP of the second device use a set of addresses based on the second network to establish the second device. The session, that is, the ASP of the first device and the ASP of the second device establishes a second session based on the second network and corresponding to the service corresponding to the first session. The specific process of establishing the second session may include that the first device opens a corresponding port according to the service corresponding to the first session, and notifies the second device through a message such as ALLOWED_PORT; at the same time, it may also include that the first device receives the second device according to the first session. The ALLOWED_PORT message sent after the service corresponding to a session opens the corresponding port. For the specific structure of the ALLOWED_PORT message, please refer to the prior art, which will not be repeated in this embodiment.
需要说明的是,在本实施例中,由于步骤301的预处理操作中,第一设备的ASP向第一设备的服务模块发送过第二报告消息(用于向第一设备的服务模块上报第一设备可以与第二设备建立基于第二网络的第二会话),且步骤305的前处理操作中第二设备的ASP向第二设备的服务模块发送过第三报告消息(用于向第二设备的服务模块请示是否接受与第一设备建立第二会话),因此,第一设备的ASP与第二设备的ASP建立该第二会话后,第一设备的ASP无需再向第一设备的服务模块发送用于指示第一设备与第二设备之间已经建立有该第二会话的报告消息,在本应用场景中,该第二会话一建立,第一设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。It should be noted that, in this embodiment, in the preprocessing operation of step 301, the ASP of the first device has sent a second report message (used to report the first report message to the service module of the first device) to the service module of the first device. A device can establish a second session based on the second network with the second device), and in the pre-processing operation of step 305, the ASP of the second device has sent a third report message (used to send a third report message to the service module of the second device) The service module of the device asks whether to accept the establishment of the second session with the first device). Therefore, after the ASP of the first device establishes the second session with the ASP of the second device, the ASP of the first device does not need to provide services to the first device. The module sends a report message indicating that the second session has been established between the first device and the second device. In this application scenario, as soon as the second session is established, the service module of the first device can recognize that there is a backup the second session, and connect and transmit data with the service module of the second device through the second session as required, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session.
可选地,在步骤306之后,本实施例还可进一步包括:Optionally, after step 306, this embodiment may further include:
307、当满足预设的第一切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话;307. When the preset first switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the first session to the second session;
在第一设备的ASP与第二设备的ASP建立该第二会话后,第一会话所对应的业务所使用的会话保持为第一会话,第二会话作为针对该第一会话所对应的业务的备用会话。当满足预设的第一切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。After the ASP of the first device and the ASP of the second device establish the second session, the session used by the service corresponding to the first session remains the first session, and the second session is used as the session for the service corresponding to the first session. Alternate session. When the preset first switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the first session to the second session, so that the service corresponding to the first session is based on the first session. Two sessions carry out service transmission.
在本实施例中,上述预设的第一切换条件可以包括第一网络的信号质量不满足预设要求或第二网络的信号质量优于第一网络的信号质量,可以理解的是,在实际应用中,预设的第一切换条件还可以包括多种方式,例如第二设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset first switching condition may include that the signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network. In application, the preset first switching condition may also include various manners, for example, the second device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
308、当满足预设的第二切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话;308. When the preset second switching condition is met, the service module of the first device switches the session used by the service corresponding to the first session from the second session to the first session;
在第一设备将第一会话所对应的业务所使用的会话由第一会话切换至第二会话之后,当满足预设的第二切换条件时,第一设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话,以使第一会话所对应的业务根据第一会话进行业务传输。After the first device switches the session used by the service corresponding to the first session from the first session to the second session, when the preset second switching condition is satisfied, the service module of the first device switches the session corresponding to the first session to the second session. The session used by the service of the first session is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the first session.
在本实施例中,上述预设的第二切换条件可以包括第二网络的信号质量不满足预设要求或第一网络的信号质量优于第二网络的信号质量,可以理解的是,在实际应用中,预设的第二切换条件还可以包括多种方式,例如第一设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset second switching condition may include that the signal quality of the second network does not meet the preset requirements or the signal quality of the first network is better than the signal quality of the second network. It can be understood that in practice, In application, the preset second switching condition may also include various manners, for example, the first device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一设备的ASP先通过执行预处理操作向第一设备的服务模块上报第一设备可以与第二设备建立基于第二网络的第二会话,并在获得第一设备的服务模块的指示后才开始发送请求消息,且向第二设备的ASP发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备的ASP在第二设备进行前处理操作后回应的响应消息后,与第二网络的ASP设备建立该第二会话,使得第一设备的ASP与第二设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,且该第二会话一建立,第一设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the ASP of the first device first reports to the service module of the first device by performing a preprocessing operation that the first device can communicate with the second device. The second device establishes a second session based on the second network, and starts to send the request message after obtaining the instruction of the service module of the first device, and the request message sent to the ASP of the second device includes the first collaboration information, the first A collaboration information is used to indicate that the second session and the first session correspond to the same service, and after receiving a response message from the ASP of the second device after the second device performs the preprocessing operation, the ASP of the second network will communicate with The device establishes the second session, so that a second session based on the second network and corresponding to the service corresponding to the first session is established between the ASP of the first device and the ASP of the second device, and once the second session is established, the second session is established. The service module of a device can identify the existence of the second session that can be used for backup, and connect and transmit data through the second session with the service module of the second device as needed, so as to realize the service corresponding to the first session in the first session. Traffic transmission between the device and the second device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
图1至图3所示的实施例是从第一设备的角度来描述的,下面从第二设备的角度对本发明实施例进行详细说明,具体请参阅图4,本发明实施例中业务处理方法另一实施例包括:The embodiments shown in FIG. 1 to FIG. 3 are described from the perspective of the first device. The following describes the embodiment of the present invention in detail from the perspective of the second device. For details, please refer to FIG. 4 , the service processing method in the embodiment of the present invention. Another embodiment includes:
401、当第一设备通过第二网络与第二设备连接时,第二设备接收第一设备发送的请求消息;401. When the first device is connected to the second device through the second network, the second device receives a request message sent by the first device;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business.
402、第二设备根据请求消息向第一设备回应响应消息;402. The second device responds with a response message to the first device according to the request message;
即第二设备根据接收到的请求消息进行响应,并向第一设备回应响应消息。在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。That is, the second device responds according to the received request message, and responds with a response message to the first device. In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device.
403、第二设备与第一设备建立第二会话;403. The second device establishes a second session with the first device;
在第一设备收到第二设备回应的响应消息后,第二设备利用基于第二网络的一套地址与第二设备建立该第二会话,即第一设备和第二设备建立有基于第二网络且对应于第一会话所对应的业务的第二会话。After the first device receives the response message responded by the second device, the second device establishes the second session with the second device by using a set of addresses based on the second network, that is, the first device and the second device establish an address based on the second network. network and corresponds to the second session of the service corresponding to the first session.
在该第二会话建立后,第一设备与第二设备可以通过该第二会话进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输,但在没有切换前,第一会话所对应的业务所使用的会话保持为第一会话,第二会话作为针对该第一会话所对应的业务的备用会话。After the second session is established, the first device and the second device may connect and transmit data through the second session, so as to implement service transmission between the first device and the second device for the service corresponding to the first session, However, before switching, the session used by the service corresponding to the first session remains the first session, and the second session serves as a backup session for the service corresponding to the first session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第二设备接收第一设备发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在向第一设备回应响应消息后,与第一设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。因此相对于现有技术,本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the second device receives a request message sent by the first device, where the request message includes first cooperation information, the first The collaboration information is used to indicate that the second session and the first session correspond to the same service, and after a response message is sent to the first device, the second session is established with the first device, so that the first device and the second device are established. A second session based on the second network and corresponding to the service corresponding to the first session. Therefore, compared with the prior art, in the embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the second session between devices can be The service corresponding to a session can continue to run in the second network, so as to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
下面针对基于第一种信令流程建立第二会话的具体实现方式,从第二设备的角度对本发明实施例进行详细说明,具体请参阅图5,本发明实施例中业务处理方法另一实施例包括:In the following, the specific implementation of establishing the second session based on the first signaling process will be described in detail from the perspective of the second device. For details, please refer to FIG. 5 , which is another embodiment of the service processing method in the embodiment of the present invention. include:
501、当第一设备通过第二网络与第二设备连接时,第二设备的ASP接收第一设备的ASP发送的确认版本请求消息;501. When the first device is connected to the second device through the second network, the ASP of the second device receives a version confirmation request message sent by the ASP of the first device;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
在本实施例中,确认版本请求消息包含第一设备的ASP的版本信息,该确认版本请求消息用于向第二设备的ASP确认该第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是否匹配。需要说明的是,在本实施例中,第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配时的情况可以是两者所支持的协议版本一致,也可以是第二设备的ASP在向下兼容机制下其所支持的高协议版本可以匹配第二设备的ASP所支持的低协议版本。在实际应用过程中,第一设备的ASP的版本信息具体可以为ASP定义的合作协议(Coordination protocol)的版本信息。In this embodiment, the confirm version request message includes version information of the ASP of the first device, and the confirm version request message is used to confirm to the ASP of the second device the protocol version supported by the ASP of the first device and the version of the protocol supported by the ASP of the second device. Whether the protocol versions supported by ASP match. It should be noted that, in this embodiment, when the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device, the protocol versions supported by the two may be the same, or The high protocol version supported by the ASP of the second device may match the low protocol version supported by the ASP of the second device under the backward compatibility mechanism. In an actual application process, the version information of the ASP of the first device may specifically be the version information of a cooperation protocol (Coordination protocol) defined by the ASP.
502、第二设备的ASP根据确认版本请求消息向第一设备的ASP回应确认版本反馈消息;502. The ASP of the second device responds with a confirmation version feedback message to the ASP of the first device according to the confirmation version request message;
在第二设备的ASP接收第一设备的ASP发送的确认版本请求消息后,第二设备的ASP对该第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是否匹配进行确认,并在第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配时,向第一设备的ASP回应确认版本反馈消息,该确认版本反馈消息包含第二设备的ASP的版本信息。相应地,在实际应用过程中,第二设备的ASP的版本信息具体可以为ASP定义的合作协议(Coordination protocol)的版本信息,且当第一设备的ASP的版本信息与第二设备的ASP的版本信息相同时,则确认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的。After the ASP of the second device receives the confirmation version request message sent by the ASP of the first device, whether the protocol version supported by the ASP of the second device matches the protocol version supported by the ASP of the second device Confirm, and when the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device, respond to the ASP of the first device with a confirmation version feedback message, the confirmation version feedback message containing the second device ASP version information. Correspondingly, in the actual application process, the version information of the ASP of the second device may specifically be the version information of the cooperation protocol (Coordination protocol) defined by the ASP, and when the version information of the ASP of the first device is the same as the version information of the ASP of the second device. When the version information is the same, it is confirmed that the protocol version supported by the ASP of the first device matches the protocol version supported by the ASP of the second device.
在本实施例中,步骤501和步骤502用于对第一设备的ASP和第二设备的ASP进行版本确认,以保证第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本匹配。可以理解的是,在某些特定的其他应用场景,也可不对第一设备的ASP和第二设备的ASP进行版本确认,例如,默认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的;而且,本实施例仅以举例的方式对如何进行版本确认进行描述,在实际应用过程中,第一设备的ASP和第二设备的ASP还可以采用其他方式进行版本确认,此处对是否进行版本确认以及如何进行版本确认不作限定。In this embodiment, step 501 and step 502 are used to confirm the version of the ASP of the first device and the ASP of the second device, so as to ensure that the protocol version supported by the ASP of the first device is the same as that supported by the ASP of the second device. The protocol version matches. It can be understood that, in some specific other application scenarios, the version confirmation of the ASP of the first device and the ASP of the second device may not be performed. The protocol versions supported by the ASP are matched; moreover, this embodiment only describes how to perform version confirmation by way of example, and in the actual application process, the ASP of the first device and the ASP of the second device may also adopt other methods Perform version confirmation, here is no limitation on whether to perform version confirmation and how to perform version confirmation.
503、第二设备的ASP接收第一设备的ASP发送的请求消息;503. The ASP of the second device receives the request message sent by the ASP of the first device;
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。在本实施例中,第一协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第一协作信息具体参数形式不作限定,只要满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。可以理解的是,第一协作信息还可以同时包含多个满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务的参数,具体此处不作限定。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business. In this embodiment, the first cooperation information may include address information of the first device in the first network (specifically may be the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. The specific parameter form of the first cooperation information is not limited here, as long as the ASP of the second device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It can be understood that the first cooperation information may also include a plurality of parameters satisfying the requirements for enabling the ASP of the second device to identify that the second session to be established corresponds to the service corresponding to the first session, which is not specifically limited here.
可以理解的是,本实施例中的第一协作信息除了包含上述内容之外,还可以进一步包括其他的参数,例如,第一设备在第二网络中的地址信息、第二会话的标识信息或第一会话所对应的业务的业务标识等,具体此处不作限定。在本实施例中,请求消息可以为REQUEST_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。It can be understood that, in addition to the above content, the first cooperation information in this embodiment may further include other parameters, for example, address information of the first device in the second network, identification information of the second session or The service identifier of the service corresponding to the first session, etc., is not specifically limited here. In this embodiment, the request message may be a REQUEST_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
504、第二设备的ASP根据请求消息向第一设备的ASP回应响应消息;504. The ASP of the second device responds with a response message to the ASP of the first device according to the request message;
在第二设备的ASP接收第一设备的ASP发送的请求消息后,第二设备的ASP根据接收到的请求消息进行响应,并向第一设备的ASP回应响应消息。在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。需要说明的是,第二设备接受与第一设备建立该第二会话表明第二设备可以根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第一设备。在本实施例中,响应消息可以为ADDED_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。After the ASP of the second device receives the request message sent by the ASP of the first device, the ASP of the second device responds according to the received request message, and sends a response message to the ASP of the first device. In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device. It should be noted that the acceptance by the second device to establish the second session with the first device indicates that the second device can open a corresponding port according to the service corresponding to the first session, and notify the first device through a message such as ALLOWED_PORT. In this embodiment, the response message may be an ADDED_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
505、第二设备的ASP与第一设备的ASP建立第二会话;505. The ASP of the second device establishes a second session with the ASP of the first device;
在第一设备的ASP收到第二设备的ASP回应的响应消息后,第二设备的ASP与第一设备的ASP利用基于第二网络的一套地址建立该第二会话,即第二设备的ASP和第一设备的ASP建立有基于第二网络且对应于第一会话所对应的业务的第二会话。建立第二会话的具体过程可以包括第一设备根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第二设备;同时也可以包括第一设备接收第二设备根据该第一会话所对应的业务打开相应的端口后发送的ALLOWED_PORT消息。该ALLOWED_PORT消息的具体结构可以参考现有相关标准以及后续相关标准中的规定,在本实施例中不做赘述。After the ASP of the first device receives the response message responded by the ASP of the second device, the ASP of the second device and the ASP of the first device establish the second session by using a set of addresses based on the second network, that is, the ASP of the second device The ASP and the ASP of the first device establish a second session based on the second network and corresponding to the service corresponding to the first session. The specific process of establishing the second session may include that the first device opens a corresponding port according to the service corresponding to the first session, and notifies the second device through a message such as ALLOWED_PORT; at the same time, it may also include that the first device receives the second device according to the first session. The ALLOWED_PORT message sent after the service corresponding to a session opens the corresponding port. For the specific structure of the ALLOWED_PORT message, reference may be made to the existing relevant standards and the regulations in subsequent relevant standards, which will not be repeated in this embodiment.
506、第二设备向第一设备的服务模块发送第一报告消息;506. The second device sends a first report message to the service module of the first device;
在本实施例中,该第一报告消息用于指示第一设备与第二设备之间已经建立有该第二会话。可以理解的是,第一设备的ASP也对应向第一设备的服务模块发送一个用于指示第一设备与第二设备之间已经建立有该第二会话的报告消息。在第二设备的服务模块收到该第一报告消息后,第二设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。In this embodiment, the first report message is used to indicate that the second session has been established between the first device and the second device. It can be understood that the ASP of the first device also sends a report message to the service module of the first device to indicate that the second session has been established between the first device and the second device. After the service module of the second device receives the first report message, the service module of the second device can identify that there is the second session that can be used for backup, and communicate with the service module of the second device through the second session as required. Connect and transmit data to implement service transmission between the first device and the second device for the service corresponding to the first session.
可以理解的是,在本实施例中,发送第一报告消息的执行时机可以是在步骤205后立即执行,也可以是在确定满足预设的第一切换条件后才执行,此处不作限定,只需保证在执行会话切换时已经完成后处理操作即可。It can be understood that, in this embodiment, the execution timing of sending the first report message may be executed immediately after step 205, or may be executed after it is determined that the preset first switching condition is satisfied, which is not limited here. Just make sure that the postprocessing is done when you perform the session switch.
可选地,在步骤506之后,本实施例还可进一步包括:Optionally, after step 506, this embodiment may further include:
507、当满足预设的第一切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话;507. When the preset first switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the first session to the second session;
在发送第一报告消息后,第一会话所对应的业务所使用的会话保持为第一会话,第二会话作为针对该第一会话所对应的业务的备用会话。当满足预设的第一切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。可以理解的是,在具体应用过程中,可以先不执行步骤206,而是:当满足预设的第一切换条件时,执行步骤206,第一设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。After the first report message is sent, the session used by the service corresponding to the first session remains the first session, and the second session serves as a backup session for the service corresponding to the first session. When the preset first switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the first session to the second session, so that the service corresponding to the first session is based on the first session. Two sessions carry out service transmission. It can be understood that, in the specific application process, step 206 may not be performed first, but: when the preset first switching condition is satisfied, step 206 is performed, and the service module of the first device will send the service corresponding to the first session. The used session is switched from the first session to the second session, so that the service corresponding to the first session is transmitted according to the second session.
在本实施例中,上述预设的第一切换条件可以包括第一网络的信号质量不满足预设要求或第二网络的信号质量优于第一网络的信号质量,可以理解的是,在实际应用中,预设的第一切换条件还可以包括多种方式,例如第二设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset first switching condition may include that the signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network. In application, the preset first switching condition may also include various manners, for example, the second device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
508、当满足预设的第二切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话;508. When the preset second switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the second session to the first session;
在第二设备将第一会话所对应的业务所使用的会话由第一会话切换至第二会话之后,当满足预设的第二切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话,以使第一会话所对应的业务根据第一会话进行业务传输。After the second device switches the session used by the service corresponding to the first session from the first session to the second session, when the preset second switching condition is satisfied, the service module of the second device switches the session corresponding to the first session to the second session. The session used by the service of the first session is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the first session.
在本实施例中,上述预设的第二切换条件可以包括第二网络的信号质量不满足预设要求或第一网络的信号质量优于第二网络的信号质量,可以理解的是,在实际应用中,预设的第二切换条件还可以包括多种方式,例如第一设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset second switching condition may include that the signal quality of the second network does not meet the preset requirements or the signal quality of the first network is better than the signal quality of the second network. It can be understood that in practice, In application, the preset second switching condition may also include various manners, for example, the first device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第二设备的ASP接收第一设备的ASP发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在向第一设备的ASP回应响应消息后,与第一设备的ASP建立该第二会话,使得第二设备的ASP与第一设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,第二设备的服务模块在接收第二设备的ASP发送的第一报告消息后便可根据需要通过第二会话与第一设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the ASP of the second device receives a request message sent by the ASP of the first device, where the request message includes the first collaboration information , the first collaboration information is used to indicate that the second session and the first session correspond to the same service, and after sending a response message to the ASP of the first device, establish the second session with the ASP of the first device, so that the second device A second session based on the second network and corresponding to the service corresponding to the first session is established between the ASP of the first device and the ASP of the first device. After the service module of the second device receives the first report message sent by the ASP of the second device It is possible to connect and transmit data with the service module of the first device through the second session as required, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
下面针对基于第二种信令流程建立第二会话的具体实现方式,从第二设备的角度对本发明实施例进行详细说明,具体请参阅图6,本发明实施例中业务处理方法另一实施例包括:The following is a detailed description of an embodiment of the present invention from the perspective of a second device for a specific implementation of establishing a second session based on the second signaling process. For details, please refer to FIG. 6 , another embodiment of the service processing method in the embodiment of the present invention. include:
在本实施例中,当第一设备通过第二网络与第二设备连接时,第一设备执行预处理操作;In this embodiment, when the first device is connected to the second device through the second network, the first device performs a preprocessing operation;
需要说明的是,当第一设备通过第二网络与第二设备连接时的应用场景可以是第一设备与第二设备刚建立基于第二网络的连接的情形,例如第一设备和第二设备使用基于第一网络的第一会话进行业务传输时,发现两者还可以建立基于第二网络的连接,于是两者建立基于第二网络的连接,在上述建立第二网络的连接完成后,可以马上执行第一设备向第二设备发送请求消息;也可以是,在第一设备与第二设备之间早已经建立有基于第二网络的连接的情形,此时可以是在满足预设的触发条件才执行第一设备向第二设备发送请求消息,例如,第一设备与第二设备之间早已经建立有基于第二网络的连接,在第一设备和第二设备使用基于第一网络的第一会话进行业务传输的过程中,发现第一会话的质量不好,于是触发第一设备向第二设备发送请求消息。It should be noted that the application scenario when the first device is connected to the second device through the second network may be the situation where the first device and the second device have just established a connection based on the second network, for example, the first device and the second device When using the first session based on the first network for service transmission, it is found that the two can also establish a connection based on the second network, so the two establish a connection based on the second network. Immediately execute the first device to send the request message to the second device; it may also be that a connection based on the second network has already been established between the first device and the second device, at this time it may be that a preset trigger is satisfied The first device sends a request message to the second device only if the conditions are met. For example, a connection based on the second network has already been established between the first device and the second device. During the service transmission process of the first session, it is found that the quality of the first session is not good, so the first device is triggered to send a request message to the second device.
可以理解的是,在第一设备与该第二设备建立有基于第二网络的连接时,第一设备和该第二设备可以使用一套基于第二网络的地址,即该第一设备的第二地址和该第二设备的第二地址。需要说明的是,在第一网络中,第一设备和第二设备使用基于第一网络的一套地址,在第二网络中,第一设备和第二设备使用基于第二网络的一套地址,且该基于第一网络的一套地址不同于该基于第二网络的一套地址。It can be understood that, when the first device and the second device establish a connection based on the second network, the first device and the second device can use a set of addresses based on the second network, that is, the first device's first address. The second address and the second address of the second device. It should be noted that in the first network, the first device and the second device use a set of addresses based on the first network, and in the second network, the first device and the second device use a set of addresses based on the second network , and the set of addresses based on the first network is different from the set of addresses based on the second network.
在本实施例中,预处理操作为:第一设备的ASP向第一设备的服务模块发送第二报告消息,该第二报告消息用于向第一设备的服务模块上报第一设备可以与第二设备建立基于第二网络的第二会话,该第二报告消息包含第二协作信息;第一设备的ASP接收第一设备的服务模块根据第二报告消息发送的第一指示消息,第一指示消息用于指示第一设备与第二设备建立第二会话。在本实施例中,该第二协作信息用于表示该第二会话和该第一会话对应于同一业务,第二协作信息包括第二设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第二标识信息中的一个或多个,其中,第二标识信息可以为根据第二设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第二协作信息具体参数形式不作限定,只要满足能让第一设备的服务模块识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。需要说明的是,在第一设备的ASP检测到该第二网络时,第一设备的ASP可以获取第二设备在第一网络中的地址信息,具体获取方式为现有技术,此处不再赘述。In this embodiment, the preprocessing operation is: the ASP of the first device sends a second report message to the service module of the first device, where the second report message is used to report to the service module of the first device that the first device can communicate with the first device The two devices establish a second session based on the second network, and the second report message contains the second cooperation information; the ASP of the first device receives the first indication message sent by the service module of the first device according to the second report message, and the first indication The message is used to instruct the first device to establish a second session with the second device. In this embodiment, the second cooperation information is used to indicate that the second session and the first session correspond to the same service, and the second cooperation information includes address information of the second device in the first network (specifically, the first One or more of the IP address or MAC address of the device in the first network), the session identifier (session_id) of the first session, and second identification information, where the second identification information may be based on the second device in the first The information obtained by calculating the address information in the network and/or the session identifier of the first session may also be identification information generated by the first device according to preset rules, such as a number randomly generated by the first device, or the first device. The device name of the device, etc. The specific parameter form of the second collaboration information is not limited here, as long as the service module of the first device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It should be noted that when the ASP of the first device detects the second network, the ASP of the first device can obtain the address information of the second device in the first network, and the specific obtaining method is the prior art, which is not repeated here. Repeat.
在实际应用中,该第二报告消息可以为SearchResult消息,该第一指示消息可以为ConnectSessions。In practical applications, the second report message may be a SearchResult message, and the first indication message may be ConnectSessions.
601、第二设备的ASP接收第一设备的ASP发送的确认版本请求消息。601. The ASP of the second device receives a version confirmation request message sent by the ASP of the first device.
602、第二设备的ASP根据确认版本请求消息向第一设备的ASP回应确认版本反馈消息;602. The ASP of the second device responds with a confirmation version feedback message to the ASP of the first device according to the confirmation version request message;
在本实施例中,步骤601和步骤602用于对第一设备的ASP和第二设备的ASP进行版本确认,其具体过程与图5所示的步骤601和步骤602过程相同,在此不再赘述。可以理解的是,在某些特定的其他应用场景,也可不对第一设备的ASP和第二设备的ASP进行版本确认,例如,默认第一设备的ASP所支持的协议版本与第二设备的ASP所支持的协议版本是匹配的;而且,本实施例仅以举例的方式对如何进行版本确认进行描述,在实际应用过程中,第一设备的ASP和第二设备的ASP还可以采用其他方式进行版本确认,此处对是否进行版本确认以及如何进行版本确认不作限定。In this embodiment, steps 601 and 602 are used to confirm the version of the ASP of the first device and the ASP of the second device, and the specific process is the same as the process of steps 601 and 602 shown in FIG. 5 , which is not repeated here. Repeat. It can be understood that, in some specific other application scenarios, the version confirmation of the ASP of the first device and the ASP of the second device may not be performed. The protocol versions supported by the ASP are matched; moreover, this embodiment only describes how to perform version confirmation by way of example, and in the actual application process, the ASP of the first device and the ASP of the second device may also adopt other methods Perform version confirmation, here is no limitation on whether to perform version confirmation and how to perform version confirmation.
603、第二设备的服务模块接收第一设备的ASP在第一设备进行预处理操作后发送的请求消息;603. The service module of the second device receives a request message sent by the ASP of the first device after the first device performs a preprocessing operation;
需要说明的是,请求消息用于请求建立基于该第二网络的第二会话,且该请求消息包含第一协作信息,该第一协作信息用于表示该第二会话和该第一会话对应于同一业务。在本实施例中,第一协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。此处对第一协作信息具体参数形式不作限定,只要满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务即可,此处不做限定。可以理解的是,第一协作信息还可以同时包含多个满足能让第二设备的ASP识别待建立的该第二会话对应于第一会话所对应的业务的参数,具体此处不作限定。It should be noted that the request message is used to request the establishment of a second session based on the second network, and the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same business. In this embodiment, the first cooperation information may include address information of the first device in the first network (specifically may be the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. The specific parameter form of the first cooperation information is not limited here, as long as the ASP of the second device can identify that the second session to be established corresponds to the service corresponding to the first session, which is not limited here. It can be understood that the first cooperation information may also include a plurality of parameters that satisfy the requirements for enabling the ASP of the second device to identify that the second session to be established corresponds to the service corresponding to the first session, which is not specifically limited here.
可以理解的是,本实施例中的第一协作信息除了包含上述内容之外,还可以进一步包括其他的参数,例如,第一设备在第二网络中的地址信息、第二会话的标识信息或第一会话所对应的业务的业务标识等,具体此处不作限定。在本实施例中,请求消息可以为REQUEST_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。It can be understood that, in addition to the above content, the first cooperation information in this embodiment may further include other parameters, for example, address information of the first device in the second network, identification information of the second session or The service identifier of the service corresponding to the first session, etc., is not specifically limited here. In this embodiment, the request message may be a REQUEST_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
604、第二设备执行前处理操作;604. The second device performs a preprocessing operation;
需要说明的是,在本实施例中,前处理操作具体为:第二设备的ASP根据请求消息向第二设备的服务模块发送第三报告消息,第三报告消息用于向第二设备的服务模块请示是否接受与第一设备建立第二会话,第三报告消息包含第三协作信息,第三协作信息用于表示第二会话和第一会话对应于同一业务;第二设备的ASP接收第二设备的服务模块根据第三报告消息发送的第二指示消息,第二指示消息用于指示第二设备的ASP向第一设备的ASP回应响应消息。It should be noted that, in this embodiment, the preprocessing operation is specifically: the ASP of the second device sends a third report message to the service module of the second device according to the request message, and the third report message is used to provide the service to the second device. The module asks whether to accept the establishment of the second session with the first device, the third report message contains third cooperation information, and the third cooperation information is used to indicate that the second session and the first session correspond to the same service; the ASP of the second device receives the second session. The service module of the device sends a second indication message according to the third report message, where the second indication message is used to instruct the ASP of the second device to respond with a response message to the ASP of the first device.
可以理解的是,上述第三协作信息可以包括第一设备在第一网络中的地址信息(具体可以为第一设备在第一网络中的IP地址或者MAC地址)、第一会话的会话标识(session_id)和第一标识信息中的一个或多个,其中,该第一标识信息可以为根据第一设备在第一网络中的地址信息和/或第一会话的会话标识进行计算后得到的信息,也可以为第一设备按照预设规则生成的一个标识信息,比如第一设备随机产生的一个数,或者第一设备的设备名字等。在实际应用中,第二协作信息可以是请求消息里包含的第一协作信息。It can be understood that the above-mentioned third cooperation information may include address information of the first device in the first network (specifically, the IP address or MAC address of the first device in the first network), the session identifier of the first session ( session_id) and one or more of the first identification information, wherein the first identification information may be information obtained by calculation according to the address information of the first device in the first network and/or the session identification of the first session , or may be identification information generated by the first device according to a preset rule, such as a number randomly generated by the first device, or a device name of the first device, and the like. In practical applications, the second collaboration information may be the first collaboration information included in the request message.
在实际应用中,该第三报告消息可以为SessionRequest消息,该第二指示消息可以为ConfirmSession消息。In practical applications, the third report message may be a SessionRequest message, and the second indication message may be a ConfirmSession message.
605、第二设备的ASP根据请求消息向第一设备的ASP回应响应消息;605. The ASP of the second device responds with a response message to the ASP of the first device according to the request message;
在本实施例中,响应消息用于表示第二设备接受与第一设备建立该第二会话。需要说明的是,第二设备接受与第一设备建立该第二会话表明第二设备可以根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第一设备。在本实施例中,该响应消息可以为ADDED_SESSION消息,也可以是具有相同功能的其他名称的消息,具体此处不作限定。In this embodiment, the response message is used to indicate that the second device accepts the establishment of the second session with the first device. It should be noted that the acceptance by the second device to establish the second session with the first device indicates that the second device can open a corresponding port according to the service corresponding to the first session, and notify the first device through a message such as ALLOWED_PORT. In this embodiment, the response message may be an ADDED_SESSION message, or may be a message with other names having the same function, which is not specifically limited here.
606、第二设备的ASP与第一设备的ASP建立第二会话;606. The ASP of the second device establishes a second session with the ASP of the first device;
在第一设备的ASP收到第二设备的服务模块回应的响应消息后,第二设备的ASP与第一设备的ASP利用基于第二网络的一套地址建立该第二会话,即第二设备的ASP和第一设备的ASP建立有基于第二网络且对应于第一会话所对应的业务的第二会话。建立第二会话的具体过程可以包括第一设备根据该第一会话所对应的业务打开相应的端口,并通过诸如ALLOWED_PORT消息通知第二设备;同时也可以包括第一设备接收第二设备根据该第一会话所对应的业务打开相应的端口后发送的ALLOWED_PORT消息。该ALLOWED_PORT消息的具体结构请见现有技术,在本实施例中不做赘述。After the ASP of the first device receives the response message from the service module of the second device, the ASP of the second device and the ASP of the first device establish the second session by using a set of addresses based on the second network, that is, the second device The ASP of the first device and the ASP of the first device establish a second session based on the second network and corresponding to the service corresponding to the first session. The specific process of establishing the second session may include that the first device opens a corresponding port according to the service corresponding to the first session, and notifies the second device through a message such as ALLOWED_PORT; at the same time, it may also include that the first device receives the second device according to the first session. The ALLOWED_PORT message sent after the service corresponding to a session opens the corresponding port. For the specific structure of the ALLOWED_PORT message, please refer to the prior art, which will not be repeated in this embodiment.
需要说明的是,在本实施例中,由于第一设备执行的预处理操作中,第一设备的ASP向第一设备的服务模块发送过第二报告消息(用于向第一设备的服务模块上报第一设备可以与第二设备建立基于第二网络的第二会话),且步骤604的前处理操作中第二设备的ASP向第二设备的服务模块发送过第三报告消息(用于向第二设备的服务模块请示是否接受与第一设备建立第二会话),因此,第一设备的ASP与第二设备的ASP建立该第二会话后,第二设备的ASP无需再向第二设备的服务模块发送用于指示第一设备与第二设备之间已经建立有该第二会话的报告消息,在本应用场景中,该第二会话一建立,第二设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第一设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。It should be noted that, in this embodiment, in the preprocessing operation performed by the first device, the ASP of the first device has sent the second report message (used to send the second report message to the service module of the first device) to the service module of the first device. It is reported that the first device can establish a second session based on the second network with the second device), and in the preprocessing operation of step 604, the ASP of the second device has sent a third report message (used to send a third report message to the service module of the second device) The service module of the second device asks whether to accept the establishment of the second session with the first device). Therefore, after the ASP of the first device establishes the second session with the ASP of the second device, the ASP of the second device does not need to communicate with the second device. The service module sends a report message indicating that the second session has been established between the first device and the second device. In this application scenario, as soon as the second session is established, the service module of the second device can identify the existence of the second session. The second session can be used as a backup, and as needed, the second session is used to connect and transmit data with the service module of the first device, so as to realize the service corresponding to the first session between the first device and the second device. transmission.
可选地,在步骤606之后,本实施例还可进一步包括:Optionally, after step 606, this embodiment may further include:
607、当满足预设的第一切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话;607. When the preset first switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the first session to the second session;
在第二设备的ASP与第一设备的ASP建立该第二会话后,第一会话所对应的业务所使用的会话保持为第一会话,第二会话作为针对该第一会话所对应的业务的备用会话。当满足预设的第一切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第一会话切换至第二会话,以使第一会话所对应的业务根据第二会话进行业务传输。After the ASP of the second device and the ASP of the first device establish the second session, the session used by the service corresponding to the first session remains the first session, and the second session is used as the session for the service corresponding to the first session. Alternate session. When the preset first switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the first session to the second session, so that the service corresponding to the first session is based on the first session. Two sessions carry out service transmission.
在本实施例中,上述预设的第一切换条件可以包括第一网络的信号质量不满足预设要求或第二网络的信号质量优于第一网络的信号质量,可以理解的是,在实际应用中,预设的第一切换条件还可以包括多种方式,例如第二设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset first switching condition may include that the signal quality of the first network does not meet the preset requirements or the signal quality of the second network is better than the signal quality of the first network. In application, the preset first switching condition may also include various manners, for example, the second device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
608、当满足预设的第二切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话;608. When the preset second switching condition is met, the service module of the second device switches the session used by the service corresponding to the first session from the second session to the first session;
在第二设备将第一会话所对应的业务所使用的会话由第一会话切换至第二会话之后,当满足预设的第二切换条件时,第二设备的服务模块将第一会话所对应的业务所使用的会话由第二会话切换至第一会话,以使第一会话所对应的业务根据第一会话进行业务传输。After the second device switches the session used by the service corresponding to the first session from the first session to the second session, when the preset second switching condition is satisfied, the service module of the second device switches the session corresponding to the first session to the second session. The session used by the service of the first session is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the first session.
在本实施例中,上述预设的第二切换条件可以包括第二网络的信号质量不满足预设要求或第一网络的信号质量优于第二网络的信号质量,可以理解的是,在实际应用中,预设的第二切换条件还可以包括多种方式,例如第一设备接收到网络侧或者用户的触发指令,此处对预设的第一切换条件的具体方式不作限定。In this embodiment, the above-mentioned preset second switching condition may include that the signal quality of the second network does not meet the preset requirements or the signal quality of the first network is better than the signal quality of the second network. It can be understood that in practice, In application, the preset second switching condition may also include various manners, for example, the first device receives a trigger instruction from the network side or the user, and the specific manner of the preset first switching condition is not limited here.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第二设备的ASP接收第一设备的ASP在第一设备进行预处理后发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在第二设备进行前处理操作后向第一设备的ASP回应响应消息,再与第一设备的ASP建立该第二会话,使得第二设备的ASP与第一设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,且该第二会话一建立,第二设备的服务模块便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第一设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the ASP of the second device receives the request message sent by the ASP of the first device after the first device performs preprocessing, the The request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service, and after the second device performs a preprocessing operation, a response message is sent to the ASP of the first device, and then The second session is established with the ASP of the first device, so that a second session based on the second network and corresponding to the service corresponding to the first session is established between the ASP of the second device and the ASP of the first device, and the second session is established between the ASP of the second device and the ASP of the first device. Once the session is established, the service module of the second device can identify the existence of the second session that can be used for backup, and connect and transmit data through the second session with the service module of the first device as required, so as to realize the corresponding first session. The service is transmitted between the first device and the second device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上面对本发明实施例中的业务处理方法进行了描述,下面对本发明实施例中的第一设备进行描述。首先,需要明确的是,在下述的本发明各个实施例中,第一设备和第二设备之间已经建立有基于第一网络的第一会话。可以理解的是,在第一设备与该第二设备已经建立有基于第一网络的连接时,第一设备和该第二设备可以使用一套基于第一网络的地址,即该第一设备的第一地址和该第二设备的第一地址,并利用基于第一网络的一套地址建立该第一会话。在该第一会话建立后,设备与目标设备通过该第一会话进行连接和传输数据,以实现第一会话所对应的业务在设备和目标设备之间的业务传输。The service processing method in the embodiment of the present invention is described above, and the first device in the embodiment of the present invention is described below. First of all, it should be clear that, in the following embodiments of the present invention, a first session based on the first network has been established between the first device and the second device. It can be understood that when the first device and the second device have established a connection based on the first network, the first device and the second device can use a set of addresses based on the first network, that is, the address of the first device. the first address and the first address of the second device, and establish the first session using a set of addresses based on the first network. After the first session is established, the device and the target device connect and transmit data through the first session, so as to implement service transmission between the device and the target device for the service corresponding to the first session.
需要说明的是,第一网络和第二网络可以是两个不同类型的网络,例如,有线网络、WI-FI、蓝牙、NFC和Powerline等,也可以是同类型但具备不同网络结构的网络,例如基于WI-FI的P2P网络和基于WI-FI的基础设施网络,其中,基于Wi-Fi的P2P网络,可以是基于WFA(Wi-Fi Alliance,Wi-Fi联盟)的Wi-Fi Direct协议建立起来的网络,这种情况下,第一设备和第二设备可以直接连接;基于Wi-Fi的基础设施网络,可以是基于IEEE的802.11协议建立起来的网络,这种情况下,第一设备和第二设备都连接到AP(Access Point,接入点),并且可以通过AP实现两者之间的通信。可以理解的是,在实际应用中,第二网络的数量可以是一个或多个,此处不作限定。It should be noted that the first network and the second network may be two different types of networks, such as wired network, WI-FI, Bluetooth, NFC, Powerline, etc., or may be networks of the same type but with different network structures. For example, a WI-FI-based P2P network and a WI-FI-based infrastructure network, wherein the Wi-Fi-based P2P network can be established based on the Wi-Fi Direct protocol of WFA (Wi-Fi Alliance, Wi-Fi Alliance). In this case, the first device and the second device can be directly connected; the Wi-Fi-based infrastructure network can be a network established based on the IEEE 802.11 protocol. In this case, the first device and the second device can be connected directly. Both the second devices are connected to the AP (Access Point, access point), and the communication between the two can be realized through the AP. It can be understood that, in practical applications, the number of second networks may be one or more, which is not limited here.
需要说明的是,在下述的本发明各个实施例中,设备和目标设备可以是具备网络连接功能的设备,例如支持网络连接功能的手机、电视机、服务器、无线路由器、其他各种家用电器或办公设备等。例如,该设备可以是手机,该目标设备可以是电视机,接入点可以是无线路由器,此时,手机跟电视机可以通过无线路由器建立基于Wi-Fi的基础设施网络的连接,并基于该基于Wi-Fi的基础设施网络建立第一会话,以使得手机通过该第一会话把播放内容传输到电视机。It should be noted that, in the following embodiments of the present invention, the device and the target device may be devices with a network connection function, such as a mobile phone, a TV, a server, a wireless router, other various household appliances or Office equipment, etc. For example, the device can be a mobile phone, the target device can be a TV, and the access point can be a wireless router. At this time, the mobile phone and the TV can establish a Wi-Fi-based infrastructure network connection through the wireless router, and based on the wireless router The Wi-Fi-based infrastructure network establishes a first session, so that the mobile phone transmits the playing content to the TV set through the first session.
请参阅图7,本发明实施例中第一设备一个实施例包括:Referring to FIG. 7, an embodiment of the first device in the embodiment of the present invention includes:
发送单元701,用于当所述第一设备还通过第二网络与所述第二设备连接时,向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;A sending unit 701, configured to send a request message to the second device when the first device is also connected to the second device through a second network; the request message is used to request to establish a network based on the second network the second session, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service;
接收单元702,用于接收所述第二设备根据请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;A receiving unit 702, configured to receive a response message responded by the second device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元703,用于根据所述响应消息与所述第二设备建立所述第二会话。The establishing unit 703 is configured to establish the second session with the second device according to the response message.
为便于理解,下面以一具体应用场景为例,对本实施例中的网络控制器的内部运作流程进行描述:For ease of understanding, the following takes a specific application scenario as an example to describe the internal operation process of the network controller in this embodiment:
当所述第一设备还通过第二网络与所述第二设备连接时,发送单元701向所述第二设备发送请求消息,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;接收单元702接收所述第二设备根据请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;建立单元703根据所述响应消息与所述第二设备建立所述第二会话。When the first device is also connected to the second device through the second network, the sending unit 701 sends a request message to the second device, where the request message is used to request the establishment of a second network based on the second network session, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; the receiving unit 702 receives the response from the second device according to the request message The response message is used to indicate that the second device accepts the establishment of the second session with the first device; the establishing unit 703 establishes the second session with the second device according to the response message .
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,发送单元701在向第二设备发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在接收单元702收到第二设备回应的响应消息后,通过建立单元703与第二设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the sending unit 701 includes the first cooperation information in the request message sent to the second device, and the first cooperation information is used It indicates that the second session and the first session correspond to the same service, and after the receiving unit 702 receives the response message responded by the second device, the establishment unit 703 establishes the second session with the second device, so that the first device A second session based on the second network and corresponding to the service corresponding to the first session is established with the second device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
下面对可保证业务在不同网络间的无缝切换的设备的具体结构进行详细说明,请参阅图8,本发明实施例中第一设备另一实施例包括:The specific structure of a device that can ensure seamless handover of services between different networks is described in detail below. Referring to FIG. 8, another embodiment of the first device in the embodiment of the present invention includes:
发送单元801,用于当所述第一设备还通过第二网络与所述第二设备连接时,向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;A sending unit 801, configured to send a request message to the second device when the first device is also connected to the second device through a second network; the request message is used to request to establish a network based on the second network the second session, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service;
接收单元802,用于接收所述第二设备根据请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;A receiving unit 802, configured to receive a response message responded by the second device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元803,用于根据所述响应消息与所述第二设备建立所述第二会话。The establishing unit 803 is configured to establish the second session with the second device according to the response message.
进一步地,本发明实施例中设备还进一步包括:Further, the device in the embodiment of the present invention further includes:
第一切换单元804,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first switching unit 804 is configured to, when a preset first switching condition is satisfied, switch the session used by the service corresponding to the first session from the first session to the second session, so that all The service corresponding to the first session performs service transmission according to the second session.
可选地,本发明实施例中设备还进一步包括:Optionally, the device in this embodiment of the present invention further includes:
第二切换单元805,用于在将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The second switching unit 805 is configured to, after switching the session used by the service corresponding to the first session from the second session to the first session, when a preset second switching condition is satisfied, switch the session used by the service corresponding to the first session to the first session. The session used by the service corresponding to the first session is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,发送单元801在向第二设备发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在接收单元802收到第二设备回应的响应消息后,通过建立单元803与第二设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the sending unit 801 includes the first cooperation information in the request message sent to the second device, and the first cooperation information uses It indicates that the second session and the first session correspond to the same service, and after the receiving unit 802 receives the response message responded by the second device, the establishment unit 803 establishes the second session with the second device, so that the first device A second session based on the second network and corresponding to the service corresponding to the first session is established with the second device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上述第二会话的建立过程可以基于不同的信令流程,下面对可基于第一种信令流程建立第二会话的第一设备进行详细说明,请参阅图9,本发明实施例中第一设备另一实施例包括:The process of establishing the second session may be based on different signaling processes. The following describes in detail the first device that can establish the second session based on the first signaling process. Please refer to FIG. 9 . Another embodiment of the device includes:
所述第一设备与第二设备之间建立有基于第一网络的第一会话,所述第一设备包括第一ASP 901和第一服务模块902;A first session based on a first network is established between the first device and the second device, and the first device includes a first ASP 901 and a first service module 902;
所述第一ASP 901,用于当所述第一设备通过第二网络与所述第二设备连接时,向所述第二设备的ASP发送请求消息,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二设备的ASP根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于根据所述响应消息与所述第二设备的ASP建立所述第二会话;The first ASP 901 is configured to send a request message to the ASP of the second device when the first device is connected to the second device through the second network, where the request message is used to request to establish a the second session of the second network, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; and is also used to receive the The ASP of the second device responds with a response message according to the request message, the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and is used to communicate with the first device according to the response message. the ASP of the second device establishes the second session;
在本实施例中,第一ASP 901,还用于在所述根据所述响应消息与所述第二设备的ASP建立所述第二会话之后,向所述第一服务模块发送第一报告消息,所述第一报告消息用于指示所述第一设备与所述第二设备之间已经建立有所述第二会话;In this embodiment, the first ASP 901 is further configured to send a first report message to the first service module after the second session is established with the ASP of the second device according to the response message , the first report message is used to indicate that the second session has been established between the first device and the second device;
所述第一服务模块902,用于接收所述第一ASP发送的所述第一报告消息。The first service module 902 is configured to receive the first report message sent by the first ASP.
可选地,在本实施例中,所述第一服务模块902,还用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the first service module 902 is further configured to, when a preset first switching condition is met, transfer the session used by the service corresponding to the first session from the A session is switched to the second session, so that the service corresponding to the first session is transmitted according to the second session.
可选地,在本实施例中,所述第一服务模块902,还用于在将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the first service module 902 is further configured to, after switching the session used by the service corresponding to the first session from the second session to the first session , when the preset second switching condition is satisfied, switch the session used by the service corresponding to the first session from the second session to the first session, so that the The service performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一ASP 901在向第二设备的ASP发送的请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在收到第二设备的ASP回应的响应消息后,与第二网络的ASP设备建立该第二会话,使得第一ASP 901与第二设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,第一服务模块902在接收第一ASP901发送的第一报告消息后便可根据需要通过第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。因此相对于现有技术,本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the first ASP 901 includes the first cooperation information in the request message sent to the ASP of the second device, the first The cooperation information is used to indicate that the second session and the first session correspond to the same service, and after receiving the response message responded by the ASP of the second device, the second session is established with the ASP device of the second network, so that the first ASP 901 A second session based on the second network and corresponding to the service corresponding to the first session is established with the ASP of the second device. After receiving the first report message sent by the first ASP 901, the first service module 902 can pass the The second session is connected with the service module of the second device and transmits data, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session. Therefore, compared with the prior art, in the embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the second session between devices can be The service corresponding to a session can continue to run in the second network, so as to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
下面对可基于第二种信令流程建立第二会话的第一设备进行详细说明,请参阅图10,本发明实施例中第一设备另一实施例包括:The following describes in detail the first device that can establish the second session based on the second signaling process. Referring to FIG. 10, another embodiment of the first device in the embodiment of the present invention includes:
第一ASP 1001,用于当所述第一设备通过第二网络与所述第二设备连接时,向所述第二设备的ASP发送请求消息,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二设备的ASP根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于根据所述响应消息与所述第二设备的ASP建立所述第二会话;The first ASP 1001 is configured to send a request message to the ASP of the second device when the first device is connected to the second device through the second network, where the request message is used to request to establish a For a second session of two networks, the request message includes first cooperation information, where the first cooperation information is used to indicate that the second session and the first session correspond to the same service; and the request message is also used to receive the second session. The ASP of the device responds with a response message according to the request message, the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and is used to communicate with the first device according to the response message The ASP of the second device establishes the second session;
在本实施例中,所述第一ASP 1001,还用于在向所述第二设备的ASP发送请求消息之前,向所述第一设备中的第一服务模块1002发送第二报告消息,所述第二报告消息用于向所述第一服务模块1002上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;In this embodiment, the first ASP 1001 is further configured to send a second report message to the first service module 1002 in the first device before sending the request message to the ASP of the second device, so The second report message is used to report to the first service module 1002 that the first device can establish a second session based on the second network with the second device, and the second report message includes a second cooperation information, where the second collaboration information is used to indicate that the second session and the first session correspond to the same service;
所述第一服务模块,用于在接收到所述第一ASP发送的第二报告消息之后,根据所述第二报告消息向所述第一ASP发送第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;The first service module is configured to, after receiving the second report message sent by the first ASP, send a first indication message to the first ASP according to the second report message, where the first indication message for instructing the first device to establish the second session with the second device;
所述第一ASP,还用于接收所述第一服务模块发送的所述第一指示消息;The first ASP is further configured to receive the first indication message sent by the first service module;
所述第一ASP用于接收所述第二设备的ASP根据所述请求消息回应的响应消息,具体为:所述第一ASP用于接收所述第二设备的ASP根据所述请求消息在所述第二设备进行前处理操作后回应的响应消息;所述前处理操作为:所述第二设备的ASP根据所述请求消息向所述第二设备的服务模块发送第三报告消息,所述第三报告消息用于向所述第二设备的服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第二设备的ASP接收所述第二设备的服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二设备的ASP向所述第一ASP回应所述响应消息。The first ASP is configured to receive a response message responded by the ASP of the second device according to the request message, specifically: the first ASP is configured to receive a response message from the ASP of the second device according to the request message. The response message responded after the second device performs a pre-processing operation; the pre-processing operation is: the ASP of the second device sends a third report message to the service module of the second device according to the request message, and the The third report message is used to request the service module of the second device whether to accept the establishment of the second session with the first device, and the third report message includes third cooperation information, and the third cooperation information is used for to indicate that the second session and the first session correspond to the same service; the ASP of the second device receives the second indication message sent by the service module of the second device according to the third report message, the The second indication message is used to instruct the ASP of the second device to respond to the response message to the first ASP.
可选地,在本实施例中,所述第一服务模块1002,还用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the first service module 1002 is further configured to, when a preset first switching condition is satisfied, transfer the session used by the service corresponding to the first session from the A session is switched to the second session, so that the service corresponding to the first session is transmitted according to the second session.
可选地,在本实施例中,所述第一服务模块1002,还用于在将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the first service module 1002 is further configured to, after switching the session used by the service corresponding to the first session from the second session to the first session , when the preset second switching condition is satisfied, switch the session used by the service corresponding to the first session from the second session to the first session, so that the The service performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,第一ASP 1001先向第一服务模块1002上报第一设备可以与第二设备建立基于第二网络的第二会话,并在获得第一服务模块1002的指示后才开始发送请求消息,且向第二设备的ASP发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备的ASP在第二设备进行前处理操作后回应的响应消息后,与第二网络的ASP设备建立该第二会话,使得第一ASP 1001与第二设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,且该第二会话一建立,第一服务模块1002便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第二设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the first ASP 1001 first reports to the first service module 1002 that the first device can establish a connection with the second device based on the second network and the request message is sent only after obtaining the instruction of the first service module 1002, and the request message sent to the ASP of the second device includes the first cooperation information, and the first cooperation information is used to indicate the The second session and the first session correspond to the same service, and after receiving the response message responded by the ASP of the second device after the second device performs the preprocessing operation, the second session is established with the ASP device of the second network, so that the second session is established. A second session based on the second network and corresponding to the service corresponding to the first session is established between the first ASP 1001 and the ASP of the second device, and as soon as the second session is established, the first service module 1002 can recognize that there is an available service. The second session is used as a backup, and as required, the second session is used to connect and transmit data with the service module of the second device, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session. . In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上面从模块化功能实体的角度对本发明实施例中的第一设备进行描述,下面从硬件处理的角度对本发明实施例中的第一设备进行描述,请参阅图11,本发明实施例中的第一设备另一实施例包括:The first device in the embodiment of the present invention is described above from the perspective of a modular functional entity, and the first device in the embodiment of the present invention is described below from the perspective of hardware processing. Please refer to FIG. Another embodiment of an apparatus includes:
输入装置1101、输出装置1102、处理器1103和存储器1104(其中设备中的处理器1103的数量可以一个或多个,图11中以一个处理器1103为例)。在本发明的一些实施例中,输入装置1101、输出装置1102、处理器1103和存储器1104可通过总线或其它方式连接。An input device 1101, an output device 1102, a processor 1103, and a memory 1104 (wherein the number of processors 1103 in the device may be one or more, and one processor 1103 is taken as an example in FIG. 11). In some embodiments of the invention, the input device 1101, the output device 1102, the processor 1103, and the memory 1104 may be connected by a bus or otherwise.
其中,in,
所述处理器1103,通过调用存储器1104存储的操作指令,用于执行如下步骤:The processor 1103 is configured to perform the following steps by invoking the operation instructions stored in the memory 1104:
第一设备与第二设备之间建立有基于第一网络的第一会话,A first session based on the first network is established between the first device and the second device,
当所述第一设备通过第二网络与所述第二设备连接时,向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;When the first device is connected to the second device through the second network, a request message is sent to the second device; the request message is used to request the establishment of a second session based on the second network, the The request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service;
接收所述第二设备根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;receiving a response message responded by the second device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
所述响应消息与所述第二设备建立所述第二会话。The response message establishes the second session with the second device.
在本发明的一些实施例中,处理器1103具体通过调用存储器1104存储的操作指令使所述第一设备的ASP向所述第二设备的ASP发送请求消息;使所述第一设备的ASP接收所述第二设备的ASP根据所述请求消息回应的响应消息;使所述第一设备的ASP根据所述响应消息与所述第二设备的ASP建立所述第二会话。In some embodiments of the present invention, the processor 1103 specifically causes the ASP of the first device to send a request message to the ASP of the second device by invoking the operation instructions stored in the memory 1104; The ASP of the second device responds with a response message according to the request message; the ASP of the first device is caused to establish the second session with the ASP of the second device according to the response message.
在本发明的一些实施例中,处理器1103还通过调用存储器1104存储的操作指令使在所述第一设备的ASP根据所述响应消息与所述第二设备的ASP建立所述第二会话之后,第一设备的ASP向第一设备的服务模块发送第一报告消息,所述第一报告消息用于指示所述第一设备与所述第二设备之间已经建立有所述第二会话。In some embodiments of the present invention, the processor 1103 further causes the ASP of the first device to establish the second session with the ASP of the second device according to the response message by invoking the operation instruction stored in the memory 1104 , the ASP of the first device sends a first report message to the service module of the first device, where the first report message is used to indicate that the second session has been established between the first device and the second device.
在本发明的一些实施例中,处理器1103还通过调用存储器1104存储的操作指令使在所述第一设备的ASP向所述第二设备的ASP发送请求消息之前,所述第一设备的ASP向所述第一设备的服务模块发送第二报告消息,所述第二报告消息用于向所述第一设备的服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第一设备的ASP接收所述第一设备的服务模块根据所述第二报告消息发送的第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;In some embodiments of the present invention, the processor 1103 further causes the ASP of the first device to send a request message to the ASP of the second device before the ASP of the first device sends a request message to the ASP of the second device by invoking the operation instruction stored in the memory 1104. Send a second report message to the service module of the first device, where the second report message is used to report to the service module of the first device that the first device can establish with the second device based on the first device. In the second session of the two networks, the second report message includes second cooperation information, and the second cooperation information is used to indicate that the second session and the first session correspond to the same service; The ASP receives a first indication message sent by the service module of the first device according to the second report message, where the first indication message is used to instruct the first device to establish the second session with the second device ;
处理器1103具体通过调用存储器1104存储的操作指令使所述第一设备的ASP接收所述第二设备的ASP根据所述请求消息在第二设备进行前处理操作后回应的响应消息;所述前处理操作为:所述第二设备的ASP根据所述请求消息向所述第二设备的服务模块发送第三报告消息,所述第三报告消息用于向所述第二设备的服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第二设备的ASP接收所述第二设备的服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二设备的ASP向第一设备的ASP回应所述响应消息。The processor 1103 specifically causes the ASP of the first device to receive the response message that the ASP of the second device responds to after the second device performs a preprocessing operation according to the request message by invoking the operation instruction stored in the memory 1104; The processing operation is: the ASP of the second device sends a third report message to the service module of the second device according to the request message, where the third report message is used to ask the service module of the second device whether Accept the establishment of the second session with the first device, and the third report message includes third cooperation information, where the third cooperation information is used to indicate that the second session and the first session correspond to the same service ; the ASP of the second device receives a second indication message sent by the service module of the second device according to the third report message, where the second indication message is used to instruct the ASP of the second device to report to the first The ASP of the device responds with the response message.
在本发明的一些实施例中,处理器1103还用于执行以下步骤:In some embodiments of the present invention, the processor 1103 is further configured to perform the following steps:
当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。When the preset first switching condition is met, the session used by the service corresponding to the first session is switched from the first session to the second session, so that the service corresponding to the first session Service transmission is performed according to the second session.
在本发明的一些实施例中,处理器1103还用于执行以下步骤:In some embodiments of the present invention, the processor 1103 is further configured to perform the following steps:
在将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。After the session used by the service corresponding to the first session is switched from the first session to the second session, when a preset second switching condition is satisfied, the session corresponding to the first session is switched to the second session. The session used by the service is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the second session.
本发明实施例中,所述输入装置1101、输出装置1102用于在所述处理器1103的控制下进行相关消息或信息的接收、发送。In this embodiment of the present invention, the input device 1101 and the output device 1102 are configured to receive and send related messages or information under the control of the processor 1103 .
本发明实施例提供的技术方案中,当第一设备通过第二网络与第二设备连接时,处理器1103通过所述输出装置1102在向第二设备发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在处理器1103通过所述输入装置1101收到第二设备回应的响应消息后,通过处理器1103与第二设备建立该第二会话,使得第一设备与第二设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device is connected to the second device through the second network, the processor 1103 includes the first cooperation information in the request message sent to the second device through the output device 1102, The first cooperation information is used to indicate that the second session and the first session correspond to the same service, and after the processor 1103 receives a response message responded by the second device through the input device 1101, the processor 1103 communicates with the second device through the input device 1101. The two devices establish the second session, so that a second session based on the second network and corresponding to the service corresponding to the first session is established between the first device and the second device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
图7至图11所示的实施例是作为查找服务角色的设备的角度来描述第一设备的,下面从提供服务角色的角度对本发明实施例的第二设备进行详细说明,具体请参阅图12,本发明实施例中第二设备一个实施例包括:The embodiments shown in FIGS. 7 to 11 describe the first device from the perspective of a device that searches for a service role. The second device in the embodiment of the present invention is described in detail below from the perspective of providing a service role. For details, please refer to FIG. 12 , an embodiment of the second device in the embodiment of the present invention includes:
接收单元1201,用于当所述第二设备还通过第二网络与第一设备连接时,接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The receiving unit 1201 is configured to receive a request message sent by the first device when the second device is also connected to the first device through the second network; the request message is used to request the establishment of a a second session, the request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service;
响应单元1202,用于根据所述请求消息向第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;A response unit 1202, configured to respond to the first device with a response message according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元1203,用于与所述第一设备建立所述第二会话。The establishing unit 1203 is configured to establish the second session with the first device.
为便于理解,下面以一具体应用场景为例,对本实施例中的网络控制器的内部运作流程进行描述:For ease of understanding, the following takes a specific application scenario as an example to describe the internal operation process of the network controller in this embodiment:
当所述第二设备还通过第二网络与所述第一设备连接时,接收单元1201接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;响应单元1202根据所述请求消息向第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;建立单元1203与所述第一设备建立所述第二会话。When the second device is also connected to the first device through a second network, the receiving unit 1201 receives a request message sent by the first device; the request message is used to request the establishment of a first device based on the second network Two sessions, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; the response unit 1202 sends the first device according to the request message A response message is returned, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device; the establishing unit 1203 establishes the second session with the first device.
本发明实施例提供的技术方案中,当第二设备通过第二网络与第一设备连接时,接收单元1201接收第一设备发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在由响应单元1202向第一设备回应响应消息后,通过建立单元1203与第一设备建立该第二会话,使得第二设备与第一设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the second device is connected to the first device through the second network, the receiving unit 1201 receives a request message sent by the first device, where the request message includes first cooperation information, the first The collaboration information is used to indicate that the second session and the first session correspond to the same service, and after the response unit 1202 responds with a response message to the first device, the second session is established with the first device through the establishment unit 1203, so that the first A second session based on the second network and corresponding to the service corresponding to the first session is established between the second device and the first device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
下面从提供服务角色的角度对可保证业务在不同网络间的无缝切换的设备的具体结构进行详细说明,请参阅图13,本发明实施例中第二设备另一实施例包括:From the perspective of providing a service role, the specific structure of a device that can ensure seamless handover of services between different networks will be described in detail below. Please refer to FIG. 13. Another embodiment of the second device in the embodiment of the present invention includes:
接收单元1301,用于当所述第二设备还通过第二网络与第一设备连接时,接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The receiving unit 1301 is configured to receive a request message sent by the first device when the second device is also connected to the first device through the second network; the request message is used to request the establishment of a network based on the second network. a second session, the request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service;
响应单元1302,用于根据所述请求消息向第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;A response unit 1302, configured to respond to the first device with a response message according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
建立单元1303,用于与所述第一设备建立所述第二会话。The establishing unit 1303 is configured to establish the second session with the first device.
进一步地,本发明实施例中设备还进一步包括:Further, the device in the embodiment of the present invention further includes:
第一切换单元1304,用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first switching unit 1304 is configured to, when a preset first switching condition is satisfied, switch the session used by the service corresponding to the first session from the first session to the second session, so that all The service corresponding to the first session performs service transmission according to the second session.
可选地,本发明实施例中设备还进一步包括:Optionally, the device in this embodiment of the present invention further includes:
第二切换单元1305,用于在所述第二设备将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The second switching unit 1305 is configured to, after the second device switches the session used by the service corresponding to the first session from the second session to the first session, when the preset second session is satisfied When switching conditions, the session used by the service corresponding to the first session is switched from the second session to the first session, so that the service corresponding to the first session is performed according to the second session. business transmission.
本发明实施例提供的技术方案中,当第二设备通过第二网络与第一设备连接时,接收单元1301接收第一设备发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在由响应单元1302向第一设备回应响应消息后,通过建立单元1303与第一设备建立该第二会话,使得第二设备与第一设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the second device is connected to the first device through the second network, the receiving unit 1301 receives a request message sent by the first device, where the request message includes first cooperation information, the first The cooperation information is used to indicate that the second session and the first session correspond to the same service, and after the response unit 1302 responds with a response message to the first device, the second session is established with the first device through the establishment unit 1303, so that the first A second session based on the second network and corresponding to the service corresponding to the first session is established between the second device and the first device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上述第二会话的建立过程可以基于不同的信令流程,下面对可基于第一种信令流程建立第二会话的第二设备进行详细说明,请参阅图14,本发明实施例中第二设备另一实施例包括:The process of establishing the second session can be based on different signaling processes. The following describes in detail the second device that can establish the second session based on the first signaling process. Please refer to FIG. 14 . Another embodiment of the device includes:
所述第二设备与第一设备之间建立有基于第一网络的第一会话,所述第二设备包括第二ASP 1401和第二服务模块1402;A first session based on a first network is established between the second device and the first device, and the second device includes a second ASP 1401 and a second service module 1402;
所述第二ASP 1401,用于当所述第二设备通过第二网络与所述第一设备连接时,接收所述第一设备的ASP发送的请求消息,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于根据所述请求消息向所述第一设备的ASP回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于与所述第一设备的ASP建立所述第二会话;The second ASP 1401 is configured to receive a request message sent by the ASP of the first device when the second device is connected to the first device through the second network, where the request message is used to request the establishment of a In the second session of the second network, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; The request message returns a response message to the ASP of the first device, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and is used to communicate with the first device the ASP establishes the second session;
在本实施例中,所述第二ASP 1401,还用于向所述第二服务模块发送第一报告消息,所述第一报告消息用于指示所述第二设备与所述第一设备之间已经建立有所述第二会话;In this embodiment, the second ASP 1401 is further configured to send a first report message to the second service module, where the first report message is used to indicate the relationship between the second device and the first device The second session has been established between;
所述第二服务模块1402,用于接收所述第二ASP发送的所述第一报告消息。The second service module 1402 is configured to receive the first report message sent by the second ASP.
可选地,在本实施例中,所述第二服务模块1402,还用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the second service module 1402 is further configured to, when a preset first switching condition is satisfied, transfer the session used by the service corresponding to the first session from the A session is switched to the second session, so that the service corresponding to the first session is transmitted according to the second session.
可选地,在本实施例中,所述第二服务模块1402,还用于在将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the second service module 1402 is further configured to, after switching the session used by the service corresponding to the first session from the second session to the first session , when the preset second switching condition is satisfied, switch the session used by the service corresponding to the first session from the second session to the first session, so that the The service performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第二设备通过第二网络与第一设备连接时,第二ASP 1401接收第一设备的ASP发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在向第一设备的ASP回应响应消息后,与第一设备的ASP建立该第二会话,使得第二ASP 1401与第一设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,第二服务模块1402在接收第二ASP1401发送的第一报告消息后便可根据需要通过第二会话与第一设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the second device is connected to the first device through the second network, the second ASP 1401 receives a request message sent by the ASP of the first device, where the request message includes the first collaboration information, The first collaboration information is used to indicate that the second session and the first session correspond to the same service, and after sending a response message to the ASP of the first device, establish the second session with the ASP of the first device, so that the second ASP 1401 A second session based on the second network and corresponding to the service corresponding to the first session is established with the ASP of the first device. After receiving the first report message sent by the second ASP 1401, the second service module 1402 can pass the The second session is connected with the service module of the first device and transmits data, so as to realize the service transmission between the first device and the second device for the service corresponding to the first session. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
下面对可基于第二种信令流程建立第二会话的第二设备进行详细说明,请参阅图15,本发明实施例中第二设备另一实施例包括:The second device that can establish the second session based on the second signaling process is described in detail below. Referring to FIG. 15, another embodiment of the second device in the embodiment of the present invention includes:
所述第二设备与第一设备之间建立有基于第一网络的第一会话,所述第二设备包括第二ASP 1501和第二服务模块1502;A first session based on a first network is established between the second device and the first device, and the second device includes a second ASP 1501 and a second service module 1502;
所述第二ASP 1501,用于当所述第二设备通过第二网络与所述第一设备连接时,接收所述第一设备的ASP发送的请求消息,所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于根据所述请求消息向所述第一设备的ASP回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;以及用于与所述第一设备的ASP建立所述第二会话;The second ASP 1501 is configured to receive a request message sent by the ASP of the first device when the second device is connected to the first device through the second network, where the request message is used to request the establishment of a In the second session of the second network, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; The request message returns a response message to the ASP of the first device, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device; and is used to communicate with the first device the ASP establishes the second session;
在本实施例中,所述第二ASP 1501用于接收第一设备的ASP发送的请求消息,具体为:所述第二ASP用于接收所述第一设备的ASP在第一设备进行预处理操作后发送的请求消息;所述预处理操作为:所述第一设备的ASP向所述第一设备的服务模块发送第二报告消息,所述第二报告消息用于向所述第一设备的服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第一设备的ASP接收所述第一设备的服务模块根据所述第二报告消息发送的第一指示消息,所述第一指示消息用于指示所述第一设备与所述第二设备建立所述第二会话;In this embodiment, the second ASP 1501 is configured to receive the request message sent by the ASP of the first device, specifically: the second ASP is configured to receive the ASP of the first device and perform preprocessing on the first device The request message sent after the operation; the preprocessing operation is: the ASP of the first device sends a second report message to the service module of the first device, and the second report message is used to send a second report message to the first device The service module reports that the first device can establish a second session based on the second network with the second device, and the second report message includes second cooperation information, and the second cooperation information is used to indicate the The second session and the first session correspond to the same service; the ASP of the first device receives a first indication message sent by the service module of the first device according to the second report message, the first indication The message is used to instruct the first device to establish the second session with the second device;
所述第二ASP 1501,还用于在所述第二ASP 1501接收所述第一设备的ASP发送的请求消息之后,所述第二ASP根据所述请求消息向第一设备的ASP回应响应消息之前,根据所述请求消息向所述第二设备中的第二服务模块1502发送第三报告消息,所述第三报告消息用于向所述第二服务模块1502请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;The second ASP 1501 is further configured to, after the second ASP 1501 receives the request message sent by the ASP of the first device, the second ASP responds with a response message to the ASP of the first device according to the request message Before, according to the request message, a third report message is sent to the second service module 1502 in the second device, and the third report message is used to ask the second service module 1502 whether to accept or not to communicate with the first service module 1502. The device establishes the second session, and the third report message includes third cooperation information, where the third cooperation information is used to indicate that the second session and the first session correspond to the same service;
所述第二服务模块,用于在接收到所述第二ASP发送的所述第三报告消息后,根据所述第三报告消息向所述第二ASP发送的第二指示消息,所述第二指示消息用于指示所述第二ASP向第一设备的ASP回应所述响应消息;The second service module is configured to, after receiving the third report message sent by the second ASP, send a second indication message to the second ASP according to the third report message, the first Two indication messages are used to instruct the second ASP to respond to the response message to the ASP of the first device;
所述第二ASP,还用于接收所述第二服务模块发送的所述第二指示消息。The second ASP is further configured to receive the second indication message sent by the second service module.
可选地,在本实施例中,所述第二服务模块1502,还用于当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the second service module 1502 is further configured to, when a preset first switching condition is satisfied, transfer the session used by the service corresponding to the first session from the A session is switched to the second session, so that the service corresponding to the first session is transmitted according to the second session.
可选地,在本实施例中,所述第二服务模块1502,还用于在将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。Optionally, in this embodiment, the second service module 1502 is further configured to switch the session used by the service corresponding to the first session from the second session to the first session , when the preset second switching condition is satisfied, switch the session used by the service corresponding to the first session from the second session to the first session, so that the The service performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第二设备通过第二网络与第一设备连接时,第二ASP 1501接收第一设备的ASP在第一设备进行预处理后发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示第二会话和第一会话对应于同一业务,并在接收第二服务模块1502根据第三报告消息发送的第二指示消息后,向第一设备的ASP回应响应消息,再与第一设备的ASP建立该第二会话,使得第二ASP 1501与第一设备的ASP之间建立基于第二网络且对应于第一会话所对应的业务的第二会话,且该第二会话一建立,第二服务模块1502便可识别存在可备用的该第二会话,并根据需要通过该第二会话与第一设备的服务模块进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the second device is connected to the first device through the second network, the second ASP 1501 receives a request message sent by the ASP of the first device after the first device performs preprocessing, the request The message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service, and after receiving the second indication message sent by the second service module 1502 according to the third report message, send the message to the The ASP of the first device responds with the response message, and then establishes the second session with the ASP of the first device, so that a service based on the second network and corresponding to the first session is established between the second ASP 1501 and the ASP of the first device the second session, and once the second session is established, the second service module 1502 can identify the existence of the second session that can be used for backup, and use the second session to connect with the service module of the first device and transmit data as needed , so as to implement service transmission between the first device and the second device for the service corresponding to the first session. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上面从模块化功能实体的角度对本发明实施例中的第二设备进行描述,下面从硬件处理的角度对本发明实施例中的第二设备进行描述,请参阅图16,本发明实施例中的设备另一实施例包括:The second device in the embodiment of the present invention is described above from the perspective of modular functional entities, and the second device in the embodiment of the present invention is described below from the perspective of hardware processing. Please refer to FIG. 16 , the device in the embodiment of the present invention Another embodiment includes:
输入装置1601、输出装置1602、处理器1603和存储器1604(其中设备中的处理器1603的数量可以一个或多个,图16中以一个处理器1603为例)。在本发明的一些实施例中,输入装置1601、输出装置1602、处理器1603和存储器1604可通过总线或其它方式连接。An input device 1601, an output device 1602, a processor 1603, and a memory 1604 (wherein the number of processors 1603 in the device may be one or more, and one processor 1603 is taken as an example in FIG. 16). In some embodiments of the invention, the input device 1601, the output device 1602, the processor 1603, and the memory 1604 may be connected by a bus or otherwise.
其中,in,
所述处理器1603,通过调用存储器1604存储的操作指令,用于执行如下步骤:The processor 1603 is configured to perform the following steps by invoking the operation instructions stored in the memory 1604:
第二设备与第一设备之间建立有基于第一网络的第一会话,A first session based on the first network is established between the second device and the first device,
当所述第二设备还通过第二网络与所述第一设备连接时,接收所述第一设备发送的请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;When the second device is also connected to the first device through a second network, receive a request message sent by the first device; the request message is used to request the establishment of a second session based on the second network, The request message includes first collaboration information, where the first collaboration information is used to indicate that the second session and the first session correspond to the same service;
根据所述请求消息向所述第一设备回应响应消息,所述响应消息用于表示所述第二设备接受与所述第一设备建立所述第二会话;Respond to a response message to the first device according to the request message, where the response message is used to indicate that the second device accepts the establishment of the second session with the first device;
与所述第一设备建立所述第二会话。The second session is established with the first device.
在本发明的一些实施例中,处理器1603具体通过调用存储器1104存储的操作指令使所述第二设备的ASP接收所述第一设备的ASP发送的请求消息;使所述第二设备的ASP根据所述请求消息向第一设备的ASP回应响应消息;使所述第二设备的ASP与所述第一设备的ASP建立所述第二会话。In some embodiments of the present invention, the processor 1603 specifically causes the ASP of the second device to receive the request message sent by the ASP of the first device by invoking the operation instruction stored in the memory 1104; A response message is returned to the ASP of the first device according to the request message; the ASP of the second device is caused to establish the second session with the ASP of the first device.
在本发明的一些实施例中,处理器1603还通过调用存储器1104存储的操作指令使第二设备的ASP向第二设备的服务模块发送第一报告消息,所述第一报告消息用于指示所述第二设备与所述第一设备之间已经建立有所述第二会话。In some embodiments of the present invention, the processor 1603 further causes the ASP of the second device to send a first report message to the service module of the second device by invoking the operation instruction stored in the memory 1104, where the first report message is used to indicate the The second session has been established between the second device and the first device.
在本发明的一些实施例中,处理器1603具体通过调用存储器1104存储的操作指令使所述第二设备的ASP接收所述第一设备的ASP在第一设备进行预处理操作后发送的请求消息;所述预处理操作为:所述第一设备的ASP向所述第一设备的服务模块发送第二报告消息,所述第二报告消息用于向所述第一设备的服务模块上报所述第一设备可以与所述第二设备建立基于所述第二网络的第二会话,所述第二报告消息包含第二协作信息,所述第二协作信息用于表示所述第二会话和所述第一会话对应于同一业务;In some embodiments of the present invention, the processor 1603 specifically causes the ASP of the second device to receive the request message sent by the ASP of the first device after the first device performs the preprocessing operation by invoking the operation instruction stored in the memory 1104 ; The preprocessing operation is: the ASP of the first device sends a second report message to the service module of the first device, and the second report message is used to report the The first device may establish a second session based on the second network with the second device, and the second report message includes second cooperation information, and the second cooperation information is used to indicate that the second session and all the first session corresponds to the same service;
处理器1603还通过调用存储器1104存储的操作指令使在所述第二设备的ASP接收所述第一设备的ASP发送的请求消息之后,所述第二设备的ASP根据所述请求消息向第一设备的ASP回应响应消息之前,所述第二设备的ASP根据所述请求消息向所述第二设备的服务模块发送第三报告消息,所述第三报告消息用于向所述第二设备的服务模块请示是否接受与所述第一设备建立所述第二会话,所述第三报告消息包含第三协作信息,所述第三协作信息用于表示所述第二会话和所述第一会话对应于同一业务;所述第二设备的ASP接收所述第二设备的服务模块根据所述第三报告消息发送的第二指示消息,所述第二指示消息用于指示所述第二设备的ASP向第一设备的ASP回应所述响应消息。The processor 1603 also causes the ASP of the second device to send the request message to the first device according to the request message after the ASP of the second device receives the request message sent by the ASP of the first device by invoking the operation instruction stored in the memory 1104. Before the ASP of the device responds to the response message, the ASP of the second device sends a third report message to the service module of the second device according to the request message, where the third report message is used to report to the service module of the second device. The service module instructs whether to accept the establishment of the second session with the first device, the third report message includes third cooperation information, and the third cooperation information is used to indicate the second session and the first session. Corresponding to the same service; the ASP of the second device receives a second indication message sent by the service module of the second device according to the third report message, where the second indication message is used to indicate the The ASP responds with the response message to the ASP of the first device.
在本发明的一些实施例中,处理器1603还用于执行以下步骤:In some embodiments of the present invention, the processor 1603 is further configured to perform the following steps:
当满足预设的第一切换条件时,将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。When the preset first switching condition is met, the session used by the service corresponding to the first session is switched from the first session to the second session, so that the service corresponding to the first session Service transmission is performed according to the second session.
在本发明的一些实施例中,处理器1603还用于执行以下步骤:In some embodiments of the present invention, the processor 1603 is further configured to perform the following steps:
在将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话之后,当满足预设的第二切换条件时,将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。After the session used by the service corresponding to the first session is switched from the first session to the second session, when a preset second switching condition is satisfied, the session corresponding to the first session is switched to the second session. The session used by the service is switched from the second session to the first session, so that the service corresponding to the first session performs service transmission according to the second session.
本发明实施例中,所述输入装置1601、输出装置1602用于在所述处理器1603的控制下进行相关消息或信息的接收、发送。In this embodiment of the present invention, the input device 1601 and the output device 1602 are configured to receive and send related messages or information under the control of the processor 1603 .
本发明实施例提供的技术方案中,当第二设备通过第二网络与第一设备连接时,处理器1603通过所述输入装置1601接收第一设备发送的请求消息,该请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在由处理器1603通过所述输出装置1602向第一设备回应响应消息后,通过处理器1603与第一设备建立该第二会话,使得第二设备与第一设备间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the second device is connected to the first device through the second network, the processor 1603 receives, through the input device 1601, a request message sent by the first device, where the request message includes the first device. collaboration information, the first collaboration information is used to indicate that the second session and the first session correspond to the same service, and after the processor 1603 sends a response message to the first device through the output device 1602, the processor 1603 The second session is established with the first device, so that a second session based on the second network and corresponding to the service corresponding to the first session is established between the second device and the first device. In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
上面对本发明实施例中的业务处理方法、第一设备以及第二设备进行了描述,下面对本发明实施例中的业务处理系统进行描述。首先需明确的是,第一设备和第二设备之间已经建立有基于第一网络的第一会话。可以理解的是,在第一设备与该第二设备已经建立有基于第一网络的连接时,第一设备和该第二设备可以使用一套基于第一网络的地址,即该第一设备的第一地址和该第二设备的第一地址,并利用基于第一网络的一套地址建立该第一会话。在该第一会话建立后,第一设备与第二设备通过该第一会话进行连接和传输数据,以实现第一会话所对应的业务在第一设备和第二设备之间的业务传输。The service processing method, the first device, and the second device in the embodiments of the present invention are described above, and the service processing system in the embodiments of the present invention is described below. First of all, it should be clear that a first session based on the first network has been established between the first device and the second device. It can be understood that when the first device and the second device have established a connection based on the first network, the first device and the second device can use a set of addresses based on the first network, that is, the address of the first device. the first address and the first address of the second device, and establish the first session using a set of addresses based on the first network. After the first session is established, the first device and the second device connect and transmit data through the first session, so as to implement service transmission between the first device and the second device for the service corresponding to the first session.
需要说明的是,第一网络和第二网络可以是两个不同类型的网络,例如,有线网络、WI-FI、蓝牙、NFC和Powerline等,也可以是同类型但具备不同网络结构的网络,例如基于WI-FI的P2P网络和基于WI-FI的基础设施网络,其中,基于Wi-Fi的P2P网络,可以是基于WFA(Wi-Fi Alliance,Wi-Fi联盟)的Wi-Fi Direct协议建立起来的网络,这种情况下,第一设备和第二设备可以直接连接;基于Wi-Fi的基础设施网络,可以是基于IEEE的802.11协议建立起来的网络,这种情况下,第一设备和第二设备都连接到AP(Access Point,接入点),并且可以通过AP实现两者之间的通信。可以理解的是,在实际应用中,第二网络的数量可以是一个或多个,此处不作限定。It should be noted that the first network and the second network may be two different types of networks, such as wired network, WI-FI, Bluetooth, NFC, Powerline, etc., or may be networks of the same type but with different network structures. For example, a WI-FI-based P2P network and a WI-FI-based infrastructure network, wherein the Wi-Fi-based P2P network can be established based on the Wi-Fi Direct protocol of WFA (Wi-Fi Alliance, Wi-Fi Alliance). In this case, the first device and the second device can be directly connected; the Wi-Fi-based infrastructure network can be a network established based on the IEEE 802.11 protocol. In this case, the first device and the second device can be connected directly. Both the second devices are connected to the AP (Access Point, access point), and the communication between the two can be realized through the AP. It can be understood that, in practical applications, the number of second networks may be one or more, which is not limited here.
需要说明的是,在下述的本发明各个实施例中,第一设备和第二设备可以是具备网络连接功能的设备,例如支持网络连接功能的手机、电视机、服务器、无线路由器、其他各种家用电器或办公设备等。例如,第一设备可以是手机,第二设备可以是电视机,接入点可以是无线路由器,此时,手机跟电视机可以通过无线路由器建立基于Wi-Fi的基础设施网络的连接,并基于该基于Wi-Fi的基础设施网络建立第一会话,以使得手机通过该第一会话把播放内容传输到电视机。It should be noted that, in the following embodiments of the present invention, the first device and the second device may be devices with a network connection function, such as a mobile phone, a TV, a server, a wireless router, and other various devices that support the network connection function. Home appliances or office equipment, etc. For example, the first device can be a mobile phone, the second device can be a TV, and the access point can be a wireless router. At this time, the mobile phone and the TV can establish a Wi-Fi-based infrastructure network connection through the wireless router, The Wi-Fi-based infrastructure network establishes a first session, so that the mobile phone transmits the playing content to the TV set through the first session.
请参阅图17,本发明实施例中业务处理系统一个实施例包括:Referring to FIG. 17, an embodiment of the service processing system in the embodiment of the present invention includes:
第一设备1701,用于当所述第一设备1701通过第二网络与所述第二设备1702连接时,向所述第二设备1702发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二设备1702根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备1702接受与所述第一设备1701建立所述第二会话;以及用于根据所述响应消息与所述第二设备1702建立所述第二会话。The first device 1701 is configured to send a request message to the second device 1702 when the first device 1701 is connected to the second device 1702 through the second network; the request message is used to request to establish a For a second session of the second network, the request message includes first cooperation information, where the first cooperation information is used to indicate that the second session and the first session correspond to the same service; and the request message is also used to receive the first session. The second device 1702 responds with a response message according to the request message, where the response message is used to indicate that the second device 1702 accepts the establishment of the second session with the first device 1701; and is used to communicate with the first device 1701 according to the response message. The second device 1702 establishes the second session.
所述第二设备1702,用于当所述设备通过第二网络与所述目标设备连接时,接收所述目标设备发送的请求消息;还用于根据所述请求消息向第一设备回应所述响应消息;以及用于与所述目标设备建立所述第二会话。The second device 1702 is configured to receive a request message sent by the target device when the device is connected to the target device through the second network; and is further configured to respond to the first device according to the request message. a response message; and for establishing the second session with the target device.
为便于理解,下面以一具体应用场景为例,对本实施例中的业务处理系统的内部运作流程进行描述:For ease of understanding, the following takes a specific application scenario as an example to describe the internal operation process of the business processing system in this embodiment:
当所述第一设备1701通过第二网络与所述第二设备1702连接时,第一设备1701向所述第二设备发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;第二设备1702根据所述请求消息向第一设备1701回应所述响应消息,所述响应消息用于表示所述第二设备1702接受与所述第一设备1701建立所述第二会话;第一设备1701接收所述第二设备1702根据所述请求消息回应的响应消息;第一设备1701根据所述响应消息与所述第二设备1702建立所述第二会话。When the first device 1701 is connected to the second device 1702 through the second network, the first device 1701 sends a request message to the second device; the request message is used to request the establishment of a For the second session, the request message includes first cooperation information, and the first cooperation information is used to indicate that the second session and the first session correspond to the same service; the second device 1702 sends the request message to the second session according to the request message. A device 1701 responds to the response message, and the response message is used to indicate that the second device 1702 accepts the establishment of the second session with the first device 1701; the first device 1701 receives the second device 1702 according to the The first device 1701 establishes the second session with the second device 1702 according to the response message.
本发明实施例提供的技术方案中,当第一设备1701通过第二网络与第二设备1702连接时,第一设备1701在向第二设备1702发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备1702回应的响应消息后,与第二设备1702建立该第二会话,使得第一设备1701与第二设备1702间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device 1701 is connected to the second device 1702 through the second network, the first device 1701 includes the first cooperation information in the request message sent to the second device 1702, and the first device 1701 includes the first cooperation information. A piece of cooperation information is used to indicate that the second session and the first session correspond to the same service, and after receiving the response message responded by the second device 1702, the second session is established with the second device 1702, so that the first device 1701 A second session based on the second network and corresponding to the service corresponding to the first session is established with the second device 1702 . In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
下面对可保证业务在不同网络间的无缝切换的业务处理系统的具体结构进行详细说明,请参阅图18,本发明实施例中业务处理系统另一实施例包括:The specific structure of the service processing system that can ensure seamless switching of services between different networks is described in detail below. Please refer to FIG. 18. Another embodiment of the service processing system in the embodiment of the present invention includes:
第一设备1801,用于当所述第一设备1801通过第二网络与所述第二设备1802连接时,向所述第二设备1802发送请求消息;所述请求消息用于请求建立基于所述第二网络的第二会话,所述请求消息包含第一协作信息,所述第一协作信息用于表示所述第二会话和所述第一会话对应于同一业务;还用于接收所述第二设备1802根据所述请求消息回应的响应消息,所述响应消息用于表示所述第二设备1802接受与所述第一设备1801建立所述第二会话;以及用于根据所述响应消息与所述第二设备1802建立所述第二会话。The first device 1801 is configured to send a request message to the second device 1802 when the first device 1801 is connected to the second device 1802 through the second network; the request message is used to request a setup based on the For a second session of the second network, the request message includes first cooperation information, where the first cooperation information is used to indicate that the second session and the first session correspond to the same service; and the request message is also used to receive the first session. The second device 1802 responds with a response message according to the request message, the response message is used to indicate that the second device 1802 accepts the establishment of the second session with the first device 1801; and is used to communicate with the first device 1801 according to the response message. The second device 1802 establishes the second session.
所述第二设备1802,用于当所述设备通过第二网络与所述目标设备连接时,接收所述目标设备发送的请求消息;还用于根据所述请求消息向第一设备回应所述响应消息;以及用于与所述目标设备建立所述第二会话。The second device 1802 is configured to receive a request message sent by the target device when the device is connected to the target device through a second network; and is further configured to respond to the first device according to the request message. a response message; and for establishing the second session with the target device.
进一步地,本发明实施例中业务处理系统还进一步包括:Further, the service processing system in the embodiment of the present invention further includes:
所述第一设备1801或所述第二设备1802,还用于当满足预设的第一切换条件时将所述第一会话所对应的业务所使用的会话由所述第一会话切换至所述第二会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first device 1801 or the second device 1802 is further configured to switch the session used by the service corresponding to the first session from the first session to the session when a preset first switching condition is met. the second session, so that the service corresponding to the first session performs service transmission according to the second session.
可选地,本发明实施例中业务处理系统还进一步包括:Optionally, the service processing system in the embodiment of the present invention further includes:
所述第一设备1801或所述第二设备1802,还用于当满足预设的第二切换条件时将所述第一会话所对应的业务所使用的会话由所述第二会话切换至所述第一会话,以使所述第一会话所对应的业务根据所述第二会话进行业务传输。The first device 1801 or the second device 1802 is further configured to switch the session used by the service corresponding to the first session from the second session to the session when a preset second switching condition is satisfied. the first session, so that the service corresponding to the first session performs service transmission according to the second session.
本发明实施例提供的技术方案中,当第一设备1801通过第二网络与第二设备1802连接时,第一设备1801在向第二设备1802发送的请求消息中包含第一协作信息,该第一协作信息用于表示所述第二会话和第一会话对应于同一业务,并在收到第二设备1802回应的响应消息后,与第二设备1802建立该第二会话,使得第一设备1801与第二设备1802间建立基于第二网络且对应于第一会话所对应的业务的第二会话。本发明实施例通过在设备间建立针对同一业务且基于第二网络的第二会话,可在第一网络出现信号质量不佳或被切换等情况时,设备间的第一会话所对应的业务可在第二网络中继续运行,以保证业务传输的可靠性,有效提高业务传输质量,且能够提高网络资源利用率,避免网络资源的浪费。In the technical solution provided by the embodiment of the present invention, when the first device 1801 is connected to the second device 1802 through the second network, the first device 1801 includes the first cooperation information in the request message sent to the second device 1802. A piece of cooperation information is used to indicate that the second session and the first session correspond to the same service, and after receiving the response message responded by the second device 1802, the second session is established with the second device 1802, so that the first device 1801 A second session based on the second network and corresponding to the service corresponding to the first session is established with the second device 1802 . In this embodiment of the present invention, by establishing a second session between devices for the same service and based on the second network, when the first network has poor signal quality or is switched, the service corresponding to the first session between devices can be Continue to operate in the second network to ensure the reliability of service transmission, effectively improve the quality of service transmission, improve the utilization rate of network resources, and avoid waste of network resources.
更进一步地,本发明实施例可根据预设的第一切换条件和预设的第二切换条件,将第一会话所对应的业务在基于第一网络的第一会话和基于第二网络的第二会话中切换,为业务使用网络的选择提供了更大的灵活度,并保证业务在不同网络间的无缝切换,从而提高用户体验。Further, in this embodiment of the present invention, according to the preset first switching condition and the preset second switching condition, the service corresponding to the first session can be included in the first session based on the first network and the first session based on the second network. Switching in two sessions provides greater flexibility for the choice of network used by services, and ensures seamless switching of services between different networks, thereby improving user experience.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410438698.5ACN105451289B (en) | 2014-08-30 | 2014-08-30 | A kind of method for processing business and system, equipment |
| PCT/CN2015/087669WO2016029820A1 (en) | 2014-08-30 | 2015-08-20 | Service processing method, system and device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410438698.5ACN105451289B (en) | 2014-08-30 | 2014-08-30 | A kind of method for processing business and system, equipment |
| Publication Number | Publication Date |
|---|---|
| CN105451289A CN105451289A (en) | 2016-03-30 |
| CN105451289Btrue CN105451289B (en) | 2019-05-28 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410438698.5AActiveCN105451289B (en) | 2014-08-30 | 2014-08-30 | A kind of method for processing business and system, equipment |
| Country | Link |
|---|---|
| CN (1) | CN105451289B (en) |
| WO (1) | WO2016029820A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115334494B (en)* | 2021-05-10 | 2025-08-12 | 华为技术有限公司 | Communication method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6842621B2 (en)* | 2001-12-21 | 2005-01-11 | Motorola, Inc. | Method and apparatus for splitting control and media content from a cellular network connection |
| CN101330748B (en)* | 2007-07-31 | 2011-11-30 | 中兴通讯股份有限公司 | Method for switching control route of IP multimedia subsystem centralized business conversation |
| US8934463B2 (en)* | 2010-02-17 | 2015-01-13 | Qualcomm Incorporated | Managing pages of an access terminal when the access terminal is engaged in a communication session within a wireless communications system |
| CN102905390B (en)* | 2011-07-26 | 2017-12-01 | 中兴通讯股份有限公司 | Session association methods, devices and systems |
| CN102883390A (en)* | 2012-10-22 | 2013-01-16 | 张家港市鸿嘉数字科技有限公司 | Service switching method |
| Publication number | Publication date |
|---|---|
| CN105451289A (en) | 2016-03-30 |
| WO2016029820A1 (en) | 2016-03-03 |
| Publication | Publication Date | Title |
|---|---|---|
| AU2015315695B2 (en) | Establishing and maintaining a VOIP call | |
| KR101176144B1 (en) | System and method for peer-to-peer connection in multiple network environment | |
| US10728344B2 (en) | Service discovery method, related device, and system | |
| CN102801800B (en) | Method and system for performing resource sharing processing among plurality of wireless terminals | |
| JP5551805B2 (en) | Method and apparatus for accessing the Internet | |
| TW201531145A (en) | Wireless communication device and method capable of peer-to-peer interconnection | |
| CN104426956B (en) | A kind of SOT state of termination method for subscribing, apparatus and system | |
| US10149134B2 (en) | Near field discovery method, user equipment, and storage medium | |
| JP2017503407A (en) | Packet processing method and apparatus | |
| CN106027599B (en) | Data transmission channel establishing method, system and server | |
| CN105187677A (en) | System And Method For Transferring A Call | |
| CN104471910A (en) | Method, server and computer program for local discovery | |
| CN105451289B (en) | A kind of method for processing business and system, equipment | |
| US20120215869A1 (en) | Multimedia Message Transmission Method and Apparatus Thereof, and Domain Name Server | |
| JP2025505219A (en) | Method, apparatus and system for requesting application functionality - Patents.com | |
| JP2014068171A (en) | Multicast distribution system, multicast distribution method and program | |
| CN109495918B (en) | Data transmission method and device | |
| CN103874239B (en) | The implementation method and device of a kind of network interface of multimode terminal data card | |
| CN105188107B (en) | Improve the method and device of the access efficiency of website | |
| CN117202410A (en) | Data communication methods, equipment and storage media for converged networks | |
| CN107995115B (en) | Automatic networking method without master-slave relation | |
| WO2012147248A1 (en) | Call-linking system, home data control unit, call-linking method | |
| CN115943673A (en) | Shared session establishment method and device and communication equipment | |
| JP2017536057A (en) | Communication method and apparatus | |
| WO2017054284A1 (en) | Communication method and related device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right | Effective date of registration:20211201 Address after:215010 room 704, building 5, No. 556, Changjiang Road, high tech Zone, Suzhou, Jiangsu Patentee after:SUZHOU YUDESHUI ELECTRICAL TECHNOLOGY Co.,Ltd. Address before:518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before:HUAWEI TECHNOLOGIES Co.,Ltd. | |
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right | Effective date of registration:20221222 Address after:No. 8, Xingbo 7th Road, Boxing Economic Development Zone, Boxing County, Binzhou City, Shandong Province, 256599 Patentee after:Shandong Rongzhi Industry Guidance Fund Co.,Ltd. Address before:215010 room 704, building 5, No. 556, Changjiang Road, high tech Zone, Suzhou, Jiangsu Patentee before:SUZHOU YUDESHUI ELECTRICAL TECHNOLOGY Co.,Ltd. | |
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right | Effective date of registration:20241219 Address after:017000 North Zhungeer Road, Xuejiawan Town, Zhungeer Banner, Ordos City, Inner Mongolia Autonomous Region Patentee after:Inner Mongolia Yingyuan Coal Transportation and Sales Co.,Ltd. Country or region after:China Address before:No. 8, Xingbo 7th Road, Boxing Economic Development Zone, Boxing County, Binzhou City, Shandong Province, 256599 Patentee before:Shandong Rongzhi Industry Guidance Fund Co.,Ltd. Country or region before:China |