CN105956133A - Method and apparatus for displaying file in intelligent terminal - Google Patents

Method and apparatus for displaying file in intelligent terminal Download PDF

Info

Publication number
CN105956133A
CN105956133A CN201610309637.8A CN201610309637A CN105956133A CN 105956133 A CN105956133 A CN 105956133A CN 201610309637 A CN201610309637 A CN 201610309637A CN 105956133 A CN105956133 A CN 105956133A
Authority
CN
China
Prior art keywords
content
label
video
file
attribute
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
Application number
CN201610309637.8A
Other languages
Chinese (zh)
Other versions
CN105956133B (en
Inventor
李中秋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610309637.8A priority Critical patent/CN105956133B/en
Publication of CN105956133A publication Critical patent/CN105956133A/en
Application granted granted Critical
Publication of CN105956133B publication Critical patent/CN105956133B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Abstract

The invention discloses a method and an apparatus for displaying a file in an intelligent terminal. The method comprises the steps of obtaining file content of the to-be-displayed file and analyzing the file content to obtain each content structure of the file content; converting each content structure into webpage content; and displaying the webpage content obtained after conversion through webpage browsing software. According to the scheme provided by embodiments of the invention, the typesetting, rendering and display are carried out by virtue of a technology of displaying the webpage through the webpage browsing software by converting the file content into the webpage content without using or encapsulating various underlying interfaces of a system, so that the whole rendering and display process is simplified, the file can be simply displayed in the intelligent terminal, and the display efficiency is high.

Description

The method and device of intelligent terminal's upper display file
Technical field
The present invention relates to field of information display, particularly relate to the method for a kind of intelligent terminal upper display file with And the device of a kind of intelligent terminal upper display file.
Background technology
Along with the increasingly extensive universal and application of intelligent terminal, by mobile File Open document content, come Realize checking of various document content, have become as an important content in the application of current intelligent terminal.
But, the composition of document content is more complicated, and different documents may comprise different contents, such as Document may include in the various contents such as picture, form, figure, chart, formula, symbol, word One or more various combinations and the various typesettings of these contents.Intelligent terminal is to document at present When content shows, it is common that use the system interface that carries of intelligent terminal, in different in document Holding, after using the specific system interface corresponding with to content to be packaged, color applying drawing is to bitmap (position Map file, bitmap is Windows reference format graphic file, and image definition is by point (pixel) group by it Become, each point can be represented by multicolour) caching in, be finally shown on screen by bitmap.? During this encapsulation and drafting, for the attribute information relevant to drafting parsed, need extraly Carry out mating and calculating, in order to the system interface that can be correlated with can be packaged.Residence is comprised with the content of document As a example by the picture of middle display, based on current display mode, figure can be obtained by document content is carried out parsing The information of sheet typesetting placed in the middle, thus need to calculate concrete according to the size of picture and the size of document file page Position drawn by picture, then calls relevant system interface to draw picture.Carry in this employing system and be In the mode that document content is drawn by system interface, the attribute of content each to document is needed to recalculate, The even attribute of a lot of contents of document needs further package system interface just can complete to draw, and these are all Making intelligent terminal when showing document content, color applying drawing is the most extremely complex, has influence on intelligent terminal and shows The efficiency of document content.
Summary of the invention
Based on this, the purpose of the embodiment of the present invention be to provide the method for a kind of intelligent terminal upper display file with And the device of a kind of intelligent terminal upper display file, file can be carried out on intelligent terminal by it with summary Display, and the efficiency of display is high.
For reaching above-mentioned purpose, the embodiment of the present invention by the following technical solutions:
A kind of upper method showing file of intelligent terminal, including step:
Obtain the file content of file to be shown, described file content is resolved, it is thus achieved that in described file The each content structure held;
Each described content structure is converted to web page contents;
The described web page contents obtained after conversion is shown by web browser software.
The upper device showing file of a kind of intelligent terminal, including:
Content obtaining module, for obtaining the file content of file to be shown;
Parsing module, for resolving described file content, it is thus achieved that each content knot of described file content Structure;
Modular converter, for being converted to web page contents by each described content structure;
Display module, for showing the described web page contents obtained after conversion by web browser software.
According to the scheme of the embodiment of the present invention as above, the file to be shown of intelligent terminal is being carried out by it During display, it is after the file content obtaining this file to be shown, carries out resolving acquisition this document content to it Content structure, and these content structures are converted into web page contents, then this web page contents are passed through webpage Browse software to show, thus without using the various physical layer interfaces of system, it is not required that to these bottoms Interface is packaged, but is converted into web page contents, by the technology of web browser software display webpage Carry out typesetting, render and show, so that the whole process simplification rendering, showing, can be with summary File is shown on intelligent terminal by ground, and the efficiency of display is high.
Accompanying drawing explanation
Fig. 1 is the working environment schematic diagram of the present invention program in an embodiment;
Fig. 2 is the composition structural representation of terminal in an embodiment;
Fig. 3 is the schematic flow sheet of the method for the intelligent terminal of the present invention upper display file in an embodiment;
Fig. 4 is the schematic flow sheet of the method for the intelligent terminal of the present invention upper display file in another embodiment;
Fig. 5 is the structural representation of the device of the intelligent terminal of the present invention upper display file in an embodiment.
Detailed description of the invention
For making the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and enforcement Example, is described in further detail the present invention.Should be appreciated that detailed description of the invention described herein Only in order to explain the present invention, do not limit protection scope of the present invention.
Fig. 1 shows the working environment schematic diagram in one embodiment of the invention.Intelligent terminal 101 needs to open Relevant file, it is thus achieved that the file content of this document also shows, this document is stored at intelligence eventually Hold 101 this locality, it is also possible to obtained from server 102 by network.The present embodiments relate to is Intelligent terminal 101 shows the scheme of file, can should be that intelligent terminal 101 is local in order to the file shown , it is also possible to being that intelligent terminal 101 is obtained from server 102 by network, the embodiment of the present invention is to file Source do not do concrete differentiation.
Intelligent terminal 101 structural representation in one embodiment is as shown in Figure 2.This intelligent terminal includes leading to Cross processor, storage medium, communication interface, power interface and internal memory that system bus connects.Wherein, intelligence The storage medium storage of energy terminal 101 has the upper device showing file of a kind of intelligent terminal, and this device is used for realizing Display to file on intelligent terminal.The communication interface of intelligent terminal 101 can be used for being connected with server 102 With communicate, the power interface of intelligent terminal 101 is for being connected with external power source, and external power source is connect by this power supply Mouth is powered to intelligent terminal 101.Intelligent terminal 101 can be that any one is capable of intelligent input output Equipment, such as mobile terminal, such as mobile phone, panel computer etc.;Can also be that other has said structure Equipment.
Fig. 3 shows the schematic flow sheet of the method for the upper display file of the intelligent terminal in an embodiment. As it is shown on figure 3, the method in this embodiment includes step:
Step S301: obtain the file content of file to be shown,
Step S302: described file content is resolved, it is thus achieved that each content structure of described file content;
Step S303: each described content structure is converted to web page contents;
Step S304: the described web page contents obtained after conversion is shown by web browser software.
According to the scheme of the embodiment of the present invention as above, the file to be shown of intelligent terminal is being carried out by it During display, it is after the file content obtaining this file to be shown, carries out resolving acquisition this document content to it Content structure, and these content structures are converted into web page contents, then this web page contents are passed through webpage Browse software to show, thus without using the various physical layer interfaces of system, it is not required that to these bottoms Interface is packaged, but is converted into web page contents, by the technology of web browser software display webpage Carry out typesetting, render and show, so that the whole process simplification rendering, showing, can be with summary File is shown on intelligent terminal by ground, and the efficiency of display is high.
Wherein, after above-mentioned steps S301 obtains the file content of file to be shown, can be by this document Hold to be loaded into after local internal memory stores and resolve again.Accordingly, Fig. 4 shows one based on the party The schematic flow sheet of the method for the intelligent terminal of another embodiment of formula upper display file.As shown in Figure 4, Method in this embodiment includes step:
Step S401: obtain the file content of file to be shown,
Step S402: the file content of acquisition is loaded into local internal memory;
Step S403: the file content being loaded into local internal memory is resolved, it is thus achieved that described file content Each content structure;
Step S404: each described content structure is converted to web page contents;
Step S404: the described web page contents obtained after conversion is shown by web browser software.
Thus, after obtaining file content, first file content is loaded into local internal memory, then for being loaded into The file content of local internal memory resolves, and thereby may be ensured that seriality and the stream resolving and showing process Smooth property.
It will be understood by those skilled in the art that except file content is loaded into internal memory, it would however also be possible to employ other Mode file content is processed, and accordingly ensure resolve and display seriality, the present invention implement Example is not done exhaustive at this.
When resolving file content in above-mentioned steps S302, step S403, concrete resolving is led to Can be to carry out in intelligent terminal this locality, certainly, based on being actually needed in the case of Chang, it is also possible to be by except Third party device outside intelligent terminal is carried out, such as server etc..
On the other hand, due in the data stream of file content, for the different file format in file content, In some fields specified of related data flow, the information of this document form can be included, and corresponding its In his field being associated, the particular content information of this document form, therefore, this area skill can be included Art personnel can be clear and definite, and when resolving file content, difference based on file format, to related words The byte of section is analyzed being assured that various file formats comprised in file content and relevant concrete Content, this analysis and resolving can use any possibility that is the most existing and that be later likely to occur Mode carry out, the most no longer resolving is carried out expansion and repeats.
After above-mentioned parsing, can obtain the content structure of above-mentioned file content, content structure specifically can wrap Include content type and the attribute data corresponding with this content type.Content type can have a variety of, such as Picture, form, word, figure, icon, formula, symbol, audio frequency, video etc., naturally it is also possible to It it is other the most unlisted content type.For different files, the content class of its file content Type can be different, it is common that one or more in various content types, it is also possible to is these content types Various combinations.
HTML (HyperText Markup Language, HTML) is a kind of design, creates Webpage and a kind of markup language of other information can seen in web browser software, its document compiling is not multiple Miscellaneous, but powerful, support that the file of different data format is bumped into.Accordingly, in a concrete example, Above-mentioned web page contents can be HTML content.Additionally, due to also CSS is that one can be truly realized webpage The form design language that performance separates with content, for the performance of conventional HTML, CSS can be right The position typesetting of the object in webpage carries out the accurate control of Pixel-level, supports almost all of font size sample Formula, has web object and the ability of model pattern editor, and can carry out preliminary interaction design, therefore, Above-mentioned web page contents, it is also possible to be HTML CSS content.Wherein, above-mentioned web browser software, usual feelings Can be web browser under condition, it will be appreciated by those skilled in the art that this web browser software can also be other In order to browse the software of webpage, as long as being capable of html web page is browsed.
Now, as a example by web page contents is as HTML content, will in above-mentioned steps S303, step S404 When each content structure is converted to web page contents, following manner can be used to carry out:
According to the content type comprised respectively in each described content structure, add the described with each of html language The label that content type is corresponding;
According to the described attribute data corresponding with each content type, set corresponding with each content type each respectively The property content of label, it is thus achieved that the HTML content after conversion.
In html language, for different content types, it is configured with different labels, thus based on interior Hold the difference of type, add the label corresponding with related content type of html language, and based on content class The associated property data of type, arranges the property content relevant to this label in HTML content, such that it is able to Advantageously realize the conversion from content structure to HTML content, thus without using the various bottoms of system to connect Mouthful, it is not required that these physical layer interfaces are packaged, and are made by HTML technology and carry out typesetting, render And display so that the whole process simplification rendering, showing.
As a example by the embodiment in Fig. 4, in conjunction with the upper mistake showing file of a concrete intelligent terminal Cheng Jinhang illustrated in greater detail.
When file to be shown is shown by needs, this file to be shown is probably and is previously stored in intelligence eventually The file that end is local, it is also possible to the file obtained from server, first obtains the file content of file to be shown, Then the file content of acquisition being loaded into internal memory, carry out local parsing, this resolving can use mesh Any possible mode that is front existing and that be later likely to occur is carried out, thus the file content after being resolved Content structure.Content structure specifically includes content type and the attribute data corresponding with content type.
For different files, the content type of its file content can be different, is generally probably figure Sheet, form, word, figure, icon, formula, symbol, audio frequency, video and other are unlisted each Any one or combination in any in kind of content type.
For different content types, the attribute data of its correspondence can render display in order to assist, right The various content types comprised in file and the attribute data of correspondence thereof, all can be converted into corresponding one by one Web page contents.It is a kind of design in view of HTML, creates webpage and other can be seen in web browser software A kind of markup language of the information arrived, document compiling is uncomplicated and powerful, supports different data format File is bumped into, and therefore, in embodiments of the present invention, this web page contents can be HTML content.Additionally, Owing to also CSS is that a kind of webpage that can be truly realized shows the form design language separated with content, relative to For the performance of conventional HTML, CSS can carry out the essence of Pixel-level to the position typesetting of the object in webpage Really control, support almost all of font size pattern, have web object and the energy of model pattern editor Power, and preliminary interaction design, therefore, above-mentioned web page contents can be carried out, it is also possible in being HTML CSS Hold.Then can use HTML technology or the CSS technology HTML content to being converted to or HTML CSS content carries out typesetting and renders and show.
As a example by content type below in conjunction with the most several file contents, to converting thereof into HTML content Mode is illustrated.
As a example by content type is as picture, HTML has the label img of the display for picture, to file Content carries out resolving after acquisition obtains picture, and the picture storage intelligent terminal that can parsing be obtained is local, and remembers The picture store path of this picture of address book stored.Then in HTML content, add img label, and img is set The src attribute of label is described picture store path, thus realizes the conversion of HTML content.Such as, By arranging the src attribute of img label, i.e.<img src="Image storage paths"/>, it is possible to complete figure Sheet is to the conversion of HTML content, it is not necessary to calling system physical layer interface, carries out without to system bottom interface Encapsulation, the most simply.
On the other hand, for picture, may also have other attribute data, such as, be shown centered on picture. Now, when the attribute data corresponding with picture includes being shown centered on picture, can be by arranging div tag Style attribute is text-align:center, thus realizes being shown centered on the attribute data of picture to HTML content Conversion.Now, for having the picture being shown centered on attribute, as long as arranging<div style=" text-align:center; "><img src="All images mobile path"/></div>Just realize being shown centered on belonging to The picture of property, to the conversion of HTML content, allows picture be shown centered on.
As a example by content type is as form, there is table label in HTML for showing form, can be easy to Form in document is converted into<table>label of HTML, and the mode of a concrete example can be: HTML content adds table label;Each row for form adds the tr label of correspondence respectively;According to table The number of the cell of each row of lattice, after the tr label that each row is corresponding, add respectively with each unit lattice pair The td label answered and/td label;The content of text of each unit lattice is added on the td label corresponding with this cell And between/td label.
Certainly, it will be understood by those skilled in the art that the mode in above-mentioned example primarily to table is described Label, tr label, td label ,/td label, the position relationship each other of content of text of cell, Specifically when changing, other order can be used, as long as form can be converted into HTML content ?.
On the other hand, for form, may also have the frame width of other attribute data, such as form Degree, the spacing etc. of cell.The border width of form, unit is included at the attribute data corresponding with form During the spacing of lattice, can be described border width by arranging the border attribute of table label;Table is set The spacing that cellspacing attribute is described cell of label, it is achieved both attribute datas of form arrive The conversion of HTML content.
Table 1
First Row
Second Row
As a example by form shown in above table table 1, after it is changed, the generation of the HTML content after conversion Code can be as follows:
As can be seen here, the every a line in form is converted to<tr>label, and each cell is converted to<td>mark Signing, the content of text of cell is converted to<td></td>content of text in the middle of label.Relative to existing Need to calculate the position of the rectangle of each cell, then call canvas graphic plotting interface drawRect Function be plotted to the content of text on bitmap, in cell be also required to calculate text more specific location information right After call the mode of drawText interface renderings for, the process resolving conversion is the simplest.
As a example by content type is as video, there is video label in html for showing the video literary composition of various form Part, after resolving file content, can store intelligent terminal local by the video that parsing obtains, and Record stores the video store path of this video;Obtain the video width in the attribute data corresponding with video, Video height and video type.Then in HTML content, add video label, and video mark is set The src attribute signed is described video store path, and width attribute is described video width, and height attribute is Described video height, type attribute is described video type.
As a example by the video file of a mp4 form, after parsing, the HTML content obtained after conversion Code can be as follows:
<video width=" 320 " height=" 240 " controls>
<source src=" video store path " type=" video/mp4 ">
</video>
According to current technology development, web browser software (such as browser) typically all can support video Label, it is achieved broadcasting to video file in web browser software.Video is not supported at web browser software In the case of label, can call and described type according to the height attribute of video label and width attribute The video of described src attribute is played out by the player plug-in unit that attribute is corresponding, i.e. by calling player plug-in unit Video is rendered display.When playing, width attribute based on video label and height attribute, The scaling to video can be realized.
As a example by content type is as audio frequency, such as audio file, there is audio label each for showing in HTML Planting the audio file of form, after resolving file content, the audio storage that can parsing be obtained is to intelligence Energy terminal local, and record the audio storage path storing this audio frequency.Then add in HTML content Audio label, and the src attribute arranging audio label is described audio storage path.
With the audio file of a mp3 form, the html code obtained after resolving, changing can be as follows Described:
<audio src=" mobile phone path, audio file place " controls=" controls ">
</audio>
According to current technology development, web browser software (such as browser) typically all can support audio Label, it is achieved broadcasting to audio frequency in web browser software.Audio label is not supported at web browser software In the case of, the relevant audio frequency player plug-in sound to described src attribute can be called according to audio label Frequency plays out, and i.e. plays out audio frequency, renders by calling audio frequency player plug-in.
Based on above-mentioned example content, it may be determined that owing to HTML itself is a kind of simple language, easily In grasp, and HTML itself has encapsulated a lot of attribute interface, these interfaces with to document content solution After analysis, the interface that needs is basically identical, one_to_one corresponding during process, this is transformed into by file content HTML content carries out the process shown, decreases middle because the property value parsed and transducer offer connect What the parameter value of mouth did not mated and brought recalculates and many times needs again asking of package system interface Topic, uses more efficient, and reduces the render process complexity of local Rendering.Obtain after conversion HTML content can form html web page, then by this webpage by relevant web browser software (example As web browser or other html webpage browse software) go to show, also can improve mutual very well Property.
Based on thought same as mentioned above, the embodiment of the present invention also provides for showing literary composition on a kind of intelligent terminal The device of part, shows in Fig. 5 that the structure of the device of the upper display file of the intelligent terminal in an embodiment is shown It is intended to.
As it is shown in figure 5, the device in the present embodiment includes:
Content obtaining module 501, for obtaining the file content of file to be shown;
Parsing module 502, for resolving described file content, it is thus achieved that each content of described file content Structure;
Modular converter 503, for being converted to web page contents by each described content structure;
Display module 504, for showing the described web page contents obtained after conversion by web browser software Show.
According to the scheme of the embodiment of the present invention as above, the file to be shown of intelligent terminal is being carried out by it During display, it is after the file content obtaining this file to be shown, carries out resolving acquisition this document content to it Content structure, and these content structures are converted into web page contents, then this web page contents are passed through webpage Browse software to show, thus without using the various physical layer interfaces of system, it is not required that to these bottoms Interface is packaged, but is converted into web page contents, by the technology of web browser software display webpage Carry out typesetting, render and show, so that the whole process simplification rendering, showing, can be with summary File is shown on intelligent terminal by ground, and the efficiency of display is high.
Wherein, the file content of the file to be shown that foregoing acquisition module 501 obtains, can be to load Resolve again after storing to local internal memory.Accordingly, as it is shown in figure 5, in a concrete example, Device in the present embodiment also includes internal memory load-on module 505.
Wherein, this internal memory load-on module 505, load for the file content that content obtaining module 501 is obtained To local internal memory.
Now, above-mentioned parsing module 502, is for resolving the file content being loaded into local internal memory, Obtain each content structure of described file content.
Thus, after obtaining file content, first file content is loaded into local internal memory, then for being loaded into The file content of local internal memory resolves, and thereby may be ensured that seriality and the stream resolving and showing process Smooth property.
It will be understood by those skilled in the art that except file content is loaded into internal memory, it would however also be possible to employ other Mode file content is processed, and accordingly ensure resolve and display seriality, the present invention implement Example is not done exhaustive at this.
Due in the data stream of file content, for the different file format in file content, at dependency number According to some fields specified of stream, the information of this document form can be included, and other relevant corresponding In the field of connection, can include the particular content information of this document form, therefore, those skilled in the art can With clearly, when file content is resolved, difference based on file format, the byte to relevant field It is analyzed being assured that the various file formats comprised in file content and relevant particular content, this Kind analyze and resolving can by use at present existing and be likely to occur later any possible in the way of enter OK, the most no longer resolving is carried out expansion to repeat.
After above-mentioned parsing, can obtain the content structure of above-mentioned file content, content structure specifically can wrap Include content type and the attribute data corresponding with this content type.Content type can have a variety of, such as Picture, form, word, figure, icon, formula, symbol, audio frequency, video etc., naturally it is also possible to It it is other the most unlisted content type.For different files, the content class of its file content Type can be different, it is common that one or more in various content types, it is also possible to is these content types Various combinations.
HTML (HyperText Markup Language, HTML) is a kind of design, creates Webpage and a kind of markup language of other information can seen in web browser software, its document compiling is not multiple Miscellaneous, but powerful, support that the file of different data format is bumped into.Accordingly, in a concrete example, Above-mentioned web page contents can be HTML content.Additionally, due to also CSS is that one can be truly realized webpage The form design language that performance separates with content, for the performance of conventional HTML, CSS can be right The position typesetting of the object in webpage carries out the accurate control of Pixel-level, supports almost all of font size sample Formula, has web object and the ability of model pattern editor, and can carry out preliminary interaction design, therefore, Above-mentioned web page contents, it is also possible to be HTML CSS content.
Now, as a example by web page contents is as HTML content, shown in Figure 5, in a concrete example, Above-mentioned modular converter 503 includes:
Label adds module 5031, for according to the content type comprised respectively in each described content structure, adds Add the label corresponding with each described content type of html language;
Tag attributes setting module 5032, for according to the described attribute data corresponding with each content type, divides The property content of each label that She Ding be not corresponding with each content type, it is thus achieved that the HTML content after conversion.
As a example by the most several different content types, the parsing relevant to it and transformation process are carried out Illustrate.
Include as a example by picture by content type, the picture storage that parsing can be obtained by above-mentioned parsing module 502 Intelligent terminal is local, and records the picture store path storing this picture.Now, above-mentioned label adds module 5031 can add img label in HTML content, and above-mentioned tag attributes setting module 5032 arranges img The src attribute of label is described picture store path, realizes picture turning to corresponding HTML content accordingly Change.
On the other hand, for picture, may also have other attribute data, such as, be shown centered on picture. Now, when the attribute data corresponding with picture includes being shown centered on picture, can be by arranging div tag Style attribute is text-align:center, thus realizes being shown centered on the attribute data of picture to HTML content Conversion.
As a example by when content type includes form, above-mentioned label adds module 5031 can be in HTML content Add table label;Each row for form adds the tr label of correspondence respectively;The list of each row according to form Unit lattice number, after the tr label that each row is corresponding, add td label corresponding with each unit lattice respectively and / td label;The content of text of each unit lattice is added on and this cell by above-mentioned tag attributes setting module 5032 Between corresponding td label and/td label, realize the picture conversion to corresponding HTML content accordingly.
On the other hand, for form, may also have the frame width of other attribute data, such as form Degree, the spacing etc. of cell.The border width of form, unit is included at the attribute data corresponding with form During the spacing of lattice, can be described border width by arranging the border attribute of table label;Table is set The spacing that cellspacing attribute is described cell of label, it is achieved both attribute datas of form arrive The conversion of HTML content.
As a example by when content type includes video, the attribute data corresponding with video generally comprise video width, Video height and video type;Now, the video storage that parsing can be obtained by above-mentioned parsing module 502 Local to intelligent terminal, and record the video store path storing this video;Obtain the attribute corresponding with video Video width, video height and video type in data.When specifically changing, label adds mould Block 5031 can add video label in HTML content, and tag attributes setting module 5032 arranges video The src attribute of label is described video store path, and width attribute is described video width, height attribute For described video height, type attribute is described video type, realizes video accordingly in corresponding HTML The conversion held.
According to current technology development, web browser software the most all can support video label, it is achieved Broadcasting to video file in web browser software.The situation of video label is not supported at web browser software Under, can call corresponding with described type attribute according to the height attribute of video label and width attribute Player plug-in unit the video of described src attribute is played out, i.e. video is entered by calling player plug-in unit Row renders display.When playing, width attribute based on video label and height attribute, it is possible to achieve Scaling to video.
Include as a example by audio frequency by content type, now, the sound that parsing can be obtained by above-mentioned parsing module 502 Frequency storage is local to intelligent terminal, and records the audio storage path storing this audio frequency.Specifically changing Time, label adds module 5031 can add audio label in HTML content, and tag attributes sets mould It is described audio storage path that block 5032 arranges the src attribute of audio label, realizes audio frequency accordingly to correspondence The conversion of HTML content.
According to current technology development, web browser software the most all can support audio label, it is achieved Broadcasting to audio frequency in web browser software.In the case of web browser software does not support audio label, can With according to audio label, call relevant audio frequency player plug-in and the audio frequency of described src attribute played out, I.e. audio frequency is played out, renders by calling audio frequency player plug-in.
It will be understood by those skilled in the art that and show literary composition on the intelligent terminal of the embodiment of the present invention as above The device of part, can become one as with web browser software, as a part for web browser software Use.For the data stream of web browser software and difficulty or ease that web browser software is safeguarded The consideration of degree, the upper device showing file of the intelligent terminal of the embodiment of the present invention as above, it is also possible to The form of plug-in unit realizes.Web browser software can provide the file path of file to be shown to this plug-in unit, inserts Part obtains the file content of file to be shown and carries out resolving, being converted to the HTML content after changing, then After the conversion that will obtain, content sends web browser software to and shows, can rely on web browser software itself Ability directly show by the form of html web page.It practice, the embodiment of the present invention as above The device of intelligent terminal's upper display file also can be not limited to above two mode, it is achieved as above this The purpose of bright embodiment.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, Can be by computer program and complete to instruct relevant hardware, described program can be stored in one non-easily In the computer read/write memory medium of the property lost, in the embodiment of the present invention, this program can be stored in computer In the storage medium of system, and performed by least one processor in this computer system, to realize including Flow process such as the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic disc, CD, read-only Store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can combine arbitrarily, for making description succinct, the most right The all possible combination of each technical characteristic in above-described embodiment is all described, but, if these skills There is not contradiction in the combination of art feature, is all considered to be the scope that this specification is recorded.
Embodiment described above only have expressed the several embodiments of the present invention, and it describes more concrete and detailed, But can not therefore be construed as limiting the scope of the patent.It should be pointed out that, for this area For those of ordinary skill, without departing from the inventive concept of the premise, it is also possible to make some deformation and change Entering, these broadly fall into protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be with appended power Profit requires to be as the criterion.

Claims (16)

1. the upper method showing file of an intelligent terminal, it is characterised in that include step:
Obtain the file content of file to be shown;
Described file content is resolved, it is thus achieved that each content structure of described file content;
Each described content structure is converted to web page contents;
The described web page contents obtained after conversion is shown by web browser software.
The upper method showing file of intelligent terminal the most according to claim 1, it is characterised in that described Content structure includes content type and the attribute data corresponding with this content type, and described web page contents includes HTML content;
The mode that each content structure is converted to web page contents is included:
According to the content type comprised respectively in each described content structure, add the described with each of html language The label that content type is corresponding;
According to the described attribute data corresponding with each content type, set corresponding with each content type each respectively The property content of label, it is thus achieved that the HTML content after conversion.
The upper method showing file of intelligent terminal the most according to claim 2, it is characterised in that described Content type include but not limited to picture, form, word, figure, icon, formula, symbol, audio frequency, Any one or combination in any in video.
The upper method showing file of intelligent terminal the most according to claim 3, it is characterised in that:
When described content type includes picture, the content structure that content type is picture is converted in HTML The mode held includes: picture storage intelligent terminal parsing obtained is local, and records the figure storing this picture Sheet store path;In HTML content, add img label, and the src attribute arranging img label is institute State picture store path.
The upper method showing file of intelligent terminal the most according to claim 3, it is characterised in that:
When described content type includes form, the content structure that content type is form is converted in HTML The mode held includes: add table label in HTML content;Each row for form adds correspondence respectively Tr label;The number of the cell of each row according to form, after the tr label that each row is corresponding, adds Td label corresponding with each unit lattice respectively and/td label;The content of text of each unit lattice is added on and this list Between td label and/td label that unit's lattice are corresponding.
The upper method showing file of intelligent terminal the most according to claim 3, it is characterised in that:
When described content type includes video, the content structure that content type is video is converted in HTML The mode held includes: it is local that video parsing obtained stores intelligent terminal, and records this video of storage Video store path;Obtain video width, video height and the video in the attribute data corresponding with video Type;In HTML content, add video label, and the src attribute arranging video label is described regarding Frequently store path, width attribute is described video width, and height attribute is described video height, and type belongs to Property is described video type.
The upper method showing file of intelligent terminal the most according to claim 3, it is characterised in that:
When described content type includes audio frequency, the content structure that content type is audio frequency is converted in HTML The mode held includes: audio storage parsing obtained to intelligent terminal is local, and records this audio frequency of storage Audio storage path;In HTML content, add audio label, and the src attribute of audio label is set For described audio storage path.
8., according to the upper method showing file of the intelligent terminal described in claim 4 to 6 any one, it is special Levy and be, including following every at least one:
When the attribute data corresponding with picture includes being shown centered on picture, it is the content of picture by content type Structure is converted to the mode of HTML content and also includes: the style attribute arranging div tag is text-align:center;
When the attribute data corresponding with form includes the spacing of the border width of form, cell, by content Type is that the content structure of form is converted to the mode of HTML content and also includes: arrange table label Border attribute is described border width;The cellspacing attribute arranging table label is described cell Spacing;
When described content type includes video, the HTML content obtained after conversion is passed through web browser software When showing, according to height attribute and the width attribute of video label, call and described type attribute The video of described src attribute is played out by corresponding player plug-in unit.
9. the upper device showing file of intelligent terminal, it is characterised in that including:
Content obtaining module, for obtaining the file content of file to be shown;
Parsing module, for resolving described file content, it is thus achieved that each content knot of described file content Structure;
Modular converter, for being converted to web page contents by each described content structure;
Display module, for showing the described web page contents obtained after conversion by web browser software.
The upper device showing file of intelligent terminal the most according to claim 9, it is characterised in that institute State content structure and include content type and the attribute data corresponding with this content type, described web page contents bag Include HTML content;Described modular converter includes:
Label adds module, for according to the content type comprised respectively in each described content structure, adds The label corresponding with each described content type of html language;
Tag attributes setting module, for according to the described attribute data corresponding with each content type, setting respectively The property content of the fixed each label corresponding with each content type, it is thus achieved that the HTML content after conversion.
The upper device showing file of 11. intelligent terminal according to claim 10, it is characterised in that institute State content type include but not limited to picture, form, word, figure, icon, formula, symbol, audio frequency, Any one or combination in any in video.
The upper device showing file of 12. intelligent terminal according to claim 11, it is characterised in that:
When described content type includes picture, the picture storage intelligent terminal that parsing is obtained by described parsing module This locality, and record the picture store path storing this picture;Described label adds module in HTML content Adding img label, it is the storage of described picture that described tag attributes setting module arranges the src attribute of img label Path.
The upper device showing file of 13. intelligent terminal according to claim 11, it is characterised in that:
When described content type includes form, described label adds module and adds table in HTML content Label;Each row for form adds the tr label of correspondence respectively;The number of the cell of each row according to form Mesh, after the tr label that each row is corresponding, adds td label corresponding with each unit lattice respectively and/td label; The content of text of each unit lattice is added on the td label corresponding with this cell by described tag attributes setting module And between/td label.
The upper device showing file of 14. intelligent terminal according to claim 11, it is characterised in that:
When described content type includes video, the attribute data corresponding with video includes that video width, video are high Degree and video type;
It is local that the video that parsing is obtained by described parsing module stores intelligent terminal, and records this video of storage Video store path;Obtain video width, video height in the attribute data corresponding with video and regard Frequently type;
Described label adds module and adds video label in HTML content, and described tag attributes sets mould It is described video store path that block arranges the src attribute of video label, and width attribute is described video width, Height attribute is described video height, and type attribute is described video type.
The upper device showing file of 15. intelligent terminal according to claim 11, it is characterised in that:
When described content type includes audio frequency, the audio storage that parsing is obtained by described parsing module is to intelligence eventually End this locality, and record the audio storage path storing this audio frequency;Described label adds module at HTML content Middle interpolation audio label, it is described sound that described tag attributes setting module arranges the src attribute of audio label Frequently store path.
16. according to the upper device showing file of the intelligent terminal described in claim 12 to 14 any one, It is characterized in that, including following every at least one:
When the attribute data corresponding with picture includes being shown centered on picture, described tag attributes setting module is also The style attribute arranging div tag is text-align:center;
When the attribute data corresponding with form includes the spacing of the border width of form, cell, described mark It is described border width that label attribute setup module also sets up the border attribute of table label;Table mark is set The spacing that cellspacing attribute is described cell signed;
When described content type includes video, described display module according to the height attribute of video label and Width attribute, calls the player plug-in unit corresponding with described type attribute and carries out the video of described src attribute Play.
CN201610309637.8A 2016-05-10 2016-05-10 Method and device for displaying file on intelligent terminal Active CN105956133B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610309637.8A CN105956133B (en) 2016-05-10 2016-05-10 Method and device for displaying file on intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610309637.8A CN105956133B (en) 2016-05-10 2016-05-10 Method and device for displaying file on intelligent terminal

Publications (2)

Publication Number Publication Date
CN105956133A true CN105956133A (en) 2016-09-21
CN105956133B CN105956133B (en) 2020-12-22

Family

ID=56912198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610309637.8A Active CN105956133B (en) 2016-05-10 2016-05-10 Method and device for displaying file on intelligent terminal

Country Status (1)

Country Link
CN (1) CN105956133B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577650A (en) * 2017-07-24 2018-01-12 华中师范大学 A kind of Rich Media's preparation method of local chronicle resource
CN108268256A (en) * 2018-01-24 2018-07-10 中山大学 A kind of log sheet standardizes dynamic web page generation method
CN111309313A (en) * 2019-10-17 2020-06-19 天津大学 Method for quickly generating HTML (hypertext markup language) and storing form data
CN116108492A (en) * 2023-04-07 2023-05-12 安羚科技(杭州)有限公司 Laterally expandable data leakage prevention system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697157A (en) * 2009-09-04 2010-04-21 耿学鸿 Electronic document browse processing method and system
US8005854B2 (en) * 2003-03-14 2011-08-23 Sybase, Inc. System with methodology for executing relational operations over relational data and data retrieved from SOAP operations
CN103324731A (en) * 2013-06-28 2013-09-25 中国农业银行股份有限公司 Method and device for converting spreadsheet file into web format file
CN103353878A (en) * 2013-06-14 2013-10-16 陆昀 Method for displaying files of different file formats in webpage
CN103853806A (en) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 Method and device for converting table
CN104156207A (en) * 2014-07-31 2014-11-19 广州金山网络科技有限公司 File display method and device
CN104853254A (en) * 2015-05-26 2015-08-19 深圳市理奥网络技术有限公司 Video playing method and mobile terminal
CN105095160A (en) * 2015-07-31 2015-11-25 河南大学 Document conversion reading method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8005854B2 (en) * 2003-03-14 2011-08-23 Sybase, Inc. System with methodology for executing relational operations over relational data and data retrieved from SOAP operations
CN101697157A (en) * 2009-09-04 2010-04-21 耿学鸿 Electronic document browse processing method and system
CN103353878A (en) * 2013-06-14 2013-10-16 陆昀 Method for displaying files of different file formats in webpage
CN103324731A (en) * 2013-06-28 2013-09-25 中国农业银行股份有限公司 Method and device for converting spreadsheet file into web format file
CN103853806A (en) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 Method and device for converting table
CN104156207A (en) * 2014-07-31 2014-11-19 广州金山网络科技有限公司 File display method and device
CN104853254A (en) * 2015-05-26 2015-08-19 深圳市理奥网络技术有限公司 Video playing method and mobile terminal
CN105095160A (en) * 2015-07-31 2015-11-25 河南大学 Document conversion reading method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577650A (en) * 2017-07-24 2018-01-12 华中师范大学 A kind of Rich Media's preparation method of local chronicle resource
CN108268256A (en) * 2018-01-24 2018-07-10 中山大学 A kind of log sheet standardizes dynamic web page generation method
CN111309313A (en) * 2019-10-17 2020-06-19 天津大学 Method for quickly generating HTML (hypertext markup language) and storing form data
CN116108492A (en) * 2023-04-07 2023-05-12 安羚科技(杭州)有限公司 Laterally expandable data leakage prevention system

Also Published As

Publication number Publication date
CN105956133B (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN108040278A (en) Active page processing method, server, system and the storage medium of smart television
CN104123399B (en) A kind of cross-platform exam pool resource construction method
CN105956133A (en) Method and apparatus for displaying file in intelligent terminal
CN109254773A (en) Skeleton page generation method, device, equipment and storage medium
US20060161890A1 (en) Application-generic sequence diagram generator driven by a non-proprietary language
CN104346322A (en) Document format processing device and document format processing method
CN102541819B (en) Electronic document reading mode processing method and device
CN104520816B (en) For adjusting method, equipment and storage media across expanding communication
CN106648635B (en) Cross-platform formula editing and rendering method and system
CN104820589A (en) Method and device for dynamically adapting webpage
CN104050238A (en) Map labeling method and map labeling device
CN106469047A (en) A kind of list implementation method and device
CN103377039B (en) A kind of web game exploitation, analytic method, a kind of editing machine and resolver
CN105373520A (en) Method and device for setting control style attributes
JP2014197341A (en) Electronic book production device, electronic book system, electronic book production method and program
CN110297636A (en) A kind of automatic production of HTML page and parameter management method based on page configuration file, system and device
US9727293B1 (en) Method and apparatus for paginating electronic documents
CN109683978A (en) A kind of method, apparatus and electronic equipment of the rendering of streaming layout interface
CN111190519A (en) File and control processing method, device, equipment and storage medium thereof
CN109190078A (en) Webpage construction method, device and storage medium
CN101527737A (en) Display method of help information of page, system and client
US20050132285A1 (en) System and method for generating webpages
CN114168853A (en) Data visualization display method, device, medium and electronic equipment
CN104424174B (en) Document processing system and document processing method
CN113127410A (en) Method and system for converting PPT file format

Legal Events

Date Code Title Description
C06 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