Read-write method and read-write device for shared queue

A technology for sharing queues and queues, applied in the field of reading and writing methods and devices for shared queues, can solve problems such as low efficiency and waste of memory, and achieve the effects of improving efficiency and stability and optimizing memory usage.

Inactive Publication Date: 2014-09-24
武汉众智数字技术有限公司
View PDF5 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In view of the above problems, the purpose of the present invention is to provide a method and device for reading and writing shared queues, aiming to solve the technical problems of waste of memory and low efficiency in the existing method of using multiple data copies of multiple queues

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Read-write method and read-write device for shared queue
  • Read-write method and read-write device for shared queue
  • Read-write method and read-write device for shared queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0033] figure 1 A flow chart of the method for writing to a shared queue provided by the first embodiment of the present invention is shown, and only parts related to the embodiment of the present invention are shown for convenience of description.

[0034] The writing method of the shared queue provided by this embodiment includes the following steps:

[0035] Step S101, for the media data of the same channel, create a corresponding queue for each session, and different queues share the same media data;

[0036] This step first creates a queue. There may be multiple sessions on the same channel, and a queue is created for each session. The queue is used to store descriptors pointing to data packets, and different queues share media data in the same channel. Add the descriptor to the queue list, initialize the head node of the list, the head node includes the length information of the queue, including all data packet length statistics (that is, the length of all data packets ...

Embodiment 2

[0044] figure 2 The flow of the writing method of the shared queue provided by the second embodiment of the present invention is shown, and only the parts related to the embodiment of the present invention are shown for convenience of description.

[0045] The writing method of the shared queue provided by this embodiment includes the following steps:

[0046] Step S201, for the media data of the same channel, create a corresponding queue for each session, and different queues share the same media data;

[0047] Step S202, before writing the data packet, add 1 to the reference count of the data packet;

[0048] Step S203, create a descriptor pointing to the data packet according to the queue corresponding to the current session, different queues have their own memory management descriptors, and organize them into a linked list, and the descriptors of the same node point to the same piece of media data;

[0049]Step S204, when the queue writing condition is not met, discard ...

Embodiment 3

[0054] image 3 The flow of the writing method of the shared queue provided by the third embodiment of the present invention is shown, and only the parts related to the embodiment of the present invention are shown for convenience of description.

[0055] The writing method of the shared queue provided by this embodiment includes the following steps:

[0056] Step S301, for the media data of the same channel, create a corresponding queue for each session, and different queues share the same media data;

[0057] Step S302, before writing the data packet, add 1 to the reference count of the data packet;

[0058] Step S303, according to the queue corresponding to the current session, create a descriptor pointing to the data packet, different queues have their own memory management descriptors, and organize them into linked lists, and the descriptors of the same node point to the same piece of media data;

[0059] Step S304, when the queue write condition is not met, discard the...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention is suitable for the technical field of multichannel retransmission of audio / video, and provides a writing method and a writing device for a shared queue. The writing method comprises the following steps: for media data in the same channel, establishing descriptors pointing to data packages according to a queue corresponding to the current session; when the writing conditions of the queue are not met, dropping the data packages beginning from the head of the queue until the writing conditions are met; when the writing conditions of the queue are met, adding one on reference counting of the data packages, and inserting the descriptors of the data packages in the tail of the queue, and increasing the total length of the queue at the same time. Sessions in the same video channel own respective queues, the descriptors are stored in the queues, and the queues are managed by adopting the manner of reference counting for the application of the same data package; the queue management is combined with shared cache, and the management style that a group of data is shared by multiple queues is realized, so that the memory usage in an embedded system is greatly optimized, and the efficiency and stability of the system are improved.

Description

technical field [0001] The invention belongs to the technical field of multi-channel forwarding of audio and video, and in particular relates to a method and device for reading and writing a shared queue. Background technique [0002] At present, the forwarding of videos will be in the form of a queue. Queues are generally implemented as linked lists. Each node of the linked list represents a piece of video or audio data, collectively referred to as media data. When writing, write the newly added audio and video data from the head of the queue, and when reading, read the corresponding data from the end of the queue and delete it from the queue. When the speed of reading does not match the speed of writing, it is necessary to consider controlling the length of the queue and delete nodes that have not been read. This will result in packet loss. Generally speaking, if multiple queues use the audio and video data of the same channel, the same piece of data can be used in pri...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCH04N7/147
Inventor 陈成刘树惠
Owner 武汉众智数字技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products