Connection method and device of XR equipment and camera, equipment and storage medium

By pre-establishing a session pool and activating idle sessions using re-INVITE requests, the problem of high latency in XR device-camera connection was solved, achieving low-latency video streaming transmission and improving user experience and system response speed.

CN121908071APending Publication Date: 2026-04-21CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE COMM LTD RES INST
Filing Date
2026-01-09
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The connection between XR devices and cameras has a high latency, especially in weak network environments where the session failure rate is high, affecting user experience and real-time interaction.

Method used

By pre-establishing a session pool to store pre-connected sessions, when the server receives a video stream request from an XR device, it selects an idle session from the session pool, adjusts the media parameters, and directly activates the session to establish a connection. This avoids the complete handshake process in the traditional SIP protocol and uses a re-INVITE request to achieve a fast connection.

Benefits of technology

It reduces the connection latency between XR devices and cameras from the traditional 300-500ms to less than 50ms, improving system response speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908071A_ABST
    Figure CN121908071A_ABST
Patent Text Reader

Abstract

The invention relates to the field of communication, and provides a connection method and device of XR equipment and a camera, equipment and a storage medium. The method comprises the following steps: acquiring a video stream request sent by an augmented reality XR device; determining an idle target session in a preset session pool according to the video stream request; the session pool comprises at least one session and an initial media parameter of each session, and the session in the session pool is established after pre-connection between the camera and the server; adjusting an initial media parameter of the target session, and determining a target media parameter of the target session; the target media parameter is used for representing that the target session is activated; sending a target media parameter of the target session to the camera, and receiving a response message fed back by the camera; the response message is used for representing that connection is established between the XR equipment and the camera through the target session. According to the technical scheme provided by the invention, the delay of establishing the connection between the XR equipment and the camera can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device, and storage medium for connecting an XR device and a camera. Background Technology

[0002] XR (Extended Reality) devices are smart terminals that integrate Virtual Reality (VR), Augmented Reality (AR), and Mixed Reality (MR) technologies. Through a head-mounted display, sensors, and an interactive system, they merge digital content with the physical world to provide an immersive experience. Video or images of the physical world can be captured by a camera; once a connection is established between the XR device and the camera, the device can access the video or images of the physical world captured by the camera.

[0003] In related technologies, when an XR device needs to establish a connection with a camera, it typically first sends a user request to the server, and then the server forwards the user request to the camera and establishes a temporary session with the camera to perform a handshake connection, thereby realizing the connection between the XR device and the camera.

[0004] However, the above technologies suffer from high latency when establishing a connection between the XR device and the camera. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for connecting an XR device and a camera, in order to solve the technical problem of high latency when establishing a connection between an XR device and a camera.

[0006] In a first aspect, embodiments of this application provide a method for connecting an XR device and a camera, including: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0007] In one embodiment, the above method further includes: Receive session maintenance messages periodically sent by the camera; the session maintenance messages carry the identifier of the first session in the session pool that needs to be kept active; Update the target timestamp of the first session in the session pool based on the time the session maintenance message is received; the target timestamp is used to represent the time when the first session last updated its own target timestamp based on the time the session maintenance message was received. Determine whether to maintain the first session based on the target timestamp of the first session.

[0008] In one embodiment, determining whether to maintain the first session based on the target timestamp of the first session includes: Determine whether the first session has expired based on the target timestamp of the first session and the preset session expiration duration; If it is determined that the first session has not expired, then the first session is maintained; If it is determined that the first session has expired, then release the session resources corresponding to the first session.

[0009] In one embodiment, the above method further includes: Based on the first number of video stream requests sent by the XR device in the historical time period, determine the second number of video stream requests sent by the XR device in the future time period; If the second number is greater than the session number threshold, a new session is added to the session pool.

[0010] In one embodiment, the aforementioned session count threshold includes a third number corresponding to currently idle sessions in the session pool.

[0011] In one embodiment, adding a new session to the session pool as described above includes: Based on the second and third quantities, determine the fourth quantity corresponding to the new sessions; Add a fourth session to the session pool.

[0012] In one embodiment, the above method further includes: Receive a session initiation request sent by the camera; the session initiation request includes the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected. Based on the identifier of the pre-connected session and the initial media parameters of the pre-connected session in the session initiation request, session resources are allocated and a session channel is established, and a session pool is established through the pre-connected session.

[0013] Secondly, embodiments of this application provide a method for connecting an XR device and a camera, including: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0014] In one embodiment, the above method further includes: Generate an identifier for the session to be pre-connected, and construct a session initiation request based on the identifier and the initial media parameters of the pre-connected session. Send a session initiation request to the server; the session initiation request is used to instruct the server to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, and to establish a session pool through the pre-connected session.

[0015] Thirdly, embodiments of this application provide a connection device for an XR device and a camera, comprising: The video stream request acquisition module is used to acquire video stream requests sent by extended reality (XR) devices; The target session determination module is used to determine an idle target session in a preset session pool based on the video stream request. The session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected. The media parameter adjustment module is used to adjust the initial media parameters of the target session and determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The connection module is used to send the target media parameters of the target session to the camera and receive the response message from the camera; the response message is used to indicate that a connection has been established between the XR device and the camera through the target session.

[0016] Fourthly, embodiments of this application provide a connection device for an XR device and a camera, comprising: The media parameter receiving module is used to receive the target media parameters of the target session sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after identifying an idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. The response message feedback module is used to send response messages back to the server; the response messages indicate that a connection has been established between the XR device and the camera through the target session.

[0017] Fifthly, embodiments of this application provide a server, including a memory, a transceiver, and a processor; A memory for storing computer programs; a transceiver for sending and receiving data under the control of the processor; and a processor for reading the computer programs from the memory and performing the following operations: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0018] Sixthly, embodiments of this application provide a camera, including a memory, a transceiver, and a processor; A memory for storing computer programs; a transceiver for sending and receiving data under the control of the processor; and a processor for reading the computer programs from the memory and performing the following operations: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0019] In a seventh aspect, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the connection method between the XR device and the camera described in the first or second aspect.

[0020] Eighthly, embodiments of this application provide a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the connection method between the XR device and the camera described in the first or second aspect.

[0021] Ninthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the connection method between the XR device and the camera described in the first or second aspect.

[0022] The XR device and camera connection method, apparatus, device, and storage medium provided in this application embodiment obtain a video stream request sent by the XR device, determine an idle target session in a preset session pool according to the video stream request, adjust the initial media parameters of the target session to determine the target media parameters of the target session, send the target media parameters of the target session to the camera, and receive a response message from the camera. The response message is used to indicate that a connection has been established between the XR device and the camera through the target session. The session pool includes at least one session and its initial media parameters, and the sessions in the session pool are established after the camera and the server have pre-connected. The target media parameters are used to indicate that the target session has been activated. This method uses a pre-established session pool to store pre-connected sessions. When an XR device establishes a connection with a camera, it can select an idle pre-connected session from this pool to establish the connection between the XR device and the camera. This avoids the need for a complete INVITE handshake process (including INVITE→200 OK→ACK) every time an XR device requests a video stream, as required by the traditional SIP protocol. This reduces the session establishment latency from the traditional 300-500ms to less than 50ms, greatly reducing the connection establishment time between the XR device and the camera, and improving user experience and system response speed. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of the communication system architecture provided in an embodiment of this application; Figure 2 This is one of the flowcharts illustrating the connection method between an XR device and a camera provided in an embodiment of this application; Figure 3 This is a second schematic flowchart of the connection method between an XR device and a camera provided in the embodiments of this application; Figure 4 This is one of the structural schematic diagrams of the connection device between the XR device and the camera provided in the embodiments of this application; Figure 5 This is a second schematic diagram of the connection device between the XR device and the camera provided in the embodiments of this application; Figure 6 This is a schematic diagram of the server structure provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of the camera provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] Pre-session management refers to the process of identifying and processing user identity, intent, and context information through a series of preprocessing mechanisms before the user formally interacts with the system, in order to improve the efficiency and accuracy of subsequent interactions. It is commonly found in scenarios such as intelligent customer service, voice assistants, and online service platforms. Its core objective is to optimize user experience and reduce invalid interactions, typically involving the collaborative operation of functional modules such as user behavior analysis, intent recognition, session routing, and permission verification. Currently, in the field of pre-session management, most methods are implemented through session establishment based on the SIP (Session Initiation Protocol), transmission optimization techniques based on TC (Transmission Control Protocol) or UDP (User Datagram Protocol), session pre-connection and caching techniques, QoS (Quality of Service) based network status monitoring techniques, and AI-based intent recognition and route prediction techniques.

[0027] In related technologies, when an XR device needs to establish a connection with a camera, it typically first sends a user request to the server, which then forwards the request to the camera and establishes a temporary session to handshake and connect. However, this technology has the following problems: 1. High session establishment latency: Existing SIP cameras require a temporary session establishment upon user request (INVITE → 200 OK → ACK, where INVITE is the session initiation request and ACK is the acknowledgement character), with an average latency of 300-500ms, resulting in a poor user experience. 2. High session failure rate in weak network environments: Due to high network latency or packet loss, INVITE requests are prone to timeout (default T1 = 500ms), requiring multiple retransmissions, further affecting connection stability and real-time interaction.

[0028] Based on this, embodiments of this application provide a method, apparatus, device, and storage medium for connecting an XR device and a camera, aiming to optimize the real-time video stream connection efficiency between the XR device and the camera, reduce connection latency, and improve system response speed and resource utilization. Specifically, a signaling interaction mechanism can be built based on the SIP protocol, and efficient and stable video stream transmission can be achieved through key technical means such as pre-establishing an idle session pool, maintaining session activity, and dynamically adjusting the session pool capacity.

[0029] The XR device and camera connection method of this application embodiment can be applied to communication systems. See [link to relevant documentation]. Figure 1The diagram illustrates a communication system architecture. This system includes XR devices, a server, and cameras. Built on the SIP protocol, the systems work collaboratively through signaling interaction and media transmission to achieve efficient and stable video stream connections. The XR devices and cameras can communicate via the server, or after establishing a connection, the XR devices can communicate with the cameras via devices such as routers. The XR devices, such as XR glasses, can be extended reality terminals and are responsible for initiating video stream requests to the server. The server, based on the SIP protocol, acts as the signaling control center, responsible for session resource allocation, state management, and dynamic expansion decisions. The cameras can be high-performance terminals with computing capabilities, such as mobile phones, tablets, and laptops, primarily responsible for pre-connection establishment, session maintenance, and media stream transmission.

[0030] The following embodiments first illustrate the connection method between the XR device and the camera in this application from the server side.

[0031] Figure 2 This is one of the flowcharts illustrating the connection method between an XR device and a camera provided in an embodiment of this application. (Refer to...) Figure 2 The method may include the following steps: Step 202: Obtain the video stream request sent by the extended reality XR device.

[0032] In this step, when an XR device needs video streaming from a camera for extended reality services, it can send a video stream request to the server. This video stream request indicates that the XR device needs to acquire the video stream from the camera, and therefore needs to establish a connection with the camera first. The video stream request may include information such as the camera's ID (the identifier of the camera to which the XR device needs to establish a connection) and the desired video stream acquisition time range.

[0033] In addition, an XR device can also be referred to as a user terminal. When the XR device sends a video stream request to the server, the user can trigger the corresponding video stream request button or enter relevant video stream request information on the XR device, and then the XR device can construct a video stream request and send it to the server.

[0034] Step 204: Based on the video stream request, determine the idle target session in the preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected.

[0035] In this step, after receiving the video stream request from the XR device, the server can parse the video stream request to obtain the ID of the camera that the XR device needs to establish a connection with, and at the same time determine that the XR device needs to establish a connection with the camera.

[0036] Additionally, the server can pre-maintain a corresponding session pool for each camera. Taking the session pool corresponding to the cameras that the XR device needs to establish a connection with as an example, this session pool includes one or more sessions, as well as information such as the initial media parameters and session status of each session. All sessions in this session pool are established after the camera pre-connects with the server through a three-way handshake (INVITE→200 OK→ACK). When establishing each pre-connection session with the server, the camera can send the initial media parameters of each session to the server for storage. For each session in the session pool, its initial media parameters can be declared in the SDP (Session Description Protocol) field. Specifically, each session's SDP field can include initial media parameters, which may include a first initial media parameter and other initial media parameters. The first initial media parameter is used to characterize the session's video stream transmission and reception attributes, such as sending only video streams, sending and receiving video streams, etc. For example, the SDP field of a session may include the following: v=0; o=-1234567890 1234567890 IN IP4 192.168.1.100; s = Pre-connected Session; c=IN IP4 192.168.1.100; m=video 5000 RTP / AVP 96; a1 = sendonly; a2=rtpmap:96 H264 / 90000; Where a1 represents the first initial media parameter, and its value is sendonly, indicating that the session's sending and receiving attributes for the video stream are to send only the video stream. If the value is sendrecv, it indicates that the session's sending and receiving attributes for the video stream are to send and receive both the video stream and the video stream.

[0037] Other initial media parameters in the SDP field include media type (e.g., video), transport protocol (e.g., RTP / UDP), port number (e.g., 5000), and encoding format (e.g., H.264 or H.265). The initial media parameters in the SDP field for each session are configured by the camera according to the actual device capabilities and are sent to the server once during the pre-connection phase to avoid repeated negotiation during subsequent activation.

[0038] After one or more sessions are pre-established between the camera and the server, the server assigns a unique Session ID to each session in the session pool and records the session state in the session pool. The session pool is stored in a hash table structure, in key-value pairs, where the session state of each session includes the following state fields: is_active: Indicates whether the session is active, with values ​​including true (yes) or false (no); last_heartbeat_time: Represents the timestamp of the most recent OPTIONS heartbeat message in the session, and its value includes the specific timestamp; media_status: Indicates whether the media stream corresponding to the session is active (default is not active), and its value includes true (yes) or false (no); timestamp: Represents the session creation time, and its value includes the specific time.

[0039] The session state information of these sessions can be used by the server to select idle sessions, detect timeouts, and release resources in subsequent operations.

[0040] After the server determines that the XR device needs to establish a connection with the camera, it can select an idle session from the session pool corresponding to the camera based on the session status of each session. For example, it can select an active session from the session pool whose media stream is not active (is_active = true and media_status = false) as the idle session. If multiple idle sessions are selected, any one can be chosen as the target idle session, or a target idle session can be selected based on a comprehensive filter of other session status information for each idle session.

[0041] Step 206: Adjust the initial media parameters of the target session to determine the target media parameters of the target session; the target media parameters are used to indicate that the target session has been activated.

[0042] In this step, after the server selects an idle target session from the session pool, it can obtain the SDP field corresponding to that target session from the session pool. Then, it modifies the SDP field of the target session, specifically by modifying the initial media parameters in the SDP to obtain the target media parameters. For example, it can change the send / receive attribute of the first initial media parameter from "send only video stream" to "send and receive video streams" to obtain the first target media parameter corresponding to the first initial media parameter, i.e., changing a=sendonly to a=sendrecv. Of course, other initial media parameters can also be modified to finally obtain the target media parameters of the target session.

[0043] Understandably, the server modifies the initial media parameters of the target session to the target media parameters. The core purpose of this is to activate the target session, which facilitates the rapid establishment of a connection between the XR device and the camera. In other words, the target media parameters here can indicate that the target session has been activated.

[0044] Step 208: Send the target media parameters of the target session to the camera and receive the response message from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0045] For the camera, its core components include: a SIP client module, responsible for initiating signaling messages such as session initiation requests, session maintenance messages, and re-initiation requests, and interacting with the server; a media transmission module, which transmits video streams via the RTP protocol after the session is activated, supports H.264 / H.265 encoding formats, and uses UDP transmission to ensure low latency; and a session management module, responsible for maintaining the activity of sessions in the session pool, recording the established Session IDs and their status, and periodically sending session maintenance messages to maintain session activity.

[0046] In this step, after obtaining the target media parameters of the target session, the server can generate a re-INVITE request (re-initiate session request) based on these parameters and send it to the camera. Upon receiving the re-INVITE request from the server, the camera recognizes that the target session has been activated and directly allocates a pre-connected target session to establish a connection between the server and the camera, skipping the handshake process of the INVITE request. At this point, the camera can immediately return a 200 OK response to the server and establish a connection with the XR device through the target session, then begin transmitting a video stream (e.g., an RTP video stream) to the XR device. After receiving the video stream from the camera, the XR device can render it onto the display interface, completing real-time playback of the video stream.

[0047] Throughout the entire process of establishing a connection between the camera and the XR device and transmitting the video stream, the transmission latency of the video stream is less than 50ms, which meets the real-time requirements and enables the purpose of quickly establishing a connection with the XR device and quickly transmitting the video stream to the XR device.

[0048] As described above, when a user / XR device requests a video stream, the server selects an idle session from a session pool containing multiple pre-connected sessions and quickly activates the media stream using the re-INVITE command. Without needing to renegotiate parameters, the camera immediately responds and begins transmitting the RTP stream, achieving a low latency response of less than 50ms. This improves the efficiency of real-time video stream connection between the XR device and the camera, reduces connection latency, enhances system response speed and resource utilization, and effectively improves the quality of service between the XR device and the camera. It is suitable for augmented reality and virtual reality applications with high real-time requirements.

[0049] In this embodiment, by acquiring the video stream request sent by the XR device, an idle target session is determined from a preset session pool based on the video stream request. The initial media parameters of the target session are adjusted to determine the target media parameters of the target session. The target media parameters of the target session are sent to the camera, and a response message is received from the camera. The response message indicates that a connection has been established between the XR device and the camera through the target session. The session pool includes at least one session and its initial media parameters. The sessions in the session pool are established after a pre-connection between the camera and the server. The target media parameters indicate that the target session has been activated. In this method, a pre-established session pool is used to store pre-connected sessions. When the XR device and the camera establish a connection, an idle session that has completed the pre-connection can be selected from the session pool to establish a connection between the XR device and the camera. This avoids the need for a complete INVITE handshake process (including INVITE → 200 OK → ACK) every time the XR device requests a video stream, as required by the traditional SIP protocol. This reduces the session establishment latency from the traditional 300-500ms to less than 50ms, greatly reducing the latency of establishing a connection between the XR device and the camera, improving user experience and system response speed.

[0050] The above embodiments mentioned the server settings including a session pool for pre-connected sessions. The following embodiments will describe the specific process of setting up the session pool on the server.

[0051] In one embodiment, the above method further includes: Receive a session initiation request sent by the camera; the session initiation request includes the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected. Based on the identifier of the pre-connected session and the initial media parameters of the pre-connected session in the session initiation request, session resources are allocated and a session channel is established, and a session pool is established through the pre-connected session.

[0052] After startup, the camera generates N random session IDs (identifiers for the sessions to be pre-connected) and constructs N session initiation requests using these N random session IDs. Then, it actively sends these N session initiation requests to the server. These session initiation requests can be denoted as INVITE requests. Here, N can be 1 or a value greater than 1. Optionally, this embodiment mainly uses the example of the camera sending multiple session initiation requests to the server in batches, that is, N here is a value greater than 1. The specific value can be determined according to the number of pre-connected sessions supported by the camera in actual situations, such as 3~5, 10, etc., to adapt to the needs of different application scenarios.

[0053] Meanwhile, after the camera generates each session identifier, it indicates that the camera needs to establish a corresponding pre-connection session. At this time, the camera can also set the media parameters of the pre-connection session, which are recorded as initial media parameters (e.g., a=sendonly, indicating that the session is only used for video stream transmission). The initial media parameters of each pre-connection session are encapsulated in the SDP field / SDP description information of the session initiation request. In this way, each session initiation request sent by the camera to the server can include the identifier of the pre-connection session to be established and the initial media parameters.

[0054] The server, acting as the signaling control center, is responsible for session resource allocation, state management, and dynamic expansion decisions. This includes a session manager. Upon receiving multiple session initiation requests from the camera, the session manager parses each request to obtain the identifier of the pre-connected session carried within. It then assigns the session ID and corresponding initial media parameters to the pre-connected session in the request, allocating session resources and returning a 200 OK response to the camera, as well as receiving an ACK response from the camera, completing the three-way handshake connection and establishing the pre-connection. At this point, the session channel is established, but the media stream is not yet activated, preparing for a rapid response to user / XR device requests. The sessions with assigned session IDs and their initial media parameters can then be stored in a session pool, forming a pre-defined session pool. The sessions in this pool represent the established session channels between the server and the camera.

[0055] In this embodiment, the server can receive a session initiation request sent by the camera, which includes a session identifier and initial media parameters, and allocate session resources and establish a session channel accordingly, thereby establishing a session pool. This allows multiple pre-connection sessions to be established before the XR device connects to the camera, which facilitates the subsequent rapid establishment of a connection with the XR device and quick response to the user / XR device's video stream requests.

[0056] The above embodiments mention that multiple pre-connection sessions can be established between the camera and the server. However, these sessions may be released due to timeout. To solve this problem, this application proposes a technical solution to maintain the activity of pre-connection sessions. The following embodiments will illustrate this.

[0057] In one embodiment, the above method further includes: Receive session maintenance messages periodically sent by the camera; the session maintenance messages carry the identifier of the first session in the session pool that needs to be kept active; Update the target timestamp of the first session in the session pool based on the time the session maintenance message is received; the target timestamp is used to represent the time when the first session last updated its own target timestamp based on the time the session maintenance message was received. Determine whether to maintain the first session based on the target timestamp of the first session.

[0058] After establishing multiple pre-connection sessions with the server, the camera can periodically send session maintenance messages, denoted as OPTIONS heartbeat messages, to the server to maintain the activity of the pre-connection sessions. The periodic sending of these session maintenance messages can be timed using a timer, with the timer period set according to the available time, such as 30 seconds or 60 seconds.

[0059] Each time the camera sends a session maintenance message, it can carry the identifier of the first active session in the session pool that needs to be maintained. The first session here can be all or part of the sessions in the session pool where the camera has established a pre-connection with the server, which can be set according to the actual situation.

[0060] When the server receives a session maintenance message from the camera, it can obtain the reception time of the message. This reception time can be represented as the timestamp of the last / most recent reception of a session maintenance message / OPTIONS heartbeat message for the first session in the session maintenance message. The server can find the first session in the session pool based on the identifier of the first session carried in the session maintenance message, and update the last_heartbeat_time field of the first session in the session pool with the reception time. In other words, the reception time is used as the target timestamp of the most recent reception of an OPTIONS heartbeat message for the first session.

[0061] Additionally, the server can include a heartbeat detection module to periodically check whether each session in the session pool has timed out. Specifically, the server can periodically check whether each session (including the first session) has timed out by comparing the target timestamp (i.e., last_heartbeat_time) with the current time. Taking the first session as an example, if the last_heartbeat_time of the first session does not exceed the current time, it is determined that the first session has not timed out / expired and can continue to be maintained; otherwise, it indicates that the first session has timed out / expired, and the first session is released.

[0062] Optionally, determining whether to maintain the first session based on the target timestamp of the first session includes: Determine whether the first session has expired based on the target timestamp of the first session and the preset session expiration duration; If it is determined that the first session has not expired, then the first session is maintained; If it is determined that the first session has expired, then release the session resources corresponding to the first session.

[0063] Specifically, taking the first session in the session pool as an example, the server can periodically check whether the sum of the target timestamp (i.e., last_heartbeat_time) and the preset session expiration duration (denoted as the Session-Expires header field) of the first session in the session pool is greater than the current time. If the sum of last_heartbeat_time + Session-Expires for a certain first session is greater than the current time, it means that the first session has not timed out / expired and can continue to be maintained; otherwise, it means that the first session has timed out / expired and the session resources of the first session can be released. The session expiration duration can be set according to the actual situation, that is, the server can support different Session-Expires header field values, such as 1800 seconds, 3600 seconds, 7200 seconds, etc., to balance resource utilization and session lifespan.

[0064] In this embodiment, the server updates the target timestamp of the corresponding session in the session pool through maintenance messages periodically sent by the camera, and determines whether to maintain the session based on the target timestamp of the session in the session pool. This enables precise maintenance of session activity and prevents sessions from being released due to timeout. Furthermore, by comprehensively determining whether a session has expired based on the session's target timestamp and the session's expiration duration, and maintaining the session while it is still active, session activity can be maintained within a certain timeframe, avoiding frequent release of session resources. Conversely, releasing session resources after expiration avoids wasting session resources.

[0065] The above embodiments illustrate that a session pool including multiple pre-connected sessions can be established to quickly respond to video stream requests from XR devices. In actual communication, high-load scenarios may occur. To adapt to high-load scenarios, this application proposes that the pre-connected sessions in the session pool can be dynamically expanded. The following embodiments illustrate this process.

[0066] In one embodiment, the above method further includes: Based on the first number of video stream requests sent by the XR device in the historical time period, determine the second number of video stream requests sent by the XR device in the future time period; If the second number is greater than the session number threshold, a new session is added to the session pool.

[0067] To achieve dynamic scaling of the session pool, the server needs to collect and analyze historical traffic data in real time to implement the dynamic scaling algorithm. The traffic data includes the following metrics: request_rate(t): The number of video stream requests received within time t; session_usage(t): The number of sessions used within time t; idle_session_count(t): The number of idle sessions within time t; avg_request_interval(t): Average video stream request interval.

[0068] This data is collected via scheduled tasks and stored in the server's local database or memory cache for use by dynamically scaling algorithms.

[0069] Specifically, the server may also include a dynamic scaling controller. This controller can count the number of video stream requests sent by XR devices to the server within a past / historical period (e.g., M minutes), i.e., request_rate(t), denoted as the first quantity. Then, it calculates the average request rate avg_request_rate based on this first quantity, for example, avg_request_rate = request_rate(t) / M. This average request rate can then be directly used as the second quantity of video stream requests sent by XR devices to the server in the future period. Alternatively, the server can use linear prediction algorithms, exponential smoothing algorithms, or neural network models to predict the video stream request trend in the future period based on the first quantity and the average request rate, thereby obtaining the second quantity of video stream requests sent by XR devices to the server in the future period and improving prediction accuracy.

[0070] The server can then compare this second quantity with the session quantity threshold. If the second quantity is greater than the session quantity threshold, it indicates that XR devices may send a large number of video stream requests in the future, and the system may be under high load. In this case, expansion is triggered, and the server can add pre-connected sessions to the session pool to ensure that it can still respond quickly to XR devices' video stream requests under high load. If the second quantity is not greater than the session quantity threshold, expansion is not triggered.

[0071] Optionally, the aforementioned session count threshold includes a third number corresponding to the currently idle sessions in the session pool, denoted as `idle_session_count`. Taking the average request rate `avg_request_rate` as the second number as an example, the comparison process can be expressed as follows: if `avg_request_rate` > `idle_session_count`, then expansion is triggered, and the server adds pre-connected sessions to the session pool. For example, assuming the average request rate over the past 10 minutes is 2 times per minute, and the current number of idle sessions is 3, then it is predicted that there may be 2 requests in the next minute. Since the current number of idle sessions is greater than the predicted request volume, the system does not trigger expansion. If the predicted request volume exceeds the number of idle sessions, pre-connected sessions are automatically added to ensure the stability and scalability of the system under high load scenarios.

[0072] Optionally, adding a new session to the session pool as described above includes: Based on the second and third quantities, determine the fourth quantity corresponding to the new sessions; Add a fourth session to the session pool.

[0073] In this process, after obtaining the second number of video stream requests sent by XR devices to the server in the future time period and the third number of currently idle sessions in the session pool, the server can directly subtract these two data points and use the difference as the fourth number K corresponding to the new session; or, taking the second number as the average request rate avg_request_rate mentioned above as an example, the server can first calculate the difference between the second number and half of the third number, or calculate half of the difference between the second number and the third number, and then compare the difference or half of the difference with 1, taking the maximum value as the fourth number K corresponding to the new session. The process of comparing the difference with 1 can be expressed as: K = max(1, avg_request_rate - idle_session_count / 2).

[0074] After the server determines the fourth number of sessions that need to be added to the session pool, it can send a request to the camera to generate the fourth number of random session identifiers and establish the fourth number of pre-connected sessions with the server. After the pre-connected sessions are established, the server can add these pre-connected sessions to the session pool and update the session status of each session in the session pool as well as the third number of currently idle sessions in the session pool.

[0075] In this embodiment, the server predicts the number of video stream requests in future time periods by statistically analyzing the number of video stream requests from XR devices in historical time periods. When the number of video stream requests in future time periods exceeds a session count threshold, the server adaptively adds sessions to the session pool. This ensures rapid connection between XR devices and cameras even under high load, enabling quick response to video stream requests from XR devices and guaranteeing system stability and scalability under high load conditions. Furthermore, the session count threshold includes the number of currently idle sessions in the session pool. This allows for determining whether to dynamically expand the session pool based on the actual number of idle sessions, improving the accuracy of dynamic expansion. Moreover, when dynamically expanding the session pool, the number of new sessions can be determined based on the predicted number of video stream requests from XR devices in future time periods and the number of currently idle sessions in the session pool, thus achieving precise dynamic expansion.

[0076] The above embodiments illustrate the connection method between the XR device and the camera on the server side. The following embodiments illustrate the connection method between the XR device and the camera in this application from the camera side.

[0077] Figure 3 This is the second flowchart illustrating the connection method between an XR device and a camera provided in an embodiment of this application. (Refer to...) Figure 3 The method may include the following steps: Step 302: Receive the target media parameters of the target session sent by the server; the target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected.

[0078] After the camera is activated, it can establish multiple pre-connected sessions with the server. Optionally, the process of establishing multiple pre-connected sessions may include: generating an identifier for the desired pre-connected session, and constructing a session initiation request (i.e., an INVITE request) based on the identifier and initial media parameters of the desired pre-connected session; then sending the session initiation request to the server; the session initiation request instructs the server to allocate session resources and establish a session channel based on the identifier and initial media parameters of the desired pre-connected session in the session initiation request, and to establish a session pool through the pre-connected sessions.

[0079] For details on the process by which the camera establishes multiple pre-connected sessions with the server based on the generated session identifier to form a session pool, please refer to the explanation of the server-side embodiment above, which will not be repeated here.

[0080] After the server establishes the session pool, it can receive video stream requests from XR devices, select an idle target session from the session pool based on the video stream request, modify the initial media parameters of the target session to the target media parameters, and send the target media parameters of the target session to the camera via a re-INVITE request to activate the media stream.

[0081] Step 304: Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0082] After receiving the target media parameters for the target session from the server, the camera can send a 200 OK response message to the server, indicating that a connection has been established between it and the XR device through the target session, and it has begun transmitting an RTP video stream to the XR device. The video stream transmission latency is less than 50ms, meeting the real-time requirements for video stream transmission.

[0083] In this embodiment, the camera receives the target media parameters after the server adjusts the initial media parameters of the target session, establishes a connection with the XR device based on the target media parameters, and sends a response message back to the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining an idle target session in a preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server make a pre-connection. This method uses a pre-established session pool to store pre-connected sessions. When an XR device establishes a connection with a camera, it can select an idle pre-connected session from this pool to establish the connection between the XR device and the camera. This avoids the need for a complete INVITE handshake process (including INVITE→200 OK→ACK) every time an XR device requests a video stream, as required by the traditional SIP protocol. This reduces the session establishment latency from the traditional 300-500ms to less than 50ms, greatly reducing the connection establishment time between the XR device and the camera, and improving user experience and system response speed.

[0084] In summary, the embodiments of this application have the following technical effects: 1. Significantly reduce session establishment latency: By pre-establishing an idle session pool, the complete INVITE handshake process (including INVITE→200 OK→ACK) required for each user request in the traditional SIP protocol can be avoided, thereby reducing the session establishment latency from the traditional 300-500ms to less than 50ms, greatly improving user experience and system response speed.

[0085] 2. Improve connection stability in weak network environments: In weak network environments, traditional SIP protocols are prone to INVITE timeouts and require multiple retransmissions due to high latency or packet loss. This application maintains session activity through a pre-connection mechanism and periodically sending OPTIONS messages, which can effectively avoid the problem of sessions being released due to timeouts, thereby reducing session failure rate and improving connection reliability.

[0086] 3. Dynamically adjust session pool capacity to optimize resource utilization: Based on historical traffic data and linear prediction algorithms, the system can adjust the session pool capacity in real time and automatically add pre-connections in high-load scenarios to ensure that the system can maintain efficient and stable video streaming capabilities under different business needs, avoiding resource waste or insufficiency.

[0087] 4. Enhance system scalability and adaptability: Through pre-connection mechanisms and dynamic expansion strategies, the system can flexibly cope with sudden high traffic demands, making it suitable for application scenarios such as augmented reality (AR) and virtual reality (VR) with high real-time requirements, and has good scalability and adaptability.

[0088] 5. Reduce redundant negotiation and resource overhead: During the pre-connection phase, the camera declares media parameters once by sending INVITE requests in batches (e.g., a=sendonly), avoiding the overhead of renegotiation of parameters during subsequent activation, reducing the number of signaling interactions and resource consumption, and improving overall efficiency.

[0089] 6. Supports low-latency media streaming: When a user requests a video stream, the server quickly activates the media stream via the re-INVITE command without needing to renegotiate parameters. The camera immediately responds and begins transmitting the RTP stream, achieving a low-latency response of less than 50ms, meeting the needs of XR devices and camera connection scenarios with high real-time requirements.

[0090] The following describes the connection device between the XR device and the camera provided in the embodiments of this application. The connection device between the XR device and the camera described below can be referred to in correspondence with the connection method between the XR device and the camera described above.

[0091] Figure 4 This is one of the structural schematic diagrams of the connection device between the XR device and the camera provided in the embodiments of this application. See also... Figure 4 As shown, the device may include: The video stream request acquisition module 410 is used to acquire video stream requests sent by the extended reality XR device. The target session determination module 420 is used to determine an idle target session in a preset session pool based on the video stream request; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The media parameter adjustment module 430 is used to adjust the initial media parameters of the target session and determine the target media parameters of the target session; the target media parameters are used to indicate that the target session has been activated. The connection module 440 is used to send the target media parameters of the target session to the camera and receive the response message from the camera; the response message is used to indicate that a connection has been established between the XR device and the camera through the target session.

[0092] In one embodiment, the above-mentioned apparatus further includes: The heartbeat detection module is used to receive session maintenance messages periodically sent by the camera; the session maintenance message carries the identifier of the first session in the session pool that needs to be maintained; the target timestamp of the first session in the session pool is updated according to the reception time of the session maintenance message; the target timestamp is used to characterize the time when the first session last updated its own target timestamp through the reception time of the session maintenance message; and the first session is determined whether to maintain the first session according to the target timestamp of the first session.

[0093] Optionally, the aforementioned heartbeat detection module is specifically used to determine whether the first session has expired based on the target timestamp of the first session and the preset session expiration duration; if it is determined that the first session has not expired, the first session is maintained; if it is determined that the first session has expired, the session resources corresponding to the first session are released.

[0094] In one embodiment, the above-mentioned apparatus further includes: The dynamic expansion control module is used to determine the second number of video stream requests that XR devices will send in future periods based on the first number of video stream requests sent by XR devices in historical periods; if the second number is greater than the session number threshold, a new session is added to the session pool.

[0095] Optionally, the above-mentioned session number threshold includes a third number corresponding to the currently idle sessions in the session pool.

[0096] Optionally, the aforementioned dynamic expansion control module is specifically used to determine the fourth number corresponding to the newly added sessions based on the second and third numbers; and to add the fourth number of sessions to the session pool.

[0097] In one embodiment, the above-mentioned apparatus further includes: The session initiation request receiving module is used to receive a session initiation request sent by the camera; the session initiation request includes the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected. The pre-connection establishment module is used to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, as well as to establish a session pool through the pre-connected session.

[0098] Figure 5 This is the second structural schematic diagram of the connection device between the XR device and the camera provided in the embodiments of this application. See also... Figure 5 As shown, the device may include: The media parameter receiving module 510 is used to receive the target media parameters of the target session sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. The response message feedback module 520 is used to send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0099] In one embodiment, the above-mentioned apparatus further includes: The session initiation request building module is used to generate the identifier of the session to be pre-connected and to build the session initiation request based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected. The session request initiation module is used to send a session initiation request to the server. The session initiation request is used to instruct the server to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, as well as to establish a session pool through the pre-connected session.

[0100] The terminal involved in the embodiments of this application may be a device that provides voice and / or data connectivity to a user, a handheld device with wireless connectivity, or other processing devices connected to a wireless modem. The name of the terminal device may differ in different systems; for example, in a 5G system, the terminal device may be called a User Equipment (UE).

[0101] The server involved in this application embodiment can be a base station, which may include multiple cells providing services to terminals. Depending on the specific application, a base station may also be called an access point, or a device in an access network that communicates with wireless terminal devices through one or more sectors on the air interface, or other names.

[0102] Figure 6 This is a schematic diagram of the server structure according to an embodiment of this application, with reference to... Figure 6 This application embodiment also provides a server, which may include: a memory 610, a transceiver 620, and a processor 630; The memory 610 is used to store computer programs; the transceiver 620 is used to send and receive data under the control of the processor 630; the processor 630 is used to read the computer program in the memory 610 and perform the following operations: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0103] Among them, Figure 6 In this context, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 630) and memory (memory 610). The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface. Transceiver 620 may be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. Processor 630 is responsible for managing the bus architecture and general processing, and memory 610 may store data used by processor 630 during operation.

[0104] Optionally, the processor 630 is also used to perform the following operations: Receive session maintenance messages periodically sent by the camera; the session maintenance messages carry the identifier of the first session in the session pool that needs to be maintained; update the target timestamp of the first session in the session pool according to the reception time of the session maintenance messages; the target timestamp is used to characterize the time when the first session last updated its own target timestamp through the reception time of the session maintenance messages; determine whether to maintain the first session according to the target timestamp of the first session.

[0105] Optionally, the processor 630 is also used to perform the following operations: Based on the target timestamp of the first session and the preset session expiration duration, determine whether the first session has expired; if it is determined that the first session has not expired, then maintain the first session; if it is determined that the first session has expired, then release the session resources corresponding to the first session.

[0106] Optionally, the processor 630 is also used to perform the following operations: Based on the first number of video stream requests sent by XR devices in the historical time period, determine the second number of video stream requests sent by XR devices in the future time period; if the second number is greater than the session number threshold, add a new session in the session pool.

[0107] Optionally, the above-mentioned session number threshold includes a third number corresponding to the currently idle sessions in the session pool.

[0108] Optionally, the processor 630 is also used to perform the following operations: Based on the second and third quantities, determine the fourth quantity corresponding to the new sessions; add the fourth quantity of sessions to the session pool.

[0109] Optionally, the processor 630 is also used to perform the following operations: Receive a session initiation request sent by the camera; the session initiation request includes the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected; allocate session resources and establish a session channel according to the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, and establish a session pool through the pre-connected session.

[0110] Figure 7 This is a schematic diagram of the camera structure according to an embodiment of this application, with reference to... Figure 7 This application embodiment also provides a camera, which may include: a memory 710, a transceiver 720, and a processor 730; The memory 710 is used to store computer programs; the transceiver 720 is used to send and receive data under the control of the processor 730; the processor 730 is used to read the computer program in the memory 710 and perform the following operations: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0111] Among them, Figure 7In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, such as one or more processors represented by processor 730 and memory represented by memory 710. The bus architecture can also link together various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 720 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, the user interface 740 can also be an interface capable of connecting external or internal devices as needed.

[0112] The processor 730 is responsible for managing the bus architecture and general processing, while the memory 710 can store the data used by the processor 730 during operation.

[0113] The processor 730 executes any of the methods described in the embodiments of this application according to the obtained executable instructions by calling a computer program stored in the memory 710. The processor and the memory may also be physically separated.

[0114] Optionally, the processor 730 is also used to perform the following operations: Generate an identifier for the session to be pre-connected, and construct a session initiation request based on the identifier and the initial media parameters of the pre-connected session. A session initiation request is sent to the server. This request instructs the server to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the pre-connected session, as well as to establish a session pool through the pre-connected session. An identifier for the pre-connected session is generated, and a session initiation request is constructed based on the identifier and the initial media parameters of the pre-connected session. Send a session initiation request to the server; the session initiation request is used to instruct the server to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, and to establish a session pool through the pre-connected session.

[0115] It should be noted that the camera and server provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0116] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call a computer program in the memory 830 to execute steps of the connection method between the XR device and the camera, such as including: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0117] Or include: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0118] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0119] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the XR device and camera connection method provided in the above embodiments, such as including: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0120] Or include: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0121] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing a processor to perform the steps of the methods provided in the above embodiments, such as including: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined from a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; the aforementioned target media parameters are used to indicate that the target session has been activated. The target media parameters of the target session are sent to the camera, and a response message is received from the camera; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0122] Or include: The target media parameters of the target session are sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after determining the idle target session in the preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after the camera and the server are pre-connected. Send a response message to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

[0123] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).

[0124] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for connecting an XR device to a camera, characterized in that, include: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined in a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after a pre-connection between the camera and the server; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; The target media parameters are used to indicate that the target session has been activated; Send the target media parameters of the target session to the camera and receive the response message from the camera; The response message indicates that a connection has been established between the XR device and the camera through the target session.

2. The method for connecting an XR device and a camera according to claim 1, characterized in that, The method further includes: Receives session maintenance messages periodically sent by the camera; the session maintenance message carries an identifier of the first session in the session pool that needs to be kept active; The target timestamp of the first session in the session pool is updated according to the reception time of the session maintenance message; the target timestamp is used to characterize the time when the first session last updated its own target timestamp based on the reception time of the session maintenance message. Based on the target timestamp of the first session, determine whether to maintain the first session.

3. The method for connecting an XR device and a camera according to claim 2, characterized in that, The step of determining whether to maintain the first session based on the target timestamp of the first session includes: Based on the target timestamp of the first session and the preset session expiration duration, determine whether the first session has expired; If it is determined that the first session has not expired, then the first session is maintained; If it is determined that the first session has expired, then the session resources corresponding to the first session are released.

4. The method for connecting an XR device and a camera according to any one of claims 1 to 3, characterized in that, The method further includes: Based on the first number of video stream requests sent by the XR device during the historical period, determine the second number of video stream requests sent by the XR device in the future period; If the second quantity is greater than the session quantity threshold, then a new session is added to the session pool.

5. The method for connecting an XR device and a camera according to claim 4, characterized in that, The session count threshold includes a third number corresponding to the currently idle sessions in the session pool.

6. The method for connecting an XR device and a camera according to claim 5, characterized in that, Adding a new session to the session pool includes: Based on the second quantity and the third quantity, determine the fourth quantity corresponding to the new session; The fourth number of sessions are added to the session pool.

7. The method for connecting an XR device and a camera according to any one of claims 1 to 3, characterized in that, The method further includes: Receive a session initiation request sent by the camera; the session initiation request includes an identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected. Based on the identifier of the pre-connected session to be established in the session initiation request and the initial media parameters of the pre-connected session, session resources are allocated and a session channel is established, and the session pool is established through the pre-connected session.

8. A method for connecting an XR device to a camera, characterized in that, include: Receive the target media parameters of the target session sent by the server; The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after identifying an idle target session in a preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected. A response message is sent back to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

9. The method for connecting an XR device and a camera according to claim 8, characterized in that, The method further includes: Generate an identifier for the session to be pre-connected, and construct a session initiation request based on the identifier of the pre-connected session and the initial media parameters of the pre-connected session. Send a session initiation request to the server; the session initiation request is used to instruct the server to allocate session resources and establish a session channel based on the identifier of the session to be pre-connected and the initial media parameters of the session to be pre-connected in the session initiation request, and to establish the session pool through the pre-connected session.

10. A connection device for an XR device and a camera, characterized in that, include: The video stream request acquisition module is used to acquire video stream requests sent by extended reality (XR) devices; The target session determination module is used to determine an idle target session in a preset session pool based on the video stream request; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected; The media parameter adjustment module is used to adjust the initial media parameters of the target session and determine the target media parameters of the target session. The target media parameters are used to indicate that the target session has been activated; The connection module is used to send the target media parameters of the target session to the camera and receive the response message from the camera. The response message indicates that a connection has been established between the XR device and the camera through the target session.

11. A connection device for an XR device and a camera, characterized in that, include: The media parameter receiving module is used to receive the target media parameters of the target session sent by the server. The target media parameters are determined by the server based on the video stream request sent by the extended reality XR device, after identifying an idle target session in a preset session pool and adjusting the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after the camera and the server are pre-connected. The response message feedback module is used to send a response message to the server; the response message is used to indicate that a connection has been established between the XR device and the camera through the target session.

12. A server, characterized in that, Includes memory, transceiver, and processor; A memory for storing computer programs; a transceiver for sending and receiving data under the control of the processor; and a processor for reading the computer programs from the memory and performing the following operations: Get the video stream request sent by the extended reality XR device; Based on the video stream request, an idle target session is determined in a preset session pool; the session pool includes at least one session and the initial media parameters of each session, and the sessions in the session pool are established after a pre-connection between the camera and the server; The initial media parameters of the target session are adjusted to determine the target media parameters of the target session; The target media parameters are used to indicate that the target session has been activated; Send the target media parameters of the target session to the camera and receive the response message from the camera; The response message indicates that a connection has been established between the XR device and the camera through the target session.

13. A camera, characterized in that, Includes memory, transceiver, and processor; Memory, used to store computer programs; Transceiver, used to send and receive data under the control of the processor; Processor, configured to read the computer program in the memory and perform the following operations: The server receives target media parameters for a target session. These target media parameters are determined by the server based on a video stream request sent by an extended reality XR device. The server identifies an idle target session in a preset session pool and adjusts the initial media parameters of the target session. The target media parameters are used to indicate that the target session has been activated. The session pool includes at least one session and the initial media parameters of each session. The sessions in the session pool are established after a pre-connection between the camera and the server. A response message is sent back to the server; the response message indicates that a connection has been established between the XR device and the camera through the target session.

14. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the XR device and camera connection method according to any one of claims 1 to 7, or the steps of the XR device and camera connection method according to any one of claims 8 to 9.

15. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the XR device and camera connection method as described in any one of claims 1 to 7, or the steps of the XR device and camera connection method as described in any one of claims 8 to 9.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the XR device and camera connection method according to any one of claims 1 to 7, or the steps of the XR device and camera connection method according to any one of claims 8 to 9.