Communication method and device
Patent Information
- Application Number
- CN202380093165.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2025-09-12
AI Technical Summary
In communications between ProSe-capable UEs, when the number of links processed by the Relay UE is limited, existing links cannot be effectively shared, resulting in increased processing complexity of the relay equipment and inefficiency of link usage.
The relay device determines whether the existing connection with the second device allows sharing, and requests sharing if sharing is allowed, or establishes a new connection when sharing is not allowed, thereby realizing communication between the relay device and the second device. Link sharing improves link usage efficiency.
It improves the link usage efficiency between the relay device and the second device, reduces the possibility that the second device refuses to share the existing connection, avoids the processing efficiency problem caused by resending the request, and improves the sharing of the relay device. Processing efficiency of existing connections.
Smart Images

Figure CN120642244A_ABST
Abstract
Description
Communication method and device Technical Field
[0001] The present application relates to the field of communications, and more specifically, to a communication method, device, computer-readable storage medium, computer program product, and computer program. Background Art
[0002] In related technologies, when two ProSe (Proximity-based Services)-capable UEs (User Equipment) are far apart and cannot communicate directly, they can use a ProSe-capable relay UE for relaying. In other words, the two ProSe-capable UEs are respectively called the initiating UE and the target UE. The initiating UE and the target UE can exchange data through the relay UE.
[0003] As the number of initiating and / or target UEs communicating through a relay UE increases, the number of links increases, which in turn increases the complexity of the relay UE's processing. Furthermore, because the relay UE can only handle a limited number of links, this also limits the number of initiating and / or target UEs that can communicate through the relay UE. Therefore, how to share existing links between the relay UE and the initiating and / or target UEs becomes a challenge that needs to be addressed.
[0004] Summary of the Invention
[0005] Embodiments of the present application provide a communication method, device, computer-readable storage medium, computer program product, and computer program.
[0006] An embodiment of the present application provides a communication method, including:
[0007] The relay device receives a first message sent by the first device, wherein the first message is used to request a connection with the second device;
[0008] The relay device sends a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0009] An embodiment of the present application provides a communication method, including:
[0010] A first device sends a first message to a relay device, wherein the first message is used to request a connection with a second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0011] An embodiment of the present application provides a communication method, including:
[0012] The second device receives a second message sent by the relay device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0013] An embodiment of the present application provides a relay device, including:
[0014] A first communication unit is used to receive a first message sent by a first device, wherein the first message is used to request a connection with a second device; and send a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0015] An embodiment of the present application provides a first device, including:
[0016] A second communication unit is used to send a first message to a relay device, wherein the first message is used to request a connection with a second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0017] An embodiment of the present application provides a second device, including:
[0018] A third communication unit is used to receive a second message sent by a relay device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0019] An embodiment of the present application provides a relay device, comprising a transceiver, a processor, and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the relay device performs the above method.
[0020] An embodiment of the present application provides a first device, comprising a transceiver, a processor, and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the first device performs the above method.
[0021] An embodiment of the present application provides a second device, including: a transceiver, a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the second device executes the above method.
[0022] The embodiment of the present application provides a chip for implementing the above method.
[0023] Specifically, the chip includes: a processor, which is used to call and run a computer program from a memory, so that a device equipped with the chip executes the above method.
[0024] An embodiment of the present application provides a computer-readable storage medium for storing a computer program, which enables a device to perform the above method when the computer program is executed by the device.
[0025] An embodiment of the present application provides a computer program product, including computer program instructions, which enable a computer to execute the above method.
[0026] An embodiment of the present application provides a computer program, which, when executed on a computer, enables the computer to execute the above method.
[0027] It can be seen that by adopting the above solution, when the first device needs to connect to the second device through the relay device, the relay device can determine whether to request to share the existing connection with the second device. In this way, it is possible to serve multiple initiating devices by sharing the existing connection between the relay device and the second device, thereby improving the link utilization efficiency between the relay device and the second device. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] FIG1 is a schematic diagram of an application scenario according to an embodiment of the present application.
[0029] Figure 2 is a 5G network system architecture diagram according to an embodiment of the present application.
[0030] FIG3 is a schematic flowchart of a communication method according to an embodiment of the present application.
[0031] FIG4 is a schematic flowchart of a communication method according to another embodiment of the present application.
[0032] FIG5 is a schematic flowchart of a communication method according to another embodiment of the present application.
[0033] 6A and 6B are schematic diagrams of various exemplary processes of a communication method according to an embodiment of the present application.
[0034] 7A and 7B are schematic diagrams of various exemplary processes of a communication method according to another embodiment of the present application.
[0035] FIG8 is a schematic diagram of a process flow for establishing a short-distance link in the related art.
[0036] 9 and 10 are schematic diagrams of various scenarios of establishing a connection between an initiating UE and a target UE through a relay UE according to the related art.
[0037] FIG11 is a schematic diagram of a process of connecting an initiating UE to a target UE via a relay UE.
[0038] FIG12 is a schematic block diagram of a relay device according to an embodiment of the present application.
[0039] FIG13 is a schematic block diagram of a relay device according to another embodiment of the present application.
[0040] FIG14 is a schematic block diagram of a first device according to an embodiment of the present application.
[0041] FIG15 is a schematic block diagram of a first device according to another embodiment of the present application.
[0042] FIG16 is a schematic block diagram of a second device according to an embodiment of the present application.
[0043] FIG17 is a schematic block diagram of a second device according to another embodiment of the present application.
[0044] FIG18 is a schematic block diagram of a communication device according to an embodiment of the present application.
[0045] FIG19 is a schematic block diagram of a chip according to an embodiment of the present application.
[0046] Figure 20 is a schematic block diagram of a communication system according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0048] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, Advanced Long Term Evolution (LTE-A) system, New Radio (NR) system, NR system evolution system, LTE on unlicensed spectrum (LTE-U) system, NR on unlicensed spectrum (NR-U) system, Non-Terrestrial Networks (NTN) system, Universal Mobile Telecommunication System (UMTS), Wireless Local Area Networks (WLAN), Wireless Fidelity (Wireless Fidelity) system. Fidelity, WiFi), fifth-generation communication (5th-Generation, 5G) system or other communication systems, etc.
[0049] Generally speaking, traditional communication systems support a limited number of connections and are easy to implement. However, with the development of communication technology, mobile communication systems will not only support traditional communications, but will also support, for example, device-to-device (D2D) communication, machine-to-machine (M2M) communication, machine-type communication (MTC), vehicle-to-vehicle (V2V) communication, or vehicle-to-everything (V2X) communication, etc. The embodiments of the present application can also be applied to these communication systems.
[0050] In one possible implementation, the communication system in the embodiment of the present application can be applied to a carrier aggregation (CA) scenario, a dual connectivity (DC) scenario, and a standalone (SA) networking scenario.
[0051] In one possible implementation, the communication system in the embodiment of the present application can be applied to an unlicensed spectrum, where the unlicensed spectrum can also be considered as a shared spectrum; or, the communication system in the embodiment of the present application can also be applied to an authorized spectrum, where the authorized spectrum can also be considered as an unshared spectrum.
[0052] FIG1 exemplarily illustrates a communication system 100. The communication system includes a network device 110 and two terminal devices 120. In one possible implementation, the communication system 100 may include multiple network devices 110, and each network device 110 may include a different number of terminal devices 120 within its coverage area, which is not limited in this embodiment of the present application.
[0053] In one possible implementation, the communication system 100 may further include other network entities such as a Mobility Management Entity (MME) and an Access and Mobility Management Function (AMF), which is not limited in this embodiment of the present application.
[0054] The terminal device may also be referred to as user equipment (UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, etc. The terminal device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a next-generation communication system such as a NR network, or a terminal device in a future-evolved Public Land Mobile Network (PLMN) network, etc.
[0055] In the embodiments of the present application, the terminal device can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted; it can also be deployed on the water (such as a ship, etc.); it can also be deployed in the air (such as an airplane, balloon, and satellite, etc.). In the embodiments of the present application, the terminal device can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical care, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc.
[0056] As an example and not a limitation, in the embodiment of the present application, the terminal device may also be a wearable device. Wearable devices may also be called wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0057] Among them, the network equipment may include access network equipment and core network equipment. That is, the wireless communication system also includes multiple core networks for communicating with the access network equipment. The access network equipment can be an evolutionary base station (evolutional node B, abbreviated as eNB or e-NodeB) macro base station, micro base station (also called "small base station"), pico base station, access point (AP), transmission point (TP) or new generation Node B (gNodeB), etc. in a long-term evolution (LTE) system, a next-generation (mobile communication system) (next radio, NR) system or an authorized auxiliary access long-term evolution (LAA-LTE) system.
[0058] In an embodiment of the present application, the network device may be a device for communicating with a mobile device. The network device may be an access point (AP) in WLAN, a base station (BTS) in GSM or CDMA, a base station (NodeB, NB) in WCDMA, an evolved base station (eNB or eNodeB) in LTE, or a relay station or access point, or a vehicle-mounted device, a wearable device, and a network device (gNB) in an NR network, or a network device in a future evolved PLMN network or a network device in an NTN network, etc.
[0059] As an example and not a limitation, in an embodiment of the present application, the network device may have a mobile feature, for example, the network device may be a mobile device. Alternatively, the network device may be a satellite or a balloon station. For example, the satellite may be a low earth orbit (LEO) satellite, a medium earth orbit (MEO) satellite, a geostationary earth orbit (GEO) satellite, a high elliptical orbit (HEO) satellite, etc. Optionally, the network device may also be a base station set up in a location such as land or water.
[0060] In an embodiment of the present application, the network device can provide services for a cell, and the terminal device communicates with the network device through the transmission resources used by the cell (for example, frequency domain resources, or spectrum resources). The cell can be a cell corresponding to the network device (for example, a base station). The cell can belong to a macro base station or a base station corresponding to a small cell. The small cells here may include: metro cells, micro cells, pico cells, femto cells, etc. These small cells have the characteristics of small coverage and low transmission power, and are suitable for providing high-speed data transmission services.
[0061] It should be understood that in the embodiments of the present application, a device having a communication function in a network / system may be referred to as a communication device. Taking the communication system shown in Figure 1 as an example, the communication device may include a network device and a terminal device having a communication function. The network device and the terminal device may be specific devices in the embodiments of the present application and will not be described in detail here. The communication device may also include other devices in the communication system, such as a network controller, a mobility management entity, and other network entities, which are not limited in the embodiments of the present application.
[0062] To facilitate understanding of the embodiments of the present application, the following briefly describes the basic processes and basic concepts involved in the embodiments of the present application. It should be understood that the basic processes and basic concepts introduced below do not limit the embodiments of the present application.
[0063] The 5G network system architecture is shown in Figure 2, which includes: NSSF (Network Slice Selection Function) is mainly used to manage network slice related information, such as selecting network slices for terminal devices; AUSF (Authentication Server Function) is used to complete the identity authentication function of user access; UDM (Unified Data Management) is used to manage and store contract data and authentication data; AMF (Access and Mobility Management Function) is used to complete mobility management, security anchor and security context management, etc. In addition to managing the mobility of UE, AMF is also responsible for forwarding session management related messages between UE and SMF; SMF (Session Management Function) is used to complete session management, UE IP address allocation and management, etc.; PCF (Policy Control Function) is responsible for formulating policies related to UE mobility management, session management, billing, etc.; AF (Application Function) is used for external application servers; UPF (User Plane Function) is used to manage and store user data and authentication data; Function) is used for complex user plane processing, such as forwarding traffic between the wireless access network and the Internet, reporting traffic usage, and implementing QoS (Quality of Service) policies. DN (Data Network) refers to the 5GC external data network (such as the Internet).
[0064] In addition, data is transmitted between various nodes in the 5G Core Network (5G Core Network), between user equipment (UE) and 5G Core Network nodes, between the UE and the Radio Access Network (RAN), and between the RAN and 5G Core Network nodes through corresponding interfaces. For example, as shown in Figure 2, data is transmitted between the AMF and the NSSF in the 5G Core Network (5G Core Network) via interface N22; data is transmitted between the AMF and the SMF via interface N11; data is transmitted between the AMF and the AUSF via interface N12; and data is transmitted between the AMF and the UDM via interface N8. Data is transmitted between the SMF and the UPF via interface N4. The UPF transmits data to the external data network via interface N6 and to the AN via interface N3. The UE connects to the AN via the Uu interface for access layer communication, exchanging access layer messages and wireless data transmission. The UE connects to the AMF via the N1 interface for non-access layer (NAS) communication, exchanging NAS messages. Data is transmitted between the RAN and the AMF via interface N2, and between the RAN and the UPF via interface N3. It should be understood that the above only describes the interfaces between some nodes, and other interfaces between other 5GC nodes in Figure 2 are not described one by one.
[0065] It should be understood that the terms "system" and "network" are often used interchangeably herein. The term "and / or" is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " generally indicates that the related objects are in an "or" relationship.
[0066] It should be understood that the "indication" mentioned in the embodiments of this application can be a direct indication, an indirect indication, or an indication of an association. For example, "A indicates B" can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B.
[0067] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between the two, or an association relationship between the two, or a relationship between indication and being indicated, configuration and being configured, etc.
[0068] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following relevant technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application.
[0069] Figure 3 is a schematic flow chart of a communication method according to an embodiment of the present application. The method includes at least part of the following contents.
[0070] S310. The relay device receives a first message sent by the first device, wherein the first message is used to request a connection with the second device;
[0071] S320. The relay device sends a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0072] Figure 4 is a schematic flow chart of a communication method according to another embodiment of the present application. The method includes at least part of the following contents.
[0073] S410. The first device sends a first message to the relay device, wherein the first message is used to request a connection with the second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0074] Figure 5 is a schematic flow chart of a communication method according to another embodiment of the present application. The method includes at least part of the following contents.
[0075] S510. The second device receives a second message sent by the relay device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0076] Here, the first device, the relay device, and the second device may all be terminal devices. The first device may also be referred to as a first initiating device, the second device may be referred to as a target device, and the relay device may also be referred to as a forwarding device.
[0077] The connections mentioned in the embodiments of the present application all refer to the connections of the PC5 interface. The connections of the PC5 interface can be called PC5 connections, or PC5 links, etc. All possible names of the connections in this embodiment are not enumerated here.
[0078] In some possible implementations, the type of the first message may be a direct communication request message.
[0079] Before the first device sends the first message to the relay device, the first device may select a relay device from a plurality of candidate relay devices. Whether a PC5 connection already exists between the first device and the relay device is not limited in this embodiment.
[0080] The first message is used to request a connection with the second device, and the first message is used to request a connection with the relay device. Specifically, the first message is used to request a connection with the relay device, which may mean that the first message is also used to request a fourth connection between the first device and the relay device.
[0081] Optionally, the first message may carry an identifier of the first device and an identifier of the second device. The identifier may be an application layer identifier and / or a link layer identifier, which may also be called a layer 2 identifier (L2ID).
[0082] Optionally, in addition to carrying the identifier of the first device and the identifier of the second device, the first message may also carry information about the target service. The information about the target service may specifically include at least one of the following: the application identifier of the target service and the service type of the target service. In addition, the information about the target service may also include a relay service code (RSC) corresponding to the target service. This embodiment does not limit the configuration or determination method of the correspondence between the target service and the relay service code.
[0083] In some possible implementations, the relay device sends a second message to the second device, including: when there is a first connection between the relay device and the second device and the first connection is in a state allowing sharing, the relay device sends a second message to the second device, and the second message is used to request sharing of the first connection to transmit data between the first device and the second device.
[0084] The relay device sends a second message to the second device, including: when there is a first connection between the relay device and the second device and the first connection is in a state where sharing is not allowed, the relay device sends a second message to the second device, wherein the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0085] After the relay device receives the first message sent by the first device, the method also includes: when there is no connection between the relay device and the second device, the relay device sends a second message to the second device, and the second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0086] That is, the second message can have two possibilities: one is a second message for requesting to share the first connection for transmitting data between the first device and the second device. This second message is hereinafter referred to as the second message for requesting to share the first connection. The other is a second message for requesting to establish a second connection between the relay device and the second device for transmitting data between the first device and the second device. This second message is hereinafter referred to as the second message for requesting to establish a second connection between the relay device and the second device.
[0087] The manner in which the relay device determines whether the first connection is in a state allowing sharing may include: the relay device determining whether the first connection is in a state allowing sharing based on first state indication information of the first connection.
[0088] Next, two scenarios are described, one in which the first message does not carry information about the target service, and the other in which the first message carries information about the target service.
[0089] In one scenario, the first message does not carry information about the target service.
[0090] After receiving the first message sent by the first device, the relay device can first determine whether there is a connection between the relay device and the second device. If there is no connection between the relay device and the second device, the relay device sends a second message to the second device to request establishment of a second connection between the relay device and the second device; if there is a connection between the relay device and the second device, the relay device uses the connection as the first connection between the relay device and the second device, and the relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection; if the first connection is in a state allowing sharing, the relay device sends a second message to the second device to request sharing of the first connection; if the first connection is in a state not allowing sharing, the relay device sends a second message to the second device to request establishment of a second connection between the relay device and the second device. Alternatively, when there are multiple connections between the relay device and the second device, the relay device uses any one of the multiple connections as the first connection; the relay device determines whether the first connection is in a state where sharing is allowed based on the first status indication information of the first connection, and if the first connection is in a state where sharing is allowed, sends a second message to the second device requesting to share the first connection; if the first connection is in a state where sharing is not allowed and it is determined that the judgment of all connections has been completed, sends a second message to the second device requesting to establish a second connection between the relay device and the second device; if the first connection is in a state where sharing is not allowed and there are remaining connections that have not been judged, reselect any one connection from the remaining connections as the new first connection to continue judgment.
[0091] The manner in which the relay device determines whether a connection exists between the relay device and the second device may be: the relay device obtains the identifier of the second device from the first message, and the relay device determines whether a connection exists between the relay device and the second device based on the identifier of the second device. The manner in which the relay device determines whether a connection exists between the relay device and the second device based on the identifier of the second device may include: the relay device determines whether a connection exists between the relay device and the second device based on the identifier of the second device and connection-related information of the relay device, and the connection-related information of the relay device may include information on whether a connection exists between the relay device and each of at least one candidate target device.
[0092] The above-mentioned relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection, including one of the following: when the first status indication information of the first connection includes an indication that the first connection accepts sharing, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes the maximum number of initiating devices that can share the first connection, and the current number of initiating devices that have shared the first connection is less than the maximum number, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection has not reached the maximum number, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes a first remaining number of initiating devices that can share the first connection, and the first remaining number is not zero, determining that the first connection is in a state allowing sharing.
[0093] Alternatively, the relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection, and may also include one of the following: when the first status indication information of the first connection includes an indication that the first connection does not accept sharing, determining that the first connection is in a state not allowing sharing; when the first status indication information of the first connection includes the maximum number of initiating devices that can share the first connection, and the current number of initiating devices that have shared the first connection reaches the maximum number, determining that the first connection is in a state not allowing sharing; when the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection reaches the maximum number, determining that the first connection is in a state not allowing sharing; when the first status indication information of the first connection includes a first remaining number of initiating devices that can share the first connection, and the first remaining number is zero, determining that the first connection is in a state not allowing sharing.
[0094] Here, the first status indication information of the first connection may be sent by the second device to the relay device when the relay device and the second device last established the first connection, or when the relay device and the second device last shared the first connection. The first status indication information of the first connection may include at least one of the following: an indication of whether the first connection accepts sharing; a maximum number of initiating devices that can share the first connection; an indication of whether the number of initiating devices that have shared the first connection has reached the maximum number; and a first remaining number of initiating devices that can share the first connection.
[0095] Optionally, the first status indication information of the first connection includes an indication of whether the first connection receives sharing.
[0096] The indication of whether the first connection accepts sharing may be an indication that the status indication information of each first connection is the same. In other words, the first connection does not limit the maximum number of sharing initiating devices and can continue to accept sharing, or the first connection cannot be shared and remains unshared. Whether the first connection continues to accept sharing may be determined by the second device based on configuration information or its own situation, and this embodiment does not limit this.
[0097] Alternatively, the indication of whether the first connection accepts sharing may be determined by the second device based on actual conditions each time the status indication information of the first connection is sent. For example, when the second device last determined to share the first connection, it determined that the first connection could not be shared next time. When the second device sent the last status indication information of the first connection, it set the indication of whether the first connection accepts sharing to that the first connection would not accept sharing next time. For example, when the second device last determined to establish the first connection, it determined that the first connection could be shared next time. When the second device sent the last status indication information of the first connection, it set the indication of whether the first connection accepts sharing to that the first connection would accept sharing next time. The second device may determine whether to accept sharing next time based on the maximum number of initiating devices for sharing the first connection, or the second device may determine whether to accept sharing next time based on other configuration information, or the second device may determine whether to accept sharing next time based on its own resource allocation situation. This embodiment does not limit this.
[0098] The indication of whether the first connection accepts sharing may be expressed in the form of an indication value. For example, if the indication value of the indication of whether the first connection accepts sharing is 1, it indicates that the first connection accepts sharing; and if the indication value of the indication of whether the first connection accepts sharing is 0, it indicates that the first connection does not accept sharing; or vice versa. Alternatively, the indication of whether the first connection accepts sharing may be expressed in the form of indication content. For example, if the indication content of the indication of whether the first connection accepts sharing is yes, or accept or share, it indicates that the first connection accepts sharing; and if the indication content of the indication of whether the first connection accepts sharing is no, or do not accept or share, it indicates that the first connection does not accept sharing.
[0099] Correspondingly, the relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection. It can be: when the first status indication information of the first connection includes an indication that the first connection accepts sharing, it is determined that the first connection is in a state allowing sharing; otherwise, it is determined that the first connection is in a state not allowing sharing.
[0100] Optionally, the first status indication information of the first connection includes a maximum number of initiating devices that can share the first connection.
[0101] The maximum number of initiating devices that can share the first connection may be determined by the second device based on its own configuration or circumstances, and is not limited in this embodiment. Specifically, the maximum number of initiating devices that can share the first connection may be a positive integer, such as 10, 5, 2, or a larger or smaller number, and the list is not exhaustive.
[0102] Accordingly, the relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection. This can be as follows: when the first status indication information of the first connection includes the maximum number of initiating devices that can share the first connection, the relay device obtains the current number of initiating devices that have shared the first connection; determines whether the current number of initiating devices that have shared the first connection is less than the maximum number; if so, determines that the first connection is in a state allowing sharing; otherwise, determines that the first connection is in a state not allowing sharing.
[0103] Optionally, the first status indication information of the first connection includes an indication of whether the number of initiating devices that have shared the first connection has reached a maximum number.
[0104] The indication of whether the number of initiating devices that have shared the first connection has reached the maximum number may be determined by the second device based on its own configuration. For example, the processing of the second device may include: when the second device last determined to share the first connection or established the first connection, determining the number of initiating devices that had been shared with the first connection, and judging whether the number of initiating devices that had been shared with the first connection had reached the maximum number of initiating devices that the first connection could accept for sharing; if so, including an indication that the number of initiating devices that have shared the first connection has reached the maximum number in the first status indication information of the first connection; otherwise, including an indication that the number of initiating devices that have shared the first connection has not reached the maximum number in the first status indication information of the first connection.
[0105] The indication of whether the number of the first-shared initiating devices of the first connection has reached the maximum number may be represented by an indication value. For example, if the indication value of the indication of whether the number of the first-shared initiating devices of the first connection has reached the maximum number is 1, it indicates that the maximum number has been reached; if the indication value of the indication of whether the number of the first-shared initiating devices of the first connection has reached the maximum number is 0, it indicates that the maximum number has not been reached; or vice versa. Alternatively, the indication of whether the number of the first-shared initiating devices of the first connection has reached the maximum number may be represented by an indication content. For example, if the indication content is yes or the maximum number has been reached, it indicates that the number of the first-shared initiating devices of the first connection has reached the maximum number; if the indication content is no or the maximum number has not been reached, it indicates that the number of the first-shared initiating devices of the first connection has not reached the maximum number.
[0106] Correspondingly, the relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection. It can be: if the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection has not reached the maximum number, then it is determined that the first connection is in a state allowing sharing; otherwise, it is determined that the first connection is in a state not allowing sharing.
[0107] Optionally, the first status indication information of the first connection includes a first remaining number of initiating devices that can share the first connection.
[0108] The first remaining number of initiating devices that can share the first connection may be determined by the second device. For example, the processing by the second device may include: when the second device last determined to share the first connection or last determined to establish the first connection, determining the number of initiating devices that had already shared the first connection, and subtracting the number of initiating devices that had already shared the first connection from the maximum number of initiating devices that can share the first connection to obtain the first remaining number of initiating devices that can share the first connection.
[0109] Correspondingly, the relay device determines whether the first connection is in a state allowing sharing based on the last status indication information of the first connection. It can be as follows: when the last status indication information of the first connection includes the first remaining number of initiating devices that can share the first connection, it is determined whether the first remaining number is zero; if it is not zero, it is determined that the first connection is in a state allowing sharing; otherwise, it is determined that the first connection is in a state not allowing sharing.
[0110] It should be understood that the first status indication information of the first connection may include any one of the above four types of content. Alternatively, the first status indication information of the first connection may include at least some of the above four types of content. For example, the first status indication information of the first connection may include an indication of whether the first connection accepts sharing and a first remaining number of initiating devices that can share the first connection. In this case, the relay device determines whether the first connection is in a state where sharing is permitted based on the first status indication information of the first connection. This may be done by: if the first status indication information of the first connection includes an indication of whether the first connection accepts sharing and a first remaining number of initiating devices that can share the first connection, if the indication of whether the first connection accepts sharing indicates that sharing is permitted, determining that the first connection is in a state where sharing is permitted, and saving the first remaining number of initiating devices that can share the first connection for use in conjunction with the second status indication information of the first connection when determining whether to share the first connection next time; if the indication of whether the first connection accepts sharing indicates that sharing is not permitted, determining that the first connection is in a state where sharing is not permitted, and saving the first remaining number of initiating devices that can share the first connection for use in conjunction with the second status indication information of the first connection when determining whether to share the first connection next time. This is merely an example. There may be other examples of how the first status indication information of the first connection includes at least part of the above four contents, which are not exhaustive here.
[0111] After the relay device determines that the first connection is in a sharing-allowed state, the relay device may send a second message to the second device requesting sharing of the first connection, so as to transmit data between the first device and the second device via the first connection. Transmitting data between the first device and the second device via the first connection may refer to forwarding data between the first device and the second device via the first connection by the relay device.
[0112] The second message used to request sharing of the first connection may be a link modification request message. Specifically, the second message is a link modification request message for the first connection. The second message may carry relevant information about the first connection, for example, the relevant information about the first connection may include at least one of the first connection number, the first connection identifier, and configuration information of the first connection.
[0113] The second message for requesting to share the first connection may carry an identifier of the first device. Furthermore, if the first message carries address information of the first device, the second message may also carry address information of the first device, where the address information may be network address information, such as at least one of an Internet Protocol (IP) address, a MAC (Media Access Control) address, and the like.
[0114] When no connection exists between the relay device and the second device, or when a first connection exists between the relay device and the second device and the first connection is in a state where sharing is not permitted, the relay device sends a second message to the second device for requesting establishment of a second connection between the relay device and the second device. The second message for requesting establishment of the second connection between the relay device and the second device may be a direct communication request message, and the second message for requesting establishment of the second connection between the relay device and the second device may carry an identifier of the first device. Furthermore, the second message for requesting establishment of the second connection between the relay device and the second device may also carry address information of the first device.
[0115] In another scenario, the first message carries information about the target service.
[0116] Optionally, in this scenario, the processing performed by the relay device may be the same as that in the aforementioned embodiment, that is, the relay device does not process at the granularity of the target service. In this way, the first connection may carry the target service; or, the first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service. In addition, the aforementioned second message for requesting to share the first connection, or the second message for requesting to establish a second connection between the relay device and the second device may carry information about the target service, or may not carry information about the target service. The processing of the second device, the processing of the relay device, and the processing of the first device are the same as those in the aforementioned embodiment and are not described in detail.
[0117] Optionally, when the first message carries information about the target service, the relay device processes the message based on the target service. In this manner, the first connection carries the target service; in addition, the second message for requesting sharing the first connection carries information about the target service, and the second message for requesting sharing the first connection carries information about the target service.
[0118] When there is a first connection between the relay device and the second device, and the first connection is in a state allowing sharing, the relay device sends a second message to the second device, which may include: when there is a connection that carries a target service between the relay device and the second device, the relay device uses the connection as the first connection between the relay device and the second device, and the relay device determines whether the first connection is in a state allowing sharing based on first status indication information of the first connection; when the first connection is in a state allowing sharing, sending a second message to the second device for requesting sharing of the first connection, and the second message may carry information about the target service.
[0119] In addition, when the first connection is in a state where sharing is not allowed, the processing of the relay device sending a second message to the second device for requesting to establish a second connection between the relay device and the second device is the same as the aforementioned embodiment, except that the second message for requesting to establish a second connection between the relay device and the second device carries information about the target service.
[0120] When no connection exists between the relay device and the second device, the relay device sends a second message to the second device, which may include: when no connection exists between the relay device and the second device, the relay device sends a second message to the second device for requesting establishment of a second connection between the relay device and the second device, and the second message carries information about the target service; or, when no connection exists between the relay device and the second device that carries the target service, the relay device sends a second message to the second device for requesting establishment of a second connection between the relay device and the second device, and the second message carries information about the target service.
[0121] Specifically, after the relay device receives the first message sent by the first device, it can first determine whether there is a connection between the relay device and the second device. If there is no connection between the relay device and the second device, the relay device sends a second message to the second device to request the establishment of a second connection between the relay device and the second device, and the second message carries the information of the target service; if there is one or more connections between the relay device and the second device, the relay device determines whether there is a connection carrying the target service in the one or more connections. If not, the relay device sends a second message to the second device to request the establishment of a second connection between the relay device and the second device, and the second message carries the information of the target service; if there is a connection carrying the target service, the connection is used as the first connection between the relay device and the second device, and the relay device determines whether the first connection is in a state where sharing is allowed based on the first status indication information of the first connection; if the first connection is in a state where sharing is allowed, the relay device sends a second message to the second device; if the first connection is in a state where sharing is not allowed, the relay device sends a second message to the second device to request sharing of the first connection, and the second message carries the information of the target service.
[0122] The manner in which the relay device determines whether a connection exists with the second device is the same as in the aforementioned embodiment and is not further described. The relay device determines whether a connection carrying the target service exists among the one or more connections by, for example, obtaining information about the target service from the first message and determining, based on the information about the target service, whether a connection carrying the target service exists among the one or more connections.
[0123] The above-mentioned relay device determines whether the first connection is in a state allowing sharing based on the first status indication information of the first connection, including one of the following: when the first status indication information of the first connection includes an indication that the target service carried by the first connection accepts sharing, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes the maximum number of initiating devices that can share the target service carried by the first connection, and the current number of initiating devices that have shared the target service carried by the first connection is less than the maximum number, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the target service carried by the first connection has not reached the maximum number, determining that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes a first remaining number of initiating devices that can share the target service carried by the first connection, and the first remaining number is not zero, determining that the first connection is in a state allowing sharing.
[0124] Alternatively, the relay device determines whether the first connection is in a state where sharing is allowed based on the first status indication information of the first connection, and may also include one of the following: when the first status indication information of the first connection includes an indication that the target service carried by the first connection is not subject to sharing, determining that the first connection is in a state where sharing is not allowed; when the first status indication information of the first connection includes the maximum number of initiating devices that can share the target service carried by the first connection, and the current number of initiating devices that have shared the target service carried by the first connection has reached the maximum number, determining that the first connection is in a state where sharing is not allowed; when the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number, determining that the first connection is in a state where sharing is not allowed; when the first status indication information of the first connection includes a first remaining number of initiating devices that can share the target service carried by the first connection, and the first remaining number is zero, determining that the first connection is in a state where sharing is not allowed.
[0125] Here, the first status indication information of the first connection may include at least one of the following: an indication of whether each of the one or more services carried by the first connection accepts sharing; a maximum number of initiating devices that can share each of the one or more services carried by the first connection; an indication of whether the number of initiating devices that have shared each of the one or more services carried by the first connection has reached the maximum number; and a first remaining number of initiating devices that can share each of the one or more services carried by the first connection. The one or more services include the aforementioned target service.
[0126] It should be understood that the description of the four types of content included in the first status indication information of the first connection is similar to that of the aforementioned embodiment, with the only difference being that the first status indication information of the first connection includes specific information corresponding to each service carried by the first connection, and therefore the above information content will not be repeated. The specific description of the relay device judging whether the first connection is in a state allowing sharing based on the first status indication information of the first connection is also similar to that of the aforementioned embodiment, with the only difference being that the relay device judges whether the target service carried by the first connection allows sharing based on the target service granularity, and further determines whether the first connection allows sharing, and will not be repeated here.
[0127] In some possible implementations, the second message is used to request sharing of the first connection for transmitting data between the first device and the second device. After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the second message to the relay device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state that allows sharing the first connection the next time.
[0128] The second device sends a response message to the relay device in response to the second message, including one of the following: if the second device determines to share the first connection, the second device sends a response message to the relay device indicating that the second device agrees to share the first connection; if the second device determines not to share the first connection, the second device sends a response message to the relay device indicating that the second device refuses to share the first connection. In other words, regardless of whether the second device determines to share the first connection or refuses to share the first connection, the response message to the second message carries the second status indication information of the first connection.
[0129] As described in the preceding embodiment, the second message may be a link modification request message for the first connection. Accordingly, when the response message to the second message indicates that the second device agrees to share the first connection, the response message to the second message may specifically be a link modification accept message for the first connection. When the response message to the second message indicates that the second device refuses to share the first connection, the response message to the second message may specifically be a link modification reject message for the first connection.
[0130] Next, two scenarios are described, one in which the second message for requesting to share the first connection does not carry information about the target service, and the other in which the second message for requesting to share the first connection carries information about the target service.
[0131] In one scenario, the second message for requesting to share the first connection does not carry information about the target service.
[0132] The second status indication information of the first connection includes at least one of the following: an indication of whether the first connection accepts sharing; a maximum number of initiating devices that can share the first connection; an indication of whether the number of initiating devices that have already shared the first connection has reached the maximum number; and a third remaining number of initiating devices that can share the first connection. The detailed description of the four types of content included in the second status indication information of the first connection is similar to the detailed description of the first status indication information of the first connection in the aforementioned embodiment and is not repeated here.
[0133] Before sending a response message to the second message, the second device will also determine whether to share the first connection and obtain the second status indication information of the first connection. The manner in which the second device determines whether to share the first connection and obtains the second status indication information of the first connection may include: the second device obtaining relevant status information of the first connection based on the identifier of the first connection carried in the second message; determining whether the first connection is in a shareable state based on the relevant status information of the first connection; if the first connection is in a state that is not shareable, determining not to share the first connection and generating the second status indication information of the first connection based on the relevant status information of the first connection; and if the first connection is in a state that is shareable, determining to share the first connection and generating the second status indication information of the first connection based on the relevant status information of the first connection. It should be understood that the manner in which the second device determines whether to share the first connection is merely exemplary. In actual processing, the second device may also determine whether to share the first connection based on information such as the remaining amount of its own processing resources, the total number of connection initiating devices, etc., which is not further described here.
[0134] The relevant status information of the first connection may be relevant status information of the first connection updated in real time by the second device.
[0135] Optionally, the relevant state information of the first connection may include whether the first connection remains sharing-enabled. Determining whether the first connection is in a sharing-enabled state based on the relevant state information of the first connection may include: if the relevant state information of the first connection indicates that the first connection remains sharing-enabled, determining that the first connection is in a sharing-enabled state; and if the relevant state information of the first connection indicates that the first connection remains sharing-disabled, determining that the first connection is in a non-sharing state.
[0136] Furthermore, if the first connection is in a state that cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection based on relevant status information of the first connection may include: if the first connection is in a state that cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection including an indication that the first connection does not accept sharing. If the first connection is in a state that can be shared, determining to share the first connection, and generating second status indication information of the first connection based on relevant status information of the first connection may include: if the first connection is in a state that can be shared, determining to share the first connection, and generating second status indication information of the first connection including an indication that the first connection accepts sharing.
[0137] Optionally, the relevant status information of the first connection may include the maximum number of initiating devices that the first connection can accept to be shared and the number of initiating devices that the first connection currently shares. Accordingly, judging whether the first connection is in a state that can be shared based on the relevant status information of the first connection may include: when the relevant status information of the first connection is the maximum number of initiating devices that the first connection can accept to be shared, obtaining the number of initiating devices that the first connection currently shares in the relevant status information of the first connection, and when the number of initiating devices that are currently shared is less than the maximum number, determining that the first connection is in a state that can be shared; otherwise, determining that the first connection is in a state that cannot be shared.
[0138] Further, if the first connection is in a state where it cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection based on relevant status information of the first connection may include: if the first connection is in a state where it cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection including at least one of the following: an indication that the first connection does not accept sharing, a maximum number of initiating devices that can share the first connection, an indication that the number of initiating devices that have shared the first connection has reached the maximum number, and a third remaining number of initiating devices that can share the first connection, where the third remaining number is zero. If the first connection is in a state where it can be shared, determining to share the first connection, and generating second status indication information of the first connection based on relevant status information of the first connection may include: if the first connection is in a state where it can be shared, determining to share the first connection, and generating second status indication information of the first connection including at least one of the following: an indication that the first connection accepts sharing, a maximum number of initiating devices that can share the first connection, an indication that the number of initiating devices that have shared the first connection has not reached the maximum number, and a third remaining number of initiating devices that can share the first connection, where the third remaining number is not zero.
[0139] In another scenario, the second message for requesting to share the first connection carries information of the target service.
[0140] In a possible example, the first connection carries the target service.
[0141] The second status indication information of the first connection includes at least one of the following: an indication of whether the target service carried by the first connection is shared; a maximum number of initiating devices that can share the target service carried by the first connection; an indication of whether the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number; and a third remaining number of initiating devices that can share the target service carried by the first connection. The detailed description of the four types of content included in the second status indication information of the first connection is similar to the detailed description of the first status indication information of the first connection in the aforementioned embodiment and is not repeated here.
[0142] It should be understood that the first connection may carry one or more services, which may include a target service. Therefore, the second status indication information of the first connection specifically includes at least one of the following: an indication of whether each service carried by the first connection will be shared next time; the maximum number of initiating devices that can share each service carried by the first connection; an indication of whether the number of initiating devices that have shared each service carried by the first connection has reached the maximum number; and the third remaining number of initiating devices that can share each service carried by the first connection.
[0143] Before sending the response message of the above-mentioned second message, the second device will also determine whether to share the first connection and obtain the second status indication information of the first connection. The processing method for the second device to determine whether to share the first connection and obtain the second status indication information of the first connection may include: the second device obtains the relevant status information of the target service carried by the first connection based on the identifier of the first connection and the information of the target service carried by the second message; based on the relevant status information of the target service carried by the first connection, it is determined whether the target service carried by the first connection is in a state that can be shared; if the target service carried by the first connection is in a state that cannot be shared, it is determined not to share the first connection, and the second status indication information of the first connection is generated based on the relevant status information of the target service carried by the first connection; if the target service carried by the first connection is in a state that can be shared, it is determined to share the first connection, and the second status indication information of the first connection is generated based on the relevant status information of the first connection.
[0144] Optionally, the relevant status information of the target service carried by the first connection may include whether the target service carried by the first connection remains allowed to be shared. The determination of whether the target service carried by the first connection is in a state capable of being shared based on the relevant status information of the target service carried by the first connection may include: if the relevant status information of the target service carried by the first connection indicates that the target service carried by the first connection remains allowed to be shared, determining that the target service carried by the first connection is in a state capable of being shared; if the relevant status information of the target service carried by the first connection indicates that the target service carried by the first connection remains not allowed to be shared, determining that the target service carried by the first connection is in a state capable of being shared.
[0145] Further, if the target service carried by the first connection is in a state that cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection based on relevant status information of the target service carried by the first connection, may include: if the target service carried by the first connection is in a state that cannot be shared, determining not to share the first connection, and generating second status indication information of the first connection including an indication that the target service carried by the first connection does not accept sharing. If the target service carried by the first connection is in a state that can be shared, determining to share the first connection, and generating second status indication information of the first connection based on relevant status information of the target service carried by the first connection, may include: if the target service carried by the first connection is in a state that can be shared, determining to share the first connection, and generating second status indication information of the first connection including an indication that the target service carried by the first connection accepts sharing.
[0146] Optionally, the relevant status information of the target service carried by the first connection may include the maximum number of initiating devices that the target service carried by the first connection can accept to be shared, and the number of initiating devices that the target service carried by the first connection has currently shared. Accordingly, judging whether the target service carried by the first connection is in a state that can be shared based on the relevant status information of the target service carried by the first connection may include: when the relevant status information of the target service carried by the first connection is the maximum number of initiating devices that the target service carried by the first connection can accept to be shared, obtaining the number of initiating devices that the target service carried by the first connection has currently shared from the relevant status information of the target service carried by the first connection, and when the number of initiating devices that have currently been shared is less than the maximum number, determining that the target service carried by the first connection is in a state that can be shared; otherwise, determining that the target service carried by the first connection is in a state that cannot be shared.
[0147] Further, if the target service carried by the first connection is in a state that cannot be shared, it is determined not to share the first connection, and second status indication information of the first connection is generated based on the relevant status information of the target service carried by the first connection, which may include: if the target service carried by the first connection is in a state that cannot be shared, it is determined not to share the first connection, and second status indication information of the first connection is generated, including at least one of the following: an indication that the target service carried by the first connection does not accept sharing; the maximum number of initiating devices that can share the target service carried by the first connection; an indication that the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number; the third remaining number of initiating devices that can share the target service carried by the first connection, and the third remaining number is zero. If the target service carried by the first connection is in a state where it can be shared, determining to share the first connection, and generating second status indication information of the first connection based on relevant status information of the target service carried by the first connection may include: if the target service carried by the first connection is in a state where it can be shared, determining to share the first connection, and generating second status indication information of the first connection including at least one of the following: an indication that the target service carried by the first connection does not accept sharing; the maximum number of initiating devices that can share the target service carried by the first connection; an indication that the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number; the third remaining number of initiating devices that can share the target service carried by the first connection, and the third remaining number is not zero.
[0148] In a possible example, the first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
[0149] When the second device determines to share the first connection, it sends a response message to the relay device for the second message confirming the sharing of the first connection, including: when the second device determines to share the first connection and adds the target service to the first connection, it sends a response message to the relay device for the second message indicating that the second device agrees to share the first connection. That is to say, in this example, there is a unique first connection between the relay device and the second device in a state where sharing is allowed, but the first connection does not carry the target service. The second device can add configuration information related to the target service to the first connection based on the information of the target service carried in the second message to add the target service. When the addition of the target service is successful, the second device sends a response message to the relay device for confirming the sharing of the first connection.
[0150] Additionally, the method may further include: if the second device determines not to share the first connection, or if the target service cannot be added to the first connection, sending a response message to the relay device to indicate that the second device rejects the second message of the shared first connection. Furthermore, in this case, the one or more services in the second status indication information of the first connection do not include the target service.
[0151] The manner in which the second device determines whether to share the first connection can be the same as the manner in which the relevant state information of the first connection is used to determine in the aforementioned embodiment, and will not be described again. This embodiment does not limit the reason why the second device cannot add the target service.
[0152] In some possible implementations, the second message is used to request sharing of the first connection for transmitting data between the first device and the second device. After the relay device sends the second message to the second device, the method further includes: the relay device receiving a response message to the second message sent by the second device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state that allows sharing the first connection the next time.
[0153] Regarding the processing method of the relay device for determining whether the first connection is in a state allowing sharing next time based on the second status indication information of the first connection, the processing method of the relay device for determining whether the first connection is in a state allowing sharing based on the first status indication information of the first connection in the aforementioned embodiment is the same as that in the aforementioned embodiment, and no repeated explanation is given.
[0154] In one scenario, the second message for requesting to share the first connection does not carry information about the target service.
[0155] Optionally, the first message is also used to request establishment of a fourth connection between the first device and the relay device; after the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sends a connection confirmation response to the first device when the response message to the second message is used to indicate that the second device agrees to share the first connection and completes the establishment of the fourth connection.
[0156] Correspondingly, after the first device sends the first message to the relay device, the method further includes: upon receiving a connection confirmation response sent by the relay device, the first device determines to establish the fourth connection and determines that the first device and the second device complete the connection.
[0157] Specifically, when the response message of the second message indicates that the second device agrees to share the first connection and the fourth connection is established, the relay device sends a connection confirmation response to the first device. This may include: when the response message of the second message indicates that the second device agrees to share the first connection, the relay device and the first device exchange security information; after the relay device and the first device complete the security information exchange and determine that the fourth connection is established, the relay device sends a connection confirmation response to the first device. The connection confirmation response may carry the address information of the second device, and the address information may be network address information, such as at least one of an (Internet Protocol) address, a MAC (Media Access Control) address, and the like. The address information of the second device may be obtained by the relay device from the locally stored context of the first connection; or the address information of the second device may be carried in the response message of the aforementioned second message.
[0158] Among them, the process of security information interaction between the relay device and the first device may also include: when the first message carries the address information of the first device, the relay device performs security information interaction processing with the first device based on the address information of the first device; or, when the first message does not carry the address information of the first device, the relay device obtains its address information from the first device, and then the relay device performs security information interaction processing with the first device based on the address information of the first device. It should be pointed out that before the first device and the relay device complete the establishment of the fourth connection, the direct communication request message transmitted between the first device and the relay device is a signaling message, which only needs to use the identifier of the first device; and the establishment of the fourth connection between the first device and the relay device requires further establishment of a security-based connection, so it needs to be completed using the address information of the first device; this embodiment does not limit the specific processing from the security information interaction between the first device and the relay device to the completion of the establishment of the fourth connection.
[0159] Optionally, after the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device resending a second message to the second device for requesting to establish a second connection between the relay device and the second device when the response message to the second message is used to indicate that the second device refuses to share the first connection.
[0160] Alternatively, after the relay device receives a response message to the second message sent by the second device, the method further includes: if the response message to the second message indicates that the second device refuses to share the first connection, the relay device determines whether there are other connections other than the first connection between the relay device and the second device; if no connections exist, resending a second message to the second device requesting establishment of a second connection between the relay device and the second device; if one or more other connections exist, selecting one of the one or more other connections as a fifth connection; and if the fifth connection is in a state where sharing is permitted, sending a third message to the second device, requesting sharing of the fifth connection to forward data between the first device and the second device via the fifth connection. The method may further include: if the fifth connection is not in a state where sharing is not permitted, sending a second message to the second device requesting establishment of a second connection between the relay device and the second device. Alternatively, the method may further include: if the fifth connection is not in a state where sharing is not permitted, selecting another connection from the remaining connections as the fifth connection and re-determining the connection; and if no other connections exist, sending a second message to the second device requesting establishment of a second connection between the relay device and the second device.
[0161] In this case, the method of generating the aforementioned third message is similar to that of the aforementioned first message, except that the first connection corresponding to the first message is replaced by the fifth connection, and the method of judging whether the fifth connection is in a state that allows sharing is also the same as the method of judging whether the first connection is in a state that allows sharing, and will not be repeated. The processing after the second device receives the third message sent by the relay device is also similar to the processing after the aforementioned second device receives the second message sent by the relay device, and will not be repeated. The content that may be contained in the response message to the third message sent by the second device is also similar to the response message to the aforementioned second message, except that the first connection therein is replaced by the fifth connection, and will not be repeated. The processing after the relay device receives the response message to the third message sent by the second device is also similar to the processing after the relay device receives the response message to the second message sent by the second device, and will not be repeated.
[0162] In another scenario, the second message for requesting to share the first connection carries information of the target service.
[0163] After the relay device receives a response message to the second message sent by the second device, if the response message to the second message is used to indicate that the second device agrees to share the first connection, the processing of the relay device and the processing of the first device are the same as those in the aforementioned embodiment. The only difference is that the first connection carries the target service, so no repeated description is given.
[0164] When the response message of the second message is used to indicate that the second device refuses to share the first connection, the relay device resends to the second device a second message for requesting to establish a second connection between the relay device and the second device, and the second message for requesting to establish a second connection between the relay device and the second device carries information about the target service.
[0165] In some possible implementations, the second message is used to request establishment of a second connection between the relay device and the second device for transmitting data between the first device and the second device. After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the relay device to indicate whether the second device and the relay device have completed establishing the second connection.
[0166] In one scenario, the second message for requesting to establish a second connection between the relay device and the second device does not carry information about the target service.
[0167] The processing of the second device sending a response message to the relay device in response to the second message may include: the second device exchanging security information with the relay device, and after the second device and the relay device have exchanged security information, if the second device determines that the second connection has been established, sending a response message to the relay device in response to the second message indicating that the second device and the relay device have completed establishing the second connection, wherein the response message to the second message may carry the address information of the second device. It should be understood that if the second device determines that the second connection cannot be established, it may send a response message to the relay device in response to the second message indicating that the establishment of the second connection failed.
[0168] The response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message to the second message carries status indication information of the second connection. The status indication information of the second connection is used by the relay device to determine whether the second connection is in a state that allows sharing the next time. The content and generation method of the status indication information of the second connection are similar to those of the second status indication information of the first connection described above and are not further described.
[0169] After the relay device sends the second message to the second device, the method further includes: the relay device receives a response message to the second message sent by the second device, and the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
[0170] The first message is also used to request establishment of a fourth connection between the first device and the relay device. After the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sending a connection confirmation response to the first device when the response message to the second message indicates that the second device and the relay device have completed establishment of the second connection and the fourth connection.
[0171] Here, when the response message to the second message is used to indicate that the second device and the relay device have completed the establishment of the second connection and the fourth connection, the relay device sends a connection confirmation response to the first device, which may include: when the response message to the second message is used to indicate that the second device and the relay device have completed the establishment of the second connection, the relay device and the first device exchange security information; after the relay device and the first device complete the security information exchange, when it is determined that the fourth connection is completed, the relay device sends a connection confirmation response to the first device. The relevant description of the connection confirmation response is the same as that of the aforementioned embodiment and is not repeated here.
[0172] After the first device sends the first message to the relay device, the method further includes: upon receiving a connection confirmation response sent by the relay device, the first device determines to establish the fourth connection and determines that the first device and the second device are connected.
[0173] In one scenario, the second message for requesting to establish a second connection between the relay device and the second device carries information about the target service.
[0174] The processing by the second device may include: the second device receiving a second message sent by the relay device, the second message being used to request establishment of a second connection between the relay device and the second device, the second connection being used to transmit data between the first device and the second device, specifically, the second message being used to request establishment of a second connection between the relay device and the second device that carries the target service. After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the second message to the relay device, the response message to the second message being used to indicate whether establishment of the second connection between the relay device and the second device that carries the target service is complete.
[0175] Regarding the manner in which the second device establishes the second connection that carries the target service, the manner may include: the second device exchanges security information with the relay device, and after the second device and the relay device exchange security information, establishes the second connection that carries the target service based on the information of the target service. In addition, when it is determined that the establishment of the second connection is complete, a response message to the second message indicating the completion of the establishment of the second connection that carries the target service is sent to the relay device. The response message to the second message may carry the address information of the second device. It should be understood that if the second device determines that the second connection cannot be established, a response message to the second message indicating the failure to establish the second connection may be sent to the relay device.
[0176] Wherein, when the response message to the second message is used to indicate the completion of establishing the second connection carrying the target service, the response message to the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing the next time. The content and generation method of the status indication information of the second connection are similar to those of the second status indication information of the first connection described above and are not further described.
[0177] The processing performed by the relay device after receiving the response message to the second message sent by the second device is the same as that in the above embodiment and will not be repeated.
[0178] 6A , the communication method is exemplarily described by taking the first device as the first initiating UE, the relay device as the Relay UE, the second device as the target UE, and the connection as the PC5 connection as an example, specifically including:
[0179] Step 6101: A first initiating UE sends a first message to a relay UE. The first message carries the identifier of the first initiating UE and the identifier of the target UE. The first message may be a direct communication request message. Optionally, the first message may also carry information about the target service. Optionally, the first message may also carry the address information of the first initiating UE.
[0180] Step 6102: The relay UE determines whether there is a PC5 connection between it and the target UE. If there is a first PC5 connection between the relay UE and the target UE, step 6103 is executed; if there is no PC5 connection, step 6108 is executed.
[0181] Step 6103: The relay UE determines whether the first PC5 connection is in a state allowing sharing based on the first connection state information of the first PC5 connection. If the first PC5 connection is in a state allowing sharing, execute step 6104; otherwise, execute step 6108.
[0182] Step 6104: The relay UE sends a second message to the target UE, where the second message is used to request sharing of the first PC5 connection.
[0183] The second message may specifically be a link modification request message for the first PC 5 .
[0184] Step 6105: The target UE determines whether to share the first PC5 connection. If it is determined to share the first PC5 connection, execute step 6106; otherwise, execute step 6107.
[0185] Step 6106: The target UE sends a response message of the second message for confirming sharing the first PC5 connection to the relay UE, and then executes step 6110.
[0186] The response message for confirming the second message of sharing the first connection may specifically be a link modification acceptance message for the connection to the first PC 5 .
[0187] Step 6107: The target UE sends a response message to the relay UE for the second message for rejecting the sharing of the first PC5 connection. The response message for rejecting the second message for rejecting the sharing of the first PC5 connection may be a link modification rejection message for the first PC5 connection.
[0188] Step 6108: The relay UE sends a second message to the target UE, where the second message is used to request establishment of a second PC5 connection between the relay device and the second device, where the second PC5 connection is used to transmit data between the first device and the second device. The second message may be a direct communication request message.
[0189] Step 6109: When the target UE and the relay UE complete establishing the second PC5 connection, the target UE sends a response message to the relay UE to confirm the completion of the second PC5 connection establishment. The response message to the second message to confirm the completion of the second PC5 connection establishment may be a direct communication acceptance message corresponding to the second message.
[0190] Step 6110: The relay UE interacts with the first initiating UE for security information.
[0191] Step 6111: The relay UE sends a connection confirmation response to the first initiating UE, and the process ends. The connection confirmation response may be a direct communication acceptance message corresponding to the first message.
[0192] The above-mentioned first message can carry information of the target business, the second message can carry information of the target business, and the second message can carry information of the target business; regarding the case where the above-mentioned message carries information of the target business, the specific processing of the above-mentioned steps is the same as the above-mentioned embodiment, so it will not be repeated.
[0193] Through the above example, the relay UE can determine whether to send a second message, namely a link modification request message for the first PC5 connection, to the target UE based on whether the first PC5 connection allows sharing. This allows the first PC5 connection between the relay UE and the target UE to serve multiple initiating UEs. It also avoids the problem of the relay UE sending a link modification request message without making a judgment, which would result in a response message rejecting sharing and the relay UE having to re-establish a link with the target UE, which would waste resources and time.
[0194] 6B , the communication method is exemplarily described below, taking the first device as the initiating UE, the relay device as the Relay terminal, the second device as the target UE, the first message as the direct communication request, the second message as the first request, the response message to the second message as the first response, the connection confirmation response as the direct communication acceptance, and the connection as the PC5 connection as an example, specifically including:
[0195] Step 6201: The initiating UE sends a direct communication request message to the relay terminal. The direct communication request message includes the initiating UE identifier, the target UE identifier, and optionally service information and address information of the initiating UE. In this embodiment, the UE identifier may be the UE's application layer identifier and / or link layer identifier (Layer 2 ID), the service information may include an application identifier, service type, relay service code, etc., and the address information may include, for example, an IP address or MAC address.
[0196] Step 6202: The relay terminal determines that there is no PC5 connection between the relay UE and the target UE or there is no PC5 connection for the corresponding service, then the first request is a direct communication request message, which includes the identifier of the initiating UE and optionally includes the address information of the initiating UE.
[0197] If a PC5 connection already exists or a PC5 connection corresponding to the service already exists, the relay terminal sends a first request to the target UE, which is a link modification request message for the existing PC5 connection, requesting that the existing PC5 connection be used to transmit data between the initiating UE and the target UE. This message includes the initiating UE's identifier and, optionally, the initiating UE's address information.
[0198] Step 6203: The target UE and the relay terminal exchange security information. This step may be performed when the first request is a direct communication request message.
[0199] Step 6204: The target UE sends a first response to the relay terminal.
[0200] Specifically, if the first request is a direct communication request message, the target UE replies with a first response to the relay terminal. The first response is a direct communication acceptance message. The direct communication acceptance message may optionally include the address information of the target UE. This step also carries the maximum number of initiating UEs acceptable to the connection; or whether link sharing is accepted. The relay terminal decides whether the first request message sent to the target UE next time is a link modification request message or a direct communication request message based on the maximum number of initiating UEs acceptable to the connection; if the carried indication is to accept link sharing, the first request message sent by the relay terminal next time is a link modification request message, otherwise it is a direct communication request message. If the carried indication is that the current link has the maximum number of initiating UEs acceptable, the relay terminal can calculate the maximum number of initiating UEs supported by the current link, and then decides whether the first request sent is a link modification request message or a direct communication request message based on this maximum number.
[0201] The target UE determines to reuse the existing PC5 connection through the first response. The first response (message) can be, for example, a link modification acceptance message for the existing PC5 connection, and the address information of the target UE can be optionally included in this step. This step also carries the maximum number of initiating UEs acceptable to the connection; or whether to continue to accept link sharing; this step also carries the maximum number of initiating UEs acceptable to the connection; or whether to accept link sharing; or the maximum number of initiating UEs acceptable to the current link; the relay terminal decides whether the first request message sent to the target UE next time is a link modification request message or a direct communication request message based on the maximum number of initiating UEs acceptable to the connection; if the carried indication is to continue to accept link sharing, the first request message sent by the relay UE next time is a link modification request message, otherwise it is a direct communication request message. If the carried indication is that the maximum number of initiating UEs acceptable to the current link has been reached, the relay UE can calculate the maximum number of initiating UEs acceptable to the current link. At this time, if some initiating UEs stop the service and release the link, the relay UE can continue to use the link for other initiating UEs.
[0202] Step 6205: The initiating UE and the relay terminal exchange security information. In this step, the relay terminal may also optionally obtain the address information of the initiating UE.
[0203] Step 6206: The relay terminal responds with a direct communication acceptance message to the initiating UE, completing the PC5 link establishment between the relay UE and the initiating UE. This message carries the target UE's address information. The relay UE determines the target UE's address, for example, from step 6204 or from a locally stored context of an existing PC5 connection between the relay UE and the target UE.
[0204] In some possible implementations, the first device may determine whether to share the connection with the relay device.
[0205] The first device sends a first message to the relay device, including: when there is a third connection between the first device and the relay device and the third connection is in a state allowing sharing, the first device sends the first message to the relay device, and the first message is also used to request sharing of the third connection.
[0206] The first device sends a first message to the relay device, including: when there is a third connection between the first device and the relay device, and the third connection is in a state where sharing is not allowed, the first device sends the first message to the relay device, and the first message is also used to request establishment of a fourth connection between the first device and the relay device.
[0207] The first device sends a first message to the relay device, including: when there is no connection between the first device and the relay device, the first device sends the first message to the relay device, and the first message is also used to request establishment of a fourth connection between the first device and the relay device.
[0208] The first device determines whether the third connection is in a sharing-allowed state based on the first state indication information of the third connection.
[0209] That is, in this embodiment, the first message is further used to request sharing of a third connection between the first device and the relay device, or the first message is further used to request establishment of a fourth connection between the first device and the relay device.
[0210] The first message may carry the identifier of the first device and the identifier of the second device. Alternatively, the first message may carry information of the target service in addition to the identifier of the first device and the identifier of the second device.
[0211] Next, two scenarios are described, one in which the first message does not carry information about the target service, and the other in which the first message carries information about the target service.
[0212] In one scenario, the first message does not carry information about the target service.
[0213] Before the first device sends the first message to the relay device, it can first determine whether there is a connection between the first device and the relay device. If there is no connection between the first device and the relay device, the first device sends a first message to the relay device to request establishment of a fourth connection between the first device and the relay device.
[0214] Alternatively, before the first device sends the first message to the relay device, it may first determine whether there is a connection between the first device and the relay device. If there is a connection between the first device and the relay device, the connection is used as the third connection between the first device and the relay device. The first device determines whether the third connection is in a state that allows sharing based on the first status indication information of the third connection; if the third connection is in a state that allows sharing, the first device sends a first message to the relay device for requesting to share the third connection; if the third connection is in a state that does not allow sharing, the first device sends a first message to the relay device for requesting to establish a fourth connection between the first device and the relay device.
[0215] Alternatively, before the first device sends the first message to the relay device, it may first determine whether there is a connection between the first device and the relay device. If there are multiple connections between the first device and the relay device, any one of the multiple connections may be used as the third connection; the first device determines whether the third connection is in a state allowing sharing based on the first status indication information of the third connection. If the third connection is in a state allowing sharing, the first device sends a first message to the relay device requesting to share the third connection; if the third connection is in a state not allowing sharing and it is determined that the judgment of all connections has been completed, the first message is sent to the relay device requesting to establish a fourth connection between the first device and the relay device; if the third connection is in a state not allowing sharing and there are remaining connections that have not been judged, any one connection is reselected from the remaining connections as a new third connection to continue the judgment.
[0216] The above-mentioned method of determining whether a connection exists with the relay device may be that the first device obtains the status information between the candidate relay devices stored by itself, which is not limited in this embodiment.
[0217] The first device determines whether the third connection is in a state allowing sharing based on the first state indication information of the third connection, including one of the following: the first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the third connection accepts sharing; the first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a maximum number of target devices that can share the third connection, and the number of target devices that have shared the third connection is less than the maximum number; the first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the number of target devices that have shared the third connection has not reached the maximum number; the first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a second remaining number of target devices that can share the third connection, and the second remaining number is not zero. Alternatively, in the opposite case to the above, the first device determines that the third connection is in a state not allowing sharing, which will not be repeated.
[0218] Here, the first status indication information of the third connection may be sent by the relay device to the first device when the first device and the relay device last established the third connection or when the first device and the relay device last shared the third connection. The first status indication information of the third connection may include at least one of the following: an indication of whether the third connection is shared; a maximum number of target devices that can share the third connection; an indication of whether the number of target devices that have shared the third connection has reached the maximum number; and a second remaining number of target devices that can share the third connection.
[0219] The detailed description of the four types of content included in the first status indication information of the third connection is similar to the detailed description of the first status indication information of the first connection in the aforementioned embodiment, and thus is not repeated here. Furthermore, the processing by which the first device determines whether the third connection is in a state allowing sharing based on each type of content is also similar to the processing by which the relay device determines whether the first connection is in a state allowing sharing based on each type of content, and thus is not repeated here.
[0220] After the first device determines that the third connection is in a sharing-allowed state, the first device may send the first message to the relay device, where the first message is used to request a connection with the second device and to request sharing of the third connection. Sharing the third connection may include forwarding data between the first device and the second device by the relay device via the third connection.
[0221] The first message for requesting sharing of the third connection may be a link modification request message. Specifically, the first message is a link modification request message for the third connection. The first message may also carry relevant information about the third connection, for example, the relevant information about the third connection may be at least one of a number of the third connection, an identifier of the third connection, and configuration information of the third connection.
[0222] When no connection exists between the first device and the relay device, or when the third connection between the first device and the relay device is in a sharing-disabled state, the first device sends a first message to the relay device requesting establishment of a fourth connection between the first device and the relay device. The first message may be a direct communication request message, and the first message may carry an identifier of the first device. Furthermore, the first message may also carry address information of the first device.
[0223] In another scenario, the first message carries information about the target service.
[0224] Optionally, the processing performed by the first device may be the same as in the aforementioned embodiment, that is, the first device does not perform processing at the granularity of the target service. In this manner, the third connection may carry the target service; or the third connection does not carry the target service, and no connection carrying the target service exists between the first device and the relay device.
[0225] Optionally, when the first message carries information of the target service, the first device processes the message based on the target service as the granularity. In this manner, the third connection carries the target service.
[0226] When there is a third connection between the first device and the relay device, and the third connection is in a state allowing sharing, the first device sends the first message to the relay device, which may include: when there is a connection that carries the target service between the first device and the relay device, the first device uses the connection as the third connection between the first device and the relay device, and the first device determines whether the third connection is in a state allowing sharing based on first status indication information of the third connection; when the third connection is in a state allowing sharing, the first device sends the first message to the relay device, the first message is also used to request sharing of the third connection, and the first message carries information of the target service.
[0227] When the third connection is in a state where sharing is not allowed, the first device sends the first message to the relay device. The first message is also used to request the establishment of a fourth connection between the first device and the relay device, which is the same as the aforementioned embodiment, except that the first message carries information about the target service.
[0228] When there is no connection between the first device and the relay device, the first device sends the first message to the relay device, and the first message is also used to request the establishment of a fourth connection between the first device and the relay device. This may include: when there is no connection between the first device and the relay device, the first device sends the first message to the relay device for requesting the establishment of the fourth connection between the first device and the relay device; or when there is no connection between the first device and the relay device that carries the target service, the first device sends the first message to the relay device for requesting the establishment of the fourth connection between the first device and the relay device. The difference from the above embodiment is that, when there is one or more connections between the first device and the relay device, the first device further determines whether there is a connection that carries the target service among the one or more connections.
[0229] The first device determines whether the third connection is in a state allowing sharing based on the first state indication information of the third connection, including one of the following: if the first state indication information of the third connection includes an indication that the target service carried by the third connection is shared, determining that the third connection is in a state allowing sharing; if the first state indication information of the third connection includes a maximum number of target devices that can share the target service carried by the third connection, and the number of target devices that have shared the target service carried by the third connection is less than the maximum number, determining that the third connection is in a state allowing sharing; if the first state indication information of the third connection includes an indication that the number of target devices that have shared the target service carried by the third connection has not reached the maximum number, determining that the third connection is in a state allowing sharing; if the first state indication information of the third connection includes a second remaining number of target devices that can share the target service carried by the third connection, and the second remaining number is not zero, determining that the third connection is in a state allowing sharing. Alternatively, in the opposite case to the above, determining that the third connection is in a state not allowing sharing.
[0230] Here, the first status indication information of the third connection may include at least one of the following: an indication of whether each of the one or more services carried by the third connection accepts sharing; a maximum number of target devices that can share each of the one or more services carried by the third connection; an indication of whether the number of target devices that have shared each of the one or more services carried by the third connection has reached the maximum number; or a second remaining number of target devices that can share each of the one or more services carried by the third connection. The one or more services include the aforementioned target services. It should be understood that the description of the four types of content included in the first status indication information of the third connection is similar to that of the aforementioned embodiment, and therefore the above-mentioned information content will not be repeated here. The specific description of the judgment processing performed by the first device is also similar to that of the aforementioned embodiment, with the only difference being that the first device determines whether the target services carried by the third connection allow sharing based on the granularity of the target services, and then determines whether the third connection allows sharing. This description will not be repeated here.
[0231] In some possible implementations, the processing performed by the relay device after receiving the first message sent by the first device may be: the relay device sends a second message to the second device, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0232] Regarding the above processing of the relay device, the specific descriptions in two scenarios, namely, when the first message carries information about the target service and when the first message does not carry information about the target service, are the same as those in the previous embodiment and will not be repeated.
[0233] In some possible implementations, the second message is used to request sharing of the first connection for transmitting data between the first device and the second device. After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the second message to the relay device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state that allows sharing the first connection the next time.
[0234] Regarding the above processing of the second device, the specific descriptions in two scenarios, namely, when the second message carries information about the target service and when the second message does not carry information about the target service, are the same as those in the previous embodiment and will not be repeated.
[0235] After the relay device sends the second message to the second device, the method also includes: the relay device receives a response message to the second message sent by the second device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
[0236] Regarding the processing method of the relay device for determining whether the first connection is in a state allowing sharing next time based on the second status indication information of the first connection, the processing method of the relay device for determining whether the first connection is in a state allowing sharing based on the first status indication information of the first connection in the aforementioned embodiment is the same as that in the aforementioned embodiment, and no repeated explanation is given.
[0237] In one scenario, the second message for requesting to share the first connection does not carry information about the target service.
[0238] Optionally, the first message is also used to request establishment of a fourth connection between the first device and the relay device; after the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sends a connection confirmation response to the first device when the response message to the second message is used to indicate that the second device agrees to share the first connection and completes the establishment of the fourth connection.
[0239] Correspondingly, after the first device sends the first message to the relay device, the method further includes: upon receiving a connection confirmation response sent by the relay device, the first device determines to establish the fourth connection and determines that the first device and the second device complete the connection.
[0240] When the response message of the second message is used to indicate that the second device agrees to share the first connection and completes the establishment of the fourth connection, the process of the relay device sending a connection confirmation response to the first device is the same as the above embodiment and will not be repeated.
[0241] The difference from the aforementioned embodiment is that, in this case, the connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine next time whether the fourth connection is in a state that allows sharing. The status indication information of the fourth connection may include at least one of the following: an indication of whether the fourth connection accepts sharing, the maximum number of target devices that can share the fourth connection, an indication of whether the number of target devices that have shared the fourth connection has reached the maximum number, and the remaining number of target devices that can share the fourth connection. The meaning of the specific content in the status indication information of the fourth connection is similar to the specific content and meaning of the second (or first) status indication information of the first connection in the aforementioned embodiment, and will not be elaborated on.
[0242] Optionally, the first message is also used to request sharing of the third connection between the first device and the relay device; after the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sends a sharing confirmation response to the first device when the response message to the second message is used to indicate that the second device agrees to share the first connection and the relay device determines to share the third connection. The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state where sharing is allowed next time.
[0243] Correspondingly, after the first device sends the first message to the relay device, the method further includes: upon receiving the sharing confirmation response sent by the relay device, the first device determines to share the third connection and determines that the first device and the second device complete the connection.
[0244] In this case, the sharing confirmation response carries the second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state that allows sharing the next time. The second status indication information of the third connection may include at least one of the following: an indication of whether the third connection accepts sharing, the maximum number of target devices that can share the third connection, an indication of whether the number of target devices that have shared the third connection has reached the maximum number, and the remaining number of target devices that can share the third connection. The meaning of the specific content in the second status indication information of the third connection is similar to the specific content and meaning of the second (or first) status indication information of the first connection in the aforementioned embodiment, and will not be repeated.
[0245] Optionally, the response message to the second message is used to instruct the second device to refuse to share the first connection. The processing of the relay device after receiving the response message to the second message sent by the second device is the same as that in the above embodiment and will not be repeated.
[0246] In another scenario, the aforementioned second message carries information about the target service.
[0247] After the relay device receives a response message to the second message sent by the second device, if the response message to the second message is used to indicate that the second device agrees to share the first connection, the processing of the relay device and the processing of the first device are the same as those in the aforementioned embodiment. The only difference is that the first connection carries the target service, so no repeated description is given.
[0248] When the response message to the second message indicates that the second device refuses to share the first connection, the relay device sends a second message to the second device, wherein the second message is used to request establishment of a second connection between the relay device and the second device, and the second connection is used to transmit data between the first device and the second device. The second message differs from the previous embodiment in that the second message carries information about the target service.
[0249] In some possible implementations, the second message is used to request establishment of a second connection between the relay device and the second device, where the second connection is used to transmit data between the first device and the second device.
[0250] In one scenario, the second message for requesting to establish a second connection between the relay device and the second device does not carry information about the target service.
[0251] After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the relay device in response to the second message, where the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection. The processing of the second device is the same as in the previous embodiment and is not further described.
[0252] After the relay device sends the second message to the second device, the method further includes: the relay device receives a response message to the second message sent by the second device, and the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
[0253] Optionally, the first message is further used to request establishment of a fourth connection between the first device and the relay device. After the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sending a connection confirmation response to the first device when the response message to the second message is used to indicate that the second device and the relay device have completed establishment of the second connection and the fourth connection.
[0254] Here, the processing between the relay device and the first device is the same as in the previous embodiment and is not described in detail. The only difference from the previous embodiment is that the connection confirmation response carries the second status indication information of the fourth connection. The second status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a sharing-allowed state the next time. The second status indication information of the fourth connection is also the same as in the previous embodiment and is not described again.
[0255] Optionally, the first message is also used to request sharing of a third connection between the first device and the relay device. After the relay device receives a response message to the second message sent by the second device, the method further includes: the relay device sending a sharing confirmation response to the first device when the response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection and the relay device determines to share the third connection.
[0256] Here, the processing between the relay device and the first device is the same as in the previous embodiment and will not be repeated here. The only difference from the previous embodiment is that in this case, the sharing confirmation response carries the second status indication information of the third connection. This second status indication information of the third connection is used by the first device to determine whether the third connection is in a sharing-allowed state the next time. The second status indication information of the third connection is also the same as in the previous embodiment and will not be repeated here.
[0257] In one scenario, the second message for requesting to establish a second connection between the relay device and the second device carries information about the target service.
[0258] The processing by the second device may include: the second device receiving a second message sent by the relay device, the second message being used to request establishment of a second connection between the relay device and the second device, the second connection being used to transmit data between the first device and the second device, specifically, the second message being used to request establishment of a second connection between the relay device and the second device that carries the target service. After the second device receives the second message sent by the relay device, the method further includes: the second device sending a response message to the second message to the relay device, the response message to the second message being used to indicate whether establishment of the second connection that carries the target service is complete.
[0259] The manner in which the second device establishes the second connection carrying the target service and the response message of the second message is used to indicate completion of the process of establishing the second connection carrying the target service are the same as those in the aforementioned embodiment and will not be described in detail.
[0260] After the relay device sends the second message to the second device, the method further includes: the relay device receiving a response message to the second message sent by the second device, where the response message to the second message is used to indicate whether the second connection carrying the target service is established.
[0261] The first message is also used to request the establishment of a fourth connection between the first device and the relay device, or the first message is also used to request the sharing of a third connection between the first device and the relay device. In both cases, the subsequent processing of the relay device and the first device is the same as that in the aforementioned embodiment and will not be repeated.
[0262] 7A , the communication method is exemplarily described below, taking the first device as the first initiating UE, the relay device as the Relay UE, the second device as the target UE, and the connection as the PC5 connection as an example, specifically including:
[0263] Step 7101: The first initiating UE determines whether there is a PC5 connection between it and the relay UE. If there is a third PC5 connection between the first initiating UE and the relay UE, step 7102 is executed; if there is no PC5 connection, step 7104 is executed.
[0264] Step 7102: The first initiating UE determines whether the third PC5 connection is in a state allowing sharing based on the first connection state information of the third PC5 connection. If the third PC5 connection is in a state allowing sharing, execute step 7103; otherwise, execute step 7104.
[0265] Step 7103: The first initiating UE sends a first message to the relay UE. This first message is used to request a connection with the second device and to request sharing of the third PC5 connection. The relay UE then executes step 7105. The first message carries the identifier of the first initiating UE and the identifier of the target UE. The first message can be a link modification request message for the third PC5 connection. Optionally, the first message can also carry information about the target service. Optionally, the first message can also carry the address information of the first initiating UE.
[0266] Step 7104: The first initiating UE sends a first message to the relaying UE. This first message is used to request a connection with the second device and to request establishment of a fourth PC5 connection between the first initiating UE and the relaying UE. The first message carries the identifier of the first initiating UE and the identifier of the target UE. The first message may be a direct communication request message. Optionally, the first message may also carry information about the target service. Optionally, the first message may also carry address information of the first initiating UE.
[0267] Step 7105: The relay UE determines whether there is a PC5 connection between it and the target UE. If there is a first PC5 connection between the relay UE and the target UE, step 7106 is executed; if there is no PC5 connection, step 7111 is executed.
[0268] Step 7106: The relay UE determines whether the first PC5 connection is in a state allowing sharing based on the first connection status information of the first PC5 connection. If the first PC5 connection is in a state allowing sharing, execute step 7107; otherwise, execute step 7111.
[0269] Step 7107: The relay UE sends a second message to the target UE, where the second message is used to request sharing of the first PC5 connection. The second message may specifically be a link modification request message for the first PC5 connection.
[0270] Step 7108: The target UE determines whether to share the first PC5 connection. If it is determined to share the first PC5 connection, execute step 7109; otherwise, execute step 7110.
[0271] Step 7109: The target UE sends a response message to the relay UE for confirming the second message of sharing the first PC5 connection, and then the relay UE executes step 7113. The response message for confirming the second message of sharing the first connection can be a link modification accept message for the first PC5 connection.
[0272] Step 7110: The target UE sends a response message to the relay UE for the second message for rejecting the sharing of the first PC5 connection. The response message to the second message for rejecting the sharing of the first PC5 connection may be a link modification rejection message for the first PC5 connection.
[0273] Step 7111: The relay UE sends a second message to the target UE, where the second message is used to request establishment of a second PC5 connection between the relay device and the second device, where the second PC5 connection is used to transmit data between the first device and the second device. The second message may be a direct communication request message.
[0274] Step 7112: When the target UE and the relay UE complete establishing the second PC5 connection, the target UE sends a response message to the relay UE to confirm the second message for confirming the completion of establishing the second PC5 connection. The response message to the second message for confirming the completion of establishing the second PC5 connection may be a direct communication acceptance message corresponding to the second message.
[0275] Step 7113: If the first request is for establishing a fourth PC5 connection between the first initiating UE and the relay UE, the relay UE sends a connection confirmation response to the first initiating UE; if the first request is for sharing a third PC5 connection, the relay UE sends a sharing confirmation response to the first initiating UE. The connection confirmation response may be a direct communication acceptance message corresponding to the first message, and the sharing confirmation response may be a link modification acceptance message corresponding to the first message.
[0276] The first message may carry target service information, and the second message may carry target service information. When the message carries target service information, the specific processing of the steps is the same as that in the previous embodiment, and thus will not be repeated.
[0277] Through the above example, the relay UE can determine whether to send the second message, i.e., the link modification request message for the first PC5 connection, to the target UE based on whether the first PC5 connection is allowed to be shared. In addition, through the above example, the first initiating UE can determine whether to initiate a direct communication request or a link modification request to the relay UE based on the number of target UEs.
[0278] 7B , the communication method is exemplarily described below, taking the first device as the initiating UE, the relay device as the Relay terminal, the second device as the target UE, the first message as the second request, the second message as the first request, the response message to the second message as the first response, and the connection as the PC5 connection as an example, specifically including:
[0279] Step 7201: The initiating UE sends a second request to the relay terminal. The second request (message) includes the initiating UE identifier, the target UE identifier, and optionally service information and address information of the initiating UE. The UE identifier in this embodiment may be the UE's application layer identifier or link layer identifier (Layer 2 ID), the service information may be an application identifier, service type, relay service code, etc., and the address information may be, for example, an IP address, a MAC address, etc.
[0280] If the initiating UE determines that there is no PC5 connection between the relay UE and the initiating UE or there is no PC5 connection for the corresponding service, the second request is a direct communication request message.
[0281] If a PC5 connection already exists or a PC5 connection corresponding to the service exists, a second request is sent to the relay UE as a link modification request message for the existing PC5 connection, requesting to use the existing PC5 connection to transmit data between the initiating UE and the target UE.
[0282] Step 7202: The relay terminal determines that there is no PC5 connection between the relay UE and the target UE or there is no PC5 connection for the corresponding service, then the first request is a direct communication request message, which includes the identifier of the initiating UE and optionally includes the address information of the initiating UE.
[0283] If a PC5 connection already exists or a PC5 connection corresponding to the service already exists, a first request is sent to the target UE, which is a link modification request message for the existing PC5 connection, requesting that the existing PC5 connection be used to transmit data between the initiating UE and the target UE. This message includes the initiating UE's identifier and, optionally, the initiating UE's address information.
[0284] Step 7203: Security information is exchanged between the target UE and the relay terminal.
[0285] Step 7204: The target UE sends a first response to the relay terminal.
[0286] If the first request is a direct communication request message, the target UE replies to the relay UE with a first response, which is a direct communication acceptance message. This step may optionally include the address information of the target UE. This step also carries the maximum number of initiating UEs that the connection can accept; or whether link sharing is accepted.
[0287] The relay UE determines whether the first request to be sent to the target UE next time is a link modification request message or a direct communication request message according to the maximum number of initiating UEs acceptable to the connection.
[0288] If the carried indication indicates acceptance of link sharing, the next first request message sent by the relay UE is a link modification request message; otherwise, it is a direct communication request message. If the carried indication indicates the maximum number of initiating UEs acceptable for the current link, the relay UE can calculate the maximum number of initiating UEs supported by the current link and then determine whether the first request sent is a link modification request message or a direct communication request message based on this maximum number.
[0289] If the first request is a link modification request message for the existing PC5 connection, the target UE determines to reuse the existing PC5 connection through a first response (message). The first response (message) can, for example, be a link modification acceptance message for the existing PC5 connection. This step can optionally include the target UE's address information. This step also carries the maximum number of initiating UEs acceptable for the connection; or whether to continue to accept link sharing; This step also carries the maximum number of initiating UEs acceptable for the connection; or whether to accept link sharing; or the maximum number of initiating UEs acceptable for the current link. The relay UE determines whether the next first request message sent to the target UE will be a link modification request message or a direct communication request message based on the maximum number of initiating UEs acceptable for the connection. If the carried indication is to continue to accept link sharing, the next first request message sent by the relay UE will be a link modification request message; otherwise, it will be a direct communication request message. If the carried indication is that the current link has the maximum number of initiating UEs acceptable, the relay UE can calculate the maximum number of initiating UEs acceptable for the current link. At this time, if some initiating UEs stop their services and release the link, the relay UE can continue to use the link for other initiating UEs.
[0290] Step 7205: If the second message is a direct communication request message, security information is exchanged between the initiating UE and the relay terminal. In this step, the relay terminal may also optionally obtain the address information of the initiating UE.
[0291] Step 7206: The relay terminal sends a second response (message) to the initiating UE, completing the establishment or modification of the PC5 link between the relay UE and the initiating UE. This message carries the address information of the target UE. The relay UE determines the target UE's address, for example, from step 7204 or from a locally stored context of an existing PC5 connection between the relay UE and the target UE.
[0292] This step also carries the maximum number of target UEs that the connection can accept; or whether link sharing is accepted.
[0293] The initiating UE determines whether the second request message to be sent to the relay next time is a link modification request message or a direct communication request message according to the maximum number of destination UEs acceptable to the connection;
[0294] If the carried indication is to accept link sharing, the second request message sent by the UE next time is a link modification request message, otherwise it is a direct communication request message.
[0295] If the message carries an indication that the maximum number of target UEs accepted by the current link has been reached, the initiating UE can calculate the maximum number of target UEs supported by the current link and then, based on this maximum number, decide whether to send a second request message, a Link Modification Request message or a Direct Communication Request message. If some target UEs terminate their service and release the link, the initiating UE can continue to use the link for other target UEs. The indication that the maximum number of target UEs accepted by the current link has been reached can also be carried in the second rejection message.
[0296] It can be seen that by adopting the above solution, when the first device needs to connect to the second device through the relay device, the relay device can determine whether to request to share the existing connection with the second device. In this way, it is possible to serve multiple initiating devices by sharing the existing connection between the relay device and the second device, thereby improving the link utilization efficiency between the relay device and the second device.
[0297] Furthermore, by adopting the above solution, when a first device needs to connect to a second device via a relay device, if the relay device already has a connection with the second device, the relay device will only initiate a message to the second device requesting to share the existing connection if it determines that the existing connection allows sharing. This allows the same connection to be shared with multiple initiating devices. Furthermore, because the relay device predetermines whether the existing connection can be shared, the likelihood of the second device rejecting the request to share the existing connection is reduced, avoiding the problem of processing efficiency affected by resending the request, thereby improving the processing efficiency of the relay device sharing the existing connection.
[0298] The beneficial effects of the solution provided by this embodiment are further described below in conjunction with related technologies:
[0299] A UE with ProSe capability can communicate directly with another UE with ProSe capability via the PC5 interface. This direct communication between two UEs can be referred to as unicast short-range communication. As shown in Figure 8, UE-1, UE-2, UE-3, and UE-4 are all UEs with ProSe capability. When performing direct communication (or unicast short-range communication), in step 801, UE-2 to UE-4 can respectively determine the target layer 2 identifier for signaling reception; in step 802, UE-1's application can provide application layer information for unicast short-range communication, and then execute step 803; in step 803, UE-1 can send a direct communication request message in a broadcast or unicast manner, and the direct communication request message can be sent to UE-2 to UE-4 respectively. Next, two possible scenarios are explained respectively. Scenario A) establishes a short-range link targeting the UE. In this scenario, the establishment of a short-range link between UE-2 and UE-1 is taken as an example. In step 804a, UE-2 and UE-1 perform a security establishment process, that is, they can perform security information exchange processing; in step 805a, after completing the security establishment, UE-2 sends a direct communication acceptance message to UE-1, and the direct communication acceptance message can be sent in unicast mode; in step 806a, UE-2 and UE-1 complete the link establishment, and unicast data units can be transmitted through the link. Scenario B) Establishment of a short-range link targeting a service, that is, the established connection is used to carry a specified service. Taking the establishment of a short-range link between UE-4 and UE-1 as an example, in step 804b, UE-4 and UE-1 perform security establishment processing, that is, they can perform security information exchange processing; in step 805b, after completing the security establishment, UE-4 sends a direct communication acceptance message to UE-1, and the direct communication acceptance message can be sent in unicast mode; in step 806b, UE-4 and UE-1 complete the link establishment, through which unicast data units can be transmitted, and the link carries the service specified by UE-1.
[0300] When two ProSe-capable UEs are far apart and cannot communicate directly through the PC5 interface, they can use a ProSe-capable Relay UE to relay the communication. For example, as shown in Figure 9, the Relay UE (UE-R in Figure 9) can communicate directly with UE1 through the PC5 interface, and can also communicate directly with UE2 through the PC5 interface. UE1 and UE2 can then exchange services through the Relay UE.
[0301] In the related art, a method for communication between UEs via UE-R is provided. As shown in FIG10 , UE-1 acts as an initiating UE. UE-1 can establish a separate link between UE-1 and UE-R (i.e., a relay UE) for each target UE (e.g., UE-2, UE-3). For example, link 1-a in FIG10 is used to communicate with UE-2, and link 2-a is used to communicate with UE-3. Similarly, UE-4 acts as another initiating UE. UE-4 can also establish a separate link between UE-4 and UE-R for each target UE. For example, link 3-a in FIG10 is used to communicate with UE-2, and link 4-a is used to communicate with UE-3. Correspondingly, for each initiating UE (such as UE-1, UE-4), a separate link is established between UE-R and the target UE. As shown in Figure 10, link 1-b is used for communication between UE-1 and UE-2, link 3-b is used for communication between UE-4 and UE-2, link 2-b is used for communication between UE-1 and UE-3, and link 4-b is used for communication between UE-4 and UE-3. In this way, UE-R only needs to associate links 1-a with 1-b to forward data between UE-1 and UE-2, and correspondingly associate 2-a with 2-b, 3-a with 3-b, and 4-a with 4-b.
[0302] In the above-mentioned related technologies, when the number of UEs communicating through UE-R increases, the number of links is very large, which increases the processing complexity of the relay UE. Moreover, since the number of links that the relay UE can process is limited, the number of UEs that can communicate through the relay UE is greatly limited.
[0303] In order to control the number of links between the UE and the relay UE, link sharing is further proposed in the relevant technology. Link sharing can mean that when UE1 communicates with UE2 and UE3 (UE2 and UE3 are two target UEs) as an initiating UE, the link between UE1 and the relay UE can be shared; or when UE1 (an initiating UE) communicates with UE2 (a target UE) and UE4 (another initiating UE) communicates with UE2, the link between UE2 and the relay UE can be shared. As shown in Figure 11, in step 1101, the initiating UE sends a direct communication request to the relay terminal, and the direct communication request may carry the identifier of the initiating UE and the identifier of the target UE; in step 1102, the initiating UE and the relay terminal need to interact with security information; in step 1103, when the relay UE decides that the link between it and the target UE can be shared, the first request is a Link Modification Request message, which carries the initiating UE identifier; in step 1104, the target UE will determine whether to accept the sharing, and if so, send a first response to confirm the shared link; in step 1105, the relay UE sends a direct communication acceptance to the initiating UE, which may carry the target UE address. However, in the processing of the above step 1104, if the target UE determines that this link cannot be shared by more initiating UEs, the target UE will reject the Link Modification Request message. In this case, the relay UE needs to re-initiate the link establishment process (that is, the first request becomes a Direct Communication Request message); the same is true in reverse. If the relay UE directly initiates the link establishment process, but the target UE believes that the original link is still communicating with more initiating UEs, the target UE will reject the link establishment process, and the relay UE needs to re-initiate the link modification process (that is, the first request becomes a Link Modification Request message).
[0304] It can be seen that in the related art, when the relay UE shares a connection or establishes a new connection with the target UE, there is no process for determining whether the existing connection can be shared. Therefore, the relay UE needs to re-initiate a request to establish a new link or re-initiate a request to share an existing link. This process of first rejecting and then re-initiating the message will increase the time to establish the service, thereby affecting the user experience. By adopting the solution provided by this embodiment, when the first device needs to connect to the second device through the relay device, if the relay device has an existing connection with the second device, the relay device will only initiate a message to the second device for requesting to share the existing connection if it is determined that the existing connection allows sharing. In this way, it is possible to share the same connection to serve multiple initiating devices, and since the relay device will pre-determine whether the existing connection can be shared, the possibility of the second device rejecting the message requesting to share the existing connection can be reduced, avoiding the problem of affecting processing efficiency caused by resending the request, and improving the processing efficiency of the relay device sharing the existing connection; similarly, since the relay device can also initiate a request to establish a connection only when it determines that the existing connection is not allowed to be shared or there is no existing connection, it can also avoid the problem of the second device refusing to establish a new connection and re-initiating a request to share the existing connection, thereby ensuring the processing efficiency of the relay device in establishing a new connection.
[0305] FIG12 is a schematic diagram of the structure of a relay device according to an embodiment of the present application, including:
[0306] The first communication unit 1201 is used to receive a first message sent by a first device, wherein the first message is used to request a connection with a second device; and send a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0307] The first communication unit is configured to send a second message to the second device when a first connection exists between the first device and the second device and the first connection is in a state where sharing is allowed, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device.
[0308] The first communication unit is used to send a second message to the second device when there is a first connection between the first device and the second device and the first connection is in a state where sharing is not allowed, wherein the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0309] The first communication unit is configured to send a second message to the second device when no connection exists between the first device and the second device, wherein the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0310] The first message carries information about the target service.
[0311] The first connection carries the target service.
[0312] The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
[0313] The second message carries information about the target service.
[0314] Based on FIG12 , as shown in FIG13 , the relay device further includes:
[0315] The first processing unit 1202 is configured to determine, based on first status indication information of the first connection, whether the first connection is in a state allowing sharing.
[0316] The first processing unit is used to perform one of the following: when the first status indication information of the first connection includes an indication that the first connection accepts sharing, determine that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes a maximum number of initiating devices that can share the first connection, and the current number of initiating devices that have shared the first connection is less than the maximum number, determine that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection has not reached the maximum number, determine that the first connection is in a state allowing sharing; when the first status indication information of the first connection includes a first remaining number of initiating devices that can share the first connection, and the first remaining number is not zero, determine that the first connection is in a state allowing sharing.
[0317] The first processing unit is used to perform one of the following: determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes an indication that the target service carried by the first connection accepts sharing; determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes a maximum number of initiating devices that can share the target service carried by the first connection, and the current number of initiating devices that have shared the target service carried by the first connection is less than the maximum number; determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes an indication that the number of initiating devices that have shared the target service carried by the first connection has not reached the maximum number; determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes a first remaining number of initiating devices that can share the target service carried by the first connection, and the first remaining number is not zero.
[0318] The first communication unit is used to receive a response message to the second message sent by the second device after sending the second message to the second device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
[0319] The first message is further used to request sharing of a third connection between the first device and the relay device;
[0320] The first communication unit is used to send a sharing confirmation response to the first device after receiving a response message to the second message sent by the second device, if the response message to the second message is used to indicate that the second device agrees to share the first connection and the relay device determines to share the third connection.
[0321] The first message is further used to request establishment of a fourth connection between the first device and the relay device;
[0322] The first communication unit is configured to, after receiving a response message to the second message sent by the second device, send a connection confirmation response to the first device if the response message to the second message is used to indicate that the second device agrees to share the first connection and completes establishing the fourth connection.
[0323] The first communication unit is configured to receive a response message to the second message sent by the second device after sending the second message to the second device, where the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
[0324] The first message is further used to request sharing of a third connection between the first device and the relay device;
[0325] The first communication unit is used to send a sharing confirmation response to the first device after receiving a response message to the second message sent by the second device, when the response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection and the relay device determines to share the third connection.
[0326] The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
[0327] The first message is also used to request the establishment of a fourth connection between the first device and the relay device; the first communication unit is used to send a connection confirmation response to the first device after receiving a response message to the second message sent by the second device, when the response message to the second message is used to indicate that the second device and the relay device have completed the establishment of the second connection and completed the establishment of the fourth connection.
[0328] The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
[0329] The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state that allows sharing.
[0330] The relay device of the embodiment of the present application can realize the corresponding functions of the relay device in the aforementioned communication method embodiment. The processes, functions, implementation methods and beneficial effects corresponding to the various modules (sub-modules, units or components, etc.) in the relay device can be found in the corresponding descriptions in the above-mentioned method embodiments, which will not be repeated here. It should be noted that the functions described by the various modules (sub-modules, units or components, etc.) in the relay device of the application embodiment can be implemented by different modules (sub-modules, units or components, etc.), or by the same module (sub-modules, units or components, etc.).
[0331] FIG14 is a schematic diagram of the composition structure of a first device according to an embodiment of the present application, including:
[0332] The second communication unit 1401 is used to send a first message to the relay device, wherein the first message is used to request a connection with the second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing the first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0333] The second communication unit is configured to send the first message to the relay device when a third connection exists between the second communication unit and the relay device and the third connection is in a sharing-allowed state, wherein the first message is further configured to request sharing of the third connection.
[0334] The second communication unit is used to send the first message to the relay device when there is a third connection between the first device and the relay device and the third connection is in a state where sharing is not allowed. The first message is also used to request establishment of a fourth connection between the first device and the relay device.
[0335] The second communication unit is configured to send the first message to the relay device when no connection exists between the first device and the relay device, and the first message is further configured to request establishment of a fourth connection between the first device and the relay device.
[0336] The first message carries information about the target service.
[0337] The third connection carries the target service.
[0338] The third connection does not carry the target service, and no connection carrying the target service exists between the first device and the relay device.
[0339] Based on FIG14 , as shown in FIG15 , the first device further includes:
[0340] The second processing unit 1402 is configured to determine whether the third connection is in a sharing-allowed state based on the first state indication information of the third connection.
[0341] The second processing unit is used to perform one of the following: when the first status indication information of the third connection includes an indication that the third connection accepts sharing, determine that the third connection is in a state allowing sharing; when the first status indication information of the third connection includes a maximum number of target devices that can share the third connection, and the number of target devices that have shared the third connection is less than the maximum number, determine that the third connection is in a state allowing sharing; when the first status indication information of the third connection includes an indication that the number of target devices that have shared the third connection does not reach the maximum number, determine that the third connection is in a state allowing sharing; when the first status indication information of the third connection includes a second remaining number of target devices that can share the third connection, and the second remaining number is not zero, determine that the third connection is in a state allowing sharing.
[0342] The second processing unit is used to perform one of the following: determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the target service carried by the third connection accepts sharing; determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a maximum number of target devices that can share the target service carried by the third connection, and the number of target devices that have shared the target service carried by the third connection is less than the maximum number; determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the number of target devices that have shared the target service carried by the third connection has not reached the maximum number; determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a second remaining number of target devices that can share the target service carried by the third connection, and the second remaining number is not zero.
[0343] The second communication unit is configured to, after sending the first message to the relay device, receive a sharing confirmation response sent by the relay device;
[0344] The second processing unit is configured to determine whether to share the third connection and whether the first device and the second device have completed the connection.
[0345] The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
[0346] The second communication unit is configured to, after sending the first message to the relay device, receive a connection confirmation response sent by the relay device;
[0347] The second processing unit is configured to determine whether to establish the fourth connection and whether the first device and the second device have completed the connection.
[0348] The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
[0349] The first device of the embodiment of the present application can implement the corresponding functions of the first device in the aforementioned communication method embodiment. The processes, functions, implementation methods and beneficial effects corresponding to the various modules (sub-modules, units or components, etc.) in the first device can be found in the corresponding descriptions in the above-mentioned method embodiments, which will not be repeated here. It should be noted that the functions described by the various modules (sub-modules, units or components, etc.) in the first device of the application embodiment can be implemented by different modules (sub-modules, units or components, etc.), or by the same module (sub-module, unit or component, etc.).
[0350] FIG16 is a schematic diagram of the structure of a second device according to an embodiment of the present application, including:
[0351] The third communication unit 1601 is used to receive a second message sent by the relay device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
[0352] The second message carries information of the target service.
[0353] The first connection carries the target service.
[0354] The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
[0355] The second message is used to request sharing of a first connection to transmit data between the first device and the second device;
[0356] The third communication unit is used to send a response message to the second message to the relay device after receiving the second message sent by the relay device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
[0357] The third communication unit is used to perform one of the following: when the second device determines to share the first connection, sending a response message to the relay device to the second message indicating that the second device agrees to share the first connection; when the second device determines not to share the first connection, sending a response message to the relay device to the second message indicating that the second device refuses to share the first connection.
[0358] The second status indication information of the first connection includes at least one of the following: an indication of whether the first connection accepts sharing; a maximum number of initiating devices that can share the first connection; an indication of whether the number of initiating devices that have shared the first connection has reached the maximum number; and a third remaining number of initiating devices that can share the first connection.
[0359] Based on FIG16 , as shown in FIG17 , the first device further includes:
[0360] The third processing unit 1602 is used to determine that the first connection is shared and the target service is added to the first connection, and then send a response message of the second message to the relay device through the third communication unit to indicate that the second device agrees to share the first connection.
[0361] The second status indication information of the first connection includes at least one of the following: an indication of whether the target service carried by the first connection is accepted for sharing; a maximum number of initiating devices that can share the target service carried by the first connection; an indication of whether the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number; and a third remaining number of initiating devices that can share the target service carried by the first connection.
[0362] The second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device;
[0363] The third communication unit is used to send a response message to the relay device after receiving the second message sent by the relay device, where the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
[0364] The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing next time.
[0365] The second device of the embodiment of the present application can implement the corresponding functions of the second device in the aforementioned communication method embodiment. The processes, functions, implementation methods and beneficial effects corresponding to the various modules (sub-modules, units or components, etc.) in the second device can be found in the corresponding descriptions in the above-mentioned method embodiments, which will not be repeated here. It should be noted that the functions described by the various modules (sub-modules, units or components, etc.) in the second device of the application embodiment can be implemented by different modules (sub-modules, units or components, etc.), or by the same module (sub-modules, units or components, etc.).
[0366] Figure 18 is a schematic structural diagram of a communication device 1800 according to an embodiment of the present application. The communication device 1800 includes a processor 1810, which can call and run a computer program from a memory to enable the communication device 1800 to implement the method in the embodiment of the present application.
[0367] In a possible implementation, the communication device 1800 may further include a memory 1820. The processor 1810 may call and execute a computer program from the memory 1820 to enable the communication device 1800 to implement the method in the embodiment of the present application.
[0368] The memory 1820 may be a separate device independent of the processor 1810 , or may be integrated into the processor 1810 .
[0369] In one possible implementation, the communication device 1800 may further include a transceiver 1830 , and the processor 1810 may control the transceiver 1830 to communicate with other devices. Specifically, it may send information or data to other devices, or receive information or data sent by other devices.
[0370] The transceiver 1830 may include a transmitter and a receiver. The transceiver 1830 may further include an antenna, and the number of antennas may be one or more.
[0371] In one possible implementation, the communication device 1800 may be a relay device of an embodiment of the present application, and the communication device 1800 may implement the corresponding processes implemented by the relay device in each method of the embodiment of the present application. For the sake of brevity, they will not be described in detail here. In one possible implementation, the communication device 1800 may be a first device of an embodiment of the present application, and the communication device 1800 may implement the corresponding processes implemented by the first device in each method of the embodiment of the present application. For the sake of brevity, they will not be described in detail here. In one possible implementation, the communication device 1800 may be a second device of an embodiment of the present application, and the communication device 1800 may implement the corresponding processes implemented by the second device in each method of the embodiment of the present application. For the sake of brevity, they will not be described in detail here.
[0372] 19 is a schematic structural diagram of a chip 1900 according to an embodiment of the present application. The chip 1900 includes a processor 1910, which can call and execute a computer program from a memory to implement the method according to the embodiment of the present application.
[0373] In one possible implementation, chip 1900 may further include memory 1920. Processor 1910 may call and execute a computer program from memory 1920 to implement the method performed by the relay device, the first device, and the second device in the embodiments of the present application. Memory 1920 may be a separate device independent of processor 1910 or integrated into processor 1910.
[0374] In one possible implementation, the chip 1900 may further include an input interface 1930. The processor 1910 may control the input interface 1930 to communicate with other devices or chips, specifically, to obtain information or data sent by other devices or chips. In one possible implementation, the chip 1900 may further include an output interface 1940. The processor 1910 may control the output interface 1940 to communicate with other devices or chips, specifically, to output information or data to other devices or chips.
[0375] In one possible implementation, the chip can be applied to the relay device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the relay device in the various methods of the embodiment of the present application. For the sake of brevity, it will not be described in detail here. In one possible implementation, the chip can be applied to the first device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the first device in the various methods of the embodiment of the present application. For the sake of brevity, it will not be described in detail here. In one possible implementation, the chip can be applied to the second device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the second device in the various methods of the embodiment of the present application. For the sake of brevity, it will not be described in detail here.
[0376] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0377] The processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or other programmable logic devices, transistor logic devices, discrete hardware components, etc. The general-purpose processor mentioned above may be a microprocessor or any conventional processor, etc.
[0378] The memory mentioned above may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM).
[0379] It should be understood that the above-mentioned memories are exemplary but not restrictive. For example, the memories in the embodiments of the present application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM RAM (DR RAM), etc. In other words, the memories in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0380] Figure 20 is a schematic block diagram of a communication system 2000 according to an embodiment of the present application. The communication system 2000 includes a relay device 2010, a first device 2020, and a second device 2030. The relay device 2010 can be used to implement the corresponding functions implemented by the relay device in the above method. The first device 2020 can be used to implement the corresponding functions implemented by the first device in the above method. The second device 2030 can be used to implement the corresponding functions implemented by the second device in the above method.
[0381] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function in accordance with the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0382] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0383] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0384] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A communication method, comprising: The relay device receives a first message sent by the first device, wherein the first message is used to request a connection with the second device; The relay device sends a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
2. The method according to claim 1, wherein: The relay device sending a second message to the second device includes: When there is a first connection between the relay device and the second device and the first connection is in a state allowing sharing, the relay device sends a second message to the second device, where the second message is used to request sharing of the first connection to transmit data between the first device and the second device.
3. The method according to claim 1, wherein: The relay device sending a second message to the second device includes: When there is a first connection between the relay device and the second device and the first connection is in a state where sharing is not allowed, the relay device sends a second message to the second device, wherein the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
4. The method according to claim 1, wherein: The relay device sending a second message to the second device includes: When no connection exists between the relay device and the second device, the relay device sends a second message to the second device, where the second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device.
5. The method according to any one of claims 1 to 4, wherein: The first message carries information of the target service.
6. The method according to any one of claims 1 to 5, wherein: The first connection carries the target service.
7. The method according to any one of claims 1 to 5, wherein: The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
8. The method according to any one of claims 1 to 7, wherein: The second message carries information of the target service.
9. The method according to any one of claims 1 to 8, wherein: The method further comprises: The relay device determines, based on first status indication information of the first connection, whether the first connection is in a state allowing sharing.
10. The method according to claim 9, wherein: The relay device determines, based on the first state indication information of the first connection, whether the first connection is in a state allowing sharing, including one of the following: The relay device determines, when the first state indication information of the first connection includes an indication that the first connection accepts sharing, that the first connection is in a state allowing sharing; The relay device determines that the first connection is in a state allowing sharing, when the first state indication information of the first connection includes a maximum number of initiating devices that can share the first connection, and the current number of initiating devices that have shared the first connection is less than the maximum number; The relay device determines, when the first state indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection has not reached a maximum number, that the first connection is in a state allowing sharing; The relay device determines that the first connection is in a state allowing sharing when the first state indication information of the first connection includes a first remaining number of initiating devices that can share the first connection and the first remaining number is not zero.
11. The method according to claim 9, wherein: The relay device determines, based on the first state indication information of the first connection, whether the first connection is in a state allowing sharing, including one of the following: In a case where the first state indication information of the first connection includes an indication that the target service carried by the first connection accepts sharing, determining that the first connection is in a state allowing sharing; When the first state indication information of the first connection includes a maximum number of initiating devices that can share the target service carried by the first connection, and the current number of initiating devices that have shared the target service carried by the first connection is less than the maximum number, determining that the first connection is in a state allowing sharing; In a case where the first state indication information of the first connection includes an indication that the number of initiating devices that have shared the target service carried by the first connection has not reached a maximum number, determining that the first connection is in a state allowing sharing; When the first state indication information of the first connection includes a first remaining number of initiating devices that can share the target service carried by the first connection, and the first remaining number is not zero, it is determined that the first connection is in a state allowing sharing.
12. The method according to claim 2, wherein: After the relay device sends the second message to the second device, the method further includes: The relay device receives a response message to the second message sent by the second device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is allowed next time Shared status.
13. The method according to claim 12, wherein: The first message is also used to request sharing of a third connection between the first device and the relay device; After the relay device receives a response message to the second message sent by the second device, the method further includes: The relay device sends a sharing confirmation response to the first device when the response message of the second message is used to indicate that the second device agrees to share the first connection and the relay device determines to share the third connection.
14. The method according to claim 12, wherein: The first message is also used to request to establish a fourth connection between the first device and the relay device; After the relay device receives a response message to the second message sent by the second device, the method further includes: When the response message of the second message is used to indicate that the second device agrees to share the first connection and completes establishing the fourth connection, the relay device sends a connection confirmation response to the first device.
15. The method according to claim 3 or 4, wherein: After the relay device sends the second message to the second device, the method further includes: The relay device receives a response message to the second message sent by the second device, where the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
16. The method according to claim 15, wherein: The first message is also used to request sharing of a third connection between the first device and the relay device; After the relay device receives a response message to the second message sent by the second device, the method further includes: The relay device sends a sharing confirmation response to the first device when the response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection and the relay device determines to share the third connection.
17. The method according to claim 13 or 16, wherein: The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
18. The method according to claim 15, wherein: The first message is also used to request to establish a fourth connection between the first device and the relay device; After the relay device receives a response message to the second message sent by the second device, the method further includes: The relay device sends a connection confirmation response to the first device when the response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection and the fourth connection.
19. The method according to claim 14 or 18, wherein: The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
20. The method according to any one of claims 15 to 18, wherein: The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing.
21. A communication method, comprising: A first device sends a first message to a relay device, wherein the first message is used to request a connection with a second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
22. The method according to claim 21, wherein: The first device sending a first message to the relay device includes: When there is a third connection between the first device and the relay device, and the third connection is in a state allowing sharing, the first device sends the first message to the relay device, where the first message is also used to request sharing of the third connection.
23. The method according to claim 21, wherein: The first device sending a first message to the relay device includes: When there is a third connection between the first device and the relay device and the third connection is in a state where sharing is not allowed, the first device sends the first message to the relay device, and the first message is also used to request establishment of a fourth connection between the first device and the relay device.
24. The method according to claim 21, wherein: The first device sending a first message to the relay device includes: When there is no connection between the first device and the relay device, the first device sends the first message to the relay device, where the first message is also used to request to establish a fourth connection between the first device and the relay device.
25. The method according to any one of claims 21 to 24, wherein: The first message carries information of the target service.
26. The method according to any one of claims 21 to 25, wherein: The third connection carries the target service.
27. The method according to any one of claims 21 to 25, wherein: The third connection does not carry the target service, and there is no connection between the first device and the relay device that carries the target service.
28. The method according to any one of claims 22 to 27, wherein: The method further comprises: The first device determines whether the third connection is in a state allowing sharing based on the first state indication information of the third connection.
29. The method according to claim 28, wherein: The first device determines, based on the first status indication information of the third connection, whether the third connection is in a state allowing sharing, including one of the following: When the first state indication information of the third connection includes an indication that the third connection accepts sharing, the first device determines that the third connection is in a state allowing sharing; The first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a maximum number of target devices that can share the third connection and the number of target devices that have shared the third connection is less than the maximum number; The first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the number of target devices that have shared the third connection has not reached a maximum number; The first device determines that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a second remaining number of target devices that can share the third connection and the second remaining number is not zero.
30. The method of claim 28, wherein: The first device determines, based on the first status indication information of the third connection, whether the third connection is in a state allowing sharing, including one of the following: In a case where the first state indication information of the third connection includes an indication that the target service carried by the third connection accepts sharing, determining that the third connection is in a state allowing sharing; When the first state indication information of the third connection includes a maximum number of target devices that can share the target service carried by the third connection, and the number of target devices that have shared the target service carried by the third connection is less than the maximum number, determining that the third connection is in a state allowing sharing; In a case where the first state indication information of the third connection includes an indication that the number of target devices that have shared the target service carried by the third connection has not reached a maximum number, determining that the third connection is in a state allowing sharing; When the first state indication information of the third connection includes a second remaining number of target devices that can share the target service carried by the third connection, and the second remaining number is not zero, it is determined that the third connection is in a state allowing sharing.
31. The method of claim 22, wherein: After the first device sends the first message to the relay device, the method further includes: When the first device receives the sharing confirmation response sent by the relay device, it determines to share the third connection and determines that the first device and the second device are connected.
32. The method according to claim 31, wherein: The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
33. The method according to claim 23 or 24, wherein: After the first device sends the first message to the relay device, the method further includes: When the first device receives the connection confirmation response sent by the relay device, it determines to establish the fourth connection and determines that the first device and the second device are connected.
34. The method of claim 33, wherein: The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
35. A communication method, comprising: The second device receives a second message sent by the relay device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
36. The method of claim 35, wherein: The second message carries information of the target service.
37. The method according to claim 35 or 36, wherein: The first connection carries the target service.
38. The method according to claim 35 or 36, wherein: The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
39. The method according to any one of claims 35 to 38, wherein: The second message is used to request sharing of a first connection to transmit data between the first device and the second device; After the second device receives the second message sent by the relay device, the method further includes: The second device sends a response message to the second message to the relay device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
40. The method of claim 39, wherein: The second device sending a response message to the second message to the relay device includes one of the following: When the second device determines to share the first connection, sending a response message to the relay device to the second message indicating that the second device agrees to share the first connection; When the second device determines not to share the first connection, the second device sends a response message to the relay device for the second message indicating that the second device rejects the shared first connection.
41. The method according to claim 39 or 40, wherein: The second status indication information of the first connection includes at least one of the following: an indication of whether the first connection accepts sharing; a maximum number of initiating devices that can share the first connection; an indication of whether the number of initiating devices that have shared the first connection has reached a maximum number; A third remaining number of initiating devices that can share the first connection.
42. The method of claim 40, wherein: When the second device determines to share the first connection, sending a response message to the relay device to the second message indicating that the second device agrees to share the first connection includes: When the second device determines to share the first connection and adds the target service to the first connection, the second device sends a response message to the relay device to the second message indicating that the second device agrees to share the first connection.
43. The method according to claim 39 or 42, wherein: The second status indication information of the first connection includes at least one of the following: An indication of whether the target service carried by the first connection accepts sharing; a maximum number of initiating devices that can share the target service carried by the first connection; an indication of whether the number of initiating devices that have shared the target service carried by the first connection has reached a maximum number; a third remaining number of initiating devices that can share the target service carried by the first connection.
44. The method according to any one of claims 35 to 38, wherein: The second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device; After the second device receives the second message sent by the relay device, the method further includes: The second device sends a response message to the second message to the relay device, where the response message to the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
45. The method of claim 44, wherein: The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing next time.
46. A relay device comprising: A first communication unit is used to receive a first message sent by a first device, wherein the first message is used to request a connection with a second device; and send a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
47. The relay device according to claim 46, wherein: The first communication unit is configured to send a second message to the second device when a first connection exists between the first device and the second device and the first connection is in a state allowing sharing, wherein the second message is used to request sharing of the first connection to transmit data between the first device and the second device.
48. The relay device according to claim 46, wherein: The first communication unit is used to send a second message to the second device when there is a first connection between the first device and the second device and the first connection is in a state where sharing is not allowed, wherein the second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device.
49. The relay device according to claim 46, wherein: The first communication unit is used to send a second message to the second device when there is no connection between the first device and the second device, and the second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device.
50. The relay device according to any one of claims 46 to 49, wherein: The first message carries information of the target service.
51. The relay device according to any one of claims 46 to 50, wherein: The first connection carries the target service.
52. The relay device according to any one of claims 46 to 50, wherein: The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
53. The relay device according to any one of claims 46 to 52, wherein: The second message carries information of the target service.
54. The relay device according to any one of claims 46 to 53, further comprising: The first processing unit is configured to determine whether the first connection is in a state allowing sharing based on first state indication information of the first connection.
55. The relay device according to claim 54, wherein: The first processing unit is configured to perform one of the following: determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes an indication that the first connection accepts sharing; determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes a maximum number of initiating devices that can share the first connection and the current number of initiating devices that have shared the first connection is less than the maximum number; When the first state indication information of the first connection includes an indication that the number of initiating devices that have shared the first connection has not reached a maximum number, determining that the first connection is in a state allowing sharing; When the first state indication information of the first connection includes a first remaining number of initiating devices that can share the first connection, and the first remaining number is not zero, it is determined that the first connection is in a state allowing sharing.
56. The relay device according to claim 54, wherein: The first processing unit is configured to perform one of the following: determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes an indication that the target service carried by the first connection accepts sharing; determining that the first connection is in a state allowing sharing when the first state indication information of the first connection includes a maximum number of initiating devices that can share the target service carried by the first connection, and the current number of initiating devices that have shared the target service carried by the first connection is less than the maximum number; In a case where the first state indication information of the first connection includes an indication that the number of initiating devices that have shared the target service carried by the first connection has not reached a maximum number, determining that the first connection is in a state allowing sharing; When the first state indication information of the first connection includes a first remaining number of initiating devices that can share the target service carried by the first connection, and the first remaining number is not zero, it is determined that the first connection is in a state allowing sharing.
57. The relay device according to claim 47, wherein: The first communication unit is used to receive a response message to the second message sent by the second device after sending the second message to the second device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
58. The relay device according to claim 57, wherein: The first message is also used to request sharing of a third connection between the first device and the relay device; The first communication unit is used to send a sharing confirmation response to the first device after receiving a response message to the second message sent by the second device, if the response message to the second message is used to indicate that the second device agrees to share the first connection and the relay device determines to share the third connection.
59. The relay device according to claim 57, wherein: The first message is also used to request to establish a fourth connection between the first device and the relay device; The first communication unit is used to send a connection confirmation response to the first device after receiving a response message to the second message sent by the second device, if the response message to the second message is used to indicate that the second device agrees to share the first connection and completes establishing the fourth connection.
60. The relay device according to claim 48 or 49, wherein: The first communication unit is used to receive a response message to the second message sent by the second device after sending the second message to the second device, wherein the response message to the second message is used to indicate whether the second device has completed establishing the second connection with the relay device.
61. The relay device according to claim 60, wherein: The first message is also used to request sharing of a third connection between the first device and the relay device; The first communication unit is used to send a sharing confirmation response to the first device after receiving a response message to the second message sent by the second device, when the response message to the second message is used to indicate that the second device and the relay device have completed establishing the second connection and the relay device determines to share the third connection.
62. The relay device according to claim 58 or 61, wherein: The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
63. The relay device according to claim 60, wherein: The first message is also used to request establishment of a fourth connection between the first device and the relay device; the first communication unit is used to send a connection confirmation response to the first device after receiving a response message to the second message sent by the second device, when the response message to the second message is used to indicate that the second device and the relay device have completed establishment of the second connection and completed establishment of the fourth connection.
64. The relay device according to claim 59 or 63, wherein: The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
65. The relay device according to any one of claims 60 to 63, wherein: The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing.
66. A first device, comprising: A second communication unit is used to send a first message to a relay device, wherein the first message is used to request a connection with a second device, and the first message is used to trigger the relay device to send a second message to the second device, wherein the second message is used to request sharing of a first connection to transmit data between the first device and the second device, or the second message is used to request establishment of a second connection between the relay device and the second device to transmit data between the first device and the second device.
67. The first device according to claim 66, wherein The second communication unit is configured to send the first message to the relay device when a third connection exists between the second communication unit and the relay device and the third connection is in a sharing-allowed state, and the first message is further configured to request sharing of the third connection.
68. The first device according to claim 66, wherein The second communication unit is used to send the first message to the relay device when there is a third connection between the first device and the relay device and the third connection is in a state where sharing is not allowed. The first message is also used to request to establish a fourth connection between the first device and the relay device.
69. The first device according to claim 66, wherein: The second communication unit is used to send the first message to the relay device when no connection exists between the first device and the relay device, and the first message is also used to request to establish a fourth connection between the first device and the relay device.
70. The first device according to any one of claims 66 to 69, wherein: The first message carries information of the target service.
71. A first device according to any one of claims 66 to 70, wherein: The third connection carries the target service.
72. The first device according to any one of claims 66 to 70, wherein: The third connection does not carry the target service, and there is no connection between the first device and the relay device that carries the target service.
73. The first device according to any one of claims 67 to 72, further comprising: The second processing unit is configured to determine whether the third connection is in a state allowing sharing based on the first state indication information of the third connection.
74. The first device according to claim 73, wherein The second processing unit is configured to perform one of the following: determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the third connection accepts sharing; determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes a maximum number of target devices that can share the third connection and the number of target devices that have shared the third connection is less than the maximum number; In a case where the first state indication information of the third connection includes an indication that the number of target devices that have shared the third connection has not reached a maximum number, determining that the third connection is in a state allowing sharing; When the first state indication information of the third connection includes a second remaining number of target devices that can share the third connection, and the second remaining number is not zero, it is determined that the third connection is in a state allowing sharing.
75. The first device of claim 73, wherein: The second processing unit is configured to perform one of the following: determining that the third connection is in a state allowing sharing when the first state indication information of the third connection includes an indication that the target service carried by the third connection accepts sharing; When the first state indication information of the third connection includes a maximum number of target devices that can share the target service carried by the third connection, and the number of target devices that have shared the target service carried by the third connection is less than the maximum number, determining that the third connection is in a state allowing sharing; In a case where the first state indication information of the third connection includes an indication that the number of target devices that have shared the target service carried by the third connection has not reached a maximum number, determining that the third connection is in a state allowing sharing; When the first state indication information of the third connection includes a second remaining number of target devices that can share the target service carried by the third connection, and the second remaining number is not zero, it is determined that the third connection is in a state allowing sharing.
76. The first device of claim 67, wherein: The second communication unit is used to send the first message to the relay device and, upon receiving a sharing confirmation response sent by the relay device; the second processing unit is used to determine to share the third connection and to determine that the first device and the second device have completed the connection.
77. The first device according to claim 76, wherein The sharing confirmation response carries second status indication information of the third connection, and the second status indication information of the third connection is used by the first device to determine whether the third connection is in a state allowing sharing next time.
78. The first device according to claim 68 or 69, wherein The second communication unit is configured to, after sending the first message to the relay device, receive a connection confirmation response sent by the relay device; The second processing unit is used to determine to establish the fourth connection and to determine that the first device and the second device complete the connection.
79. The first device according to claim 78, wherein The connection confirmation response carries status indication information of the fourth connection, and the status indication information of the fourth connection is used by the first device to determine whether the fourth connection is in a state allowing sharing next time.
80. A second device, comprising: The third communication unit is configured to receive a second message sent by the relay device, wherein the second message is used to request to share the first connection to transmit data between the first device and the second device, or the second message is used to request to establish a connection between the relay device and the first device. The second connection between the two devices transmits data between the first device and the second device.
81. The second device according to claim 80, wherein The second message carries information of the target service.
82. The second device according to claim 80 or 81, wherein The first connection carries the target service.
83. The second device according to claim 80 or 81, wherein The first connection does not carry the target service, and there is no connection between the relay device and the second device that carries the target service.
84. The second device according to any one of claims 80 to 83, wherein: The second message is used to request sharing of a first connection to transmit data between the first device and the second device; The third communication unit is used to send a response message to the relay device for the second message after receiving the second message sent by the relay device, wherein the response message to the second message is used to indicate whether the second device agrees to share the first connection, and the response message to the second message carries second status indication information of the first connection, and the second status indication information of the first connection is used by the relay device to determine whether the first connection is in a state allowing sharing next time.
85. The second device according to claim 84, wherein The third communication unit is used to perform one of the following: when the second device determines to share the first connection, sending a response message to the relay device to the second message indicating that the second device agrees to share the first connection; when the second device determines not to share the first connection, sending a response message to the relay device to the second message indicating that the second device refuses to share the first connection.
86. The second device according to claim 84 or 85, wherein The second status indication information of the first connection includes at least one of the following: an indication of whether the first connection accepts sharing; a maximum number of initiating devices that can share the first connection; an indication of whether the number of initiating devices that have shared the first connection has reached the maximum number; a third remaining number of initiating devices that can share the first connection.
87. The second device of claim 85, further comprising: The third processing unit is used to determine that the first connection is shared and the target service is added to the first connection, and then send a response message to the second message indicating that the second device agrees to share the first connection to the relay device through the third communication unit.
88. The second device according to claim 84 or 87, wherein The second status indication information of the first connection includes at least one of the following: an indication of whether the target service carried by the first connection is accepted for sharing; a maximum number of initiating devices that can share the target service carried by the first connection; an indication of whether the number of initiating devices that have shared the target service carried by the first connection has reached the maximum number; a third remaining number of initiating devices that can share the target service carried by the first connection.
89. The second device according to any one of claims 80 to 83, wherein: The second message is used to request to establish a second connection between the relay device and the second device to transmit data between the first device and the second device; The third communication unit is used to send a response message of the second message to the relay device after receiving the second message sent by the relay device, wherein the response message of the second message is used to indicate whether the second device and the relay device have completed establishing the second connection.
90. The second device according to claim 89, wherein The response message of the second message is used to indicate that the second device and the relay device have completed establishing the second connection. The response message of the second message carries status indication information of the second connection, and the status indication information of the second connection is used by the relay device to determine whether the second connection is in a state allowing sharing next time.
91. A relay device, comprising: A transceiver, a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory, so that the relay device executes the method as claimed in any one of claims 1 to 20.
92. A first device, comprising: A transceiver, a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory so that the first device executes the method as claimed in any one of claims 21 to 34.
93. A second device, comprising: A transceiver, a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory so that the second device executes the method as claimed in any one of claims 35 to 45.
94. A chip, comprising: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes a method as described in any one of claims 1 to 20, or claims 21 to 34, or claims 35 to 45.
95. A computer-readable storage medium for storing a computer program, which, when executed by a device, causes the device to perform the method of any one of claims 1 to 20, or claims 21 to 34, or claims 35 to 45.
96. A computer program product comprising computer program instructions for causing a computer to perform the method of any one of claims 1 to 20, or claims 21 to 34, or claims 35 to 45.
97. A computer program causing a computer to perform the method of any one of claims 1 to 20, or claims 21 to 34, or claims 35 to 45.