A device and method for establishing a connection for screen projection
By acquiring and processing preset screen projection modes on the receiving terminal, determining the service channel and group owner, the problem of unfriendly connection mode in multiple screen projection scenarios is solved, and a stable multi-screen projection connection is achieved.
Patent Information
- Application Number
- CN202111629594.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-12-28
AI Technical Summary
The existing screen projection method cannot provide a friendly connection mode in multiple screen projection scenarios, resulting in users being unable to successfully establish a connection when they expect multiple screen projection.
An apparatus and method are provided for responding to a connection request of a sending terminal on a receiving terminal, obtaining a preset single-channel or multi-channel mode, determining a group owner of a traffic channel and a connection, and establishing a connection based on this information.
In the screen projection scenario, different number of screen projection operations provide corresponding ways to determine the service channel and connected group owners, solve the problem of establishing the connection stage, and support subsequent screen projection operations.
Smart Images

Figure CN114339385B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multi-channel screen projection. Specifically, the present application relates to a device, method, electronic device and computer-readable storage medium for establishing a connection for screen projection. Background Art
[0002] Currently, there are many screen projection solutions on the market, and the screen projection solution based on the Miracast protocol is widely used because it does not rely on wireless routers, does not require users to install additional apps, and can connect to multiple terminal devices at the same time. Among them, the end that projects the video is called the sending terminal, and the end that receives and plays the video is called the receiving terminal.
[0003] However, the current situation is that the types of network cards held by the sending terminals are not uniform, which may easily lead to the inability to realize screen projection in some situations, or in other words, the existing screen projection method does not manage the screen projection terminal. For example, after establishing a connection through the 5G frequency band channel, the network card of the terminal that needs to project the screen later needs to support the 5G frequency band to successfully establish a connection. If the user expects a single-channel screen projection, this method barely meets the requirements. If the user expects multi-channel screen projection, this method is obviously not friendly.
[0004] Therefore, in the multi-channel projection scenario, how to provide a more friendly connection mode is a technical problem that urgently needs to be solved. Summary of the invention
[0005] The purpose of the embodiments of the present application is to solve the problem of how to provide a more friendly connection mode in a multi-channel screen projection scenario.
[0006] According to one aspect of an embodiment of the present application, a device for establishing a connection for screen projection is provided, which is applied to a receiving terminal, and includes:
[0007] An acquisition module, configured to acquire a preset connection mode in response to a connection request sent by a sending terminal, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode;
[0008] A determination module, used to determine a service channel and a group owner of the connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data;
[0009] A connection module is used to establish a connection according to the service channel and the group owner.
[0010] In a possible implementation, before receiving the connection request, the determination module is further configured to:
[0011] In response to the received mode setting instruction, a preset connection mode is determined and set.
[0012] In a possible implementation, if the acquired preset connection mode is a single-channel mode, the determination module is specifically used to:
[0013] Determine the frequency bands supported by both the transmitting terminal and the receiving terminal;
[0014] Traffic channels are determined from commonly supported frequency bands.
[0015] In another possible implementation, the device further includes a broadcast module, where the broadcast module is configured to:
[0016] Stop broadcasting operations over the negotiation channel over which the connection request was received.
[0017] In another possible implementation, if the acquired preset connection mode is a multi-channel mode, the determination module is specifically used to:
[0018] If a connection request is received for the first time, determining a service channel from a first frequency band, wherein the first frequency band is a frequency band supported by the transmitting terminal and the receiving terminal;
[0019] If it is not the first time that the connection request is received, the service channel determined from the first frequency band when the connection request is received for the first time is obtained, and feedback is given to the receiving terminal.
[0020] In another possible implementation, if the acquired preset connection mode is a multi-channel mode, the determination module determines the group owner of the connection according to the acquired preset connection mode, specifically for:
[0021] Feedback a first negotiated value to the sending terminal, where the first negotiated value is less than or equal to the maximum negotiated value;
[0022] According to the first negotiated value, it is determined that the sending terminal or the receiving terminal is the group owner.
[0023] In another possible implementation, if the acquired preset connection mode is a single-channel mode, the determination module, in determining the group owner of the connection according to the acquired preset connection mode, is specifically configured to:
[0024] If a connection request is received for the first time, feeding back a second negotiated value to the sending terminal, wherein the second negotiated value is a maximum negotiated value;
[0025] Through the second negotiated value, the receiving terminal is determined to be the group owner.
[0026] In another possible implementation, the device further includes a playing module. If the service data is video data, after receiving the video data, the playing module is used to:
[0027] Determine whether the received video data is complete, and if any video frame in the video data is incomplete, determine whether to discard the incomplete video frame according to the state of a preset frame drop switch;
[0028] or,
[0029] If the received video data is multi-channel, in response to the received sound control instruction, the audio decoding channel of the target channel video data in the multi-channel video is controlled to be in the open state, and the audio decoding channels of other video data except the target channel video data are controlled to be in the closed state.
[0030] According to another aspect of an embodiment of the present application, a method for establishing a connection for screen projection is provided, the method comprising:
[0031] In response to a connection request sent by a sending terminal, a preset connection mode is acquired, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode;
[0032] Determine a group owner of a service channel and a connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data;
[0033] The connection is established based on the traffic channel and the group owner.
[0034] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the steps of the method shown in the above aspect of an embodiment of the present application.
[0035] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method shown in the above aspect of an embodiment of the present application are implemented.
[0036] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0037] The embodiment of the present application provides a device for establishing a connection for screen projection, including an acquisition module, a determination module and a connection module. The device is specifically used to: first, through the acquisition module, in response to a connection request sent by a sending terminal, obtain a preset connection mode including a single-channel mode and a multi-channel mode, that is, the device pre-sets two modes to correspond to different numbers of screen projection operations; then, through the determination module, determine the service channel and the group owner of the connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data, that is, determine the service channel and the group owner that should correspond to different numbers of screen projection operations; finally, through the connection module, establish a connection according to the service channel and the group owner. The embodiment of the present application realizes that in the screen projection scenario, a corresponding method of determining the service channel and the group owner of the connection is provided for different numbers of screen projection operations, which solves the problems faced in the connection establishment stage and supports subsequent screen projection operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0039] Figure 1a A schematic diagram of the structure of a device for establishing a connection for screen projection provided in an embodiment of the present application;
[0040] Figure 1b A schematic diagram of the structure of another device for establishing a connection for screen projection provided in an embodiment of the present application;
[0041] Figure 2 A flowchart of a method for establishing a connection for screen projection provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0044] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".
[0045] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0046] First, several terms involved in this application are introduced and explained:
[0047] 2.4G frequency band: The frequency band in which IEEE802.11b / g protocol works, and there are 14 channels in total. Among them, China's regulations on the 2.4GHz frequency band are: the frequency range of use is 2.4GHz~2.4835GHz, corresponding to the following available channels: channel 01, channel 02, channel 03, channel 04, channel 05, channel 06, channel 07, channel 08, channel 09, channel 10, channel 11, channel 13, channel 13.
[0048] 5G frequency band: The frequency band in which IEEE 802.11n works, with a total of 201 channels. Among them, China's regulations on the 5GHz frequency band are: using the frequency range of 5.150GHz~5.350GHz, 5.725GHz~5.850GHz, with a total bandwidth of 325MHz, corresponding to the following available channels: channel 036, channel 040, channel 044, channel 048, channel 052, channel 056, channel 060, channel 064, channel 149, channel 153, channel 157, channel 161, channel 165.
[0049] Single-band network card and dual-band network card: A single-band network card refers to a network card that supports the 2.4G frequency band, and a dual-band network card refers to a network card that supports both the 2.4G frequency band and the 5G frequency band.
[0050] The present application provides a device, method, electronic device and computer-readable storage medium for establishing a connection for screen projection, which aims to solve the above technical problems in the prior art.
[0051] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0052] See also Figure 1a , the embodiment of the present application provides a schematic diagram of a structure of a device for establishing a connection for screen projection, the device 100 includes an acquisition module 110, a determination module 120, and a connection module 130, wherein,
[0053] The acquisition module 110 is used to acquire a preset connection mode in response to a connection request sent by a sending terminal, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode;
[0054] Among them, the single-channel mode means that the receiving terminal is connected to a sending terminal, that is, a one-to-one relationship, which can also be called single-channel screen projection. The multi-channel mode means that the receiving terminal is connected to at least two sending terminals, that is, a one-to-many relationship, which can also be called multi-channel screen projection.
[0055] See also Figure 1b , the embodiment of the present application also provides a structural diagram of another device for establishing a connection for screen projection. In one possible implementation, the device 100 also includes a broadcast module 140, which is used to start any channel in the first frequency band as a negotiation channel and send a broadcast packet through the negotiation channel; after receiving the broadcast packet, the sending terminal can send a connection request to the receiving terminal. It should be noted that the sending process of the broadcast packet can refer to the prior art.
[0056] It should be noted that in the embodiment of the present application, the first frequency band is a frequency band type supported by both the transmitting terminal and the receiving terminal that can perform screen projection operations. For example, the 2.4G frequency band is a frequency band supported by most terminals and can be used as the first frequency band.
[0057] In a possible implementation, before receiving the sending request, the determining module 120 in the apparatus 100 is further configured to:
[0058] In response to the received mode setting instruction, the preset connection mode is set. Specifically, the single-channel mode and the multi-channel mode can be represented by different mode identifiers, for example: the single-channel mode is "0" and the multi-channel mode is "1". If the mode identifier carried in the mode setting instruction is "0", it indicates that the preset connection mode is the single-channel mode.
[0059] A determination module 120, configured to determine a service channel and a group owner of a connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data;
[0060] The connection module 130 is used to establish a connection according to the service channel and the group owner.
[0061] Among them, after the connection is established, the sending terminal can send video data through the service channel and then perform corresponding screen projection operations.
[0062] The embodiment of the present application provides a device for establishing a connection for screen projection, including an acquisition module 110, a determination module 120 and a connection module 130, which is specifically used to: first, through the acquisition module 110, in response to the connection request sent by the sending terminal, obtain a preset connection mode including a single-channel mode and a multi-channel mode, that is, the device pre-sets two modes to correspond to different numbers of screen projection operations; then, through the determination module 120, determine the service channel and the group owner of the connection according to the obtained preset connection mode, wherein the service channel is used to transmit service data, that is, determine the service channel and the group owner required for the screen projection operation of different data; finally, through the connection module 130, establish a connection according to the service channel and the group owner. The embodiment of the present application realizes that in the screen projection scenario, a corresponding method of determining the service channel and the group owner of the connection is provided for different numbers of screen projection operations, which solves the difficulties faced in the connection establishment stage and supports subsequent screen projection operations.
[0063] The embodiment of the present application also provides a possible implementation method. If the acquired preset connection mode is a single-channel mode, the determination module 120 is specifically used to determine the service channel according to the acquired preset connection mode:
[0064] Determine a frequency band commonly supported by the transmitting terminal and the receiving terminal; and determine the service channel from the commonly supported frequency band.
[0065] Specifically, since only the frequency band type supported by one transmitting terminal needs to be considered in the single-channel mode, the service channel can be determined based on the frequency band supported by the transmitting terminal and the receiving terminal, so that at least screen projection operations can be performed (for example, supporting certain single-frequency transmitting terminals).
[0066] Among them, if the sending terminal is a terminal carrying a single-frequency network card, that is, the terminal only supports the first frequency band (the sending terminal can receive the broadcast packet in the negotiation channel, which means that the terminal supports the first frequency band. If it is a single-frequency network card, then the single-frequency network card obviously refers to a network card that supports the first frequency band), then a channel can be selected from multiple channels in the first frequency band of the receiving terminal except the negotiation channel as the service channel.
[0067] Among them, if the sending terminal is a terminal carrying other types of network cards, such as a dual-band network card, and the dual-band network card indicates that it supports two frequency bands, specifically the first frequency band and the second frequency band, then a channel can be selected from the channels of the first frequency band and the second frequency band as a service channel. For example, it can also be another type of network card, which supports the second frequency band and / or the third frequency band and / or the fourth frequency band on the basis of supporting the first frequency band. In addition, the receiving terminal supports at least the first frequency band. Similarly, when selecting a service channel, it is also necessary to avoid the negotiation channel.
[0068] For example, if the sending terminal is a single-frequency network card, that is, a network card that supports the 2.4G frequency band, and there are 13 channels (except the negotiation channel) available in the 2.4G frequency band, therefore, a suitable channel can be selected from the 13 channels as the service channel. If the sending terminal is a dual-frequency network card, for example, supporting the 2.4G frequency band and the 5G frequency band, a suitable channel can be selected from the available channels of the 2.4G frequency band (except the negotiation channel) and the available channels of the 5G frequency band as the service channel.
[0069] In addition, if in single-channel mode, the goal is to receive video data quickly and with high video quality (the amount of data transmitted is relatively large), then selecting a service channel from the 5G frequency band will help achieve this goal.
[0070] In a possible implementation, if the acquired preset connection mode is a single-channel mode, the broadcast module 140 is further configured to:
[0071] Stop broadcasting operations over the negotiation channel over which the connection request was received.
[0072] Specifically, after the sending terminal and the connecting terminal successfully establish a connection, the sending operation of the broadcast packet on the negotiation channel is stopped to prevent other sending terminals from receiving the broadcast packet and then applying for connection with the receiving terminal.
[0073] In a possible implementation, if the acquired preset connection mode is a single-channel mode, the determination module 120 determines the group owner of the connection according to the acquired preset connection mode, specifically for:
[0074] A first negotiated value is fed back to the sending terminal, wherein the first negotiated value is less than or equal to the maximum negotiated value; and according to the first negotiated value, the sending terminal or the receiving terminal is determined to be the group owner.
[0075] Among them, the connection method provided by the embodiment of the present application does not adopt the WiFi routing mode in the stage of establishing the connection, but establishes a local area network between the sending terminal and the receiving terminal. Since a local area network is established, it is necessary to determine the group owner of the local area network, and the group owner reassigns the IP address of the local area network to the sending terminal. The process of determining the group owner of the connection specifically includes: the third negotiation value provided by the sending terminal, by comparing the size of the first negotiation value and the third negotiation value, to determine the group owner. Among them, the terminal that provides a larger negotiation value will serve as the group owner of the connection.
[0076] Exemplarily, the negotiation value can be represented by an Intent value, and the range of the Intent value provided by the sending terminal and the receiving terminal is any integer from 0 to 15. When implementing the solution shown in this application, the first negotiation value can be set to 6. From this range, it can be known that the maximum Intent value is 15.
[0077] The embodiment of the present application further provides a possible implementation manner. If the acquired preset connection mode is a multi-channel mode, the determination module 120 is specifically used to determine the service channel according to the acquired preset connection mode:
[0078] If a connection request is received for the first time, determining a service channel from a first frequency band, wherein the first frequency band is a frequency band supported by the transmitting terminal and the receiving terminal;
[0079] Exemplarily, the service channel is determined from channels 01-13 (excluding the negotiation channel) in the 2.4G frequency band. For example, channels 01, 06, and 11 may be used as service channels.
[0080] If it is not the first time that the connection request is received, the service channel determined from the first frequency band when the connection request is received for the first time is obtained, and feedback is given to the receiving terminal.
[0081] Among them, in the multi-channel mode, when the connection request is received for the first time, the service channel has been determined. When the connection request is received subsequently, there is no need to determine a new channel. The newly added sending terminal and the receiving terminal only need to interact through the service channel. Therefore, the receiving terminal obtains the confirmed service channel and feeds back to the newly added sending terminal, and the newly added sending terminal directly establishes a connection based on the service channel.
[0082] In a possible implementation, if the acquired preset connection mode is a multi-channel mode, the determination module 120, in determining the group owner of the connection according to the acquired preset connection mode, is specifically configured to:
[0083] If the connection request is received for the first time, a second negotiation value is fed back to the sending terminal, wherein the second negotiation value is the maximum negotiation value; and the receiving terminal is determined to be the group owner through the second negotiation value.
[0084] Since in multi-channel mode, the receiving terminal needs to act as the group owner of the connection to allocate IPs to all sending terminals, therefore, when providing the second negotiation value, it is necessary to provide the maximum negotiation value to seize the identity of the group owner. When the maximum negotiation value is provided, the receiving terminal will most likely become the group owner (wherein, there is a small probability that the competition for the group owner fails, then it is necessary to re-provide the second negotiation value, and even if it is re-provided, the second negotiation value = the maximum negotiation value is selected). Exemplarily, when the range of the negotiation value is all integers from 0 to 15, then the second negotiation value is 15.
[0085] If it is not the first time to receive the connection request, the receiving terminal can allocate an IP address to the sending terminal as the group owner, without sending the second negotiation value to negotiate the ownership of the group owner.
[0086] It should be noted that when determining the group owner of the service channel and the connection, the receiving terminal and the transmitting terminal are determined in the form of negotiation based on the negotiation channel. The determination process can refer to the existing technology and the embodiments of the present application do not impose any limitations.
[0087] The embodiment of the present application also provides a possible implementation method. The device 100 further includes a playing module 150. If the service data is video data, after receiving the video data, the playing module 150 is used to:
[0088] Determine whether the received video data is complete, and if any video frame in the video data is incomplete, determine whether to discard the incomplete video frame according to the state of a preset frame drop switch;
[0089] Specifically, if the frame drop switch is in the on state, the video frame is played. If the frame drop switch is in the off state, the incomplete video frame is discarded. The receiving terminal may receive a frame drop state setting instruction at any time to set the state of the frame drop switch.
[0090] Among them, one video data includes multiple video frames, and one video frame is composed of multiple RTP data packets. During the specific transmission, one video data is decomposed into multiple RTPs for transmission. Each RTP data packet has a sequence number. After the receiving terminal receives the RTP data packet, it assembles the video frame according to the sequence number carried by the RTP data packet. During the assembly, it can be determined whether there is any RTP data packet lost. If there is any loss, it is determined that the video frame is incomplete. For example, a video frame A is composed of 3 RTP data packets, and their sequence numbers are: 1A, 2A, and 3A. If all RTP data packets corresponding to the 3 sequence numbers are received, it is determined that video frame A is received. If the RTP data packet corresponding to at least one of the above sequence numbers is not received, it is determined that video frame A is incomplete.
[0091] or,
[0092] If the received video data is multi-channel, in response to the received sound control instruction, the audio decoding channel of the target channel video data in the multi-channel video is controlled to be in the open state, and the audio decoding channels of other video data except the target channel video data are controlled to be in the closed state.
[0093] Among them, the terminal device is configured with an audio decoder for decoding audio data from video data. When decoding video data, an audio decoding channel is provided for the video data. If the received sound control instruction plays the sound of the target video data, the audio decoding channel of the target audio data is turned on, and the audio decoding channels of other video data are turned off.
[0094] See also Figure 2 , an embodiment of the present application provides a flow chart of a method for establishing a connection for screen projection, the method being applied to a receiving terminal, comprising:
[0095] S210, in response to a connection request sent by a sending terminal, obtaining a preset connection mode, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode.
[0096] In one possible manner, before receiving the connection request, the method further includes:
[0097] In response to the received mode setting instruction, a preset connection mode is determined and set.
[0098] S220, determining a service channel and a connection group owner according to the acquired preset connection mode, wherein the service channel is used to transmit service data.
[0099] S230: Establish a connection according to the service channel and the group owner.
[0100] The embodiment of the present application provides a possible implementation method, if the acquired preset connection mode is a single-channel mode, determining a service channel according to the acquired preset connection mode includes:
[0101] Determine a frequency band commonly supported by the transmitting terminal and the receiving terminal; and determine the service channel from the commonly supported frequency band.
[0102] In a possible implementation, if the acquired preset connection mode is a single-channel mode, the method includes:
[0103] Stop broadcasting operations over the negotiation channel over which the connection request was received.
[0104] In a possible implementation, if the acquired preset connection mode is a single-channel mode, determining the group owner of the connection according to the acquired preset connection mode specifically includes:
[0105] If a connection request is received for the first time, feeding back a first negotiated value to the sending terminal, wherein the first negotiated value is less than or equal to a maximum negotiated value;
[0106] According to the first negotiated value, it is determined that the sending terminal or the receiving terminal is the group owner.
[0107] In a possible implementation manner, the embodiment of the present application further provides that if the acquired preset connection mode is a multi-channel mode, determining a service channel according to the acquired preset connection mode specifically includes:
[0108] If a connection request is received for the first time, determining a service channel from a first frequency band, wherein the first frequency band is a frequency band supported by the transmitting terminal and the receiving terminal;
[0109] If it is not the first time that the connection request is received, the service channel determined from the first frequency band when the connection request is received for the first time is obtained, and feedback is given to the receiving terminal.
[0110] In a possible implementation, if the acquired preset connection mode is a multi-channel mode, determining the group owner of the connection according to the acquired preset connection mode may specifically include:
[0111] If it is the first time to receive, a second negotiated value is fed back to the sending terminal, wherein the second negotiated value is the maximum negotiated value; through the second negotiated value, it is determined that the receiving terminal is the group owner.
[0112] The embodiment of the present application also provides a possible implementation method, if the service data is video data, after receiving the video data, it also includes:
[0113] Determine whether the received video data is complete, and if any video frame in the video data is incomplete, determine whether to discard the incomplete video frame according to the state of a preset frame drop switch;
[0114] or,
[0115] If the received video data is multi-channel, in response to the received sound control instruction, the audio decoding channel of the target channel video data in the multi-channel video is controlled to be in the open state, and the audio decoding channels of other video data except the target channel video data are controlled to be in the closed state.
[0116] An electronic device is provided in an embodiment of the present application, including a memory, a processor, and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of a method for establishing a connection for screen projection in the above-mentioned embodiment of the present application.
[0117] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The electronic device 3000 shown includes: a processor 3001 and a memory 3003. The processor 3001 and the memory 3003 are connected, such as through a bus 3002. Optionally, the electronic device 3000 may also include a transceiver 3004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 3004 is not limited to one, and the structure of the electronic device 3000 does not constitute a limitation on the embodiments of the present application.
[0118] Processor 3001 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 3001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0119] The bus 3002 may include a path to transmit information between the above components. The bus 3002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 3002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0120] The memory 3003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0121] The memory 3003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 3001. The processor 3001 is used to execute the computer program stored in the memory 3003 to implement the steps shown in the above method embodiment.
[0122] Among them, electronic devices include but are not limited to: televisions and video playback devices.
[0123] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0124] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0125] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0126] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A device for establishing a connection for screen projection, characterized in that: Applied to a receiving terminal, the device comprises: An acquisition module, configured to acquire a preset connection mode in response to a connection request sent by a sending terminal, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode; A determination module, configured to determine a service channel and a group owner of a connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data; a connection module, for allocating an IP address of a local area network to a sending terminal when the group owner is a receiving terminal, so as to establish a local area network between the sending terminal and the receiving terminal, and establishing a connection with the sending terminal in the local area network according to the service channel; Among them, if the preset connection mode is a single-way mode, the determination module is used to feed back a first negotiation value to the sending terminal, wherein the first negotiation value is less than or equal to a maximum negotiation value; based on the first negotiation value and a third negotiation value sent by the sending terminal, determine that the sending terminal or the receiving terminal is the group owner; if the preset connection mode is a multi-way mode, the determination module is used to feed back a second negotiation value to the sending terminal when the connection request is received for the first time, wherein the second negotiation value is the maximum negotiation value; through the second negotiation value, determine that the receiving terminal is the group owner.
2. The device according to claim 1, characterized in that Before receiving the connection request, the determination module is also used to: In response to the received mode setting instruction, the preset connection mode is determined and set.
3. The device according to claim 1, characterized in that If the acquired preset connection mode is the single-channel mode, the determination module is specifically used to: Determining a frequency band commonly supported by the transmitting terminal and the receiving terminal; The service channel is determined from the commonly supported frequency bands.
4. The device according to claim 3, characterized in that The device further includes a broadcast module, wherein the broadcast module is configured to: The broadcast operation is stopped via a negotiation channel through which the connection request is received.
5. The device according to claim 1, characterized in that If the acquired preset connection mode is the multi-channel mode, the determination module is specifically used to: If the connection request is received for the first time, determining the service channel from a first frequency band, wherein the first frequency band is a frequency band supported by the transmitting terminal and the receiving terminal; If it is not the first time that the connection request is received, a service channel determined from the first frequency band when the connection request is received for the first time is obtained, and feedback is provided to the receiving terminal.
6. The device according to any one of claims 1 to 5, characterized in that The device further includes a playing module. If the service data is video data, after receiving the video data, the playing module is used to: Determine whether the received video data is complete, and if any video frame in the video data is incomplete, determine whether to discard the incomplete video frame according to the state of a preset frame drop switch; or, If the received video data is multi-channel, in response to the received sound control instruction, the audio decoding channel of the target channel video data in the multi-channel video is controlled to be in the open state, and the audio decoding channels of other video data except the target channel video data are controlled to be in the closed state.
7. A method for establishing a connection for screen projection, characterized in that: Applied to a receiving terminal, the method comprises: In response to a connection request sent by a sending terminal, a preset connection mode is acquired, wherein the preset connection mode includes: a single-channel mode and a multi-channel mode; Determine a group owner of a service channel and a connection according to the acquired preset connection mode, wherein the service channel is used to transmit service data; When the group owner is a receiving terminal, allocating an IP address of a local area network to the sending terminal to establish a local area network between the sending terminal and the receiving terminal, and establishing a connection with the sending terminal in the local area network according to the service channel; Among them, if the preset connection mode is a single-channel mode, a first negotiation value is fed back to the sending terminal, wherein the first negotiation value is less than or equal to the maximum negotiation value; based on the first negotiation value and the third negotiation value sent by the sending terminal, it is determined that the sending terminal or the receiving terminal is the group owner; if the preset connection mode is a multi-channel mode, if the connection request is received for the first time, a second negotiation value is fed back to the sending terminal, wherein the second negotiation value is the maximum negotiation value; through the second negotiation value, it is determined that the receiving terminal is the group owner.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method of claim 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 7 are implemented.