The content of the invention
The embodiments of the invention provide the method, apparatus and electronic equipment of a kind of Flash player renewal, avoid existing
Flash player can not security risk caused by timely automated renewal in technology.
In a first aspect, this application provides the method for Flash player renewal, this method includes:
The data cached of the target web of embedded Flash player is obtained, the data cached caching Flash that is stored in is broadcast
In the file for putting the version number of device;
Whether more redaction is needed according to the data cached determination Flash player;
If so, calling system method call function updates the Flash player version.
Further, the data cached first version number for including the Flash player, the Flash are played
Device includes the second edition number of the Flash player;
Described the step of whether more redaction is needed according to the data cached determination Flash player, including:
The first version number and the second edition number are compared, determines whether the Flash player needs to update;
It is different with the second edition number or the first version number is space-time in the first version number, it is determined that described
Flash player needs to update.
Further, methods described also includes:
If it is determined that the Flash player need not more redaction, then monitor the data that issue of server, the server
For server corresponding to the target web;
If receiving updating the data for the server transmission, the current version of itself of the Flash player is compared
Number and it is described update the data described in the third edition of Flash player this number, determine whether the Flash player needs more
Newly;
When it is determined that the Flash player needs renewal, calling system method call function updates the Flash and played
Version.
Further, the target web for obtaining embedded Flash player it is data cached before, methods described is also
Including:
The embedded Flash player in the target web;
The second edition number of the Flash player is marked in the Flash player.
Further, the calling system method call function updates the step of Flash player version, including:
Object elements by carrying the Flash player are monitored the server and set in advance in the target web
The renewal Flash player event put;
If listening to the renewal Flash player event of the Flash player, calling system method call function is more
The new Flash player version.
Second aspect, the application provide a kind of device of Flash player renewal, and the device includes:
Acquiring unit, data cached, the data cached storage of the target web for obtaining embedded Flash player
In the file of the version number of caching Flash player;
Determining unit, for whether needing more redaction according to the data cached determination Flash player;
Call unit, for if it is determined that the Flash player need more redaction when, calling system method call function
Update the Flash player version.
Further, the data cached first version number for including the Flash player, the Flash are played
Device includes the second edition number of the Flash player;
The determining unit is specifically used for:
The first version number and the second edition number are compared, determines whether the Flash player needs to update;
It is different with the second edition number or the first version number is space-time in the first version number, it is determined that described
Flash player needs to update.
Further, described device also includes monitoring unit;
The monitoring unit be used for if it is determined that the Flash player need not more redaction, then monitor server issue
Data, the server is server corresponding to the target web;
If the determining unit is additionally operable to receive updating the data for the server transmission, compares the Flash and broadcast
Put device it is current itself version number and it is described update the data described in the third edition of Flash player this number, determine the Flash
Whether player, which needs, updates;
The call unit is additionally operable to when it is determined that the Flash player needs renewal, calling system method call letter
Number updates the Flash playback versions.
Further, described device also includes:
Embedded unit, for before data cached in the target web for obtaining embedded Flash player, described
The embedded Flash player in target web;
Indexing unit, for marking the second edition number of the Flash player in the Flash player.
The third aspect, the present invention also provide a kind of electronic equipment, including:Memory, processor and is stored in the storage
On device and the computer program that can run on the processor, wherein, can during computer program described in the computing device
To realize any described method in first aspect.
Fourth aspect, the present invention also provide a kind of computer-readable recording medium, are stored thereon with computer program, the journey
Any described method in first aspect is realized when sequence is executed by processor.
The embodiment of the present invention passes through the data cached of the target web that obtains embedded Flash player, and this is data cached to deposit
Store up in the file of the version number of caching Flash player, cache the file and caching Flash of the version number of Flash player
The file of player plays video is different;According to it is data cached determination Flash player whether need more redaction, it is determined that
When Flash player needs more redaction, calling system method call function renewal Flash player version.The present invention is implemented
In example by being not stored in due to Flash player version number with Flash player played data together with, can be by according to slow
Version number in deposit data determines whether Flash player needs more redaction, is called when needed automatically by systems approach
Function updates Flash player version, and avoiding Flash player in the prior art can not safety caused by timely automated renewal
Risk, realize and automatically update Flash player, it is not necessary to which user updates player manually, reduces security risk.
The (if present)s such as term " first ", " second " in description and claims of this specification and above-mentioned accompanying drawing
It is for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that the number so used
According to can exchange in the appropriate case, so as to the embodiments described herein can with except the content for illustrating or describing herein with
Outer order is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover non-exclusive bag
Contain, for example, containing the process of series of steps or unit, method, system, product or equipment is not necessarily limited to what is clearly listed
Those steps or unit, but may include not listing clearly or intrinsic for these processes, method, product or equipment
Other steps or unit.
The method that Flash player updates in the embodiment of the present invention is applied to the device of Flash player renewal, the device
In electronic equipment, the electronic equipment can be electronic equipments such as mobile phone, tablet personal computer or PC or not
To there is electronic equipment that can play Flash etc..
Referring to Fig. 1, method one embodiment that Flash updates in the embodiment of the present invention includes:
S101, acquisition are embedded in the data cached of the target web of Flash player;
Wherein, in the file of the data cached version number for being stored in caching Flash player, it is preferred that described slow
The file for depositing the version number of Flash player can be different from caching the file of the Flash player broadcasting video.
S102, according to it is described it is data cached determine whether the Flash player needs more redaction, if so, performing step
Rapid 103;If it is not, following steps S104 can be performed.
S103, calling system method call function update the Flash player version.
The embodiment of the present invention passes through the data cached of the target web that obtains embedded Flash player, and this is data cached to deposit
Store up in the file of the version number of caching Flash player, cache the file and caching Flash of the version number of Flash player
The file of player plays video is different;According to it is data cached determination Flash player whether need more redaction, it is determined that
When Flash player needs more redaction, calling system method call function renewal Flash player version.The present invention is implemented
In example by being not stored in due to Flash player version number with Flash player played data together with, can be by according to slow
Version number in deposit data determines whether Flash player needs more redaction, is called when needed automatically by systems approach
Function updates Flash player version, and avoiding Flash player in the prior art can not safety caused by timely automated renewal
Risk, realize and automatically update flash player, it is not necessary to which user updates player manually, reduces security risk.
Due to CDN cache problems, to server, (server described in the embodiment of the present invention is target web pair to webpage
The Resource Server answered) Flash player taken may also not be newest version, so when Flash player needs more
When new, the Flash player version that may be updated not is newest, then with regard to needing a mark to carry out to record
Whether it has been updated over getting newest Flash player, but in Flash player running, most of data are all deposited
Store up broadcasting video in itself, once the video played be closed these data also just be eliminated from internal memory, when next time is run,
Data will be cached from the beginning.The needs sended over to record server update the version number to Flash player,
Need one and be locally stored and come this version number of caching record so that cache the file of the version number of Flash player with delaying
The file for depositing Flash player broadcasting video differs, and avoids the caching number of the version number of Flash player when closing video
According to being eliminated.
In the embodiment of the present invention, the ShareObject that is carried using Flash player caches the version of Flash player
This number, concrete mode is as follows:
so:SharedObject=SharedObject.getLocal (" xx ", "/");
SOversion=so.data [key]
Wherein, " XX " is the folder name of the version number of storage Flash player, and key is the Flash for needing to update here
The version number of player identifies in ShareObject, and sOversion is the version number of data cached middle Flash player.
Further, the caching of the data cached version number for caching Flash player described in above-mentioned steps S101
Data, the data cached first version number for including Flash player, Flash player include the of Flash player
Two version numbers;Now, as shown in Fig. 2 in some currently preferred embodiments of the present invention, above-mentioned steps S102 can specifically include:
S1021, first version number and the second edition number are compared, determine whether Flash player needs to update;
S1022, in first version number and second edition difference or first version number it is space-time, determines that Flash is played
Device needs to update.
Specifically, compare the version number sOversion (first version number) of data cached middle Flash player with
The version number version (second edition number) carried in Flash player is contrasted (the meeting when writing in Flash player
Manually write version number), if sOversion differs for sky or both, determine that Flash player needs to update, if really
When determining first version number with second edition difference, it is determined that Flash player need not currently update.
In some preferred embodiments of the invention, upgraded in time when Flash player is likely to require in the process of running,
For such case using server as driving, Flash player establishes long connection with server, and monitors the number that server is sent
According to, needed in this data server injection it is newest need update Flash player version number (this version number need with
It is consistent that version number is manually write in newest F lash players).Therefore, when it is determined that Flash player need not currently update also
It can continue to monitor updating the data of issuing of server, update the data the caching for including this number of the third edition of Flash player
Data, specifically, as shown in figure 3, when it is determined that Flash player need not currently update, this method also includes:
S104, monitor the data that server issues;
Wherein, the server is server corresponding to the target web (also referred to as Resource Server);
If S105, receiving updating the data for server transmission, compare the current version number of itself of Flash player and
The third edition of middle Flash player this number is updated the data, determines whether Flash player needs to update;
S106, when it is determined that Flash player needs renewal, calling system method call function updates the Flash and broadcast
Put version.
In the present embodiment, receiving server update version number message directly more new web page can't obtain newest F lash
Player, but it is newest to judge whether to need to be updated page acquisition by checkout of version number of Flash player
Flash player version, server exception message is effectively filtered.
Specifically, the data that server issues are monitored, if the flash player being currently running receives server transmission
Update the data, this number newVersion of the third edition that Data Data obtains its carrying is obtained, with current Flash player version number
Version, which is compared, determines whether Flash player needs to update, if it is different, determine that Flash player needs to update,
Calling system method call function updates the Flash playback versions.
Simultaneously by the third edition this number renewal be buffered in for cache Flash player version number it is data cached in.For
Avoid avoiding in the prior art content distributing network (Content Delivery Network, CDN) cache caused by nothing
Method renewal arrive newest Flash player, so calling system method call function come it is data cached it is middle store needs brush
Newest F lash players version number, be implemented as follows:
So.data [key]=newVersion;
so.flush();
CDN data delays that the method for the caching Flash player version number effectively avoids and cause Flash player
The situation of latest edition is not brushed.
Now, data cached described in step S101 can also be that the Flash stored by systems approach call function is broadcast
Put the version number of device.
Further, in some embodiments of the invention, it is above-mentioned state step S101 before, methods described also includes:
The embedded Flash player in the target web;
The second edition number of the Flash player is marked in the Flash player.
The embedded Flash player in webpage conventional at present is broadly divided into Object+embed modes, embed modes,
These three modes of SWF Object modes, because Object+embed mode compatibilities are relatively good and can carry a large amount of
The attribute that Flash player initialization needs, so being embedded in Flash using Object+embed modes in embodiments of the present invention
Player.In object labels to id attribute assignments be classID be so easy to below the page get Flash player member
Element.The second edition number of the Flash player is marked in id attributes.Principle De- embedding above is used in the present embodiment
Flash player.It is beneficial to compatible browser on the market again, avoids the embedded Flash player failure on some special browsers
It is or abnormal.
Further, as shown in figure 4, the calling system method call function renewal Flash is broadcast in above-mentioned steps S103
The step of putting device version can specifically include:
S1031, by carry Flash player object elements monitor server in advance the target web set
Renewal Flash player event;
If S1032, the renewal Flash player event for listening to Flash player, calling system method call function
Update Flash player version.
In the embodiment of the present invention, Flash player, which is embedded into browser, uses object element forms, and object has
Attribute of the id attributes as this page elements of unique mark, that is to say, that the id cans for setting object are marked by DOM
Sign to get the div elements (document.getElementByid (" id ")) of carrying Flash player.Flash player
It can be dished out by ExternalInterface.call (" _ ACJ_ ", arg) to webpage and update Flash player event, in net
This event is monitored in page end by the object elements (object id attributes) of previously obtained carrying Flash player, when
Calling system method call function when listening to the renewal player event that Flash player is dished out
Window.location.reload () updates Flash player
The embodiment of the device that Flash player updates in the embodiment of the present invention is described below.
Referring to Fig. 5, one embodiment schematic diagram of the device updated for Flash player in the embodiment of the present invention, should
Device includes:
Acquiring unit 501, for obtain embedded Flash player target web it is data cached, it is described data cached
It is stored in the file of the version number of caching Flash player, the file and caching of the version number of the caching Flash player
The file that the Flash player plays video is different;
Determining unit 502, for whether needing more redaction according to the data cached determination Flash player;
Call unit 503, for if it is determined that the Flash player need more redaction when, calling system method call
Function updates the Flash player version.
Further, the data cached first version number for including the Flash player, the Flash are played
Device includes the second edition number of the Flash player;
The determining unit 502 is specifically used for:
The first version number and the second edition number are compared, determines whether the Flash player needs to update;
It is different with the second edition number or the first version number is space-time in the first version number, it is determined that described
Flash player needs to update.
Further, as shown in fig. 6, described device also includes monitoring unit 504;
The monitoring unit 504 be used for if it is determined that the Flash player need not more redaction, then monitor server under
The data of hair, the server are server corresponding to the target web;
If the determining unit 502 is additionally operable to receive updating the data for the server transmission, the Flash is compared
Player it is current itself version number and it is described update the data described in the third edition of Flash player this number, it is determined that described
Whether Flash player, which needs, updates;
The call unit 503 is additionally operable to when it is determined that the Flash player needs renewal, calling system method call
Function updates the Flash playback versions.
Further, as shown in fig. 7, described device also includes:
Embedded unit 505, for before data cached in the target web for obtaining embedded Flash player,
The embedded Flash player in the target web;
Indexing unit 506, for marking the second edition number of the Flash player in the Flash player.
A kind of electronic equipment is also provided in the embodiment of the present invention, refers to Fig. 8, the electronic equipment includes:
Memory 801, processor 802 and is stored in the computer that can be run on the memory and on the processor
Program 803, wherein, the processor 802 can realize the place of above-mentioned video-see record when performing the computer program 803
Reason method.
It should be noted that the electronic equipment that the application is related to include but is not limited to be:Mobile terminal (mobile phone, intelligent hand
Machine, PAD, notebook computer etc.), fixed terminal (computer).
For convenience of description, the part related to the embodiment of the present invention is illustrate only, particular technique details does not disclose, please
With reference to present invention method part.Memory 801 can be used for storage computer program 803, and above computer program includes
Software program, module and data, processor 802 perform the computer program 803 for being stored in memory 801 by running, so as to
Perform various function application and the data processing of electronic equipment.
In specific implementation process, memory 801 can be used for storage software program and module, processor 802 to pass through
Operation is stored in the software program and module of memory 801, so as to perform the various function application of electronic equipment and data
Processing.Memory 801 can mainly include storing program area and storage data field, wherein, storing program area can storage program area,
Application program (such as game class application program, chat class application program) needed at least one function etc.;Storage data field can
Storage uses created data (game configuration data, voice data) etc. according to electronic equipment.In addition, memory 801 can
Including high-speed random access memory, nonvolatile memory can also be included, a for example, at least disk memory, dodged
Memory device or other volatile solid-state parts.Processor 802 is the control centre of electronic equipment, using various interfaces and
The various pieces of the whole electronic equipment of connection, by run or perform the software program that is stored in memory 801 and/or
Module, and the data being stored in memory 801 are called, the various functions and processing data of electronic equipment are performed, so as to right
Electronic equipment carries out integral monitoring.Optionally, processor 802 may include one or more processing units;Preferably, processor
802 can integrate application processor, wherein, application processor mainly handles operating system, user interface and application program etc..
The embodiment of the present invention also provides a kind of computer-readable recording medium, wherein, the computer-readable recording medium can
Have program stored therein, the part of the processing method including the video-see record described in the above method embodiment when program performs
Or Overall Steps.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with
Realize by another way.For example, device embodiment described above is only schematical, for example, the unit
Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing
Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or
The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit
Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list
Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially
The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products
Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer
Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment methods described of the present invention
Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
Described above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before
Embodiment is stated the present invention is described in detail, it will be understood by those within the art that:It still can be to preceding
State the technical scheme described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these
Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.