A communication connection management method and an electronic device

CN120201590BActive Publication Date: 2026-06-12HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2023-12-15
Publication Date
2026-06-12

Smart Images

  • Figure CN120201590B_ABST
    Figure CN120201590B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a communication connection management method and an electronic device, and relate to the technical field of electronic devices, so that the P2P connection between the first device and the second device is kept uninterrupted when the first device acquires information transmitted by the second device. The specific scheme is as follows: the method is applied to the first device, and the devices in communication connection with the first device include the second device. The second device is configured with a first camera. The method comprises: the first device receives a first operation for enabling the first camera. In response to the first operation, the first device establishes a first session with the second device. The first session is used to transmit image information collected by the first camera. The first device establishes a second session with the second device. The first session and the second session are both carried in a first P2P connection, and the first P2P connection is a P2P connection between the first device and the second device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic device technology, and in particular to a communication connection management method and electronic device. Background Technology

[0002] Currently, multiple electronic devices can share camera resources by establishing a P2P connection.

[0003] Taking multiple electronic devices, including device 1 and device 2, as an example, device 2 includes camera A and camera B. When device 1 activates camera A, a P2P connection 1 can be established with device 1. Device 1 can then obtain image information captured by camera A based on this P2P connection 1. When device 1 switches from camera A to camera B, a P2P connection 2 can be established with device 1. Device 1 can then obtain image information captured by camera B based on this P2P connection 2.

[0004] Because establishing a P2P connection takes time, there is a delay in device 1 acquiring the image information collected by device B, which increases the user's waiting time. Summary of the Invention

[0005] This application provides a communication connection management method and electronic device, which ensures that when a first device needs to obtain information transmitted by a second device, the P2P connection between the first device and the second device remains unbroken.

[0006] A first aspect includes a communication connection management method applied to a first device, wherein the device communicatively connected to the first device includes a second device. The second device is equipped with a first camera. The method includes: the first device receiving a first operation to enable the first camera; in response to the first operation, the first device establishing a first session with the second device; the first session being used to transmit image information captured by the first camera; and the first device establishing a second session with the second device. Both the first session and the second session are carried within a first P2P connection, which is a P2P connection between the first device and the second device.

[0007] In the embodiments of this application, if no session exists in the first P2P connection, the first device will release the first P2P connection. Based on the above scheme, when the first device receives a first operation to start the first camera, it establishes a first session with the second device. Additionally, the first device also establishes a second session with the second device. Both the first and second sessions are carried within the first P2P connection. Because the first P2P connection also carries the second session, the first P2P connection can remain open.

[0008] Optionally, the first device establishes a second session with the second device, including: establishing the second session with the second device before the first session is released. This way, when the first device subsequently releases the first session, the first P2P connection will not immediately disconnect because it still carries the second session.

[0009] Optionally, the establishment of a second session between the first device and the second device includes: the first device sending a first request to the second device, the first request carrying information about the second session; and the first device receiving a first response indicating that the second session was successfully established. Thus, the first device can establish a second session with the second device.

[0010] Optionally, the first request may also carry information about the first session. The first response may also indicate that the first session was successfully established. In this way, the first device and the second device can simultaneously establish a first session and a second session.

[0011] Optionally, the first request may also be used to instruct the establishment of the first P2P connection with the second device. The first response may also be used to indicate that the first P2P connection has been successfully established. Thus, a first P2P connection can be established between the first device and the second device.

[0012] Optionally, the method further includes: releasing the second session when it is determined that the first P2P connection only carries the second session during the first duration. In this way, when other sessions in the first P2P connection are released, the second session is still carried in the first P2P connection during the first duration, and thus the first P2P connection can remain open during the first duration.

[0013] Optionally, before releasing the second session, the method further includes: the first device sending a first renewal instruction. The first device receives and responds to the first renewal instruction to maintain the second session. The first renewal instruction is sent to the second device so that the second device maintains the second session upon receiving the first renewal instruction. Thus, after the second session is established, the second session can be kept alive, thereby ensuring that the first P2P connection persists.

[0014] Optionally, sending the first renewal instruction includes: sending the first renewal instruction when it is determined that the first P2P connection carries a third session. This third session is different from the second session, but includes the first session. In this way, when the first P2P connection carries a session different from the second session, the second session can be kept within the first P2P connection.

[0015] Optionally, determining that the first P2P connection carries only the second session within a first duration includes: initiating a first timer when the first P2P connection carries only the second session. The duration of the first timer is the first duration. When the first timer expires, it is determined that the first P2P connection carries only the second session. This ensures that the first P2P connection only has the second session within the first duration, facilitating subsequent management of the second session's validity period by the first device.

[0016] Optionally, the first device is configured with a second timer. This second timer is used to trigger the first device to release the second session when the timer expires. Maintaining the second session includes resetting the timer's duration before the timer expires. This allows the second session to be kept alive, thus ensuring the first P2P connection remains open.

[0017] Optionally, releasing the second session includes: the first device sending a first release instruction; and receiving and responding to the first release instruction to release the second session. Thus, the first device can release the second session upon receiving the first release instruction.

[0018] Optionally, the first device is equipped with a display screen. The method further includes: after the first camera is activated, receiving first image information through the first session. The first image information is captured by the first camera. Upon receiving the first image information, displaying a first interface. The first interface includes a first image. The first image corresponds to the first image information. In this way, the first device can obtain the image information captured by the first camera through the first session, thereby enabling the use of the first camera.

[0019] Optionally, the second device is equipped with a second camera. After displaying the first interface, the method includes: the first device receiving a second operation for switching to use the second camera. In response to the second operation, the first device establishes a fourth session with the second device. The fourth session is used to transmit image information captured by the second camera, and the fourth session is carried in the first P2P connection and included in the third session.

[0020] In this way, the first device acquires image information captured by the second camera based on the first P2P connection. This avoids re-establishing the P2P connection between the first and second devices, improves the efficiency of the first device switching from the first camera to the second camera, and reduces the user's waiting time.

[0021] Optionally, before the first device establishes a fourth session with the second device, the method further includes: turning off the first camera and releasing the first session.

[0022] Optionally, the establishment of a fourth session between the first device and the second device includes: the first device sending a second request to the second device, the second request carrying information about the fourth session; and the first device receiving a second response indicating that the fourth session was successfully established. Thus, the first device establishes a fourth session with the second device.

[0023] In a second aspect, an electronic device includes one or more processors and one or more memories. The one or more memories are coupled to the one or more processors and store computer instructions. When the one or more processors execute the computer instructions, the electronic device performs a communication connection management method as provided in the first aspect and its alternative designs.

[0024] Thirdly, a chip system includes a processor and a communication interface. The processor is used to retrieve and run a computer program stored in a storage medium, performing a communication connection management method as provided in the first aspect and its alternative designs.

[0025] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium including computer instructions that, when executed, perform a communication connection management method as provided in the first aspect and its alternative designs.

[0026] Fifthly, a computer program product is provided, the computer program including instructions, when the computer executes the instructions, such as the communication connection management method provided in the first aspect and its alternative designs.

[0027] It is understandable that the technical solutions provided in the second to fifth aspects above can be respectively matched with the communication connection management method provided in the aforementioned design, and the beneficial effects obtained are similar, so they will not be repeated here. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of an interface for a communication connection management method;

[0029] Figure 2 This is a schematic diagram of the interface for yet another communication connection management method;

[0030] Figure 3 This is a schematic diagram of the interface interaction of a communication connection management method;

[0031] Figure 4 This is a schematic diagram of the inter-module interaction process for a communication connection management method.

[0032] Figure 5 This is a schematic diagram of the interface for yet another communication connection management method;

[0033] Figure 6 This is a schematic diagram of the interface for yet another communication connection management method;

[0034] Figure 7 This is a schematic diagram of the interface for yet another communication connection management method;

[0035] Figure 8 This is a schematic diagram of the interface for yet another communication connection management method;

[0036] Figure 9 A schematic diagram of the inter-module interaction process of a communication connection management method provided in this application embodiment;

[0037] Figure 10A flowchart illustrating a communication connection management method provided in an embodiment of this application;

[0038] Figure 11 A schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application;

[0039] Figure 12 A schematic diagram illustrating the composition of another electronic device provided in an embodiment of this application;

[0040] Figure 13 A schematic diagram illustrating the composition of another electronic device provided in an embodiment of this application;

[0041] Figure 14 This is a schematic diagram of the composition of a chip system provided in an embodiment of this application. Detailed Implementation

[0042] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.

[0043] Currently, multiple electronic devices can share hardware resources by establishing P2P connections.

[0044] For example, taking electronic device 1 (hereinafter referred to as device 1) and electronic device 2 (hereinafter referred to as device 2) as examples, device 2 includes at least one camera, and a P2P connection is established between device 1 and device 2. Based on this P2P connection, device 1 can call any target camera 1 in device 2 to send the image information A captured by the target camera 1 to device 1.

[0045] Similarly, in some implementations, device 1 includes at least one camera. Based on this P2P connection, device 2 can invoke any target camera 2 in device 1 to send the image information B captured by that target camera 2 to device 2.

[0046] The following explanation uses device 1 as an example to illustrate the specific implementation of device 1 calling any target camera 1 in device 2.

[0047] In some embodiments, before establishing a P2P connection between device 1 and device 2, device discovery needs to be performed between device 1 and device 2. This allows device 1 to subsequently recognize the camera in device 2.

[0048] In one implementation, device 1 can discover device 2 by establishing a wireless communication connection with device 2. This wireless communication connection can include any one of the following wireless communication connection methods: Bluetooth connection, Wi-Fi connection, and NFC connection.

[0049] As another implementation, device 1 has device discovery application 1 installed, and device 2 has device discovery application 2 installed. When device application 1 and device application 2 are logged into the same account, and device 1 and device 2 have established a wireless communication connection, device 1 can discover device 2 through device application 1.

[0050] Taking device 1 as a laptop and device 2 as a mobile phone as an example, the following explanation, in conjunction with the attached diagram, illustrates how device 1 discovers device 2 based on device discovery application 1.

[0051] For details, please refer to Figure 1 , Figure 1 The diagram shows the interface 101 of the device discovery application 1 in device 1. The interface 101 may include functional items such as device interconnection. Device interconnection can be used to display the identified electronic devices to the user.

[0052] like Figure 1 As shown, assuming the device discovery application 2 on device 2 is logged into account A, and the device discovery application 1 on device 1 is also logged into account A, and device 1 and device 2 establish a wireless communication connection (such as a Bluetooth connection), device 1 can display interface 101. Interface 101 corresponds to the device interconnection details interface. Device 2 is included in interface 101.

[0053] In this embodiment, device 1 is also equipped with a virtual driver module. The virtual driver module includes parameter information for the virtual camera, which may include the identifier and attributes of the virtual camera. This virtual driver module is used for registering the virtual camera.

[0054] For example, after recognizing device 2, device 1 can register the required virtual camera through the virtual driver module. This virtual camera corresponds to at least one camera included in device 2.

[0055] For example, device 2 includes camera A and camera B. The virtual driver module can include parameter information A and parameter information B. Parameter information A includes the identifier and attributes corresponding to camera A, and parameter information B includes the identifier and attributes corresponding to camera B. After device 1 recognizes device 2, it can register virtual camera A based on parameter information A and virtual camera B based on parameter information B through the virtual driver module. Virtual camera A corresponds to camera A, and virtual camera B corresponds to camera B.

[0056] Understandably, the virtual camera A and virtual camera B registered in device 1 can be viewed in the device manager.

[0057] For example, taking camera A as the front-facing camera of device 2 and camera B as the rear-facing camera of device 2 as an example... Figure 2 The diagram shows the interface 201 corresponding to the Device Manager in Device 1. Interface 201 displays other device resources such as the camera in Device 1. The camera in Device 1 may include the front-facing camera and the rear-facing camera of Device 2.

[0058] refer to Figure 3 After virtual camera A and virtual camera B are registered on device 1, device 1 can establish a P2P connection with device 2 and use virtual camera A and virtual camera B. This allows the image information captured by camera A and camera B to be sent to device 1.

[0059] For example, device 1 can use virtual camera A and virtual camera B through an application installed on the upper layer. Taking this application as a conferencing application as an example, refer to... Figure 4 This is an interactive schematic diagram of a method for a device 1 to acquire image information collected by camera A and camera B.

[0060] like Figure 4 As shown, device 1 includes a conferencing application, a virtual driver module, a service management module A, a distributed mobile sensing development platform (DMSDP) module A, and a connectivity module A. The service management module A manages the corresponding prompts (such as "Camera A is being turned on") when device 1 requests to activate cameras A and B. The connectivity module A provides communication interface 1, facilitating data interaction between device 1 and device 2. The DMSDP module A controls data transmission between device 1 and device 2.

[0061] Device 2 includes a connection module B, a DMSDP module B, a service management module B, camera A, and camera B. The service management module B is used to obtain user authorization for camera usage and manage corresponding notification messages (such as "Camera A is in use"). The connection module B is used to enable data interaction between device 2 and device 1. The DMSDP module B is used to control data transmission between device 2 and device 1.

[0062] like Figure 4 As shown, the process by which device 1 acquires image information captured by camera A and / or camera B may include:

[0063] S401, In response to operation 503, the conference application sends a startup request 1 to the virtual driver module.

[0064] In some embodiments of this application, reference is made to Figure 5 Taking conferencing applications as an example, Figure 5 The user interface 501 of the conferencing application is shown. Interface 501 includes other functions such as turning on the camera. In interface 501, the user can input an operation 502 on the control 1 corresponding to turning on the camera to select the camera to be turned on. This operation 502 can be a click operation on control 1.

[0065] In response to operation 502, the camera included in device 1 can be displayed on interface 501. For example... Figure 5 As shown, device 1 may include a front-facing camera and a rear-facing camera of device 2.

[0066] In some implementations, on interface 501, the user can input operation 503 on control 2 corresponding to the front-facing camera of device 2. This operation 503 is used to instruct device 1 to turn on the front-facing camera of device 2 (such as camera A). This operation 503 can be a click operation on control 2.

[0067] like Figure 4 As shown, in response to operation 503, the conference application can send a startup request 1 to the virtual driver module. This startup request 1 is used to instruct camera A to be started.

[0068] S402. When the virtual driver module receives startup request 1, it sends startup request 1 to the DMSDP module A.

[0069] When S403 and DMSDP module A receive startup request 1, they send startup request 1 to business module A.

[0070] In this embodiment, when the DMSDP module A receives the startup request 1, it can also perform the operation in S407.

[0071] S404. When business module A receives startup request 1, it generates prompt message 1.

[0072] For example, refer to Figure 5 When the business module receives the startup request 1, it can generate a prompt message 1 as shown in interface 504. This prompt message 1 may include "Camera is turning on...".

[0073] In this embodiment, when business module A receives startup request 1, it can also perform the operation in S405.

[0074] S405. Business module A sends Startup Request 1 to business module B.

[0075] In combination with the above Figure 1 As described above, a wireless communication connection is established between device 1 and device 2. Taking this wireless communication connection as a Bluetooth connection as an example, in this embodiment, service module A can send startup request 1 to service module B through this Bluetooth connection.

[0076] S406, DMSDP module A sends a request 2 to DMSDP module B to establish a P2P connection 1.

[0077] For example, when DMSDP module A receives the start request 1 in S402, it can send a request 2 to DMSDP module B to establish a P2P connection 1. This request 2 carries information about session 1. Session 1 is used to transmit image information captured by camera A based on P2P connection 1.

[0078] As one implementation method, DMSDP module A can send a request 2 to DMSDP module B to establish a P2P connection 1 by calling the communication interface 1 provided in connection module A.

[0079] S407, DMSDP module B sends a P2P connection 1 establishment success message to DMSDP module A.

[0080] For example, when DMSDP module B receives request 2 to establish P2P connection 1, it can respond to request 2 by sending a message indicating that P2P connection 1 has been successfully established to DMSDP module A.

[0081] In this example, after P2P connection 1 is successfully established, P2P connection 1 carries session 1.

[0082] S408. When business module B receives startup request 1, pop-up window 1 is generated.

[0083] For example, the pop-up window 1 is used to provide an operation window for the user to authorize the use of the camera on device 2. Device 2 can display a corresponding interface based on the pop-up window 1.

[0084] For example, refer to Figure 6 , Figure 6 The user interface 601 of device 2 is shown. Interface 601 includes a pop-up window 1. In some implementations, the user can input an operation 602 onto control 3. This operation 602 is used to authorize device 1 to enable the camera included in device 2. This operation 602 can be a click operation on control 3.

[0085] In response to operation 602, business module B can continue to perform the operations in S409 and S410.

[0086] S409, In ​​response to operation 602, business module B sends instruction A to camera A.

[0087] For example, the instruction A is used to instruct camera A to be turned on.

[0088] S410, Business module B generates prompt message 2.

[0089] In some embodiments, in response to operation 602, service module B can generate a prompt message 2. This prompt message 2 is used to notify the user that camera A is in use. Device 2 can then display a corresponding interface based on this prompt message 2.

[0090] For example, refer to Figure 7 , Figure 7 The user interface 701 of device 2 is shown. The interface 701 includes a prompt message 2. The prompt message 2 may include "Front-facing camera in use".

[0091] It should be noted that, in some other embodiments, in response to operation 602, service module B can also provide operations for managing camera A. These operations may include pausing the use of camera A and turning off camera A.

[0092] Accordingly, interface 701 may also include control 4 and control 5. Control 4 is used to provide the user with the operation of pausing the use of camera A, and control 5 is used to provide the user with the operation of turning off camera A.

[0093] S411, Camera A starts up.

[0094] For example, in response to instruction A, camera A starts up.

[0095] In this example, after camera A is started, it can continue the operation in S412.

[0096] S412, Camera A sends the acquired image information A to DMSDP module B.

[0097] For example, refer to Figure 7 The image range that camera A in device 2 can capture is defined as a sector area 702, which includes object 1. In this example, camera A can send the captured image information A to the DMSDP module B in device 1. This image information A corresponds to object 1.

[0098] S413. When DMSDP module B receives image information A, it sends image information A to DMSDP module A.

[0099] For example, in conjunction with the foregoing description, when DMSDP module B receives image information A captured by camera A, it can send image information A to DMSDP module A through the previously established session 1. This allows device 1 to obtain image information A.

[0100] When S414 and DMSDP module A receive image information A, they decode the image information A to obtain image information B.

[0101] Understandably, to improve the efficiency of information transmission, image information A can be encoded before being sent to device 1. Correspondingly, when device 1 receives image information A, it also needs to decode it.

[0102] For example, when receiving image information A, device 1 can decode image information A through DMSDP module A to obtain image information B.

[0103] In this example, after obtaining image information B, DMSDP module A can continue with the operation in S415.

[0104] S415, DMSDP module A sends image information B to the virtual driver module.

[0105] S416, the virtual driver module sends image information B to the conference application.

[0106] For example, when the virtual driver module receives image information B, it can send image information B to the conferencing application. In this way, device 1 will display the corresponding interface in the conferencing application based on image information B.

[0107] For example, such as Figure 7 As shown, when the conference application receives image information B, it can display interface 703 accordingly. Interface 703 displays image 705, which corresponds to image information A captured by camera A.

[0108] In this way, device 1 completes the acquisition of image information A collected by camera A.

[0109] In some embodiments, reference Figure 7 In interface 703, the user can input operation 704 on control 6 corresponding to the rear camera of device 2. This operation 704 is used to instruct device 1 to turn on the rear camera of device 2 (such as camera B). This operation 704 can be a click operation on control 6.

[0110] In this embodiment, when device 1 receives operation 704, it can, according to Figure 4 The method provided in the document is used for further processing. This allows device 1 to switch virtual camera A to virtual camera B, thereby enabling the use of camera B in device 2.

[0111] like Figure 4 As shown, the process may include:

[0112] S417, In response to operation 704, the conference application sends a shutdown request 3 to the virtual driver module.

[0113] For example, the shutdown request 3 is used to instruct camera A to be turned off. In this example, the conferencing application, in response to operation 704, can send the shutdown request 3 to the virtual driver module.

[0114] S418. When the virtual driver module receives shutdown request 3, it sends shutdown request 3 to DMSDP module A.

[0115] In this embodiment, when the DMSDP module A receives the shutdown request 3 to turn off camera A, it can continue to perform the operation in S419.

[0116] S419. When DMSDP module A receives closure request 3, it sends closure request 3 to DMSDP module B.

[0117] When the S420 and DMSDP modules B receive the shutdown request 3, they shut down camera A.

[0118] In one implementation, device 2 is equipped with a camera management module, which is used to control the camera's on and / or off status. In this implementation, when the DMSDP module B receives a turn-off request 3 to turn off camera A, it can use the camera management module to turn off camera A.

[0119] S421, DMSDP module A sends instruction B to connection module A.

[0120] For example, when DMSDP module A receives the close request 3 in S418, it can also send an instruction B to connection module A. This instruction B is used to indicate the release of session 1.

[0121] S422, in response to instruction B, connection module A releases session1 and disconnects P2P connection 1.

[0122] For example, when connection module A receives instruction B, it releases session 1 on P2P connection 1 in response to instruction B.

[0123] It should be noted that, in this embodiment, when at least one session (such as session1) is carried in P2P connection 1, connection module A maintains the P2P connection 1 between device 1 and device 2. Conversely, when there is no session in P2P connection 1, connection module A will disconnect P2P connection 1.

[0124] As described above, after releasing session1, connection module A will disconnect P2P connection 1.

[0125] S423, The conference application sends a startup request to the virtual driver module.

[0126] For example, after sending a shutdown request 3 to turn off camera A, the conferencing application can send a startup request 4 to the virtual driver module. This startup request 4 instructs the virtual driver module to start camera B.

[0127] S424. When the virtual driver module receives startup request 4, it sends startup request 4 to the DMSDP module A.

[0128] When S425 and DMSDP module A receive startup request 4, they send startup request 4 to business module A.

[0129] In this embodiment, when the DMSDP module A receives the startup request 4, it can also perform the operation in S428.

[0130] S426. When business module A receives startup request 4, it generates prompt message 3.

[0131] For example, similar to prompt 1, prompt 3 could include "Camera is turning on...". Thus, device 1 can display prompt 3 on the user interface of the conferencing application based on this prompt 3.

[0132] In this embodiment, when business module A receives startup request 4, it can also perform the operation in S427.

[0133] S427. Business module A sends startup request 4 to business module B.

[0134] For example, when business module A receives startup request 4, it can send startup request 4 to business module B.

[0135] In this example, the implementation of business module A sending startup request 4 to business module B is the same as that of sending startup request 1. For details, please refer to the description in S405, which will not be repeated here.

[0136] S428, DMSDP module A sends a request to DMSDP module B to establish a P2P connection 2.

[0137] For example, when DMSDP module A receives the start request 4 in S424, it can send a request 5 to DMSDP module B to establish a P2P connection 2. This request 5 carries information about session 2. Session 2 is used to transmit image information captured by camera B based on P2P connection 2.

[0138] S429, DMSDP module B sends a P2P connection 2 establishment success message to DMSDP module A.

[0139] For example, when DMSDP module B receives request 5 to establish P2P connection 2, it can respond to request 5 by sending a message indicating that P2P connection 2 has been successfully established to DMSDP module A.

[0140] In this example, after P2P connection 2 is successfully established, P2P connection 2 carries session 2.

[0141] S430, Service module B sends instruction C to camera B.

[0142] For example, when business module B receives startup request 4, it can send instruction B to camera B. Instruction B is used to instruct camera B to turn on.

[0143] S431, Business module B generates prompt message 4.

[0144] In some embodiments, after sending instruction C to camera B, service module B can generate prompt message 4. This prompt message 4 is used to notify the user that camera B is in use. Device 2 can then display a corresponding interface based on this prompt message B.

[0145] For example, refer to Figure 8 , Figure 8 The user interface 801 of device 2 is shown. The interface 801 includes a prompt message 4. The prompt message 4 may include "Rear camera in use".

[0146] It should be noted that, in some other embodiments, in response to operation 802, service module B can also provide operations for managing camera B. These operations may include pausing the use of camera B and turning it off.

[0147] Accordingly, interface 801 may also include control 6 and control 7. Control 6 is used to provide the user with the operation of pausing the use of camera B, and control 7 is used to provide the user with the operation of turning off camera B.

[0148] S432, Camera B starts up.

[0149] For example, when camera B receives instruction C, it starts up in response to instruction C.

[0150] In this example, after camera B is started, it can continue the operation in S434.

[0151] S433, Camera B sends the acquired image information C to DMSDP module B.

[0152] For example, refer to Figure 8 Let the image range that camera B in device 2 can capture be defined as a fan-shaped region 802, which includes object 2. In this example, camera B can send the captured image information C to DMSDP module B. This image information C corresponds to object 2.

[0153] S434. When DMSDP module B receives image information C, it sends image information C to DMSDP module A.

[0154] For example, in conjunction with the foregoing description, when DMSDP module B receives image information C captured by camera B, it can send the image information C to DMSDP module A through the previously established session 2. This allows device 1 to acquire the image information C.

[0155] When the S435 and DMSDP modules A receive image information C, they decode the image information C to obtain image information D.

[0156] In some embodiments, similar to image information A, image information C may be encoded before being sent to device 1. Accordingly, when device 1 receives image information C, it also needs to decode image information C.

[0157] For example, when image information C is received, device 1 can decode image information C through DMSDP module A to obtain image information D.

[0158] In this example, after obtaining image information D, DMSDP module A can continue with the operation in S436.

[0159] S436, DMSDP module A sends image information D to the virtual driver module.

[0160] S437, the virtual driver module sends image information D to the conference application.

[0161] For example, when the virtual driver module receives image information D, it can send image information D to the conferencing application. In this way, device 1 will display the corresponding interface in the conferencing application based on the image information D.

[0162] For example, such as Figure 8 As shown, when the conference application receives image information D, it can display interface 803 accordingly. Interface 803 displays image 804, which corresponds to image information C captured by camera B.

[0163] In this way, device 1 completes the acquisition of image information C collected by camera B.

[0164] In some embodiments, reference Figure 8 In interface 803, the user can input operation 805 on the control 8 corresponding to turning off the camera. This operation 805 is used to instruct device 1 to turn off camera B. This operation 805 can be a click operation on control 8.

[0165] In this embodiment, when device 1 receives operation 805, it can, according to Figure 4 The method provided in the document is used for further processing, enabling device 1 to turn off camera B.

[0166] like Figure 4 As shown, the process includes:

[0167] S438, In response to operation 805, the conference application sends a shutdown request 6 to the virtual driver module.

[0168] For example, the shutdown request 6 is used to instruct camera B to be turned off. In this example, the conferencing application, in response to operation 805, can send the shutdown request 6 to the virtual drive module.

[0169] S439. When the virtual driver module receives shutdown request 6, it sends shutdown request 6 to DMSDP module A.

[0170] In this embodiment, when the DMSDP module A receives the shutdown request 6, it can continue the operation in S440.

[0171] When S440 and DMSDP module A receive shutdown request 6, they send shutdown request 6 to DMSDP module B.

[0172] In this example, the implementation of DMSDP module A sending close request 6 to DMSDP module B is similar to that of sending close request 3. For details, please refer to the description in S419, which will not be repeated here.

[0173] When S441 and DMSDP module B receive shutdown request 6, they shut down camera B.

[0174] In this example, the implementation of turning off camera B in DMSDP module B is similar to that of turning off camera A. For details, please refer to the description in S420, which will not be repeated here.

[0175] S442, DMSDP module A sends instruction D to connection module A.

[0176] For example, when DMSDP module A receives the close request 6 in S439, it can also send an indication D to connection module A. This indication D is used to indicate the release of session 2.

[0177] S443. In response to instruction D, connection module A releases session2 and disconnects P2P connection2.

[0178] For example, when connection module A receives instruction D, it releases session 2 on P2P connection 2 in response to instruction D.

[0179] As described in S422 above, after releasing session1, connection module A determines that there is no session on P2P connection 1. In this case, connection module A will disconnect P2P connection 2.

[0180] Thus, device 1 achieves the shutdown of camera B.

[0181] It should be noted that, in cases such as Figure 4 In the example, when device 1 switches from virtual camera A to virtual camera B, it needs to re-establish a P2P connection 2 between device 1 and device 2. Since establishing P2P connection 2 takes time, there is a delay in device 1 acquiring the image information captured by device B. During this time period, device 1 displays the user interface shown in interface 504. This reduces the efficiency of device 1 switching virtual cameras and increases the user's waiting time.

[0182] To address the aforementioned problems, this application provides a communication connection management method and an electronic device. Device 1 includes virtual camera A and virtual camera B. Device 2 includes camera A and camera B. Virtual camera A corresponds to camera A, and virtual camera B corresponds to camera B. When device 1 activates virtual camera A, a first P2P connection is established between device 1 and device 2. This first P2P connection carries session 11. Session 11 is used to transmit image information captured by camera A. The first device and the second device establish session 12. Session 12 is carried in the first P2P connection.

[0183] In this way, when session11 is released, since the first P2P connection still carries session12, the first P2P connection can be maintained between the first device and the second device.

[0184] Furthermore, when device 1 switches from virtual camera A to virtual camera B, device 1 and device 2 can establish a session 13 based on a first P2P connection. This session 13 is used to transmit image information captured by camera B. Therefore, device 1 can switch from virtual camera A to virtual camera B in a shorter time, reducing the user's waiting time.

[0185] In other embodiments of this application, device 1 may also be referred to as a first device. Device 2 may also be referred to as a second device. Camera A may also be referred to as a first camera. Camera B may also be referred to as a second camera. Session 11 may also be referred to as a first session. Session 12 may also be referred to as a second session. Session 13 may also be referred to as a fourth session. In addition, session 11 and session 13 are included in a third session, which is different from session 12.

[0186] For example, taking a conferencing application as an example, refer to Figure 9 This is an interactive schematic diagram of a communication connection management method provided in an embodiment of this application. Through, as shown... Figure 9 The scheme shown allows device 1 to switch from virtual camera A to virtual camera B in a relatively short time.

[0187] like Figure 9 As shown, the solution may include:

[0188] S901, In response to operation 503, the conference application sends a start request 11 to the virtual driver module.

[0189] In conjunction with the foregoing description, operation 503 is used to instruct device 1 to activate the front-facing camera of device 2 (such as camera A). In response to operation 503, the conferencing application can send a startup request 11 to the virtual driver module.

[0190] The startup request 11 can be startup request 1 in S401. The startup request 11 is used to instruct camera A to be started.

[0191] In some other embodiments of this application, operation 503 may also be referred to as the first operation.

[0192] S902. When the virtual driver module receives the startup request 11, it sends the startup request 11 to the DMSDP module A.

[0193] When S903 and DMSDP module A receive startup request 11, they send startup request 11 to business module A.

[0194] In this embodiment, when the DMSDP module A receives the startup request 11, it can also perform the operation in S910.

[0195] S904. When business module A receives startup request 11, it generates prompt message 11.

[0196] For example, the prompt message 11 can be Figure 5 The prompt message 11 shown in interface 504. This prompt message 11 may include "Camera is being turned on...".

[0197] In this embodiment, when business module A receives startup request 11, it can also perform the operation in S905.

[0198] S905, Business module A sends startup request 11 to business module B.

[0199] For example, business module A can send startup request 11 to business module B through a wireless communication connection (such as a Bluetooth connection) established between device 1 and device 2.

[0200] In this example, the specific implementation of S905 can be found in the description of S405, and will not be repeated here.

[0201] S906. When business module B receives startup request 11, it generates pop-up window 11.

[0202] For example, the pop-up window 11 may include Figure 6 Pop-up window 11 is shown in interface 601. This pop-up window is used to provide the user with the operation window to authorize the use of the camera in device 2.

[0203] In some implementations, such as Figure 6 As shown, the user can enter operation 602 in pop-up window 11. Operation 602 is used to authorize device 1 to use the cameras in device 2 (such as camera A and camera B).

[0204] In response to operation 602, business module B can continue to perform the operations in S907 and S908.

[0205] S907, In response to operation 602, service module B sends instruction 1 to camera A.

[0206] For example, Instruction 1 is used to instruct camera A to turn on. In response to operation 602, service module B can send Instruction 1 to camera A.

[0207] In this example, instruction 1 can be instruction A in S409.

[0208] S908, Business Module B generates prompt message 12.

[0209] For example, in response to operation 602, business module B can generate prompt message 12. This prompt message 12 can be... Figure 7 The prompt message 12 shown on the interface 701 indicates that the camera A is in use. The prompt message 12 may include "Front-facing camera in use". Device 2 can display a corresponding interface based on this prompt message 12.

[0210] S909, Camera A starts up.

[0211] For example, upon receiving and responding to instruction 1, camera A starts up.

[0212] In this example, after camera A is started, it can continue the operation in S917.

[0213] S910, DMSDP module A sends a request to DMSDP module B to establish a P2P connection 11 12.

[0214] For example, when DMSDP module A receives the start request 11 in S902, it can send a request 12 to DMSDP module B to establish a P2P connection 11. This request 12 carries information about session 11 and session 12. Session 11 is used to transmit image information captured by camera A based on the P2P connection 11.

[0215] In this example, the implementation of sending request 12 from DMSDP module A to DMSDP module B is similar to that of sending request 2 in S406. For details, please refer to the description in S406, which will not be repeated here.

[0216] In some other embodiments of this application, request 12 may also be referred to as the first request.

[0217] S911, DMSDP module B sends response 12 to DMSDP module A.

[0218] For example, when DMSDP module B receives a request 12 to establish a P2P connection 11, it can respond to the request 12 by sending a response 12 to DMSDP module A. The response 12 indicates that the P2P connection 11 has been successfully established.

[0219] In this example, after P2P connection 11 is successfully established, P2P connection 11 carries session 11 and session 12.

[0220] In some other embodiments of this application, response 12 may also be referred to as a second response.

[0221] It should be noted that the descriptions of S910 and S911 are based on the example of session 11 and session 12 being established simultaneously. In some other embodiments of this application, device 1 can establish session 12 with device 2 before releasing session 11.

[0222] For example, before releasing session 11, device 1 sends request A to device 2. Request A carries information about session 12 and is used to instruct device 2 to establish session 12.

[0223] Accordingly, when device 2 receives request A, it responds to request A by sending response B to device A. Response A is used to indicate that session 12 was successfully established.

[0224] In the embodiments of this application, reference is made to Figure 10 After establishing session 12, DMSDP module A can... Figure 10 The scheme shown manages the validity period of session 12. This ensures that when other sessions on P2P connection 11 are closed, session 12 remains on P2P connection 11 for a period of time, thereby maintaining P2P connection 11 between device 1 and device 2.

[0225] like Figure 10 As shown, the solution may include:

[0226] S1001, DMSDP module A determines whether P2P connection 11 carries other sessions besides session 12.

[0227] In some embodiments of this application, the DMSDP module A can determine whether the P2P connection 11 carries other sessions besides session 12 when it receives a message indicating that the P2P connection 11 has been successfully established.

[0228] In one implementation, DMSDP module A determines that other sessions (such as session 11) are carried in P2P connection 11. In this implementation, DMSDP module A can continue to perform the operations in S1002.

[0229] In another implementation, DMSDP module A determines that only session 12 exists in P2P connection 11. In this implementation, DMSDP module A can continue to perform the operations in S1004.

[0230] S1002, DMSDP module A sends instruction 2 to connection module A before the expiration of session 12.

[0231] For example, if DMSDP module A determines that another session is being carried in P2P connection 11, it sends instruction 2 to connection module A. Instruction 2 instructs connection module A to keep session 12 active, so that session 12 continues to be carried in P2P connection 11.

[0232] In this example, DMSDP module A can send instruction 2 to connection module A before the expiration of session 12.

[0233] For example, DMSDP module A is configured with a loop timer. DMSDP module A can send indication 2 to connection module A each time the loop timer expires. The period of the loop timer is T1, which is less than or equal to the validity period of session 12.

[0234] For example, DMSDP module A can be configured with a detection unit to detect the validity period of session 12. By detecting the validity period of session 12, DMSDP module A can send indication 2 to connection module A before the validity period of session 12 expires.

[0235] It should be noted that, in the embodiments of this application, after sending instruction 2 to module A, DMSDP module A repeatedly executes the processing of S1001.

[0236] In some other embodiments of this application, the DMSDP module A determines that only session 12 exists in the P2P connection 11. In this case, the DMSDP module A can determine again whether the P2P connection 11 carries other sessions besides session 12 before the expiration of session 12.

[0237] As a specific implementation, DMSDP module A can execute the processing in S1003 and S1004 when it is determined that only session 12 exists in P2P connection 11.

[0238] In some other embodiments of this application, instruction 2 may also be referred to as the first renewal instruction.

[0239] S1003, DMSDP module A initiates timer 1.

[0240] For example, when DMSDP module A determines that P2P connection 11 only carries session 12, it initiates timer 1. The duration of timer 1 is T2, which is less than or equal to the validity period of session 12.

[0241] In some other embodiments of this application, timer 1 may also be referred to as the first timer, and the duration T2 may also be referred to as the first duration.

[0242] When timer 1 expires, module A of DMSDP in S1004 determines whether P2P connection 11 carries other sessions besides session 12.

[0243] In one implementation, when timer 1 expires, DMSDP module A determines that other sessions are being carried in P2P connection 11. In this implementation, DMSDP module A can continue to perform the operations in S1002.

[0244] In another implementation, when timer 1 expires, DMSDP module A determines that only session 12 exists on P2P connection 11. In this implementation, DMSDP module A can continue to execute the operation in S1005.

[0245] S1005, DMSDP module A sends instruction 6 to connection module A.

[0246] Based on the descriptions in S1003 and S1004 above, in some implementations, only session 12 is included on P2P connection 11 during duration T2. ​​In this implementation, DMSDP module A can send instruction 6 to connection module A. Instruction 6 is used to instruct connection module A to release session 12. This ensures that session 12 is released after a delay of duration T2, even if all other sessions in P2P connection 11 have been released.

[0247] According to such Figure 10 In the example, if the DMSDP module A determines that another session exists in the P2P connection 11, it can perform operation S1002 and send an instruction 2 to the connection module A to keep the session 12 alive.

[0248] In addition, when DMSDP module A determines that only session 12 exists on P2P connection 11 within time T2, it sends an instruction 6 to connection module A to release session 12.

[0249] In some other embodiments of this application, instruction 6 may also be referred to as a first release instruction.

[0250] Combination Figure 10In some embodiments of this application, as a specific example, after receiving the response 12 in S911 indicating that the P2P connection 11 has been successfully established, device 1 can perform the processing in S912 to S916 to maintain session 12 in the P2P connection 11 even if other sessions are included on the P2P connection 11.

[0251] S912, DMSDP module A determines that P2P connection 11 also carries session 11.

[0252] For example, after receiving the message that P2P connection 11 has been successfully established, DMSDP module A can determine that in addition to session 12, session 11 also exists in P2P connection 11.

[0253] In the embodiments of this application, according to Figure 10 According to the description, DMSDP module A can continue to perform the operations in S913.

[0254] S913, DMSDP module A sends instruction 2 to connection module A before the expiration of session 12.

[0255] In this example, S913 corresponds to Figure 10 The specific implementation of operations S1002 and S912 can be found in the description of S1002, and will not be repeated here.

[0256] S914. When connection module A receives instruction 2, it sends instruction 2 to connection module B.

[0257] For example, taking the wireless communication connection established between device 1 and device 2 as a Bluetooth connection, connection module A can send instruction 2 to connection module B based on the Bluetooth connection.

[0258] S915, Connect module A keeps session12 active.

[0259] For example, when the connection module receives instruction 2, it keeps session 12 active.

[0260] As a specific implementation, connection module A is configured with timer 2. Timer 2 is used to trigger the first device to release session 12 when the timer duration ends.

[0261] In this implementation, connection module A can reset timer 2 upon receiving instruction 2. This avoids triggering the release of session 12 when timer 2 expires, thus preserving session 12.

[0262] In some other embodiments of this application, timer 2 may also be referred to as a second timer.

[0263] S916, Connect module B keeps session12 active.

[0264] For example, connection module A is configured with timer 3. Timer 3 functions similarly to timer 2, and timer 3 is used to trigger the second device to release session 12 when the timer duration ends.

[0265] In this example, when connection module A receives instruction 2, it can keep session 12 alive by resetting timer 3.

[0266] S917, Camera A sends the acquired image information 1 to DMSDP module B.

[0267] In this example, the implementation in S917 is similar to... Figure 4 Similar to S412, the details can be found in the description of S412, and will not be repeated here.

[0268] In some other embodiments of this application, image information 1 may also be referred to as first image information.

[0269] When S918 and DMSDP module B receive image information 1, they send image information 1 to DMSDP module A.

[0270] For example, in conjunction with the foregoing description, when DMSDP module B receives image information 1 captured by camera A, it can send image information 1 to DMSDP module A through the aforementioned established session 11. This allows device 1 to acquire image information 1.

[0271] When the S919 and DMSDP modules A receive image information 1, they decode the image information 1 to obtain image information 2.

[0272] In this example, the implementation in S919 is similar to... Figure 4 Similar to S414, the details can be found in the description of S414, and will not be repeated here.

[0273] S920, DMSDP module A sends image information 2 to the virtual drive module.

[0274] S921, the virtual driver module sends image information 2 to the conference application.

[0275] For example, when the virtual driver module receives image information 2, it can send image information 2 to the conferencing application. In this way, device 1 will display the corresponding interface in the conferencing application based on image information 2.

[0276] In this example, the implementation in S921 is the same as... Figure 4 Similar to S416, for details please refer to the description in S416.

[0277] For example, such as Figure 7 As shown, when the conference application receives image information 2, it can display interface 703 accordingly. Interface 703 displays image 705, which corresponds to image information 2 captured by camera A.

[0278] In some other embodiments of this application, interface 703 may also be referred to as a first interface. Image 705 may also be referred to as a first image.

[0279] In this way, device 1 completes the acquisition of image information 1 collected by camera A.

[0280] Combination Figure 7 The instructions state that when a user wants to switch from virtual camera A to virtual camera B, they can... Figure 7 The interface 703 inputs operation 704, which is used to instruct device 1 to turn on the rear camera of device 2 (such as camera B).

[0281] In the embodiments of this application, when device 1 receives operation 704, it can, according to Figure 9 The method provided is used for further processing. This enables device 1 to switch virtual camera A to virtual camera B, thereby acquiring the image information captured by camera B.

[0282] like Figure 9 As shown, the process may include:

[0283] S922, In response to operation 704, the conference application sends a shutdown request 13 to the virtual driver module.

[0284] For example, the shutdown request 13 is used to instruct camera A to be turned off. In this example, the conferencing application, in response to operation 704, can send the shutdown request 13 to the virtual drive module.

[0285] In this example, closing request 13 corresponds to Figure 4 The closing request in section 3.

[0286] In some other embodiments of this application, operation 704 may also be referred to as the second operation.

[0287] S923. When the virtual driver module receives the shutdown request 13, it sends the shutdown request 13 to the DMSDP module A.

[0288] In this embodiment, when the DMSDP module A receives the shutdown request 13 to turn off camera A, it can continue to perform the operation in S924.

[0289] S924. When DMSDP module A receives shutdown request 13, it sends shutdown request 13 to DMSDP module B.

[0290] When the S925 and DMSDP module B receive the shutdown request 13, they shut down camera A.

[0291] In this example, S924 corresponds to Figure 4 S419 and S925 in the text correspond to: Figure 4 The implementation of S420, S924 to S925 can be referred to the description in S419 to S420. Specific embodiments can be referred to each other, and will not be repeated here.

[0292] S926, DMSDP module A sends instruction 3 to connection module A.

[0293] For example, when DMSDP module A receives the close request 13 in S923, it can also send instruction 3 to connection module A. Instruction 3 is used to indicate the release of session 11.

[0294] S927, Connection module A responds to instruction 3 and releases session11.

[0295] For example, when connection module A receives instruction 3, it releases session 11 on P2P connection 11 in response to instruction 3.

[0296] In this example, indicator 3 corresponds to Figure 4 Instruction C in the document.

[0297] It should be noted that, in conjunction with the foregoing Figure 10 As explained, after session 11 is closed, DMSDP module A can execute the operation in S1001 to determine that only session 12 exists in P2P connection 11. At this time, DMSDP module A continues to execute the processing in S1003, initiating timer 1 with a duration of T2.

[0298] In other words, session 12 remains within P2P connection 11 during the T2 duration. Furthermore, during the T2 duration, P2P connection 11 is maintained between device 1 and device 2.

[0299] S928, The conference application sends a startup request 14 to the virtual driver module.

[0300] For example, after sending a shutdown request 13 to turn off camera A, the conferencing application can send a startup request 14 to the virtual driver module. This startup request 14 instructs the virtual driver module to start camera B.

[0301] In this example, closing request 14 corresponds to Figure 4 The closing request in section 4.

[0302] S929. When the virtual driver module receives the startup request 14, it sends the startup request 14 to the DMSDP module A.

[0303] When S930 and DMSDP module A receive startup request 14, they send startup request 14 to business module A.

[0304] In this embodiment, when the DMSDP module A receives the startup request 14, it can also perform the operation in S933.

[0305] S931. When business module A receives startup request 14, it generates prompt message 13.

[0306] For example, similar to prompt 11, prompt 13 may include "Camera is turning on...". Thus, device 1 can display prompt 13 on the user interface of the conferencing application based on this prompt 13.

[0307] In this embodiment, when the service module A receives the startup request 14, it can also perform the operation in S932.

[0308] S932, Business module A sends startup request 14 to business module B.

[0309] In this example, similar to the implementation of sending start request 11, service module A can send start request 14 to service module B through the Bluetooth connection established between device 1 and device 2.

[0310] S933, DMSDP module A sends a request 15 to DMSDP module B to establish session 13.

[0311] It should be noted that, in the embodiments of this application, the duration of operation S928 to S933 performed by device 1 is less than the duration T2. ​​That is, during the execution of operation S928 to S933, a P2P connection 11 is still established between device 1 and device 2.

[0312] For example, when DMSDP module A receives the start request 14 in S930, it can send a request 15 to DMSDP module B to establish session 13. This request 15 carries information about session 13. Session 13 is used to transmit image information captured by camera B based on the P2P connection 11.

[0313] In some other embodiments of this application, request 15 may also be referred to as a second request.

[0314] S934, DMSDP module B sends response 15 to DMSDP module A.

[0315] As one implementation, DMSDP module B can send response 15 to DMSDP module A upon receiving request 15 to establish session 13. This response 15 indicates that session 13 has been successfully established.

[0316] In some other embodiments of this application, response 15 may also be referred to as the second response.

[0317] Therefore, session 13 is also carried on the P2P connection 11 between device 1 and device 2.

[0318] It should be noted that, in conjunction with the foregoing explanation, when timer 1 expires, DMSDP module A can continue to execute the operation in S1004 to determine whether P2P connection 11 carries sessions other than session 12. In the example of S934, DMSDP module A can determine that P2P connection 11 contains not only session 12 but also session 13. Combined with... Figure 10 As explained in S1004, at this point, DMSDP module A can continue to execute the operations in S1002, keeping session 12 alive.

[0319] As a specific example, after session 13 is established between device 1 and device 2, device 1 and device 2 can perform operations such as S912 to S916 to keep session 12 running.

[0320] Therefore, after the operation in S934 is completed, P2P connection 11 continues to carry session 12 in addition to session 13.

[0321] S935, Service module B sends instruction 4 to camera B.

[0322] For example, when business module B receives the start request 14 in S932, it can send instruction 4 to camera B. Instruction 4 is used to instruct camera B to turn on.

[0323] S936, Business module B generates prompt message 14.

[0324] In some embodiments of this application, after sending instruction 4 to camera B, service module B can generate prompt information 14. This prompt information 14 is used to notify the user that camera B is in use. Device 2 can display a corresponding interface based on this prompt information B.

[0325] For example, refer to Figure 8 Message 14 can be Figure 8 The prompt message 4 shown in the middle interface 801. The prompt message 14 may include "Front-facing camera in use".

[0326] S937, Camera B starts up.

[0327] For example, upon receiving and responding to instruction 4, camera B begins to start.

[0328] In this example, after camera B is started, it can continue the operation in S938.

[0329] S938, Camera B sends the acquired image information 3 to DMSDP module B.

[0330] For example, refer to Figure 8 Let the image range that camera B in device 2 can capture be defined as a fan-shaped region 802, which includes object 2. In this example, camera B can send the captured image information 3 to DMSDP module B. This image information 3 corresponds to object 2.

[0331] When S939 and DMSDP module B receive image information 3, they send image information 3 to DMSDP module A.

[0332] For example, in conjunction with the foregoing description, when DMSDP module B receives image information 3 captured by camera B, it can send image information 3 to DMSDP module A through the aforementioned established session 13. This allows device 1 to acquire the image information 3.

[0333] When the S940 and DMSDP modules A receive image information 3, they decode the image information 3 to obtain image information 4.

[0334] In this example, the implementation in S940 is similar to... Figure 4 Similar to S435, for details please refer to the description in S435, which will not be repeated here.

[0335] In this example, after obtaining image information 4, DMSDP module A can continue the operation in S941.

[0336] S941, DMSDP module A sends image information 4 to the virtual drive module.

[0337] S942, the virtual driver module sends image information 4 to the conference application.

[0338] For example, when the virtual driver module receives image information 4, it can send image information 4 to the conferencing application. In this way, device 1 will display the corresponding interface in the conferencing application based on image information 4.

[0339] In this example, the implementation in S942 is similar to... Figure 4 Similar to S437, for details please refer to the description in S437, which will not be repeated here.

[0340] In this way, device 1 can then acquire the image information 3 collected by camera B based on session 13 on P2P connection 11.

[0341] According to the descriptions in S922 to S942, when device 1 switches from virtual camera A to virtual camera B, it needs to first release session 11 on the P2P connection 11, and then establish session 13 for transmitting image information 3. Since session 12 continues for duration T2 after session 11 is closed, the P2P connection 11 is maintained between device 1 and device 2 during this duration. Therefore, when device 1 sends a request 15 to establish session 13 during duration T2, it can establish session 13 based on the current P2P connection 11. This allows device 1 to switch from virtual camera A to virtual camera B in a shorter time, thereby enabling device 1 to acquire image information 3 captured by camera B in a shorter time.

[0342] In combination with the above Figure 8 The explanation above, using camera B as an example, states that when a user wants to turn off camera B via device 1, they can... Figure 8 The interface 803 inputs operation 805, which is used to instruct device 1 to turn off camera B.

[0343] In some embodiments of this application, when device 1 receives operation 805, it can, according to Figure 9 The method provided in the document is used for further processing, enabling device 1 to turn off camera B.

[0344] like Figure 9 As shown, the process includes:

[0345] S943, In response to operation 805, the conference application sends a shutdown request 16 to the virtual driver module.

[0346] For example, the shutdown request 16 is used to instruct camera B to be turned off. In this example, the conferencing application, in response to operation 805, can send the shutdown request 16 to the virtual drive module.

[0347] S944. When the virtual driver module receives the shutdown request 16, it sends the shutdown request 16 to the DMSDP module A.

[0348] In this embodiment, when the DMSDP module A receives the shutdown request 16 to turn off the camera A, it can continue to perform the operation in S945.

[0349] S945. When DMSDP module A receives shutdown request 16, it sends shutdown request 16 to DMSDP module B.

[0350] In this example, the implementation of DMSDP module A sending close request 16 to DMSDP module B is similar to that of sending close request 13. For details, please refer to the description in S924, which will not be repeated here.

[0351] When S946 and DMSDP module B receive shutdown request 16, they shut down camera B.

[0352] In this example, the implementation of turning off camera B in DMSDP module B is similar to that of turning off camera A. For details, please refer to the description in S925, which will not be repeated here.

[0353] S947, DMSDP module A sends instruction 5 to connection module A.

[0354] For example, when DMSDP module A receives closure request 16, it can also send instruction 5 to connection module A. Instruction 5 is used to indicate the release of session 13.

[0355] S948, Connection module A responds to instruction 5 and releases session 13.

[0356] It should be noted that, similar to session 11, after releasing session 13, DMSDP module A can execute the operation in S1001 to determine that only session 12 exists on P2P connection 11. At this time, DMSDP module A continues to execute the processing in S1003, and after a duration of T2, it checks again whether P2P connection 11 is carrying any sessions other than session 12.

[0357] As one implementation, after a duration of T2, the DMSDP module A can execute the operation of S949.

[0358] S949, DMSDP module A determines that P2P connection 11 only has session 12 within time T2.

[0359] based on Figure 8 In the scenario where device 1 turns off camera B, in this example, DMSDP module A determines that P2P connection 11 only carries session 12 within time T2. At this time, DMSDP module A can continue to execute the processing in S950.

[0360] S950, DMSDP module A sends instruction 6 to connection module A.

[0361] For example, after completing the operation in S949, DMSDP module A sends instruction 6 to connection module A. Instruction 6 is used to indicate the release of session 12.

[0362] S951, Module A releases session 12 and disconnects P2P connection 11.

[0363] For example, when connection module A receives instruction 6, it releases session 12 carried in P2P connection 11 in response to instruction 6.

[0364] At this point, there is no session on P2P connection 11. (This is in conjunction with the aforementioned...) Figure 4 According to the description, in this implementation, after releasing session 12, connection module A will continue to disconnect P2P connection 11.

[0365] Thus, device 1 has successfully turned off camera B.

[0366] It should be noted that, in Figure 9 In the examples provided, device 1 is always illustrated using a laptop computer. However, in other embodiments of this application, device 1 can also be a mobile phone, tablet computer, or other product forms. This application does not impose any special limitations on the specific form of the electronic device.

[0367] The solutions provided in this application can be applied to electronic devices. The electronic devices (such as device 1) involved in this application can run an operating system, which can be... Or other operating systems.

[0368] For example, in device 1, there is a Take the operating system as an example. Figure 11 A schematic diagram of the composition of a device 1 is shown. As one possible implementation, device 1 can be as follows: Figure 3The laptop shown.

[0369] In this example, device 1 can have a layered architecture. This layered architecture consists of several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces.

[0370] like Figure 11 As shown, the layered architecture in device 1, from top to bottom, consists of the application layer, application framework layer, Android runtime (ART) and system libraries, hardware abstraction layer (HAL), kernel layer, and hardware layer.

[0371] like Figure 11 As shown, the application layer can include applications such as music, video, calls, ringtones, alarm clocks, Bluetooth, navigation, and gallery.

[0372] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0373] like Figure 11 As shown, the application framework layer may include a window manager, activity manager, input manager, resource manager, notification manager, view system, etc.

[0374] The window manager provides a window management service (WMS), which can be used for window management, window animation management, surface management, and as a relay station for the input system.

[0375] The Activity Manager Service (AMS) can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers), as well as manage and schedule application processes.

[0376] The input manager can provide an input management service (IMS), which can be used to manage system inputs, such as touchscreen input, keypad input, and sensor input. IMS retrieves events from input device nodes and, through interaction with the WMS, distributes these events to the appropriate windows.

[0377] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0378] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0379] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can include one or more views. For example, a display interface including a text message notification icon can include a view for displaying text and a view for displaying images.

[0380] The Android runtime is responsible for converting source code into machine code. The Android runtime primarily employs ahead-of-time (AOT) compilation and just-in-time (JIT) compilation technologies.

[0381] The Android runtime also includes core libraries. These core libraries primarily provide the functionality of basic Java class libraries, such as libraries for basic data structures, mathematics, I / O, tools, databases, and networking. The core libraries provide APIs for users to develop applications.

[0382] A system library can include multiple functional modules. For example, a surface manager, a media library, and a media framework.

[0383] The Surface Manager manages the display subsystem and provides 2D and 3D layer blending for multiple applications. The Media Framework supports playback and recording of various common audio and video formats, as well as still image files. The Media Library supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0384] The Hardware Abstraction Layer (HAL) runs in user space, encapsulates kernel-level drivers, and provides calling interfaces to higher layers. The HAL includes at least a display module.

[0385] The kernel layer is the layer between hardware and software. The kernel layer includes at least the display driver.

[0386] The hardware layer includes at least a memory and a display screen. The memory is used to store... Figure 9The computer executable program code involved includes instructions. The display screen is used to display, for example... Figures 5 to 8 The interface in the middle.

[0387] Additionally, in embodiments of this application, the application layer of device 1 further includes a conferencing application. The application framework layer also includes a business module A, a DMSDP module A, and a connection module A. The hardware abstraction layer further includes a virtual driver module.

[0388] It should be noted that, in the embodiments of this application, device 2 may have the following features: Figure 11 The structural composition is shown. As one possible implementation, the device 2 can be a mobile phone or a tablet computer, etc. The structural composition can be referred to the foregoing description, and will not be repeated here.

[0389] Additionally, in device 2, the application framework layer also includes business module B, DMSDP module B, and connectivity module B. The hardware layer also includes camera A and camera B.

[0390] For example, in device 1, there is a Take the operating system as an example. Figure 12 A schematic diagram of the composition of another device 1 is shown.

[0391] like Figure 12 As shown, in device 1 Operating systems can be broadly categorized into kernel-mode and user-mode.

[0392] In this example, user mode corresponds to the application's runtime environment. In some implementations, code execution permissions in user mode are restricted to enhance system security. Furthermore, if the application performs actions such as direct access to physical memory, it needs to request access from components in kernel mode. The user module may include a conferencing application, business module A, DMSDP module A, and connection module A.

[0393] Kernel mode corresponds to the runtime environment of operating system-level code. Kernel modules include virtual driver modules.

[0394] It should be noted that the above Figure 11 and Figure 12 The electronic device components shown are merely examples and do not constitute a limitation on the electronic devices involved in the technical solutions provided in the embodiments of this application. The embodiments of this application do not limit the specific composition of the electronic devices.

[0395] The foregoing mainly describes the solutions provided by the embodiments of this application from the perspective of various functional modules. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0396] The integrated modules described above can be implemented in hardware or as software functional modules. It should be noted that the module division in this embodiment is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used.

[0397] For example, Figure 13 A schematic diagram of the composition of an electronic device 1300 is shown. (As shown...) Figure 13 As shown, the electronic device 1300 may include a processor 1301 and a memory 1302. The memory 1302 is used to store computer execution instructions. Exemplarily, in some embodiments, when the processor 1301 executes the instructions stored in the memory 1302, the electronic device 1300 may perform any of the methods shown in the above embodiments.

[0398] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0399] Figure 14 A schematic diagram of a chip system 1400 is shown. The chip system 1400 may include a processor 1401 and a communication interface 1402, used to support related devices in implementing the functions involved in the above embodiments. In one possible design, the chip system also includes a memory for storing necessary program instructions and data for the electronic device. This chip system may be composed of chips or may include chips and other discrete devices. It should be noted that in some implementations of this application, the communication interface 1402 may also be referred to as an interface circuit.

[0400] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0401] The functions, actions, operations, or steps in the above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented using software programs, they can be implemented, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or include one or more data storage devices such as servers and data centers that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs), etc.

[0402] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A communication connection management method, characterized by, The method is applied to a first device, and the device communicatively connected to the first device includes a second device; the second device is equipped with a first camera; the method includes: The first device receives a first operation, which is used to activate the first camera; In response to the first operation, the first device establishes a first session with the second device; the first session is used to transmit image information captured by the first camera; Before the first session is released, the first device establishes a second session with the second device; wherein the second session is established based on a first request sent by the first device to the second device, the first request carrying information of the second session; the first device receives a first response, the first response indicating that the second session was successfully established; Both the first session and the second session are carried in the first P2P connection, which is a P2P connection between the first device and the second device. The second session is used to keep the first P2P connection open.

2. The method of claim 1, wherein, The first request also carries information about the first session; the first response is also used to indicate that the first session was successfully established.

3. The method of claim 2, wherein, The first request is also used to instruct the establishment of the first P2P connection with the second device; the first response is also used to instruct that the first P2P connection was successfully established.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: When it is determined that the first P2P connection only carries the second session within the first duration, the second session is released.

5. The method of claim 4, wherein, Before releasing the second session, the method further includes: The first device sends a first renewal instruction; the first device receives and responds to the first renewal instruction, and maintains the second session; Send the first renewal instruction to the second device so that the second device continues the second session when it receives the first renewal instruction.

6. The method according to claim 5, characterized in that, The sending of the first lease renewal instruction includes: When it is determined that the first P2P connection carries a third session, the first renewal instruction is sent; the third session is different from the second session, and the third session includes the first session.

7. The method according to claim 4, characterized in that, The step of determining that the first P2P connection only carries the second session during the first duration includes: When the first P2P connection only carries the second session, a first timer is initiated; the duration of the first timer is the first duration. When the first timer expires, it is determined that the first P2P connection only carries the second session.

8. The method according to claim 5, characterized in that, The first device is configured with a second timer; the second timer is used to trigger the first device to release the second session when the timer expires. The second session that is maintained includes: Before the second timer expires, reset the second timer's duration.

9. The method according to claim 7 or 8, characterized in that, The release of the second session includes: The first device sends a first release instruction; Upon receiving and responding to the first release instruction, the second session is released.

10. The method according to claim 9, characterized in that, The first device is equipped with a display screen; the method further includes: After the first camera is activated, it receives first image information through the first session; the first image information is captured by the first camera. Upon receiving the first image information, a first interface is displayed; the first interface includes a first image; the first image corresponds to the first image information.

11. The method according to claim 10, characterized in that, The second device is equipped with a second camera; after displaying the first interface, the method includes: The first device receives a second operation, which is used to switch to using the second camera; In response to the second operation, the first device establishes a fourth session with the second device; the fourth session is used to transmit image information captured by the second camera, the fourth session is carried in the first P2P connection, and the fourth session is included in the third session.

12. The method according to claim 11, characterized in that, Before the first device establishes a fourth session with the second device, the method further includes: Turn off the first camera and release the first session.

13. The method according to claim 11 or 12, characterized in that, The establishment of a fourth session between the first device and the second device includes: The first device sends a second request to the second device, the second request carrying information about the fourth session; The first device receives a second response, which indicates that the fourth session was successfully established.

14. An electronic device, characterized in that, The electronic device includes one or more processors and one or more memories; the one or more memories are coupled to the one or more processors and store computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the method as described in any one of claims 1-13.

15. A chip system, characterized in that, The chip system includes a processor and a communication interface; the processor is used to call and run a computer program stored in the storage medium from the storage medium to perform the method as described in any one of claims 1-13.