WO2020228128A1 - 一种用于存储流媒体数据的方法、装置、存储介质 - Google Patents
一种用于存储流媒体数据的方法、装置、存储介质 Download PDFInfo
- Publication number
- WO2020228128A1 WO2020228128A1 PCT/CN2019/096562 CN2019096562W WO2020228128A1 WO 2020228128 A1 WO2020228128 A1 WO 2020228128A1 CN 2019096562 W CN2019096562 W CN 2019096562W WO 2020228128 A1 WO2020228128 A1 WO 2020228128A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- media data
- streaming media
- file block
- file
- index
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0616—Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
Definitions
- the present disclosure relates to the field of data storage, and in particular to a method, device, and storage medium for storing streaming media data.
- Video storage service is a very important part in the application of streaming media technology.
- the method of creating new streaming media files and deleting old streaming media files is used to realize the cyclic storage of storage space.
- disk fragmentation will increase, leading to disk reads.
- the writing efficiency is reduced and the disk life is shortened.
- the traditional storage method by file does not support cross-file, arbitrary jump progress and fast playback according to time in the process of stored data retrieval and playback.
- the embodiments of the present disclosure disclose a use Methods, devices, and storage media for storing streaming media data.
- the present disclosure proposes a method for storing streaming media data, including the following steps:
- S2 Select a suitable file block to store streaming media data, and at the same time mark the selected file block as occupied, and establish an index between the stored streaming media data and the number of seconds of storage time;
- step S2 includes the following steps:
- S21 Select a file block according to the file size of the streaming media data, and record the number of the file block and the offset of the streaming media data in the file block;
- S24 Convert the storage time of the streaming media data into seconds, and record the file block number selected by the streaming media data, the offset of the streaming media data in the file block, and the offset of the key frame in the streaming media data To the second index information corresponding to the number of seconds.
- step S21 specifically includes: when the file size of the streaming media data is less than or equal to the remaining space of the file block, storing the streaming media data in the current file block, and when the file size of the streaming media data is larger than the file block size With the remaining space, the streaming media data is stored in the next file block of the current file block. Therefore, a suitable file block can be selected for storage according to the size of the streaming media data, and the full use of the file block space can be effectively realized.
- step S22 specifically includes: judging whether the streaming media data corresponding to any one second is a key frame or a non-key frame, if it is a key frame, recording the offset of the key frame in the streaming media data, if it is not Key frame, record the offset of the previous key frame of the non-key frame in the streaming media data.
- the time index file is created in units of days, and the index information at the time of initialization is marked as an invalid index. Through the time index file, the position of the streaming media data in the file block can be quickly located.
- step S3 includes the following steps:
- S31 Input the read start date and time and end date and time, and judge whether the corresponding time index file can be obtained according to the start date, if yes, proceed to the next step, if not, end;
- S32 Convert the start time to the Nth second, locate the second index information of the Nth second in the time index file corresponding to the start date, and determine whether the second index information of the Nth second is a valid index, and if so, proceed as follows One step, if not, end;
- S35 Repeat the steps of S31-S34 for the next second and end after the end time is exceeded.
- the file block is configured to store streaming media data containing at least 1 GOP size
- the streaming media data is stored in the file block in chronological order
- the location of the file block corresponding to the deleted streaming media data is marked as Idle state. Therefore, storing and deleting streaming media data in file blocks can solve the problem of disk fragmentation caused by the cyclic storage of storage space, and realize the extension of disk life.
- the present disclosure also proposes a device for storing streaming media data, including:
- the storage module is configured to fill the storage space with pre-created fixed-size file blocks
- the index module is configured to select a suitable file block to store streaming media data, and at the same time mark the selected file block as occupied, and establish an index between the stored streaming media data and the number of seconds of storage time;
- the positioning module is configured to use the index to locate the location of the stored streaming media data.
- the index module includes:
- the number index module is configured to select the file block according to the file size of the streaming media data, and record the number of the file block and the offset of the streaming media data in the file block;
- the key frame index module is configured to determine the offset in the streaming media data of the key frame corresponding to any second in the storage time
- the index file module is configured to create a time index file and create second index information in time seconds;
- the index generation module is configured to convert the storage time of the streaming media data into seconds, and the file block number selected by the streaming media data, the offset of the streaming media data in the file block, and the key frame in the streaming media data The offset of is recorded in the second index information corresponding to the number of seconds.
- the numbering index module is configured to store the streaming media data in the current file block when the file size of the streaming media data is less than or equal to the remaining space of the file block.
- the file size of the streaming media data is larger than the file block If the remaining space is left, the streaming media data is stored in the next file block of the current file block.
- the key frame index module is configured to determine whether the streaming media data corresponding to any one second is a key frame or a non-key frame, and if it is a key frame, record the offset of the key frame in the streaming media data, If it is a non-key frame, record the offset of the previous key frame of the non-key frame in the streaming media data.
- the time index file is created in units of days, and the index information at the time of initialization is marked as an invalid index.
- the positioning module includes:
- the time index file positioning module is configured to input the read start date and time and end date and time, and judge whether the corresponding time index file can be obtained according to the start date, if yes, proceed to the next step, if not, end;
- the second index information positioning module is configured to convert the start time into the Nth second, locate the second index information of the Nth second in the time index file corresponding to the start date, and determine whether the second index information of the Nth second is valid Index, if yes, proceed to the next step, if no, end;
- the file block positioning module is configured to read the second index information of the Nth second, and determine whether the second index information of the Nth second has a file block displaying a specified number, if yes, proceed to the next step, if not, end;
- the key frame positioning module is configured to read the key frame according to the offset of the streaming media data in the file block in the file block of the specified number in the second index information of the Nth second, and pass the key frame in the streaming media data Offset to read streaming media data;
- the repeat module is configured to repeat the steps performed by the above module for the next second and end after the end time is exceeded.
- embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method as described in any implementation manner in the first aspect is implemented.
- the embodiment of the present disclosure discloses a method for storing streaming media data.
- the storage space is filled with a fixed-size file block created in advance; and a suitable file block is selected to store the streaming media data, and the selected The file block is marked as occupied, and an index between the stored streaming media data and the number of seconds of storage time is established; finally, the index is used to locate the location of the stored streaming media data.
- Streaming media is stored in file blocks for storage and deletion, which can effectively solve the disk fragmentation problem caused by the storage space circular storage in the process of streaming media data storage, extend the life of the disk, and achieve the purpose of improving disk usage efficiency.
- the present disclosure also proposes a fast indexing method of time and streaming media data, which realizes fast retrieval of streaming media data and arbitrary jump and playback according to time, and improves the efficiency of streaming media video retrieval and positioning.
- FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure can be applied
- FIG. 2 is a schematic flowchart of a method for storing streaming media data according to an embodiment of the disclosure
- step S2 of the method for storing streaming media data according to an embodiment of the present disclosure
- step S3 is a schematic flowchart of step S3 of the method for storing streaming media data according to an embodiment of the disclosure
- FIG. 5 is a schematic diagram of an apparatus for storing streaming media data according to an embodiment of the disclosure
- Fig. 6 is a schematic structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure.
- FIG. 1 shows an exemplary system architecture 100 of a method for storing streaming media data or a device for storing streaming media data to which embodiments of the present disclosure can be applied.
- the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105.
- the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
- the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables.
- the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and so on.
- Various applications may be installed on the terminal devices 101, 102, 103, such as data processing applications, file processing applications, and so on.
- the terminal devices 101, 102, and 103 may be hardware or software.
- the terminal devices 101, 102, and 103 may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and so on.
- the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or as a single software or software module. There is no specific limitation here.
- the server 105 may be a server that provides various services, for example, a background data processing server that processes files or data uploaded by the terminal devices 101, 102, and 103.
- the background data processing server may process the acquired file or data to generate a processing result (for example, a standard file containing the standard header line and the data contained in the corresponding segment).
- the method for storing streaming media data may be executed by the server 105, or may be executed by the terminal devices 101, 102, 103, and accordingly, the device for storing streaming media data may It is set in the server 105, and may also be set in the terminal devices 101, 102, 103.
- terminal devices, networks, and servers in FIG. 1 are merely illustrative. According to implementation needs, there can be any number of terminal devices, networks and servers.
- the above system architecture may not include a network, but only a server or terminal device.
- FIG. 2 it shows a process 200 applied to an embodiment of storing streaming media data according to the present disclosure.
- the method includes the following steps:
- S1 Fill the storage space with a fixed-size file block created in advance.
- the size of the created file block can store at least 1 GOP size of streaming media data, and the streaming media data is stored in the file block in chronological order.
- the streaming media data storage process there is no need to create new files. Only need to find the free file block, and overwrite the streaming media data into the file block.
- the file block is not deleted directly, but the location of the corresponding file block is marked as an idle state after the streaming media data is deleted. Therefore, during the entire storage process, no new file blocks are created or deleted, which effectively avoids the generation of disk fragments and prolongs the life of the disk.
- the use of file block storage does not require the use of conventional database systems, but is directly based on storage space.
- the file block may be stored in a preset storage area.
- the foregoing storage area may be various types of storage areas, including but not limited to: cache, memory, hard disk, etc.
- the size of the file block is 128M.
- the file block can store the streaming media data of multiple GOPs.
- the size of the streaming media data of each GOP is much smaller than the size of the file block, so the file block is stored
- the size of the file block can also be other suitable sizes, as long as the location where the streaming media data is stored in the file block can be located, that is to say, the streaming media data can be used in the The offset in the file block to get the location of the streaming media data.
- S2 Select an appropriate file block to store the streaming media data, and mark the selected file block as occupied and establish an index between the stored streaming media data and the number of seconds of storage time.
- step S2 may complete the process of step S2 according to the following steps:
- S21 Select a file block according to the file size of the streaming media data, and record the number of the file block and the offset of the streaming media data in the file block. Specifically, when streaming media data is stored in a file block, first compare the size between the file of the streaming media data and the remaining space in the file block selected for storage. When the file size of the streaming media data is less than or equal to the remaining space of the file block Space, the streaming media data is stored in the current file block. When the file size of the streaming media data is larger than the remaining space of the file block, the streaming media data is stored in the next file block of the current file block. Therefore, a suitable file block can be selected for storage according to the size of the streaming media data, which effectively realizes the full use of the file block space and effectively improves the utilization rate of the storage space.
- S22 Determine the offset in the streaming media data of the key frame corresponding to any second of the storage time; specifically, determine whether the streaming media data corresponding to any second is a key frame or a non-key frame, if it is a key frame, Record the offset of the key frame in the streaming media data, if it is a non-key frame, record the offset of the previous key frame of the non-key frame in the streaming media data.
- the normal playback of the streaming media data can be realized, and by accurately finding the key frame corresponding to any second in the storage time, the streaming media data can be quickly located to perform the playback without having to The beginning of the streaming media data is played to the corresponding number of seconds to quickly realize the second-level positioning and progress jump of the streaming media data.
- S23 Create a time index file, and create second index information in time seconds; specifically, the time index file is created in units of days, and the time and second index information is initialized as an invalid index.
- the time index file is created in the unit of days.
- the time index file is named after the date.
- the minimum time unit of the time index file is seconds.
- Each device has a time index file every day, one second index information per second, and a time index file has a total of 24* 3600 second index information, each second index information points to the file block number where the streaming media data corresponding to the second is located, the offset of the streaming media data in the file block, and the offset of the key frame in the streaming media data. Therefore, the position of streaming media data in the file block can be quickly located by the second index information in the time index file.
- S24 Convert the storage time of the streaming media data into seconds, and record the file block number selected by the streaming media data, the offset of the streaming media data in the file block, and the offset of the key frame in the streaming media data To the second index information corresponding to the number of seconds. Specifically, if the streaming media data stored at 12:38:24 on January 1, 2019 is stored, it will be converted to the 45504 second data stored in the appropriate file block, and January 1, 2019 will be obtained. The second index information corresponding to the 45504 second in the time index file created on the day. At this time, the second index information corresponding to the 45504 second stores the file block number where the corresponding streaming media data is located, and the offset of the streaming media data in the file block. The amount of shift, the offset of the key frame in the streaming media data.
- step S3 may complete the process of step S3 according to the following steps:
- S31 Input the read start date and time and end date and time, and judge whether the corresponding time index file can be obtained according to the start date, if yes, proceed to the next step, if not, end. Specifically, the reading time starts from the selected start date and time and ends at the selected end date and time. Choosing an appropriate reading time can choose to realize cross-file, jump progress and fast playback according to time.
- S32 Convert the start time to the Nth second, locate the second index information of the Nth second in the time index file corresponding to the start date, and determine whether the second index information of the Nth second is a valid index, and if so, proceed as follows One step, if not, end. If the second index information of the Nth second is a valid index, it means that the position information of the corresponding streaming media data in the file block is stored in the second index information. For example, if the start date and time are 12:38:24 on January 1, 2019, search for the second index information corresponding to the 45504 second in the time index file created on January 1, 2019, and read the corresponding to the 45504 second Second index information to obtain the location information of the streaming media data stored in the 45504 second.
- S33 Read the second index information of the Nth second, and judge whether the second index information of the Nth second has a file block displaying the designated number, if yes, proceed to the next step, if not, end.
- the stream media data stored in the 45504 second is in the file block number 6.
- the streaming media data stored in the 45504 second is in the file block number 6, and the streaming media data stored in the 45504 second has an offset of 12 bytes in the file block, and the offset of the key frame in the streaming data The amount is 16 bytes, and accordingly, the specific position of the streaming media data in the file block is located, and even the key frame of the streaming media data is located for playing the streaming media data.
- S35 Repeat the steps of S31-S34 for the next second and end after the end time is exceeded.
- the above process is adopted to read one by one according to the number of time seconds, or it can be read at a certain time point.
- the present disclosure provides an embodiment of a device for storing streaming media data.
- the device embodiment corresponds to the method embodiment shown in FIG. 2 ,
- the device can be specifically applied to various electronic equipment.
- the apparatus 500 for storing streaming media data of this embodiment includes: a storage module 501 configured to fill the storage space with a fixed-size file block created in advance; and an indexing module 502 configured to Select the appropriate file block to store the streaming media data and mark the selected file block as occupied and establish an index between the stored streaming media data and the number of seconds of storage time; the positioning module 503 is configured to use the index to locate The location of the stored streaming media data.
- the above-mentioned index module 501 specifically includes: a numbered index module configured to select file blocks according to the file size of the streaming media data, and record the number of the file block and the offset of the streaming media data in the file block. Specifically, the number index module is used to determine when the file size of the streaming media data is less than or equal to the remaining space of the file block, then the streaming media data is stored in the current file block, and when the file size of the streaming media data is greater than the remaining space of the file block , The streaming media data is stored in the next file block of the current file block.
- the key frame index module is configured to determine the offset in the streaming media data of the key frame corresponding to any second of the storage time.
- the key frame index module is configured to determine whether the streaming media data corresponding to any one second is a key frame or a non-key frame. If it is a key frame, record the offset of the key frame in the streaming media data. If it is a non-key frame, then Record the offset of the previous key frame of the non-key frame in the streaming data.
- the index file module is configured to create a time index file and create second index information in time seconds.
- the time index file is used to create a time index file in units of days, and the initialization time and second index information is marked as an invalid index. Therefore, each day's time index file can create 86400 seconds of index information.
- the index generation module is configured to convert the storage time of the streaming media data into seconds, and the file block number selected by the streaming media data, the offset of the streaming media data in the file block, and the key frame in the streaming media data The offset of is recorded in the second index information corresponding to the number of seconds.
- the positioning module 503 includes:
- the time index file positioning module is configured to input the read start date and time and end date and time, and judge whether the corresponding time index file can be obtained according to the start date, if yes, proceed to the next step, if not, end;
- the second index information positioning module is configured to convert the start time into the Nth second, locate the second index information of the Nth second in the time index file corresponding to the start date, and determine whether the second index information of the Nth second is valid Index, if yes, proceed to the next step, if no, end;
- the file block positioning module is configured to read the second index information of the Nth second, and determine whether the second index information of the Nth second has a file block displaying a specified number, if yes, proceed to the next step, if not, end;
- the key frame positioning module is configured to read the key frame according to the offset of the streaming media data in the file block in the file block of the specified number in the second index information of the Nth second, and pass the key frame in the streaming media data Offset to read streaming media data;
- the repeat module is configured to repeat the steps performed by the above module for the next second and end after the end time is exceeded.
- FIG. 6 shows a schematic structural diagram of a computer system 600 suitable for implementing an electronic device (such as the server or terminal device shown in FIG. 1) of an embodiment of the present disclosure.
- the electronic device shown in FIG. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
- the computer system 600 includes a central processing unit (CPU) 601, which can be based on a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603 And perform various appropriate actions and processing.
- the RAM 603 also stores various programs and data required for the operation of the system 600.
- the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
- An input/output (I/O) interface 605 is also connected to the bus 604.
- the following components are connected to the I/O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a LAN card
- the communication section 609 performs communication processing via a network such as the Internet.
- the driver 610 can also be connected to the I/O interface 605 as needed.
- a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that the computer program read from it is installed into the storage part 608 as needed.
- the process described above with reference to the flowchart can be implemented as a computer software program.
- the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
- the computer program may be downloaded and installed from the network through the communication part 609, and/or installed from the removable medium 611.
- the central processing unit (CPU) 601 the above-mentioned functions defined in the method of the present disclosure are executed.
- the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable medium, or any combination of the two.
- the computer-readable medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable Read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- a computer-readable medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the computer-readable signal medium may also be any computer-readable medium other than the computer-readable medium, and the computer-readable medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device.
- the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
- the computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof.
- the programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language.
- the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
- the remote computer can be connected to the user’s computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
- LAN local area network
- WAN wide area network
- Internet service provider for example, using an Internet service provider to pass Internet connection.
- each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions.
- the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
- each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
- the modules involved in the embodiments described in the present disclosure can be implemented in software or hardware.
- the described modules may also be provided in the processor.
- a processor includes a storage module 501, an index module 502, and a positioning module 503.
- the names of these modules do not constitute a limitation on the module itself under certain circumstances.
- the storage module 501 can also be described as "a module that divides storage space into fixed-size file blocks for storage".
- the present disclosure also provides a computer-readable medium.
- the computer-readable medium may be included in the electronic device described in the above-mentioned embodiment; or it may exist alone without being assembled into the electronic device. in.
- the above-mentioned computer-readable medium carries one or more programs.
- the electronic device fills up the storage space with a fixed-size file block created in advance; and selects the appropriate The file block is used to store the streaming media data, and the selected file block is marked as occupied, and an index between the stored streaming media data and the number of seconds of storage time is established; finally, the index is used to locate the stored streaming media The location of the data.
- Streaming media is stored in file blocks for storage and deletion, which can effectively solve the disk fragmentation problem caused by the storage space circular storage in the process of streaming media data storage, extend the life of the disk, and achieve the purpose of improving disk usage efficiency.
- the present disclosure also proposes a fast indexing method for time and streaming media data, which realizes fast retrieval of streaming media data and arbitrary jump and playback according to time, and improves the efficiency of streaming media video retrieval and positioning.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (14)
- 一种用于存储流媒体数据的方法,其特征在于,包括以下步骤:S1:利用预先创建的固定大小的文件块将存储空间填满;S2:选择合适的所述文件块来存储流媒体数据,同时将所选择的文件块标记为占用状态,并且建立所存储的流媒体数据与存储时间的秒数之间的索引;S3:利用所述索引来定位所存储的流媒体数据所在的位置。
- 根据权利要求1所述的用于存储流媒体数据的方法,其特征在于,所述步骤S2包括以下步骤:S21:根据所述流媒体数据的文件大小选择所述文件块,并记录所述文件块的编号以及所述流媒体数据在所述文件块中的偏移量;S22:确定所述存储时间中的任一秒所对应的关键帧在所述流媒体数据中的偏移量;S23:创建时间索引文件,并以时间秒数建立秒索引信息;S24:将所述流媒体数据的存储时间转换为秒数,并将所述流媒体数据所选择的文件块编号、所述流媒体数据在所述文件块中的偏移量、所述关键帧在所述流媒体数据中的偏移量记录到所述秒数对应的秒索引信息中。
- 根据权利要求2所述的用于存储流媒体数据的方法,其特征在于,所述步骤S21具体包括:当所述流媒体数据的文件大小小于或等于所述文件块的剩余空间,则将所述流媒体数据存储在当前文件块中,当所述流媒体数据的文件大小大于所述文件块的剩余空间,则将所述流媒体数据存储在当前文件块的下一个文件块中。
- 根据权利要求2所述的用于存储流媒体数据的方法,其特征在于,所述步骤S22具体包括:判断任一秒所对应的所述流媒体数据是关键帧还是非关键帧,若是关键帧,则记录下所述关键帧在所述流媒体数据中的偏移量,若是非关键帧,则记录下所述非关键帧的前一个关键帧在所述流媒体数据中的偏移量。
- 根据权利要求2所述的用于存储流媒体数据的方法,其特征在于,所述时间索引文件以天为单位建立,初始化时所述秒索引信息标记为无效索引。
- 根据权利要求1所述的用于存储流媒体数据的方法,其特征在于,所述步骤S3包括以下步骤:S31:输入读取的开始日期和时间以及结束日期和时间,根据所述开始日期判断是否能获得对应的所述时间索引文件,若是,则进行下一步,若否,则结束;S32:将开始时间转换成第N秒,在开始日期所对应的所述时间索引文件中定位到第N秒的秒索引信息,并判断所述第N秒的秒索引信息是否为有效索引,若是,则进行下一步,若否,则结束;S33:读取所述第N秒的秒索引信息,判断所述第N秒的秒索引信息是否具有显示指定编号的文件块,若是,则进行下一步,若否,则结束;S34:在所述第N秒的秒索引信息中指定编号的所述文件块中,通过所述所述流媒体数据在所述文件块中的偏移量读取所述关键帧,通过所述关键帧在所述流媒体数据中的偏移量读取所述流媒体数据;S35:对下一秒重复S31-S34的步骤并截止到超出结束时间后结束。
- 根据权利要求1所述的用于存储流媒体数据的方法,其特征在于,所述文件块被配置为存储至少包含1个GOP大小的流媒体数据,所述流媒体数据以时间顺序存储在所述文件块中,被删除后的所述流媒体数据所对应的文件块位置标记为空闲状态。
- 一种用于存储流媒体数据的装置,其特征在于,包括:存储模块,被配置为利用预先创建的固定大小的文件块将存储空间填满;索引模块,被配置为选择合适的所述文件块来存储流媒体数据,同时将所选择的文件块标记为占用状态,并且建立所存储的流媒体数据与存储时间的秒数之间的索引;定位模块,被配置利用所述索引来定位所存储的流媒体数据所在的位置。
- 根据权利要求8所述的用于存储流媒体数据的装置,其特征在于,所述索引模块包括:编号索引模块,被配置为根据所述流媒体数据的文件大小选择所述文件块,并记录所述文件块的编号以及所述流媒体数据在所述文件块中的偏移量;关键帧索引模块,被配置为确定所述存储时间中的任一秒所对应的关键帧在所述流媒体数据中的偏移量;索引文件模块,被配置为创建时间索引文件,并以时间秒数建立秒索引信息;索引生成模块,被配置为将所述流媒体数据的存储时间转换为秒数,并将所述流媒体数据所选择的文件块编号、所述流媒体数据在所述文件块中的偏移量、所述关键帧在所述流媒体数据中的偏移量记录到所述秒数对应的秒索引信息中。
- 根据权利要求9所述的用于存储流媒体数据的装置,其特征在于,所述编号索引模块被配置为当所述流媒体数据的文件大小小于或等于所述文件块的剩余空间,则将所述流媒体数据存储在当前文件块中,当所述流媒体数据的文件大小大于所述文件块的剩余空间,则将所述流媒体数据存储在当前文件块的下一个文件块中。
- 根据权利要求9所述的用于存储流媒体数据的装置,其特征在于,所述关键帧索引模块被配置为判断任一秒所对应的所述流媒体数据是关键帧还是非关键帧,若是关键帧,则记录下所述关键帧在所述流媒体数据中的偏移量,若是非关键帧,则记录下所述非关键帧的前一个关键帧在所述流媒体数据中的偏移量。
- 根据权利要求9所述的用于存储流媒体数据的装置,其特征在于,所述时间索引文件以天为单位建立,初始化时所述秒索引信息标记为无效索引。
- 根据权利要求8所述的用于存储流媒体数据的装置,其特征在于,所述定位模块包括:时间索引文件定位模块,被配置为输入读取的开始日期和时间以及结束日期和时间,根据所述开始日期判断是否能获得对应的所述时间索引文件,若是,则进行下一步,若否,则结束;秒索引信息定位模块,被配置为将开始时间转换成第N秒,在开始日期所对应的所述时间索引文件中定位到第N秒的秒索引信息,并判断所述第N秒的秒索引信息是否为有效索引,若是,则进行下一步,若否,则结束;文件块定位模块,被配置为读取所述第N秒的秒索引信息,判断所述第N秒的秒索引信息是否具有显示指定编号的文件块,若是,则进行下一步,若否,则结束;关键帧定位模块,被配置为在所述第N秒的秒索引信息中指定编号的所述文件块中,通过所述流媒体数据在所述文件块中的偏移量读取所述关键帧,通过所述关键帧在所述流媒体数据中的偏移量读取所述流媒体数据;重复模块,被配置为对下一秒重复执行上述模块进行的步骤并截止到超出结束时间后结束。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-7中任一所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910407291.9A CN110262752B (zh) | 2019-05-16 | 2019-05-16 | 一种用于存储流媒体数据的方法、装置、存储介质 |
CN201910407291.9 | 2019-05-16 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020228128A1 true WO2020228128A1 (zh) | 2020-11-19 |
Family
ID=67913266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/096562 WO2020228128A1 (zh) | 2019-05-16 | 2019-07-18 | 一种用于存储流媒体数据的方法、装置、存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110262752B (zh) |
WO (1) | WO2020228128A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112699124B (zh) * | 2020-12-30 | 2022-05-17 | 罗普特科技集团股份有限公司 | 一种基于分布式多存储服务的循环存储方法和系统 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101539884A (zh) * | 2009-04-30 | 2009-09-23 | 杭州华三通信技术有限公司 | 数据存储方法和装置 |
CN103761056A (zh) * | 2014-01-17 | 2014-04-30 | 浪潮电子信息产业股份有限公司 | 一种视频监控应用中流式数据的存储方法 |
US20150071599A1 (en) * | 2013-09-12 | 2015-03-12 | International Business Machines Corporation | Storage space savings via partial digital stream deletion |
CN107229418A (zh) * | 2017-05-02 | 2017-10-03 | 浙江宇视科技有限公司 | 一种录像文件存储方法及装置 |
CN107707600A (zh) * | 2017-05-26 | 2018-02-16 | 贵州白山云科技有限公司 | 一种数据存储方法及装置 |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102685123B (zh) * | 2012-05-04 | 2015-04-15 | 杭州天视智能系统有限公司 | 一种基于云存储发布流媒体的装置、系统及方法 |
CN103064633B (zh) * | 2012-12-13 | 2016-12-21 | 广东威创视讯科技股份有限公司 | 一种数据存储方法及装置 |
CN103077200B (zh) * | 2012-12-27 | 2016-12-28 | 深圳市赛为智能股份有限公司 | 一种音视频存储索引方法及装置 |
CN103678638B (zh) * | 2013-12-20 | 2018-10-19 | 厦门雅迅网络股份有限公司 | 一种基于磁盘的对象缓存方法 |
CN104581436B (zh) * | 2015-01-28 | 2017-12-05 | 青岛海信宽带多媒体技术有限公司 | 一种视频帧定位方法及装置 |
CN107231581B (zh) * | 2016-03-25 | 2020-04-28 | 中国电信股份有限公司 | 用于视频播放的方法、系统及流媒体播放控制服务器 |
CN106303671B (zh) * | 2016-08-16 | 2019-04-16 | 任晋军 | 一种流媒体的播放方法 |
CN107205174B (zh) * | 2017-07-14 | 2019-12-10 | 广东工业大学 | 一种快速回放视频文件方法及系统 |
CN107870973B (zh) * | 2017-09-20 | 2021-11-26 | 广东东为信息技术有限公司 | 一种加快多路监控同时回放的文件存储系统 |
CN109327760B (zh) * | 2018-08-13 | 2019-12-31 | 北京中科睿芯科技有限公司 | 一种智能音响及其播放控制方法 |
CN109656474B (zh) * | 2018-11-15 | 2022-02-15 | 金蝶软件(中国)有限公司 | 数据存储方法、装置、计算机设备和存储介质 |
-
2019
- 2019-05-16 CN CN201910407291.9A patent/CN110262752B/zh active Active
- 2019-07-18 WO PCT/CN2019/096562 patent/WO2020228128A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101539884A (zh) * | 2009-04-30 | 2009-09-23 | 杭州华三通信技术有限公司 | 数据存储方法和装置 |
US20150071599A1 (en) * | 2013-09-12 | 2015-03-12 | International Business Machines Corporation | Storage space savings via partial digital stream deletion |
CN103761056A (zh) * | 2014-01-17 | 2014-04-30 | 浪潮电子信息产业股份有限公司 | 一种视频监控应用中流式数据的存储方法 |
CN107229418A (zh) * | 2017-05-02 | 2017-10-03 | 浙江宇视科技有限公司 | 一种录像文件存储方法及装置 |
CN107707600A (zh) * | 2017-05-26 | 2018-02-16 | 贵州白山云科技有限公司 | 一种数据存储方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN110262752A (zh) | 2019-09-20 |
CN110262752B (zh) | 2020-08-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2661863B1 (en) | Apparatus and method for transmitting live media content | |
WO2018076952A1 (zh) | 一种视频文件的存储、定位播放方法及装置 | |
CN102084338B (zh) | 用于多平台非线性视频编辑系统的新型媒体文件 | |
CN109840879B (zh) | 图像渲染方法、装置、计算机存储介质及终端 | |
JP2008243367A (ja) | 同報通信データを記録するための方法、および、装置 | |
JP2008065546A (ja) | データ転送システム、データ転送装置、ファイル形式変換装置、およびデータ転送方法 | |
US20220256226A1 (en) | Video data processing method, electronic device and computer-readable medium | |
WO2022110943A1 (zh) | 语音预览的方法及装置 | |
US20240126803A1 (en) | System and method for dynamically accessing media assets | |
CN102510519A (zh) | 流媒体数据的处理方法、播放方法以及装置 | |
WO2020228128A1 (zh) | 一种用于存储流媒体数据的方法、装置、存储介质 | |
CN113873288A (zh) | 在直播过程中生成回放的方法和装置 | |
US20160225407A1 (en) | Full fidelity remote video editing | |
CN113377770A (zh) | 一种数据处理方法和装置 | |
CN1241139C (zh) | 文件配送方法以及文件配送装置 | |
JP2007267356A (ja) | ファイル管理プログラム、サムネイル画像表示方法および動画再生装置 | |
CN114630143B (zh) | 视频流存储方法、装置、电子设备和存储介质 | |
WO2021227481A1 (zh) | 基于hls的文件管理方法、装置、电子设备和存储介质 | |
US20210117129A1 (en) | Method and Apparatus for Writing Data | |
US8200067B2 (en) | Processing of scalable compressed video data formats for nonlinear video editing systems | |
JP2008310889A (ja) | 記録再生装置 | |
KR20180039575A (ko) | 데이터의 관리 | |
CN115250266B (zh) | 视频处理方法及装置、流媒体设备及存储点播系统 | |
JP2004363825A (ja) | 記録再生装置、記録再生方法、その記録媒体およびプログラム | |
JP2003174608A (ja) | デジタル放送受信装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19928508 Country of ref document: EP Kind code of ref document: A1 |
|
DPE1 | Request for preliminary examination filed after expiration of 19th month from priority date (pct application filed from 20040101) | ||
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19928508 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19928508 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 30/05/2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19928508 Country of ref document: EP Kind code of ref document: A1 |