CN107509085A - The storage method and device of a kind of files in stream media - Google Patents
The storage method and device of a kind of files in stream media Download PDFInfo
- Publication number
- CN107509085A CN107509085A CN201710735490.3A CN201710735490A CN107509085A CN 107509085 A CN107509085 A CN 107509085A CN 201710735490 A CN201710735490 A CN 201710735490A CN 107509085 A CN107509085 A CN 107509085A
- Authority
- CN
- China
- Prior art keywords
- files
- stream media
- stored
- file
- memory block
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
- H04N21/23113—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving housekeeping operations for stored content, e.g. prioritizing content for deletion because of storage space restrictions
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a kind of storage method of files in stream media and device, this method includes:At least one memory block is pre-set, and determines memory capacity corresponding to each memory block;Obtain at least two files in stream media to be stored;According to memory capacity corresponding to each memory block, and the size of each files in stream media to be stored, described at least two files in stream media to be stored are merged into at least one big file;Each big file is stored into the memory block corresponding to one respectively.This programme can reduce the waste of storage resource.
Description
Technical field
The present invention relates to field of computer technology, the storage method and device of more particularly to a kind of files in stream media.
Background technology
HTTP Live Streaming (HLS) be Apple Inc. exploitation dynamic code rate adaptive technique, be mainly used in
Ios equipment (iPhone and iPad etc.) transmits HLS video flowings, including M3U8 files and TS files etc..
When server stores to the HLS video flowings received, TS files therein etc. are stored separately, for example, connecing
The HLS video flowings received include 100 TS files, and 100 memory blocks are provided with internal memory, then by this 100 TS files point
It is not stored in 100 memory blocks.
Because TS files are small documents, its size is typically far smaller than the capacity of memory block, therefore, above-mentioned to be stored separately
Mode, cause each memory block to have more residual memory space, cause the waste of storage resource.
The content of the invention
The embodiments of the invention provide a kind of storage method of files in stream media and device, the wave of storage resource can be reduced
Take.
In a first aspect, the embodiments of the invention provide a kind of storage method of files in stream media, including:
At least one memory block is pre-set, and determines memory capacity corresponding to each memory block;
Obtain at least two files in stream media to be stored;
According to memory capacity corresponding to each memory block, and the size of each files in stream media to be stored,
Described at least two files in stream media to be stored are merged into at least one big file;
Each big file is stored into the memory block corresponding to one respectively.
Preferably,
After at least two files in stream media to be stored of the acquisition, further comprise:
Determine whether the quantity of described at least two files in stream media to be stored is not more than predetermined threshold value, if it is, being
Each files in stream media distribution verification data to be stored;
It is described that described at least two files in stream media to be stored are merged into at least one big file, including:
By verification data corresponding to each files in stream media difference to be stored, and each Streaming Media to be stored
File merges, and generates at least one big file.
Preferably,
It is described each big file is stored into the memory block corresponding to one respectively after, further bag
Include:
Each memory block for being stored with the big file, is performed both by:
The big file of storage in the storage address of the memory block, and the memory block includes each
Verification data corresponding to files in stream media difference, index relative corresponding to each files in stream media difference is built respectively;
According to the index relative, each files in stream media is read out.
Preferably,
When the quantity of described at least two files in stream media to be stored is more than the predetermined threshold value,
What the big file of the storage in the storage address according to the memory block, and the memory block included
Verification data corresponding to each files in stream media difference, building each files in stream media respectively, corresponding index closes respectively
System, including:
According to the storage address of the memory block, the big file for determining to store in the memory block includes each
Store path corresponding to files in stream media difference;
According to the store path, the verification data is distributed for each files in stream media;
According to the verification data and the store path corresponding to each files in stream media difference, each institute is built
State index relative corresponding to files in stream media difference.
Preferably,
It is described each files in stream media to be read out according to the index relative, including:
For files in stream media each described, it is performed both by:
The storage address according to corresponding to the files in stream media, extracts the files in stream media;
The verification data included according to the index relative, it is determined that the files in stream media of extraction whether there is
Damage information;
When the files in stream media exist damage information when, to it is described damage information repair, and read reparation after
The files in stream media.
Preferably,
Further comprise:Stored in designated storage area and back up file corresponding to each files in stream media;
Further comprise:Configuration file is built, the configuration file includes:Corresponding at least one damage information difference
Classes of failures;
It is described when damage information be present in the files in stream media, the damage information is repaired, and reads reparation
The files in stream media afterwards, including:
According to the configuration file, classes of failures corresponding to the damage information are determined;
When the classes of failures are the first classes of failures, to it is described damage information repair, and read reparation after
The files in stream media;
When the classes of failures are the second classes of failures, the files in stream media pair is obtained from the designated storage area
The backup file answered;
The files in stream media is substituted using the backup file, and reads the backup file after substituting.
Second aspect, the embodiments of the invention provide a kind of storage device of files in stream media, including:Setting unit, conjunction
And unit and memory cell;Wherein,
The setting unit, for pre-setting at least one memory block, and determine to deposit corresponding to each memory block
Store up capacity;
The combining unit, for obtaining at least two files in stream media to be stored;It is corresponding according to each memory block
Memory capacity, and the size of each files in stream media to be stored, by described at least two files in stream media to be stored
Merge at least one big file;
The memory cell, for each big file to be stored into the memory block corresponding to one respectively.
Preferably,
The combining unit, for determining the quantity of described at least two files in stream media to be stored whether no more than default
Threshold value, if it is, distributing verification data for each files in stream media to be stored;And by each Streaming Media to be stored
Verification data corresponding to file difference, and each files in stream media to be stored merge, and generation is described at least one
Big file.
Preferably,
Further comprise:Reading unit;Wherein,
The reading unit, for each memory block for being stored with the big file, it is performed both by:According to described
Each files in stream media that the big file of storage in the storage address of memory block, and the memory block includes is right respectively
The verification data answered, index relative corresponding to each files in stream media difference is built respectively;And according to the index relative,
Each files in stream media is read out.
Preferably,
When the quantity of described at least two files in stream media to be stored is more than the predetermined threshold value, the reading unit,
For the storage address according to the memory block, each stream matchmaker that the big file stored in the memory block includes is determined
Store path corresponding to body file difference;According to the store path, the check number is distributed for each files in stream media
According to;According to the verification data and the store path corresponding to each files in stream media difference, each stream is built
Index relative corresponding to media file difference;
Preferably,
Further comprise:Backup units and construction unit;Wherein,
The backup units, file is backed up corresponding to each files in stream media for being stored in designated storage area;
The construction unit, for building configuration file, the configuration file includes:At least one damage information difference
Corresponding classes of failures;
The reading unit, for for files in stream media each described, being performed both by:According to the files in stream media pair
The storage address answered, extracts the files in stream media;The verification data included according to the index relative, it is determined that
The files in stream media of extraction is with the presence or absence of damage information;When the files in stream media has damage information, it is determined that described
Damage classes of failures corresponding to information;When the classes of failures are the first classes of failures, the damage information is repaired,
And read the files in stream media after repairing;When the classes of failures are the second classes of failures, from the designated storage area
Domain obtains backup file corresponding to the files in stream media;The files in stream media is substituted using the backup file, and is read
The backup file after replacement.
The embodiments of the invention provide a kind of storage method of files in stream media and device, waits to deposit getting at least two
After storing up files in stream media (TS files etc.), according to the memory capacity of default memory block, by each files in stream media to be stored
Big file is merged into, then stores the big file after merging into corresponding memory block.Thus, will be each less to be stored
Files in stream media merges into big file, the size of the big file of merging generation is met the memory capacity of memory block, reduces each
The residual memory space of memory block, so as to reduce the waste of storage resource.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 is a kind of flow chart of the storage method for files in stream media that one embodiment of the invention provides;
Fig. 2 is a kind of flow chart of the storage method for files in stream media that another embodiment of the present invention provides;
Fig. 3 is a kind of structural representation of the storage device for files in stream media that one embodiment of the invention provides;
Fig. 4 is a kind of structural representation of the storage device for files in stream media that another embodiment of the present invention provides.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiments of the invention provide a kind of storage method of files in stream media, this method can include with
Lower step:
Step 101:At least one memory block is pre-set, and determines memory capacity corresponding to each memory block;
Step 102:Obtain at least two files in stream media to be stored;
Step 103:According to memory capacity corresponding to each memory block, and each files in stream media to be stored
Size, described at least two files in stream media to be stored are merged into at least one big file;
Step 104:Each big file is stored into the memory block corresponding to one respectively.
In above-described embodiment, after at least two files in stream media (TS files etc.) to be stored are got, according to default
Memory block memory capacity, each files in stream media to be stored is merged into big file, then deposited the big file after merging
Storage is into corresponding memory block.Thus, each less files in stream media to be stored is merged into big file, makes what merging generated
The size of big file meets the memory capacity of memory block, reduces the residual memory space of each memory block, so as to reduce storage
The waste of resource.
In one embodiment of the invention, after step 102, it may further include:
Determine whether the quantity of described at least two files in stream media to be stored is not more than predetermined threshold value, if it is, being
Each files in stream media distribution verification data to be stored;
The embodiment of step 103, it can include:
By verification data corresponding to each files in stream media difference to be stored, and each Streaming Media to be stored
File merges, and generates at least one big file.
Herein, when the files in stream media to be stored received is not more than predetermined threshold value, by taking HLS video flowings as an example, when
When the TS files received in unit interval are not more than predetermined threshold value, the store tasks of system do not weigh, i.e., system is more idle, now
A TS file is often received, then is verification data corresponding to TS files distribution, then by each TS files and its corresponding
Verification data, which merges, forms big file.
In one embodiment of the invention, after step 104, it may further include:
Each memory block for being stored with the big file, is performed both by:
The big file of storage in the storage address of the memory block, and the memory block includes each
Verification data corresponding to files in stream media difference, index relative corresponding to each files in stream media difference is built respectively;
According to the index relative, each files in stream media is read out.
The storage address of the memory block stored according to each Streaming Media, and its corresponding verification data, structure are each
Index relative corresponding to files in stream media, recorded in detail in this index relative each files in stream media storage location and its
Verification data.Also, this index relative is expansible, it can utilize free time and space automatically, when storing or reading idle
The information such as verification data are extended, and when the memory space anxiety of memory block, it can delete some growth daties, such as stream matchmaker
Empty bag etc. corresponding to body file.Thus, can each stream of fast positioning by index relative corresponding to each files in stream media difference
The storage location of media file, mitigate the complexity of system index, be easy to system administration.
In one embodiment of the invention, when the quantity of described at least two files in stream media to be stored is more than the default threshold
During value, the big file of the storage in the storage address according to the memory block, and the memory block includes each
Verification data corresponding to individual files in stream media difference, index relative corresponding to each files in stream media difference is built respectively,
Including:
According to the storage address of the memory block, the big file for determining to store in the memory block includes each
Store path corresponding to files in stream media difference;
According to the store path, the verification data is distributed for each files in stream media;
According to the verification data and the store path corresponding to each files in stream media difference, each institute is built
State index relative corresponding to files in stream media difference.
By taking HLS video flowings as an example, when the interior TS files received are more than predetermined threshold value between unit, the storage of system is appointed
It is engaged in heavier, and system is in busy period, after the TS files received first now are merged into storage, determines and records each
The store path of TS files.After high-volume is stored in TS files, system can typically enter one section of idle periods, now further according to each
Store path corresponding to TS files difference, verification data is distributed for each TS files, wrapped with carrying out video analysis and record sky
With the position such as I frames, it thus can be easy to treat stored stream media file in time and stored, then carry out point of verification data again
Match somebody with somebody, so as to effective management system resource.
It is described according to the index relative in one embodiment of the invention, each files in stream media is read out,
Including:
For files in stream media each described, it is performed both by:
The storage address according to corresponding to the files in stream media, extracts the files in stream media;
The verification data included according to the index relative, it is determined that the files in stream media of extraction whether there is
Damage information;
When the files in stream media exist damage information when, to it is described damage information repair, and read reparation after
The files in stream media.
When reading each files in stream media of storage, the verification data according to corresponding to being distinguished each files in stream media, really
Streaming media file is with the presence or absence of damage information, if in the presence of according to the classes of failures for the damage information determined, to stream matchmaker
Body file is repaired.
Specifically, in one embodiment of the invention, this method may further include:Stored in designated storage area each
Backup file corresponding to the files in stream media;
Configuration file is built, the configuration file includes:Classes of failures corresponding at least one damage information difference;
It is described when damage information be present in the files in stream media, the damage information is repaired, and reads reparation
The files in stream media afterwards, including:
According to the configuration file, classes of failures corresponding to the damage information are determined;
When the classes of failures are the first classes of failures, to it is described damage information repair, and read reparation after
The files in stream media;
When the classes of failures are the second classes of failures, the files in stream media pair is obtained from the designated storage area
The backup file answered;
The files in stream media is substituted using the backup file, and reads the backup file after substituting.
Herein, after the files in stream media for determining to store has damage information, determine to damage corresponding to the damage data
When rank is first level, illustrate that the video file damaged condition is lighter, only part reparation need to be carried out, now only for damage
Bad information carries out part reparation, and reads the files in stream media after repairing.When classes of failures are second level, that is, illustrate the video
Stream file damage is more serious, now backs up file using corresponding to the video stream file to prestore, and what directly replacement had damaged regards
Frequency stream file, complete the complete reparation of the video stream file.Thus the damage that each video stream file occurs can be determined in time
Information, and repaired in time, be advantageous to the reading of video stream file, ensure the normal play of video stream file.
It is noted that backup file corresponding to each video stream file can be stored in another service system,
The service system of backup file and the configuration of this service system and store path all same are stored, then is so that the backup of storage
File and the video stream file are completely general, when being damaged so as to most quickly finish video stream file, back up the replacement of file
Operation.
In addition, when damage information reparation, each video stream file pair can be utilized according to configuration and time demand
The I number of frames answered, if sky bag etc. calculates reparation priority, is then repaired according to corresponding to each video stream file preferential
Level, repairs to each video stream file, thus can repair most important video section as much as possible in special time, enter
One step is advantageous to the reading of video stream file.
As shown in Fig. 2 the embodiments of the invention provide a kind of storage method of files in stream media, this method can include with
Lower step:
Step 201:At least one memory block is pre-set, and determines memory capacity corresponding to each memory block.
For example, pre-setting two memory blocks A and B, the memory capacity of each memory block is 10G.
Step 202:Obtain at least two files in stream media to be stored.
By taking HLS video flowings as an example, 20 TS files to be stored are received within the unit interval, the size of each TS files is
0.8G。
Step 203:Determine whether the quantity of described at least two files in stream media to be stored is not more than predetermined threshold value, if
It is then to distribute verification data for each files in stream media to be stored.
For example, predetermined threshold value is 50, then the quantity of the TS files received is less than predetermined threshold value, is now each TS files
Distribute verification data.
Step 204:According to memory capacity corresponding to each memory block, and each files in stream media to be stored
Size, by each files in stream media to be stored respectively corresponding to verification data, and each Streaming Media to be stored
File is merged, and generates at least one big file, and each big file is stored to described corresponding to one respectively and deposited
Store up in block.
Herein, the memory capacity of each memory block is 10G, and the size of each TS files is 0.8G, if ignoring check number
According to size, then first receive 12 TS files can be merged according to the time sequencing of reception, generation size is 9.6G
Big file, store into memory space A, then by after remaining TS Piece file mergences, store into memory space B.
In addition, when the quantity of files in stream media to be stored is more than the predetermined threshold value, the TS files that will first can receive
After merging storage, the store path of each TS files is determined and recorded.After high-volume is stored in TS files, system typically can
Into one section of idle periods, now further according to store path corresponding to each TS files difference, check number is distributed for each TS files
According to.
Step 205:Each memory block for being stored with the big file, is performed both by:According to the memory block
Each files in stream media that the big file of storage in storage address, and the memory block includes is corresponding respectively to be verified
Data, index relative corresponding to each files in stream media difference is built respectively.
Herein, recorded in detail in index relative corresponding to each TS files each files in stream media storage location and
Its verification data, by each files in stream media respectively corresponding to index relative, can fast positioning each files in stream media deposit
Storage space is put, and is mitigated the complexity of system index, is easy to system administration.
Step 206:For files in stream media each described, it is performed both by:The index according to corresponding to the files in stream media
The storage address in relation, extracts the files in stream media.
Step 207:The verification data included according to the index relative, it is determined that the files in stream media of extraction
With the presence or absence of damage information, when damage information be present, according to default configuration file, determine to damage corresponding to the damage information
Bad rank.
Step 208:When the classes of failures are the first classes of failures, the damage information is repaired, and reads
The files in stream media after reparation.
After determining the files in stream media of storage there is damage information, determine classes of failures corresponding to the damage data for the
During one rank, illustrate that the video file damaged condition is lighter, only need to carry out part reparation, now enter only for damage information
Row part is repaired, and reads the files in stream media after repairing.
Step 209:When the classes of failures are the second classes of failures, the stream matchmaker is obtained from the designated storage area
Backup file corresponding to body file, and the files in stream media is substituted using the backup file to prestore, and read the institute after substituting
State backup file.
When classes of failures are second level, that is, illustrate that video stream file damage is more serious, now regarded using this to prestore
Backup file, directly replaces the video stream file damaged, completes the complete reparation of the video stream file corresponding to frequency stream file.
In addition, when the files in stream media received is live class media file, media file itself is larger, can directly deposit
Storage is into memory block.But flower screen, sound caused by various factors draw the problems such as asynchronous in order to avoid frame is imperfect etc., it is necessary to dock
The media file received is analyzed in real time, and file cutting mark is done before key frame.Thus it can be marked and built according to cutting
The index relative of the media file, and when reading the media file, broken parts therein are repaired, to ensure to regard
The normal play of frequency.
As shown in figure 3, the embodiments of the invention provide a kind of storage device of files in stream media, including:Setting unit
301st, combining unit 302 and memory cell 303;Wherein,
The setting unit 301, for pre-setting at least one memory block, and determine corresponding to each memory block
Memory capacity;
The combining unit 302, for obtaining at least two files in stream media to be stored;According to each memory block pair
The memory capacity answered, and the size of each files in stream media to be stored, by described at least two Streaming Media texts to be stored
Part merges at least one big file;
The memory cell 303, for each big file to be stored into the memory block corresponding to one respectively.
In one embodiment of the invention, the combining unit 302, for determining described at least two Streaming Media texts to be stored
Whether the quantity of part is not more than predetermined threshold value, if it is, distributing verification data for each files in stream media to be stored;And
Verification data corresponding to each files in stream media difference to be stored, and each files in stream media to be stored are carried out
Merge, generate at least one big file.
As shown in figure 4, in one embodiment of the invention, the device may further include:Reading unit 401;Wherein,
The reading unit 401, for each memory block for being stored with the big file, it is performed both by:According to
Each files in stream media that the big file of storage in the storage address of the memory block, and the memory block includes point
Not corresponding verification data, index relative corresponding to each files in stream media difference is built respectively;And according to the index
Relation, each files in stream media is read out.
In one embodiment of the invention, when the quantity of described at least two files in stream media to be stored is more than the default threshold
During value, the reading unit 401, for the storage address according to the memory block, determine to store in the memory block described
Store path corresponding to each files in stream media difference that big file includes;It is each stream according to the store path
Media file distributes the verification data;The corresponding verification data and described deposited respectively according to each files in stream media
Store up path, index relative corresponding to each files in stream media difference of structure.
In one embodiment of the invention, the device may further include:Backup units and construction unit;Wherein,
The backup units, file is backed up corresponding to each files in stream media for being stored in designated storage area;
The construction unit, for building configuration file, the configuration file includes:At least one damage information difference
Corresponding classes of failures;
The reading unit, for for files in stream media each described, being performed both by:According to the files in stream media pair
The storage address answered, extracts the files in stream media;The verification data included according to the index relative, it is determined that
The files in stream media of extraction is with the presence or absence of damage information;When the files in stream media has damage information, it is determined that described
Damage classes of failures corresponding to information;When the classes of failures are the first classes of failures, the damage information is repaired,
And read the files in stream media after repairing;When the classes of failures are the second classes of failures, from the designated storage area
Domain obtains backup file corresponding to the files in stream media;The files in stream media is substituted using the backup file, and is read
The backup file after replacement.
The contents such as the information exchange between each unit, implementation procedure in said apparatus, due to implementing with the inventive method
Example is based on same design, and particular content can be found in the narration in the inventive method embodiment, and here is omitted.
Present invention also offers a kind of computer-readable recording medium, including execute instruction, when described in the computing device of storage control
During execute instruction, the storage control performs the method that any of the above-described embodiment of the present invention provides.
In addition, present invention also offers a kind of storage control, including:Processor, memory and bus;The memory
For storing execute instruction, the processor is connected with the memory by the bus, when the storage control is run
When, the execute instruction of memory storage described in the computing device, so that the storage control is performed in the present invention
The method that any embodiment offer is provided.
In summary, each embodiment of the invention at least has the advantages that:
1st, in embodiments of the present invention, after at least two files in stream media to be stored are got, deposited according to default
Store up block memory capacity, each files in stream media to be stored is merged into big file, then by the big file after merging store to
In corresponding memory block.Thus, each less files in stream media to be stored is merged into big file, the big text for generating merging
The size of part meets the memory capacity of memory block, reduces the residual memory space of each memory block, so as to reduce storage resource
Waste.
2nd, in embodiments of the present invention, it is each when the files in stream media to be stored received is not more than predetermined threshold value
Files in stream media distributes verification data, and each files in stream media and its corresponding verification data then are merged into big file.So
Afterwards according to the storage location of each files in stream media and its corresponding verification data, index relative is built.Pass through each Streaming Media
File respectively corresponding to index relative, can each files in stream media of fast positioning storage location, mitigate the complexity of system index
Degree, is easy to system administration.
3rd, in embodiments of the present invention, when the quantity of the files in stream media to be stored received is more than the predetermined threshold value
When, after the files in stream media received first is merged into storage, determine and record the store path of each files in stream media, Ran Hou
System idle periods, further according to store path, verification data is distributed for each files in stream media, thus can be easy in time to be stored
Files in stream media is stored, and then carries out the distribution of verification data again, so as to effective management system resource.
4th, in embodiments of the present invention, when reading each files in stream media of storage, according to each files in stream media point
Not corresponding verification data, files in stream media is determined with the presence or absence of damage information, if in the presence of according to the damage information determined
Classes of failures, the files in stream media is repaired.When classes of failures are lighter, now part is carried out only for damage information
Repair, and read the files in stream media after repairing.When damaging more serious, backup corresponding to the video stream file to prestore is utilized
File, the video stream file damaged directly is replaced, completes the complete reparation of the video stream file.Thus can determine in time each
The damage information that individual video stream file occurs, and repaired in time, be advantageous to the reading of video stream file, ensure video flowing text
The normal play of part.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation makes a distinction with another entity or operation, and not necessarily require or imply and exist between these entities or operation
Any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-
It is exclusive to include, so that process, method, article or equipment including a series of elements not only include those key elements,
But also the other element including being not expressly set out, or also include solid by this process, method, article or equipment
Some key elements.In the absence of more restrictions, the key element limited by sentence " including one ", is not arranged
Except other identical factor in the process including the key element, method, article or equipment being also present.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
Programmed instruction related hardware is completed, and foregoing program can be stored in computer-readable storage medium, the program
Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light
Disk etc. is various can be with the medium of store program codes.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made within the spirit and principles of the invention,
Equivalent substitution, improvement etc., are all contained in protection scope of the present invention.
Claims (10)
- A kind of 1. storage method of files in stream media, it is characterised in that including:At least one memory block is pre-set, and determines memory capacity corresponding to each memory block;Obtain at least two files in stream media to be stored;According to memory capacity corresponding to each memory block, and the size of each files in stream media to be stored, by institute State at least two files in stream media to be stored and merge at least one big file;Each big file is stored into the memory block corresponding to one respectively.
- 2. according to the method for claim 1, it is characterised in thatAfter at least two files in stream media to be stored of the acquisition, further comprise:Determine whether the quantity of described at least two files in stream media to be stored is not more than predetermined threshold value, if it is, being each The files in stream media distribution verification data to be stored;It is described that described at least two files in stream media to be stored are merged into at least one big file, including:By verification data corresponding to each files in stream media difference to be stored, and each files in stream media to be stored Merge, generate at least one big file.
- 3. according to the method for claim 2, it is characterised in thatIt is described each big file is stored into the memory block corresponding to one respectively after, further comprise:Each memory block for being stored with the big file, is performed both by:Each stream matchmaker that the big file of storage in the storage address of the memory block, and the memory block includes Verification data corresponding to body file difference, index relative corresponding to each files in stream media difference is built respectively;According to the index relative, each files in stream media is read out.
- 4. according to the method for claim 3, it is characterised in thatWhen the quantity of described at least two files in stream media to be stored is more than the predetermined threshold value,The big file of storage in the storage address according to the memory block, and the memory block includes each Verification data corresponding to files in stream media difference, index relative corresponding to each files in stream media difference, bag are built respectively Include:According to the storage address of the memory block, each stream matchmaker that the big file stored in the memory block includes is determined Store path corresponding to body file difference;According to the store path, the verification data is distributed for each files in stream media;According to the verification data and the store path corresponding to each files in stream media difference, each stream is built Index relative corresponding to media file difference.
- 5. according to the method for claim 3, it is characterised in thatIt is described each files in stream media to be read out according to the index relative, including:For files in stream media each described, it is performed both by:The storage address according to corresponding to the files in stream media, extracts the files in stream media;The verification data included according to the index relative, it is determined that the files in stream media of extraction is with the presence or absence of damage Information;When the files in stream media has damage information, the damage information is repaired, and reads described after repairing Files in stream media.
- 6. according to the method for claim 5, it is characterised in thatFurther comprise:Stored in designated storage area and back up file corresponding to each files in stream media;Further comprise:Configuration file is built, the configuration file includes:At least one damage information is corresponding respectively to be damaged Rank;It is described when the files in stream media exist damage information when, to it is described damage information repair, and read reparation after The files in stream media, including:According to the configuration file, classes of failures corresponding to the damage information are determined;When the classes of failures are the first classes of failures, the damage information is repaired, and reads described after repairing Files in stream media;When the classes of failures are the second classes of failures, obtained from the designated storage area corresponding to the files in stream media Backup file;The files in stream media is substituted using the backup file, and reads the backup file after substituting.
- A kind of 7. storage device of files in stream media, it is characterised in that including:Setting unit, combining unit and memory cell;Its In,The setting unit, for pre-setting at least one memory block, and determine that storage corresponding to each memory block is held Amount;The combining unit, for obtaining at least two files in stream media to be stored;Deposited according to corresponding to each memory block Capacity, and the size of each files in stream media to be stored are stored up, described at least two files in stream media to be stored are merged For at least one big file;The memory cell, for each big file to be stored into the memory block corresponding to one respectively.
- 8. device according to claim 7, it is characterised in thatThe combining unit, for determining the quantity of described at least two files in stream media to be stored whether no more than default threshold Value, if it is, distributing verification data for each files in stream media to be stored;It is and each Streaming Media to be stored is literary Verification data corresponding to part difference, and each files in stream media to be stored merge, and generation is described at least one big File.
- 9. device according to claim 8, it is characterised in thatFurther comprise:Reading unit;Wherein,The reading unit, for each memory block for being stored with the big file, it is performed both by:According to the storage Corresponding to each files in stream media difference that the big file of storage in the storage address of block, and the memory block includes Verification data, index relative corresponding to each files in stream media difference is built respectively;And according to the index relative, to each The individual files in stream media is read out.
- 10. device according to claim 9, it is characterised in thatWhen the quantity of described at least two files in stream media to be stored is more than the predetermined threshold value, the reading unit, it is used for According to the storage address of the memory block, each Streaming Media text that the big file stored in the memory block includes is determined Store path corresponding to part difference;According to the store path, the verification data is distributed for each files in stream media;Root According to the verification data and the store path corresponding to each files in stream media difference, each Streaming Media text of structure Index relative corresponding to part difference;And/orFurther comprise:Backup units and construction unit;Wherein,The backup units, file is backed up corresponding to each files in stream media for being stored in designated storage area;The construction unit, for building configuration file, the configuration file includes:At least one damage information corresponds to respectively Classes of failures;The reading unit, for for files in stream media each described, being performed both by:According to corresponding to the files in stream media The storage address, extract the files in stream media;The verification data included according to the index relative, it is determined that extraction The files in stream media with the presence or absence of damage information;When the files in stream media has damage information, the damage is determined Classes of failures corresponding to information;When the classes of failures are the first classes of failures, the damage information is repaired, and reads Take the files in stream media after repairing;When the classes of failures are the second classes of failures, obtained from the designated storage area Take backup file corresponding to the files in stream media;The files in stream media is substituted using the backup file, and reads replacement The backup file afterwards.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710735490.3A CN107509085B (en) | 2017-08-24 | 2017-08-24 | Storage method and device of streaming media file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710735490.3A CN107509085B (en) | 2017-08-24 | 2017-08-24 | Storage method and device of streaming media file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107509085A true CN107509085A (en) | 2017-12-22 |
CN107509085B CN107509085B (en) | 2019-12-24 |
Family
ID=60692756
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710735490.3A Active CN107509085B (en) | 2017-08-24 | 2017-08-24 | Storage method and device of streaming media file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107509085B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825694A (en) * | 2019-11-01 | 2020-02-21 | 北京锐安科技有限公司 | Data processing method, device, equipment and storage medium |
CN117892293A (en) * | 2023-12-28 | 2024-04-16 | 合肥君行技术有限公司 | Security monitoring system based on Internet |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102281121A (en) * | 2010-06-13 | 2011-12-14 | 中兴通讯股份有限公司 | Method, equipment and system for transmitting and verifying data file |
CN103064752A (en) * | 2011-09-27 | 2013-04-24 | 奇智软件(北京)有限公司 | Method and device of repairing document |
CN103488685A (en) * | 2013-09-02 | 2014-01-01 | 上海网达软件股份有限公司 | Fragmented-file storage method based on distributed storage system |
CN104462563A (en) * | 2014-12-26 | 2015-03-25 | 浙江宇视科技有限公司 | File storage method and system |
CN104572670A (en) * | 2013-10-15 | 2015-04-29 | 方正国际软件(北京)有限公司 | Small file storage, query and deletion method and system |
CN105224416A (en) * | 2014-05-28 | 2016-01-06 | 联发科技(新加坡)私人有限公司 | Restorative procedure and related electronic device |
CN105956183A (en) * | 2016-05-30 | 2016-09-21 | 广东电网有限责任公司电力调度控制中心 | Method and system for multi-stage optimization storage of a lot of small files in distributed database |
WO2016187831A1 (en) * | 2015-05-27 | 2016-12-01 | 华为技术有限公司 | Method and device for accessing file, and storage system |
CN106776146A (en) * | 2016-12-29 | 2017-05-31 | 华为技术有限公司 | A kind of data verification method, apparatus and system |
-
2017
- 2017-08-24 CN CN201710735490.3A patent/CN107509085B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102281121A (en) * | 2010-06-13 | 2011-12-14 | 中兴通讯股份有限公司 | Method, equipment and system for transmitting and verifying data file |
CN103064752A (en) * | 2011-09-27 | 2013-04-24 | 奇智软件(北京)有限公司 | Method and device of repairing document |
CN103488685A (en) * | 2013-09-02 | 2014-01-01 | 上海网达软件股份有限公司 | Fragmented-file storage method based on distributed storage system |
CN104572670A (en) * | 2013-10-15 | 2015-04-29 | 方正国际软件(北京)有限公司 | Small file storage, query and deletion method and system |
CN105224416A (en) * | 2014-05-28 | 2016-01-06 | 联发科技(新加坡)私人有限公司 | Restorative procedure and related electronic device |
CN104462563A (en) * | 2014-12-26 | 2015-03-25 | 浙江宇视科技有限公司 | File storage method and system |
WO2016187831A1 (en) * | 2015-05-27 | 2016-12-01 | 华为技术有限公司 | Method and device for accessing file, and storage system |
CN105956183A (en) * | 2016-05-30 | 2016-09-21 | 广东电网有限责任公司电力调度控制中心 | Method and system for multi-stage optimization storage of a lot of small files in distributed database |
CN106776146A (en) * | 2016-12-29 | 2017-05-31 | 华为技术有限公司 | A kind of data verification method, apparatus and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825694A (en) * | 2019-11-01 | 2020-02-21 | 北京锐安科技有限公司 | Data processing method, device, equipment and storage medium |
CN117892293A (en) * | 2023-12-28 | 2024-04-16 | 合肥君行技术有限公司 | Security monitoring system based on Internet |
Also Published As
Publication number | Publication date |
---|---|
CN107509085B (en) | 2019-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107436725A (en) | A kind of data are write, read method, apparatus and distributed objects storage cluster | |
CN105049260B (en) | Blog management method and device | |
CN106708711B (en) | log information output control method and device | |
CN104246767A (en) | Telemetry system for a cloud synchronization system | |
CN107870727A (en) | Method and apparatus for data storage | |
CN109447790A (en) | A kind of matching process, device and the equipment of debit request and channels to fund | |
CN106599292A (en) | Method and system for storing real-time video data and image data | |
CN104268291A (en) | Data consistency processing method and system | |
CN110321339A (en) | A kind of data migration method, device, equipment and storage medium | |
CN104967807B (en) | Caching method and apparatus | |
CN106686095A (en) | Data storage method and device based on erasure code technology | |
CN107590144A (en) | A kind of file memory method and terminal | |
CN104484131A (en) | Device and corresponding method for processing data of multi-disk servers | |
CN107509085A (en) | The storage method and device of a kind of files in stream media | |
CN110297743B (en) | Load testing method and device and storage medium | |
CN109284492B (en) | Method and device for generating notification document | |
WO2019033660A1 (en) | Method and apparatus for determining associated teaching information, teaching device, and storage medium | |
CN104636218B (en) | Data reconstruction method and device | |
CN104137100B (en) | Data library device, program and data processing method | |
CN105095352B (en) | Data processing method and device applied to distributed system | |
CN107465944A (en) | The gray scale delivery system and method for a kind of IPTV Content Management | |
CN106844236A (en) | The date storage method and device of terminal device | |
MY139867A (en) | Information storage medium for storing metadata supporting multiple languages, and systems and methods of processing metadata | |
CN109947712A (en) | Automatically merge method, system, equipment and the medium of file in Computational frame | |
CN106339473A (en) | Method and device for copying file |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210210 Address after: 250100 Inspur science and Technology Park, 1036 Inspur Road, hi tech Zone, Jinan City, Shandong Province Patentee after: Inspur Software Technology Co.,Ltd. Address before: 250100 First Floor of R&D Building 2877 Kehang Road, Sun Village Town, Jinan High-tech Zone, Shandong Province Patentee before: SHANDONG INSPUR BUSINESS SYSTEM Co.,Ltd. |
|
TR01 | Transfer of patent right |