CN113778364A - Screen projection method and device, electronic equipment and storage medium - Google Patents

Screen projection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113778364A
CN113778364A CN202111122181.1A CN202111122181A CN113778364A CN 113778364 A CN113778364 A CN 113778364A CN 202111122181 A CN202111122181 A CN 202111122181A CN 113778364 A CN113778364 A CN 113778364A
Authority
CN
China
Prior art keywords
target data
data packet
buffer area
memory
network transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202111122181.1A
Other languages
Chinese (zh)
Inventor
郝帅
苗京花
范清文
郑超
张�浩
陈丽莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Beijing BOE Display Technology Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Beijing BOE Display Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd, Beijing BOE Display Technology Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202111122181.1A priority Critical patent/CN113778364A/en
Publication of CN113778364A publication Critical patent/CN113778364A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4335Housekeeping operations, e.g. prioritizing content for deletion because of storage space restrictions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement

Abstract

The embodiment of the application provides a screen projection method and device, electronic equipment and a computer readable storage medium. The screen projection method comprises the following steps: receiving a target data packet; the target data packet comprises a sequence number; the sequence number represents the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of a buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number sequence of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the current network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.

Description

Screen projection method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of screen projection, in particular to a screen projection method and device, electronic equipment and a storage medium.
Background
The screen projection is called screen sharing, screen flying and screen sharing. Specifically, a picture of a sending end (such as a mobile phone, a tablet, a notebook, and a computer) is displayed on a receiving end (such as a tablet, a notebook, a computer, a television, an all-in-one machine, and a projector) in real time through a certain technical method, the displayed content includes various media information and real-time operation pictures, and the projection screen is widely applied to scenes such as conference lectures, demonstrations, video teaching and the like.
In the process of screen projection, due to objective reasons such as network congestion, the sequence of target data packets sent by a sending end is not necessarily the sequence of target data packets received by a receiving end, so in the prior art, a buffer area is arranged at the receiving end to store the target data packets, the target data packets are subjected to disorder detection and rearrangement, the target data packets in the buffer area are read, and the read target data packets are decoded and displayed to a screen projection device.
However, in the existing scheme, the buffer area is a memory with a fixed size, and the memory size of the buffer area is set to be compatible with the network transmission quality, in order to meet the requirement that all target data packets are received under the condition of poor network transmission quality, the memory size of the buffer area is usually set to be larger, but larger memory size of the buffer area causes larger system resource occupation, and under the condition of good network transmission quality, larger system resource waste is caused.
Disclosure of Invention
The application provides a screen projection method, a screen projection device, an electronic device and a storage medium aiming at the defects of the existing mode, and is used for solving the technical problem that the memory of a buffer area is too large in the prior art.
In a first aspect, an embodiment of the present application provides a screen projection method, including:
receiving a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet;
if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality;
adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area;
and reading each target data packet according to the sequence number sequence of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet.
In one possible implementation, adjusting the memory of the buffer according to the network transmission quality, and storing the target data packet in the adjusted buffer includes:
if the current network transmission quality is determined not to accord with the preset network transmission condition, acquiring the current residual memory of the buffer area;
and if the memory of the target data packet is larger than the current residual memory of the buffer area, expanding the memory of the buffer area, and storing the target data packet to the expanded buffer area.
In a possible implementation manner, if it is determined that the current network transmission quality does not meet the preset network transmission condition, the method further includes the following steps:
and if the memory of the target data packet is smaller than the current residual memory of the buffer area, the memory of the buffer area is not changed, and the target data packet is stored in the buffer area.
In one possible implementation manner, adjusting the memory of the buffer area according to the network transmission quality, and storing the target data packet in the adjusted buffer area, further includes:
and if the current network transmission quality is determined to meet the preset network transmission condition, carrying out capacity reduction on the memory of the buffer area, and storing the target data packet to the capacity-reduced buffer area.
In a possible implementation manner, if it is determined to store the target packet in the buffer, the method further includes:
determining whether a target data packet exists in a buffer area or not according to the sequence number;
and if the target data packet does not exist in the buffer area, determining to store the target data packet into the buffer area.
In one possible implementation, determining whether the target packet exists in the buffer according to the sequence number further includes:
and if the target data packet exists in the buffer area, discarding the target data packet.
In one possible implementation, storing the target packet in the adjusted buffer includes:
and sequencing the sequence number of each target data packet according to the sequence number of the target data packet and the sequence number of each target data packet stored in the adjusted buffer area, determining the corresponding position of the target data packet in the adjusted buffer area according to the sequencing result, and storing the target data packet to the corresponding position.
In one possible implementation, the determining that the current network transmission quality does not meet the preset network transmission condition includes:
determining the delay difference and the packet loss rate of receiving a target data packet at the current moment; the delay difference is the difference of the delays between the adjacent target data packets; the packet loss rate is the ratio of the number of target data packets lost in a preset period to the period duration of the period;
and if the delay difference is greater than the preset delay difference and/or the packet loss rate is greater than the preset packet loss rate, determining that the current network transmission quality does not accord with the preset network transmission quality.
In one possible implementation, the determining that the current network transmission quality meets the preset network transmission condition includes:
and if the delay difference is less than or equal to the preset delay difference and the packet loss rate is less than or equal to the preset packet loss rate, determining that the current network transmission quality accords with the preset network transmission quality.
In a second aspect, an embodiment of the present application provides a screen projection apparatus, including:
a receiving module for receiving a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet;
the network transmission quality acquisition module is used for acquiring the current network transmission quality if the target data packet is determined to be stored in the buffer area;
the memory adjusting module of the buffer area is used for adjusting the memory of the buffer area according to the current network transmission quality and storing the target data packet to the adjusted buffer area;
and the decoding and displaying module is used for reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet.
In one possible implementation, the memory adjustment module of the buffer includes:
the residual memory obtaining submodule of the buffer area is used for obtaining the current residual memory of the buffer area if the current network transmission quality is determined not to accord with the preset network transmission condition;
and the capacity expansion submodule is used for expanding the capacity of the memory of the buffer area and storing the target data packet into the expanded buffer area if the memory of the target data packet is larger than the current residual memory of the buffer area.
In one possible implementation manner, the memory adjustment module of the buffer further includes:
and the memory maintaining submodule is used for storing the target data packet into the buffer area without changing the memory of the buffer area if the memory of the target data packet is smaller than the current residual memory of the buffer area.
In one possible implementation manner, the memory adjustment module of the buffer further includes:
and the capacity reduction sub-module is used for reducing the capacity of the memory of the buffer area and storing the target data packet into the reduced buffer area if the current network transmission quality is determined to meet the preset network transmission condition.
In one possible implementation, the apparatus further includes:
a sequence number determining module, configured to determine whether a target data packet exists in the buffer area according to the sequence number;
and the determining and storing module is used for determining to store the target data packet into the buffer area if the target data packet does not exist in the buffer area.
In one possible implementation, the apparatus further includes:
and the discarding module is used for discarding the target data packet if the target data packet is determined to exist in the buffer area.
In a possible implementation manner, the memory adjustment module of the buffer further includes:
and the sequencing submodule is used for sequencing the serial numbers of the target data packets according to the serial numbers of the target data packets and the serial numbers of the target data packets stored in the adjusted buffer area, determining the corresponding positions of the target data packets in the adjusted buffer area according to the sequencing result, and storing the target data packets to the corresponding positions.
In one possible implementation, the network transmission quality obtaining module includes:
the delay difference and packet loss rate determining submodule is used for determining the delay difference and the packet loss rate of the target data packet received at the current moment; the delay difference is the difference of the delays between the adjacent target data packets; the packet loss rate is the ratio of the number of target data packets lost in a preset period to the period duration of the period;
and the network transmission quality determination first sub-module is used for determining that the current network transmission quality does not accord with the preset network transmission quality if the delay difference is greater than the preset delay difference and/or the packet loss rate is greater than the preset packet loss rate.
In one possible implementation manner, the network transmission quality obtaining module further includes:
and the network transmission quality determination second sub-module determines that the current network transmission quality accords with the preset network transmission quality if the delay difference is less than or equal to the preset delay difference and the packet loss rate is less than or equal to the preset packet loss rate.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the method as provided in the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program, where the computer program includes computer instructions stored in a computer-readable storage medium, and when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of implementing the method provided in the first aspect.
The beneficial technical effects brought by the technical scheme provided by the embodiment of the application comprise: the embodiment of the application receives a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to the screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the current network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a screen projection method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart illustrating a process of adjusting a memory of a buffer according to a network transmission quality and storing a target data packet in the adjusted buffer according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a buffer area after capacity expansion according to an embodiment of the present application;
fig. 4a is a schematic diagram of a corresponding position of each target packet stored in a buffer before the target packet is stored in the buffer according to an embodiment of the present application;
fig. 4b is a schematic diagram of corresponding positions of target packets in an adjusted buffer area after the target packets are stored in the adjusted buffer area according to an embodiment of the present application
Fig. 5 is a schematic flowchart of another screen projection method provided in the embodiment of the present application;
FIG. 6 is a schematic diagram of a frame of another projection device according to an embodiment of the present disclosure;
fig. 7 is a schematic frame diagram of a structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar parts or parts having the same or similar functions throughout. In addition, if a detailed description of the known art is not necessary for illustrating the features of the present application, it is omitted. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As used herein, the singular forms "a", "an", "the" and "the" include plural referents unless the context clearly dictates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
The terms referred to in this application will first be introduced and explained:
the screen projection is also called screen sharing, screen flying and screen sharing, specifically, videos played on intelligent devices such as a mobile phone, a tablet, a computer and the like are synchronized to another device for playing and watching in a screen projection mode, a user can share pictures of small-screen devices to a large-screen device for displaying, for example, a mobile phone screen is projected to a computer, the mobile phone screen is controlled by the computer, and the screen projection is suitable for scenes such as mobile phone games, live broadcasting of hand games, large-screen watching and the like.
The screen projection mainly comprises a wired screen projection and a wireless screen projection, for example, a mobile phone video is projected on a television screen, and the wired screen projection is realized by connecting a mobile phone and a television through a data line; the wireless screen projection is realized by connecting a mobile phone and a television through a network.
The screen is thrown and is carried out audio frequency, video data transmission based on RTP (Real-time Transport Protocol)/RTCP (Real-time Transport Control Protocol), RTCP Protocol and RTP Protocol are combined to work, RTCP Protocol does not transmit data, but cooperates with RTP Protocol to pack and send multimedia data, RTP Protocol defines standard data packet format for transmitting multimedia data such as audio frequency, video frequency and the like, RTCP Protocol transmits Control data among stream multimedia session participants regularly, RTCP data packet contains statistical information such as the number of sent data packets, the number of lost data packets and the like.
In the embodiment of the present application, the terminal device is a device having a wireless transceiving function, and may be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), an access terminal device, a vehicle-mounted terminal device, an industrial control terminal device, a UE unit, a UE station, a mobile station, a remote terminal device, a mobile device, a UE terminal device, a wireless communication device, a UE agent, or a UE apparatus. The terminal device may be fixed or mobile. For example, the terminal device may be a mobile phone (mobile phone), a tablet (pad), a desktop, a notebook, a kiosk, a vehicle-mounted terminal, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving, a wireless terminal in remote surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in city (PDA) a wireless terminal in smart home, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a wireless local loop (PDA) phone, a personal digital assistant (wlan) a wireless terminal with a wireless communication function, and a handheld Personal Digital Assistant (PDA) with a wireless communication function, A computing device or other processing device connected to a wireless modem, a wearable device, a terminal device in a future mobile communication network or a terminal device in a future evolved public mobile land network (PLMN), etc. In some embodiments of the present application, the terminal may also be a device having a transceiving function, such as a system-on-chip. The chip system may include a chip and may also include other discrete devices.
In the existing scheme, target data packets do not necessarily arrive in sequence in the screen projection process, and the sequence of the target data packets arriving at the receiving end is disordered, so that the receiving end needs to set a buffer area to store the target data packets, and carry out disorder detection and rearrangement on the target data packets.
However, the memory of the buffer area in the existing scheme is a fixed-size memory, and the memory size setting of the buffer area is compatible with the network transmission quality, in order to meet the requirement that all target data packets are received under the condition of poor network transmission quality, the memory of the buffer area is usually set to be larger, but larger memory setting of the buffer area causes larger system resource occupation, and under the condition of good network transmission quality, larger system resource waste is caused.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments.
The embodiment of the application provides a wireless screen projection method, as shown in fig. 1, the method includes:
step S101, receiving a target data packet, wherein the target data packet comprises a serial number; the sequence number indicates the transmission order of the target packet.
The screen projection is that a picture in a sending end (such as a mobile phone, a flat panel, a notebook computer and a computer) is displayed on a receiving end (such as a flat panel, a notebook computer, a television, an all-in-one machine and a projector), in the whole screen projection process, the receiving end is screen projection equipment, the sending end A sends target data to a receiving end B, and the receiving end B receives and processes a target data packet sent by the sending end A.
The target data packet in the embodiment of the present application includes various data packets involved in the screen projection process, for example, audio data and video data are transmitted through an RTP data packet, and then when the audio data and the video data are transmitted, the target data packet is an RTP data packet.
The sending end and the receiving end can be terminals of any types, and the receiving end is any screen projection equipment, such as a mobile phone, a pad, a computer, an all-in-one machine and the like.
In the process of screen projection, due to the situations of network delay, packet loss and the like, the sequence of sending the target data packets by the sending end and the sequence of receiving the target data packets by the receiving end may not be consistent, for example, the sending end sends the target data packets a, b and c according to the time sequence, but the time sequence of receiving the target data packets by the receiving end is not necessarily a, b and c, that is, the target data packet sent first does not mean to be received by the receiving end first.
Each target data packet in the embodiment of the application includes a sequence number, the sequence number of the target data packet represents a transmission sequence of the target data packet, and the sequence number of the target data packet can be used as a unique identifier of the target data packet.
Step S102, if the target data packet is stored in the buffer area, the current network transmission quality is obtained.
The receiving end of the embodiment of the application is provided with the buffer area, the buffer area is used for storing the received target data packet, the initial memory of the buffer area is arbitrary, the embodiment of the application does not limit the initial memory, and in practical application, a user can set the initial memory according to actual conditions.
In the embodiment of the application, after receiving the target data packet, the target data packet is not directly stored in the buffer area, whether the target data packet exists in the buffer area is judged according to the unique identifier (serial number) of the target data packet, and if the target data packet exists in the buffer area, the target data packet is directly discarded to avoid repetition; and if the target data packet does not exist in the buffer area, determining to store the target data packet into the buffer area.
The current network transmission quality refers to the current network transmission condition, the network transmission quality is determined based on the delay difference and the packet loss rate of the target data packets, and the delay difference refers to the difference of delay between adjacent target data packets; the packet loss rate refers to the ratio of the number of target data packets lost in a period to the period duration of the period, and the detailed process of obtaining the delay difference and the packet loss rate is shown in the following contents.
Step S103, adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area.
The memory of the buffer area changes along with the change of the current network transmission quality, the memory of the buffer area is dynamically adjusted according to the current network transmission quality, the target data packet is stored in the adjusted buffer area, and the detailed adjustment process is shown in the following embodiments.
And step S104, reading each target data packet according to the sequence number sequence of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet.
According to the embodiment of the application, the target data packet is stored in the buffer area, meanwhile, the target data packet is read from the buffer area according to the serial number of the target data packet, the read target data packet is decoded, and the decoded target data packet is directly displayed on the screen projection equipment, so that screen projection is realized.
The screen projection device in the embodiment of the application refers to any terminal capable of projecting a screen, including but not limited to a mobile phone, a computer, a television, a projector, a paid and a vehicle-mounted terminal.
The embodiment of the application receives a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to the screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.
An embodiment of the present application provides a possible implementation manner, as shown in fig. 2, adjusting a memory of a buffer according to network transmission quality, and storing a target data packet in the adjusted buffer, including:
in step S201, if it is determined that the current network transmission quality does not meet the preset network transmission condition, the current remaining memory of the buffer is obtained.
The remaining memory of the buffer area in the embodiment of the present application refers to an idle memory of the buffer area, and the idle memory does not store the target data packet.
The memory of the buffer area changes along with the change of the network transmission quality, the network transmission quality refers to the current network transmission condition, the current network transmission quality is determined based on the delay difference and the packet loss rate of the target data packet received at the current moment, if the delay difference at the current moment is smaller than or equal to the preset delay difference and the packet loss rate is smaller than or equal to the preset packet loss rate, the current network transmission quality is determined to accord with the preset network transmission condition, and conversely, if the delay difference at the current moment is larger than the preset delay difference and/or the packet loss rate is larger than the preset packet loss rate, the network transmission quality is determined to not accord with the preset network transmission condition.
If the current network transmission quality meets the preset condition, the current network transmission condition is good, the delay difference at the current moment is small, and the packet loss rate is low.
It should be understood that, in the case that the delay difference is larger, if the target data packet with the previous sequence number is not received all the time, and then if the target data packet with the subsequent sequence number is received, the target data packet with the subsequent sequence number will be stored in the buffer, at this time, the number of the target data packets stored in the buffer is large, and it is necessary to obtain the remaining memory of the buffer, and determine whether the remaining memory of the buffer is sufficient to store the received target data packet.
Step S202, if the memory of the target data packet is larger than the current remaining memory of the buffer area, performing capacity expansion on the memory of the buffer area, and storing the target data packet in the buffer area after capacity expansion.
The method includes the steps of obtaining current network transmission quality after a target data packet is determined to be stored in a buffer area, obtaining current residual memory of the buffer area if the current network transmission quality is determined not to meet preset network transmission conditions, and indicating that the current residual memory of the buffer area is insufficient to store the target data packet if the memory of the target data packet is larger than the current residual memory of the buffer area, wherein the memory of the buffer area needs to be expanded at the moment, so that the expanded buffer area can meet the requirement of storing the target data packet, and the target data packet is stored in the expanded buffer area.
The embodiment of the application can expand the memory of the buffer area according to the actual situation, the expanded buffer area meets the requirement of storing the target data packet, the embodiment of the application does not limit the residual memory after the expansion and after the target data packet is stored, the residual memory after the target data packet is stored can be 0 or more than 0, and the user can expand the memory of the buffer area according to the actual situation.
It should be emphasized that, in the embodiment of the present application, when the memory of the buffer is expanded, the memory of the buffer is not infinitely expanded, but the memory that needs to be expanded is determined according to actual situations.
Specifically, as shown in fig. 3, a schematic diagram after the buffer is expanded is exemplarily shown, where an initial memory of the buffer is 5 unit length, a current remaining memory is 1 unit length, and a memory of the target packet is 2 unit length, and thus it can be seen that the memory of the target packet is larger than the current remaining memory of the buffer and is not enough to store the target packet, and at this time, the memory of the buffer needs to be expanded, and the memory of the buffer after the expansion can store the target packet, and the memory of the buffer after the expansion is at least expanded by 1 unit length, and assuming that the buffer is expanded by 3 unit length, the memory after the expansion is 8 unit length, and the remaining memory after the expansion is 2 unit length after the target packet is stored.
According to the embodiment of the application, when the memory of the buffer area is not enough to store the target data packet, the buffer area is properly expanded according to the actual situation, the memory of the buffer area after expansion is not too large, and therefore waste of system resources is avoided.
As shown in fig. 2, if it is determined that the current network transmission quality does not meet the preset network transmission condition, the method according to the embodiment of the present application further includes:
in step S202', if the memory of the target data packet is smaller than the current remaining memory of the buffer area, the memory of the buffer area is not changed, and the target data packet is stored in the buffer area.
In the embodiment of the present application, if the memory of the target data packet is smaller than the current remaining memory of the buffer area, it indicates that the current remaining memory of the buffer area is sufficient to store the target data packet, and the target data packet is directly stored in the buffer area.
Specifically, it is assumed that the initial memory of the buffer area is 8 unit lengths, the current remaining memory is 3 unit lengths, and the memory of the target packet is 2 unit lengths, so that it can be seen that the memory of the target packet is smaller than the current remaining memory of the buffer area, and the target packet is stored without expanding the buffer area and directly stored in the buffer area.
According to the method and the device, when the fact that the current network transmission quality does not meet the preset transmission condition is determined, the current residual memory of the buffer area is obtained, if the memory of the target data packet is larger than the residual memory of the buffer area, the capacity of the memory of the buffer area is expanded, the expanded memory of the buffer area meets the requirement of storing the target data packet, if the memory of the target data packet is smaller than the residual memory of the buffer area, the fact that the memory of the buffer area meets the requirement of storing the target data packet is indicated, and the capacity expansion of the memory of the buffer area is not needed. According to the embodiment of the application, when the network transmission quality does not accord with the preset condition, the memory of the buffer area can be flexibly adjusted, the memory of the buffer area cannot be too large, and the waste of system resources is avoided.
The embodiment of the present application provides a possible implementation manner, adjusting a memory of a buffer according to network transmission quality, and storing a target data packet in the adjusted buffer, further including:
and if the current network transmission quality is determined to meet the preset network transmission condition, carrying out capacity reduction on the memory of the buffer area, and storing the target data packet to the capacity-reduced buffer area.
According to the embodiment of the application, when the delay difference at the current moment is smaller than or equal to the preset delay difference and the packet loss rate is smaller than or equal to the preset packet loss rate, the current network transmission quality is determined to accord with the preset network transmission condition, when the delay difference is smaller than the preset delay difference and the packet loss rate is smaller than the preset packet loss rate, the target data packet stored in the buffer area can be read and decoded immediately, the target data packet cannot be stored in the buffer area for a long time, only a few target data packets are stored in the buffer area, the buffer area can be subjected to capacity reduction at this time, and the stored content of the buffer area after capacity reduction meets the requirement for storing the target data packet.
It should be emphasized that, in the embodiment of the present application, when performing capacity reduction on the memory of the buffer, the memory of the buffer is not infinitely reduced to be empty, but the capacity reduction is confirmed according to actual situations.
In the embodiment of the application, when the network transmission quality meets the preset transmission condition, the target data packet stored in the memory of the buffer area can be read and decoded, the target data packet can not be stored in the buffer area for too long time, the memory of the buffer area is reduced, the number of the target data packets which can be stored in the memory of the buffer area after the reduction is relatively small, after the target data packet is received, the sequence number sorting of each target data packet in the buffer area is carried out according to the sequence number of the target data packet, the more the number of the target data packets in the buffer area is, the longer the time for carrying out the sequence number sorting is, and the same is true, the less the number of the target data packets in the buffer area is, the shorter the time for carrying out the sequence number sorting is, when the current network transmission quality meets the preset transmission condition, the reduction is carried out on the buffer area, and the time for re-sorting the target data packets is reduced, the screen projection delay can be reduced, and the real-time property of the screen projection is ensured.
The embodiment of the present application provides a possible implementation manner, and if it is determined that the target data packet is stored in the buffer, the method further includes:
determining whether a target data packet exists in a buffer area or not according to the sequence number;
and if the target data packet does not exist in the buffer area, determining to store the target data packet into the buffer area.
In the embodiment of the present application, after receiving the target data packet, the target data packet may not be directly stored in the buffer, and it is necessary to determine whether the target data packet with the same sequence number exists in the buffer according to the unique identifier (sequence number) of the target data packet, and if the target data packet with the same sequence number does not exist in the buffer, it is determined that the target data packet is stored in the buffer.
The embodiment of the present application provides a possible implementation manner, determining whether a target data packet exists in a buffer according to a sequence number, and then further including:
and if the target data packet exists in the buffer area, discarding the target data packet.
According to the embodiment of the application, after the target data packet is received, whether the target data packet exists in the buffer area is judged according to the sequence number of the target data packet, and if the target data packet with the same sequence number exists in the buffer area, the target data packet is discarded in order to avoid the waste of memory due to repeated storage.
The embodiment of the present application provides a possible implementation manner, storing a target data packet in an adjusted buffer area, including:
and sequencing the sequence number of each target data packet according to the sequence number of the target data packet and the sequence number of each target data packet stored in the adjusted buffer area, determining the corresponding position of the target data packet in the adjusted buffer area according to the sequencing result, and storing the target data packet to the corresponding position.
In the actual process of transmitting the target data packets, due to network delay, packet loss and other situations, the sequence of transmitting the target data packets by the transmitting end and the sequence of receiving the target data packets by the receiving end are not necessarily the same, that is, the target data packets transmitted by the transmitting end first do not mean that the receiving end receives the target data packets first, and the sequence of the target data packets received by the receiving end is chaotic, so that the target data packets need to be sequenced to determine the arrangement sequence of each target data packet.
According to the method and the device, after the target data packet is determined to be stored in the buffer area, the memory of the buffer area is adjusted according to the current network transmission quality, sequence number sorting is carried out on all the target data packets according to the sequence number of the target data packet and the sequence numbers of all the target data packets stored in the buffer area, a sorting result is obtained, the corresponding position of the target data packet in the adjusted buffer area is determined according to the sorting result, and the target data packet is stored to the corresponding position.
Specifically, as shown in fig. 4a, it exemplarily shows a schematic diagram of corresponding positions of each target packet already stored in a buffer before the target packet is stored in the buffer, where RTP data already stored in the buffer has b, d, f, and g, and sequence numbers corresponding to b, c, f, and g are (is), (is) and (is) respectively.
As shown in fig. 4b, which exemplarily shows a schematic diagram of corresponding positions of the target data packets in the adjusted buffer area after the target data packets are stored in the adjusted buffer area, assuming that the sequence numbers of the target data packets e and e are ≤, according to the sequence numbers of the target data packets, determining that ≤ r, < ≤ c, < c, and obtaining ordering results as b, d, e, f, and g, determining corresponding positions of the target data packets in the buffer area according to the ordering results, and storing the target data packets to the corresponding positions.
The embodiment of the present application provides a possible implementation manner, determining that the current network transmission quality does not meet a preset network transmission condition, including:
determining the delay difference and the packet loss rate of receiving a target data packet at the current moment; the delay difference is the difference of the delays between the adjacent target data packets; the packet loss rate is the ratio of the number of target data packets lost in a preset period to the period duration of the period;
and if the delay difference is greater than the preset delay difference and/or the packet loss rate is greater than the preset packet loss rate, determining that the current network transmission quality does not accord with the preset network transmission quality.
In the embodiment of the present invention, the current network transmission quality is determined by the delay difference and the packet loss rate, the delay difference is a delay difference between adjacent target data packets, and the data packets with adjacent sequence numbers may be referred to as adjacent data packets, for example, if the sequence number of the target data packet d is the fourth sequence number and the sequence number of the target data packet e is the fifth sequence number, the target data packet and the target data packet e may be referred to as adjacent data packets.
The delay of the target data packet in the embodiment of the application is a difference value between a receiving time stamp and a sending time stamp of the target data packet, the receiving time stamp refers to a moment when the receiving end receives the target data packet, the sending time stamp refers to a moment when the sending end sends the target data packet, and the delay difference is a difference value of delays of adjacent target data packets.
According to the embodiment of the application, the sending time stamp and the receiving time stamp of each target data packet can be obtained by receiving the RTCP data packet sent by the sending end, and the RTCP data packet comprises the sending time stamp, the receiving time stamp and other statistical information of each target data packet in the period where the RTCP data packet is located.
And calculating the delay of the target data packet by acquiring the sending time stamp and the receiving time stamp of the target data packet, calculating the delay of the adjacent target data packet by acquiring the sending time stamp and the receiving time stamp of the target data packet adjacent to the target data packet, wherein the difference value between the delay of the target data packet and the delay of the target data packet adjacent to the target data packet is the delay difference.
Specifically, assuming that the transmission timestamp of the target packet is T1 and the reception timestamp is T1 ', the delay D1 of the target packet is T1' -T1, the transmission timestamp of the target packet adjacent to the target packet is T2, and the reception timestamp is T2 ', the delay D2 of the target packet adjacent to the target packet is T2' -T2, and the delay difference between the two is D1-D2-T1 '-T1- (T2' -T2).
The packet loss rate is a ratio of the number of target data packets lost in a preset period to the duration of the preset period, the number of target data packets lost in the preset period can be obtained by receiving an RTCP data packet sent by a sending end in the embodiment of the present application, and the RTCP data packet includes a sending timestamp and a receiving timestamp of each target data packet in the period where the RTCP data packet is located, and also includes statistical information such as the number of the sent target data packets and the number of the lost target data packets.
Specifically, assuming that a preset period in which the sender sends an RTCP packet is t, and the RTCP packet records that the number of target packets lost in the preset period is count, it may be determined that the packet loss rate is count/t.
And after the delay difference and the packet loss rate at the current moment are determined, comparing the delay difference with the packet loss rate through a preset delay difference and the preset packet loss rate, and if the delay difference is greater than the preset delay difference and/or the packet loss rate is greater than the preset packet loss rate, determining that the network transmission quality does not conform to the preset network transmission quality.
The embodiment of the present application provides a possible implementation manner, and determining that the current network transmission quality meets a preset network transmission condition includes:
and if the delay difference is less than or equal to the preset delay difference and the packet loss rate is less than or equal to the preset packet loss rate, determining that the current network transmission quality accords with the preset network transmission quality.
After the current delay difference and the packet loss rate are determined, the delay difference is compared with a preset delay difference, the packet loss rate is compared with a preset packet loss rate, and if the current delay difference is smaller than or equal to the preset delay difference and/or the packet loss rate is smaller than or equal to the preset packet loss rate, the current network transmission quality is determined to accord with the preset network transmission quality.
After the current network transmission quality is determined, the memory of the buffer area is dynamically changed according to the current network transmission quality, and when the current network transmission quality meets the preset transmission condition, the memory of the buffer area is subjected to capacity reduction, so that the screen projection delay can be effectively reduced, and the screen projection instantaneity is ensured; when the current network transmission quality does not meet the preset condition, if the memory of the target data packet is larger than the residual memory of the buffer area, the capacity of the memory of the buffer area is expanded, so that the fluency of screen projection can be ensured; if the memory of the target data packet is smaller than the rest memory of the buffer area, the memory of the buffer area is not changed, so that the dynamic adjustment of the memory of the buffer area according to the current network transmission quality is realized, and the system resources are saved.
The whole screen projection process will be exemplified below by taking the target data packet as an RTP data packet, as shown in fig. 5, which exemplarily shows a flow diagram of another screen projection method, including:
step S501, receiving an RTP data packet;
step S502, judging whether the RTP data packet exists in the buffer area according to the sequence number of the RTP data packet;
step S503, if the RTP packet does not exist in the buffer area, determining to store the RTP packet in the buffer area;
step S503', if the RTP packet exists in the buffer, determining to discard the RTP packet;
step S504, obtain the transmission quality of the present network;
step S505, judging whether the current network transmission quality accords with the preset network transmission condition;
step S506, if the current network transmission quality does not accord with the preset network transmission condition, the current residual memory of the buffer area is obtained;
step S507, judging whether the memory of the RTP data packet is larger than the current residual memory of the buffer area;
step S508, if the memory of the RTP packet is larger than the current remaining memory of the buffer, expanding the memory of the buffer, and storing the RTP packet to the expanded buffer;
step S508', if the memory of the RTP packet is smaller than the current remaining memory of the buffer, directly storing the RTP packet to the buffer;
step S506', if the current network transmission quality meets the preset network transmission condition, the memory of the buffer area is scaled, and the RTP packet is stored in the scaled buffer area.
Step S509, reading each RTP packet according to the sequence number of each RTP packet stored in the buffer;
step S510, decoding the read RTP data packet;
and step S511, displaying the decoded RTP data packet on a screen projection device.
The specific implementation process of the steps S501 to S511 is the same as the implementation process described above, and the detailed description of the embodiments of the present application is omitted here.
The embodiment of the present application provides a screen projection device 60, which includes:
a receiving module 610, configured to receive a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet;
a network transmission quality obtaining module 620, configured to obtain current network transmission quality if it is determined that the target data packet is stored in the buffer area;
a buffer memory adjusting module 630, configured to adjust a buffer memory according to the current network transmission quality, and store the target data packet in the adjusted buffer memory;
and the decoding and displaying module 640 is configured to read each target data packet according to the sequence number of each target data packet in the adjusted buffer area, decode each read target data packet, and display each decoded target data packet to the screen projection device.
An embodiment of the present application provides a possible implementation manner, in which a memory adjustment module of a buffer includes:
the residual memory obtaining submodule of the buffer area is used for obtaining the current residual memory of the buffer area if the current network transmission quality is determined not to accord with the preset network transmission condition;
and the capacity expansion submodule is used for expanding the capacity of the memory of the buffer area and storing the target data packet into the expanded buffer area if the memory of the target data packet is larger than the current residual memory of the buffer area.
The embodiment of the present application provides a possible implementation manner, and the memory adjustment module of the buffer further includes:
and the memory maintaining submodule is used for storing the target data packet into the buffer area without changing the memory of the buffer area if the memory of the target data packet is smaller than the current residual memory of the buffer area.
The embodiment of the present application provides a possible implementation manner, and the memory adjustment module of the buffer further includes:
and the capacity reduction sub-module is used for reducing the capacity of the memory of the buffer area and storing the target data packet into the reduced buffer area if the current network transmission quality is determined to meet the preset network transmission condition.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes:
a sequence number determining module, configured to determine whether a target data packet exists in the buffer area according to the sequence number;
and the determining and storing module is used for determining to store the target data packet into the buffer area if the target data packet does not exist in the buffer area.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes:
and the discarding module is used for discarding the target data packet if the target data packet is determined to exist in the buffer area.
The embodiment of the present application provides a possible implementation manner, and the memory adjustment module of the buffer further includes:
and the sequencing submodule is used for sequencing the serial numbers of the target data packets according to the serial numbers of the target data packets and the serial numbers of the target data packets stored in the adjusted buffer area, determining the corresponding positions of the target data packets in the adjusted buffer area according to the sequencing result, and storing the target data packets to the corresponding positions.
The embodiment of the present application provides a possible implementation manner, where the network transmission quality obtaining module includes:
the delay difference and packet loss rate determining submodule is used for determining the delay difference and the packet loss rate of the target data packet received at the current moment; the delay difference is the difference of the delays between the adjacent target data packets; the packet loss rate is the ratio of the number of target data packets lost in a preset period to the period duration of the period;
and the network transmission quality determination first sub-module is used for determining that the current network transmission quality does not accord with the preset network transmission quality if the delay difference is greater than the preset delay difference and/or the packet loss rate is greater than the preset packet loss rate.
The embodiment of the present application provides a possible implementation manner, and the network transmission quality obtaining module further includes:
and the network transmission quality determination second sub-module determines that the current network transmission quality accords with the preset network transmission quality if the delay difference is less than or equal to the preset delay difference and the packet loss rate is less than or equal to the preset packet loss rate.
The screen projection device of the present embodiment can perform any one of the screen projection methods provided in the embodiments of the present application, and the implementation principles thereof are similar and will not be described herein again.
Based on the same inventive concept, an embodiment of the present application provides an electronic device, including: a memory and a processor.
The memory is communicatively coupled to the processor.
At least one computer program stored in the memory for execution by the processor to implement various alternative implementations of any of the screen projection methods provided by the embodiments of the present application.
Those skilled in the art will appreciate that the electronic devices provided by the embodiments of the present application may be specially designed and manufactured for the required purposes, or may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus.
Compared with the prior art, the method can realize that: by receiving a destination data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to the screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the current network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.
In an alternative embodiment, the present application provides an electronic device, as shown in fig. 7, where electronic device 7000 shown in fig. 7 includes: a processor 7001 and a memory 7003. The processor 7001 and the memory 7003 are communicatively coupled, such as via a bus 7002.
The Processor 7001 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 device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 7001 may also be a combination implementing computing functionality, e.g., comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 7002 may include a path to transfer information between the above components. The bus 7002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 7002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The Memory 7003 may be a ROM (Read-Only Memory) or other type of static storage device that can store static information and instructions, a RAM (random access Memory) or other type of dynamic storage device that can store information and instructions, 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 Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Optionally, the electronic device 7000 may also comprise the transceiver 7004. The transceiver 7004 may be used for reception and transmission of signals. The transceiver 7004 may allow the electronic device 7000 to communicate with other devices wirelessly or by wire to exchange data. Note that the transceiver 7004 is not limited to one in practical use.
Optionally, the electronic device 7000 may further include an input unit 7005. The input unit 7005 may be used to receive input numeric, character, image, and/or sound information, or to generate key signal inputs related to user settings and function control of the electronic device 7000. Input unit 7005 may include, but is not limited to, one or more of a touch screen, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, a camera, a microphone, and the like.
Optionally, electronic device 7000 may also include output unit 7006. The output unit 7006 may be used to output or display information processed by the processor 7001. Output unit 7006 may include, but is not limited to, one or more of a display device, a speaker, a vibration device, and the like.
While fig. 7 illustrates an electronic device 7000 having various means, it is to be understood that it is not required that all of the illustrated means be implemented or provided. More or fewer devices may alternatively be implemented or provided.
Optionally, the memory 7003 is used for storing application program codes for executing the scheme of the application, and the processor 7001 is used for controlling the execution. The processor 7001 is used for executing application program codes stored in the memory 7003 so as to realize any screen projection method provided by the embodiment of the application.
Based on the same inventive concept, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by an electronic device/processor, the computer program implements any of the screen projection methods provided by the present application.
Alternatively, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by an electronic device/processor, implements various optional implementations of any of the screen projection methods shown in the present application.
Embodiments of the present application provide a computer-readable storage medium, which, compared with the prior art, receives a target data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to the screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the current network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.
The embodiment of the application provides various optional implementations of a computer-readable storage medium suitable for any one of the screen projection methods. And will not be described in detail herein.
By applying the embodiment of the application, at least the following beneficial effects can be realized: by receiving a destination data packet; the target data packet includes a sequence number; the sequence number indicates the transmission sequence of the target data packet; if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality; adjusting the memory of the buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area; and reading each target data packet according to the sequence number of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet to the screen projection equipment. According to the embodiment of the application, the dynamic adjustment of the memory of the buffer area is realized according to the current network transmission quality in the screen projection process, the condition that the buffer area is in a larger memory at the moment is avoided, and the waste of system resources is avoided.
Those of skill in the art will appreciate that the various operations, methods, steps in the processes, acts, or solutions discussed in this application can be interchanged, modified, combined, or eliminated. Further, other steps, measures, or schemes in various operations, methods, or flows that have been discussed in this application can be alternated, altered, rearranged, broken down, combined, or deleted. Further, steps, measures, schemes in the prior art having various operations, methods, procedures disclosed in the present application may also be alternated, modified, rearranged, decomposed, combined, or deleted.
In the description of the present application, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be construed as limiting the present application.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.
In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
In the description herein, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (12)

1. A screen projection method, comprising:
receiving a target data packet; the target data packet comprises a sequence number; the sequence number represents the transmission sequence of the target data packet;
if the target data packet is determined to be stored in the buffer area, acquiring the current network transmission quality;
adjusting the memory of a buffer area according to the current network transmission quality, and storing the target data packet to the adjusted buffer area;
and reading each target data packet according to the sequence number sequence of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet.
2. The screen projection method of claim 1, wherein the adjusting the memory of the buffer area according to the current network transmission quality and storing the target data packet in the adjusted buffer area comprises:
if the current network transmission quality is determined not to accord with the preset network transmission condition, acquiring the current residual memory of the buffer area;
and if the memory of the target data packet is larger than the current residual memory of the buffer area, expanding the memory of the buffer area, and storing the target data packet to the expanded buffer area.
3. The screen projection method according to claim 2, wherein if it is determined that the current network transmission quality does not meet the preset network transmission condition, the current remaining memory of the buffer area is obtained, and then the method further comprises:
and if the memory of the target data packet is smaller than the current residual memory of the buffer area, the memory of the buffer area is not changed, and the target data packet is stored in the buffer area.
4. The screen projection method of claim 1, wherein the adjusting the memory of the buffer area according to the current network transmission quality and storing the target data packet in the adjusted buffer area further comprises:
and if the current network transmission quality is determined to meet the preset network transmission condition, carrying out capacity reduction on the memory of the buffer area, and storing the target data packet to the capacity-reduced buffer area.
5. The screen-projection method of claim 1, wherein if the target data packet is determined to be stored in a buffer, the method further comprises:
determining whether the target data packet exists in the buffer area according to the sequence number;
and if the target data packet does not exist in the buffer area, determining to store the target data packet into the buffer area.
6. The screen-casting method of claim 5, wherein the determining whether the target data packet exists in the buffer according to the sequence number further comprises:
and if the target data packet exists in the buffer area, discarding the target data packet.
7. The screen projection method of claim 1, wherein the storing the target data packet in the adjusted buffer area comprises:
and sequencing the sequence numbers of the target data packets according to the sequence numbers of the target data packets and the sequence numbers of the target data packets stored in the adjusted buffer area, determining the corresponding positions of the target data packets in the adjusted buffer area according to the sequencing result, and storing the target data packets to the corresponding positions.
8. The screen projection method of claim 2, wherein the determining that the current network transmission quality does not meet the preset network transmission condition comprises:
determining the delay difference and the packet loss rate of receiving the target data packet at the current moment; the delay difference is the difference of the delays between the adjacent target data packets; the packet loss rate is the ratio of the number of target data packets lost in a preset period to the period duration of the period;
and if the delay difference is greater than a preset delay difference and/or the packet loss rate is greater than a preset packet loss rate, determining that the current network transmission quality does not accord with the preset network transmission quality.
9. The screen projection method of claim 8, wherein the determining that the current network transmission quality meets the preset network transmission condition comprises:
and if the delay difference is less than or equal to a preset delay difference and the packet loss rate is less than or equal to a preset packet loss rate, determining that the current network transmission quality accords with the preset network transmission quality.
10. A screen projection apparatus, comprising:
a receiving module for receiving a target data packet; the target data packet comprises a sequence number; the sequence number represents the transmission sequence of the target data packet;
a network transmission quality obtaining module, configured to obtain current network transmission quality if it is determined that the target data packet is stored in the buffer area;
the memory adjusting module of the buffer area is used for adjusting the memory of the buffer area according to the current network transmission quality and storing the target data packet to the adjusted buffer area;
and the decoding and displaying module is used for reading each target data packet according to the sequence number sequence of each target data packet in the adjusted buffer area, and decoding and displaying each read target data packet.
11. An electronic device, comprising:
a processor;
a memory communicatively coupled to the processor;
at least one program stored in the memory and configured to be executed by the processor, the at least one program configured to: implementing a screen projection method as claimed in any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by an electronic device, implementing a screen projection method as claimed in any one of claims 1-9.
CN202111122181.1A 2021-09-24 2021-09-24 Screen projection method and device, electronic equipment and storage medium Withdrawn CN113778364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111122181.1A CN113778364A (en) 2021-09-24 2021-09-24 Screen projection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111122181.1A CN113778364A (en) 2021-09-24 2021-09-24 Screen projection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113778364A true CN113778364A (en) 2021-12-10

Family

ID=78853203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111122181.1A Withdrawn CN113778364A (en) 2021-09-24 2021-09-24 Screen projection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113778364A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338624A (en) * 2022-01-07 2022-04-12 深圳创维-Rgb电子有限公司 Wireless screen projection data processing method, intelligent terminal and readable storage medium
CN115208864A (en) * 2022-08-12 2022-10-18 阿波罗智联(北京)科技有限公司 Data transmission method, device, equipment, vehicle and storage medium
CN116055790A (en) * 2022-07-29 2023-05-02 荣耀终端有限公司 Video playing method and system and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338624A (en) * 2022-01-07 2022-04-12 深圳创维-Rgb电子有限公司 Wireless screen projection data processing method, intelligent terminal and readable storage medium
CN116055790A (en) * 2022-07-29 2023-05-02 荣耀终端有限公司 Video playing method and system and electronic equipment
CN116055790B (en) * 2022-07-29 2024-03-19 荣耀终端有限公司 Video playing method and system and electronic equipment
CN115208864A (en) * 2022-08-12 2022-10-18 阿波罗智联(北京)科技有限公司 Data transmission method, device, equipment, vehicle and storage medium
CN115208864B (en) * 2022-08-12 2024-02-06 阿波罗智联(北京)科技有限公司 Data transmission method, device, equipment, vehicle and storage medium

Similar Documents

Publication Publication Date Title
CN113778364A (en) Screen projection method and device, electronic equipment and storage medium
JP4585479B2 (en) Server apparatus and video distribution method
CN100546236C (en) The filling perforation method for testing and the system again of best endeavors that is used for the time of knowing of network service
US9007426B2 (en) Comparison-based selection of video resolutions in a video call
US20060116164A1 (en) System and method for divided display on multiple mobile terminals
US8635274B2 (en) Video conferencing using white board
US20080019440A1 (en) Apparatus and method for transmitting and receiving moving pictures using near field communication
CN103797810A (en) Synchronized wireless display devices
CN101658000A (en) Method of transmitting data in a communication system
CN103368935A (en) Method and apparatus for providing an enhanced Wi-Fi display session in a Wi-Fi display network
EP1475922A2 (en) Data processing device, data processing system, data processing method, data processing program and recording medium storing the program
JP2007006476A (en) System and method for calculating bandwidth of mobile terminal for streaming service
US20060089838A1 (en) Method of streaming multimedia data
CN113727185B (en) Video frame playing method and system
US20030004992A1 (en) Data reproduction apparatus and data reproduction method
US20130227062A1 (en) Apparatus and method of displaying a contents using for key frame in a terminal
EP1722566A1 (en) Information distributing system and method, information distributing apparatus therefor, receiver terminal, and information relaying apparatus
JP2016225922A (en) Radio communication system and method
KR100651566B1 (en) Multimedia Player Using Output Buffering in Mobile Terminal and Its Control Method
US20150189231A1 (en) Video conferencing system
JP4425887B2 (en) VIDEO CONFERENCE SYSTEM, TERMINAL USED FOR VIDEO CONFERENCE SYSTEM, TERMINAL PROCESSING METHOD, AND ITS PROGRAM
JP5086366B2 (en) Conference terminal device, relay device, and conference system
US8890918B2 (en) Mobile terminal for selectively storing video call data and video call data storing method therefor
KR101484313B1 (en) PoC SYSTEM AND PoC TERMINAL FOR TRANSMITTING AND RECEIVING MULTIMEDIA DATA AND METHOD FOR TRANSMITTING AND RECEIVING MULTIMEDIA DATA THEREOF
CN115208864B (en) Data transmission method, device, equipment, vehicle and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20211210