The processing method and processing device of historical record
Technical field
The present embodiments relate to technical field of information processing, particularly relate to the process side of a kind of historical record
Method and device.
Background technology
Along with the development of the information processing technology, great majority application can record the visit of user automatically
Asking history, such as web browser, audio or video player, conventional office software etc. all have
Preserve the function of historical record, once accessed so that user quickly can be found by historical record
Content.
The method of existing preservation historical record, it is common that each application individually preserves the history note of self
Record, such as, web browser can preserve the relevant of the webpage that user clicked in web browser
Information, video player A can preserve the phase of the video that user was watched by video player A
Pass information, video player B can preserve the video that user watched by video player B
Relevant information.But, when user requires to look up certain video information watched, and don't remember
When watching this video in which player, user needs to open each video player respectively and looks into
Look for, cause user to search the inefficient of historical record.
Summary of the invention
The embodiment of the present invention provides the processing method and processing device of a kind of historical record, in order to solve prior art
The inefficient defect of middle lookup historical record, improves the efficiency searching historical record.
The embodiment of the present invention provides the processing method of a kind of historical record, including:
Receive the call request from application program;Wherein, described call request includes: content of multimedia
Address information;
According to described address information, obtain and play described content of multimedia;
During playing described content of multimedia, preserve the content of multimedia that described application program is corresponding
The historical record play.
The embodiment of the present invention provides the processing means of a kind of historical record, including:
First request receiver module, for receiving the call request from application program;Wherein, described tune
Include with request: the address information of content of multimedia;
Content obtaining module, for according to described address information, obtains and plays described content of multimedia;
Record preserves module, for, during playing described content of multimedia, preserving described application
The historical record of the content of multimedia broadcasting that program is corresponding.
The processing method and processing device of historical record that the embodiment of the present invention provides, according to receive from should
By the call request of program, obtain and play described content of multimedia;Playing described content of multimedia
During, preserve the historical record that content of multimedia corresponding to described application program is play.Pass through the present invention
Embodiment, can be managed collectively the call request of various application programs, and preserves application program
The historical record of corresponding multimedia so that different application is called player and carried out multimedia and broadcast
The historical record put can be unified to preserve and management, and user can inquire different answering by this historical record
The historical record play with the content of multimedia that program is corresponding, such that it is able to improve the effect of query history record
Rate.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality
Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that under,
Accompanying drawing during face describes is some embodiments of the present invention, for those of ordinary skill in the art,
On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 shows the flow chart of steps of the processing method embodiment one of a kind of historical record of the present invention;
Fig. 2 shows the flow chart of steps of the processing method embodiment two of a kind of historical record of the present invention;
Fig. 3 shows the flow chart of steps of the processing method embodiment three of a kind of historical record of the present invention;
And
Fig. 4 shows the structured flowchart of the processing means embodiment of a kind of historical record of the present invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
Embodiment one
With reference to Fig. 1, it is shown that the step stream of the processing method embodiment one of a kind of historical record of the present invention
Cheng Tu, specifically may include that
Step 101, receive from the call request of application program;Wherein, described call request includes:
The address information of content of multimedia;
The embodiment of the present invention can apply to mobile phone, panel computer etc. to be had the terminal of SOS and sets
In Bei, record each APP (application program, Application) for unification and call the many matchmakers of player plays
The internal historical record holding generation, thus improve the efficiency of query history record.The embodiment of the present invention is main
Illustrate as a example by the terminal unit with Android system, there is the terminal of other operating systems such as IOS
Equipment is cross-referenced.
In one preferred embodiment of the invention, described reception is from the step of the call request of application program
Suddenly, specifically may include that
The call request from application program is received by common interface MediaPlayer.java.
For Android system, the tupe of content of multimedia is usually, the system of operating system
Player can provide interface to application program, and such as MediaPlayer.java, this interface is that Android system carries
The common interface of confession, can be used for controlling audio/video file or the broadcasting of stream.Application program can pass through this
Interface, calling system player realizes the broadcasting of content of multimedia.In the embodiment of the present invention, apply journey
Sequence can use system plays device by this common interface " MediaPlayer.java " calling system player
Play content of multimedia, and collect the historical record of broadcasting.It is appreciated that above-mentioned employing
MediaPlayer.java interface interchange system plays device is collected historical record and is only used as a kind of application of the present invention
Example, in actual applications, the present invention is not limited for the concrete form of common interface and player
System.
In the embodiment of the present invention, APP can be used for representing that install on terminal unit, operates in user model,
Can interact, have the program of visual user interface with user, as wechat APP, happy regard APP,
Browser etc..Specifically, application program can receive the playing request of user, permissible in this playing request
Carry the address of content of multimedia, such as URL (URL, Uniform Resoure
Locator) etc.;So, when receiving the playing request of user, application program can be broadcast by calling
The interface that putting device provides transmits the address information of content of multimedia to player.
In the embodiment of the present invention, above-mentioned content of multimedia specifically may include that picture, word, video and
Arbitrary or combination in audio frequency, above-mentioned content of multimedia can be transmitted with the form of Streaming Media, above-mentioned
Streaming Media can follow HLS (dynamic code rate adaptive technique, HTTP Live Streaming) agreement etc., this
Inventive embodiments is not any limitation as concrete content of multimedia and host-host protocol thereof.For the ease of describing,
The embodiment of the present invention is all as a example by video, and other content of multimedia is cross-referenced.
Step 102, according to described address information, obtain and play described content of multimedia;
Step 103, playing during described content of multimedia, preserving described application program corresponding
The historical record that content of multimedia is play.
In the embodiment of the present invention, the call request from application program of reception can also include: application
Type information.Wherein, application type information can be used for representing the type of application program, such as this application journey
Sequence is the third-party application such as wechat, microblogging or browser.
In in a kind of alternative embodiment of the present invention, it is that third-party application is the most micro-at described application program
When letter, microblogging, when user clicks on the video that friend shares in wechat APP, wechat APP can be led to
Cross MediaPlayer.java interface interchange system plays device, and incited somebody to action by MediaPlayer.java interface
The address information of this video such as URL address passes to system plays device, and system plays device is according to this URL
Address, obtains and plays the video content of correspondence, and preserve the play history note that this wechat APP is corresponding
Record, such as the URL address etc. of this video, user can find this in the historical record of system plays device
The historical record of video playback, including URL address etc..
In the another kind of alternative embodiment of the present invention, when described application program is browser, i.e. user
When needing to play the video content in certain webpage, likewise it is possible to by MediaPlayer.java interface
Calling system player, video content is played out and keeps the historical record play by system plays device,
When application program is browser, in addition to the URL address recording this video content, it is also possible to record
The URL address of this video content place webpage, so that user is possible not only to search this video content
URL address, it is also possible to browse this video quotes webpage, such that it is able to obtain in this webpage with in video
Hold relevant out of Memory.
In actual applications, collecting and when preserving historical record, except above-mentioned video URL address,
Quote outside the URL address of webpage, it is also possible to preserve other history letter the most relevant with multimedia
Breath.In one preferred embodiment of the invention, described historical record at least can include in following information
Arbitrary:
Process name that the address information of content of multimedia, application program are corresponding, play start time information,
Multimedia duration information, multimedia title information, multimedia key frame information.
As a example by content of multimedia is as video, wherein, the address information of content of multimedia is specifically as follows and regards
The URL address of frequency, application type information is specifically as follows third-party application or browser, plays initial
Temporal information is specifically as follows the time started playing this video content, and multimedia duration information is the most permissible
For total duration of this video content, multimedia title information is specifically as follows the title of this video, multimedia
Key frame information is specifically as follows the picture thumbnail of some key frame in this video display process.
In actual applications, can with arbitrary in the above-mentioned information of Collection and conservation or combination, of course, it is possible to
The historical record preserved is not limited to the above-mentioned information enumerated, and those skilled in the art can collect as required
Preserving the historical information the most relevant with multimedia, the particular content of historical information is not added with by the present invention
To limit.
To sum up, the embodiment of the present invention, according to the call request from application program received, obtains and broadcasts
Put described content of multimedia;During playing described content of multimedia, preserve described application program pair
The historical record that the content of multimedia answered is play.By the embodiment of the present invention, can be to various application programs
Call request be managed collectively, and preserve the historical record of multimedia corresponding to application program,
Make different application call player to carry out the historical record of multimedia and can unify to preserve and pipe
Reason, user can inquire what content of multimedia corresponding to different application was play by this historical record
Historical record, such that it is able to improve the efficiency of query history record.
Embodiment two
The present embodiment is on the basis of above-described embodiment one, it is also possible to include following optional technical scheme.
In one preferred embodiment of the invention, in the multimedia that the described application program of described preservation is corresponding
Hold the step of historical record play, specifically can include following sub-step:
Sub-step S11, obtained the process name of described application program by common interface;
Sub-step S12, preserve in the multimedia that the process name of described application program is corresponding with described process name
Hold the historical record play.
With reference to Fig. 2, it is shown that the step stream of the processing method embodiment two of a kind of historical record of the present invention
Cheng Tu, specifically may include that
Step 201, received from the call request of application program by common interface MediaPlayer.java;
Wherein, described call request specifically may include that the address information of content of multimedia;
Step 202, according to described address information, obtain and play described content of multimedia;
Step 203, by described common interface MediaPlayer.java obtain described application program process
Name;
Step 204, playing during described content of multimedia, preserving the process of described application program
The historical record of the content of multimedia broadcasting that name is corresponding with described process name.
In a particular application, Online Video play by application call system plays device when, permissible
By the setDataSource () method in common interface MediaPlayer.java, the URL of incoming video
Address parameter, wherein, described setDataSource () method specifically can be such that
void setDataSource(Context context,Uri uri,Map<String,String>headers);
In actual applications, setDataSource () method is used for loading the video file specified, and shows above-mentioned
In example, setDataSource () method is for specifying the file loaded representated by uri, in the embodiment of the present invention
In, the uri parameter received can be saved as variable rec_url by system plays device.
In a particular application, current application program can be obtained by MediaPlayer.java interface corresponding
Process name, and by this process name by headers parameter incoming system plays device, concrete grammar can be as
Under:
If (headers==null)
Map<String, String>headers=new HashMap<String, String>;
headers.put(“process”,process_name);
nativeSetDataSource(url,headers);The setDataSource of // calling system player
}
In a particular application, the setDataSource () method in MediaPlayer.java interface can be passed through
The setDataSource () method of calling system player realizes.In embodiments of the present invention, in application journey
Sequence is by calling setDataSource () the method call system plays device of MediaPlayer.java
During setDataSource () method, headers parameter can be passed to system plays device, system plays device
After getting the headers parameter of MediaPlayer.java transmission, can therefrom parse application program pair
The process name process answered, and this process name is saved in variable rec_processname.
In a particular application, the time of application call setDataSource () method, it is broadcasting initial
Temporal information, this broadcasting initial time can be saved in variable rec_time by system plays device.
In embodiments of the present invention, system plays device can pass through parsing module, obtains the metadata of video
Header file, therefrom resolves and obtains the duration information of video and the heading message of video, system plays device divide
It is not saved in variable rec_duration and rec_title.
System plays device passes through decoder module, video file can be decoded obtain video pictures and carry out
Play, in playing process, one of them key frame can be saved as picture thumbnail, this picture is contracted
Sketch map is saved in variable rec_image.
Complete in video playback, or when application program actively exits broadcasting process, system plays device is permissible
It is saved in variable rec_url, rec_time, rec_duration, rec_processname, rec_image by above-mentioned
In value store in data base.By said process, the mistake of content of multimedia play by system plays device
Cheng Zhong, can by the address information of content of multimedia, process name that application program is corresponding, play initial time
Between the historical record such as information, multimedia duration information, multimedia title information, multimedia key frame information
Be stored in data base so that user can to obtain various application program by this database lookup corresponding
The history of content of multimedia plays record, offers convenience for search procedure, can improve search efficiency.Example
As, after user opens system plays device, various application program pair can be seen in history options
The play history record answered, relative to needing in prior art to open the broadcasting that each application program is corresponding respectively
Historical record searched by device, can improve search efficiency.Additionally, by the embodiment of the present invention so that
When playing the video that social networking application program such as wechat, microblogging etc. are shared, it is also possible to the history note that record is corresponding
Record.
In one preferred embodiment of the invention, when described application type information is browser, described
Historical record can also include: the address information of described content of multimedia place webpage.
In a particular application, if the video playback request that browser is initiated, browser is the most logical
Cross MediaPlayer.java interface, calling system player.When calling MediaPlayer.java interface,
By the address of current web page by headers parameter incoming MediaPlayer.java interface
In setDataSource (), detailed process can be such that
Map<String, String>headers=new HashMap<String, String>;
headers.put(“webpage”,wepage_url);
mediaplayer.setDataSource(url,headers);// call MediaPlayer.java's
setDataSource
By MediaPlayer.java calling system player, at application program by calling
The setDataSource () side of setDataSource () the method call system plays device of MediaPlayer.java
During method, headers parameter can pass to system plays device, system plays device can be from incoming
Headers parameter obtains the address information of the webpage (quoting webpage) at video place, webpage will be quoted
Address information is saved in variable rec_webpage.
When video playback is complete, or when application program actively exits broadcasting process, system plays device is being protected
While depositing rec_url, rec_time, rec_duration, rec_processname, rec_image, also
Rec_webpage can be stored in data base.
The embodiment of the present invention can obtain, by common interface, the process name that application program is corresponding, is playing institute
During stating content of multimedia, the process name preserving described application program is corresponding with described process name many
The historical record that media content is play.Make different application call player and carry out multimedia
Historical record can be unified to preserve and management, and user can inquire different application journey by this historical record
The historical record that the content of multimedia that ordered pair is answered is play, such that it is able to improve the efficiency of query history record.
Embodiment three
The present embodiment is on the basis of above-described embodiment one or embodiment two, it is also possible to provide historical record
Playback function.With reference to Fig. 3, it is shown that the processing method embodiment three of a kind of historical record of the present invention
Flow chart of steps, specifically may include that
Step 301, receive from the call request of application program;Wherein, described call request specifically may be used
To include: the address information of content of multimedia;
Step 302, according to described address information, obtain and play described content of multimedia;
Step 303, playing during described content of multimedia, preserving described application program corresponding
The historical record that content of multimedia is play;
Step 304, basis are asked from the browsing history of user, show described application journey to user
The historical record that the content of multimedia that ordered pair is answered is play;
The playback request that step 305, reception user select for described historical record;
Step 306, according to the address information of content of multimedia in described playback request correspondence historical record,
Obtain and play described content of multimedia.
In embodiments of the present invention, preserve content of multimedia corresponding to application program at system plays device to play
Historical record after, browsing history can be selected when user is again turned on this application program, then
Application program reads the historical record of correspondence from data base and shows in the display interface of player, tool
Body ground, can be showed history by the form of list.
User can from display historical record select want playback a record, application program according to
The selection of user, can play out again through MediaPlayer.java interface interchange system plays device.
It is in one preferred embodiment of the invention, described during playing described content of multimedia,
Preserve the step of the historical record that content of multimedia corresponding to described application program is play, specifically can include
Following sub-step:
Sub-step S21, judge the type of described call request, when described call request is for asking first,
During playing described content of multimedia, preserve content of multimedia corresponding to described application program and play
Historical record;
Sub-step S22, when described call request is playback request, playing described content of multimedia
During, skip the operation preserving the historical record that content of multimedia corresponding to described application program is play.
In embodiments of the present invention, when MediaPlayer.java interface interchange system plays device, can sentence
This call request disconnected is to ask first or playback request, in MediaPlayer.java interface check to this tune
When being playback request with request, MediaPlayer.java interface can be by setDataSource () method
Headers parameter, inform that the call request of system plays device current application program is playback request;It is then
System player, when playing corresponding video content, no longer preserves historical record, to avoid repeating preservation making
Become the waste of memory source.
In embodiments of the present invention, the step of the type of the described call request of described judgement, specifically can wrap
Include:
Historical record searches whether there is the process name of described application program and described content of multimedia
The corresponding relation of address information, if existing, then judge that described call request is as playback request;Otherwise,
Judge that described call request is as asking first.
In embodiments of the present invention, the call request that system plays device is current can be informed as follows
For playback request:
Map<String, String>headers=new HashMap<String, String>;
headers.put(“skip_rec”,“yes”);
mediaplayer.setDataSource(url,headers);
Ask for playback when system plays device checks this call request at the headers that setDataSource () is inner
When asking, the operation preserving historical record can be skipped, cause the waste of memory source to avoid repeating preserving.
Device embodiment
With reference to Fig. 4, it is shown that the structured flowchart of the processing means embodiment of a kind of historical record of the present invention,
Specifically may include that
First request receiver module 410, for receiving the call request from application program;Wherein, institute
State call request to include: the address information of content of multimedia;
Content obtaining module 420, for according to described address information, obtains and plays in described multimedia
Hold;
Record preserves module 430, and for during playing described content of multimedia, preservation is described should
The historical record play with the content of multimedia that program is corresponding.
In one preferred embodiment of the invention, described record preserves module 430, specifically may include that
Obtain submodule, for being obtained the process name of described application program by common interface;
Preserve submodule, corresponding many for the process name and described process name preserving described application program
The historical record that media content is play.
In another preferred embodiment of the invention, described device can also include:
Record display module, for asking according to the browsing history from user, shows institute to user
State the historical record that content of multimedia corresponding to application program is play;
Second request receiver module, for receiving the playback request that user selects for described historical record;
Contents play module, for according to the ground of content of multimedia in described playback request correspondence historical record
Location information, obtains and plays described content of multimedia.
In another preferred embodiment of the present invention, described record preserves module 430, specifically can wrap
Include:
Type judges submodule, for judging the type of described call request, headed by described call request
During secondary request, during playing described content of multimedia, preserve many matchmakers that described application program is corresponding
The internal historical record holding broadcasting;
Submodule skipped in record, for when described call request is playback request, is playing described many matchmakers
During internal appearance, skip and preserve the historical record that content of multimedia corresponding to described application program is play
Operation.
In the still another preferable embodiment of the present invention, described type judges submodule, specifically may include that
Identifying unit, for search whether to have existed in historical record described application program process name and
The corresponding relation of the address information of described content of multimedia, if existing, then judge described call request as
Playback request;Otherwise, it is determined that described call request is for ask first.
In the still another preferable embodiment of the present invention, described historical record at least can include following information
In arbitrary:
Process name that the address information of content of multimedia, application program are corresponding, play start time information,
Multimedia duration information, multimedia title information, multimedia key frame information.
In the still another preferable embodiment of the present invention, described call request can also include: application type
Information;
When described application type information is browser, described historical record can also include: described many matchmakers
The address information of internal appearance place webpage.
Device embodiment described above is only schematically, wherein said illustrates as separating component
Unit can be or may not be physically separate, the parts shown as unit can be or
Person may not be physical location, i.e. may be located at a place, or can also be distributed to multiple network
On unit.Some or all of module therein can be selected according to the actual needs to realize the present embodiment
The purpose of scheme.Those of ordinary skill in the art are not in the case of paying performing creative labour, the most permissible
Understand and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive each reality
The mode of executing can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part.Based on such understanding, the portion that prior art is contributed by technique scheme the most in other words
Dividing and can embody with the form of software product, this computer software product can be stored in computer can
Read in storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that one
Computer equipment (can be personal computer, server, or the network equipment etc.) performs each to be implemented
The method described in some part of example or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it
Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area
Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or
Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.