CN105956133B - Method and device for displaying file on intelligent terminal - Google Patents

Method and device for displaying file on intelligent terminal Download PDF

Info

Publication number
CN105956133B
CN105956133B CN201610309637.8A CN201610309637A CN105956133B CN 105956133 B CN105956133 B CN 105956133B CN 201610309637 A CN201610309637 A CN 201610309637A CN 105956133 B CN105956133 B CN 105956133B
Authority
CN
China
Prior art keywords
content
video
attribute
tag
audio
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.)
Active
Application number
CN201610309637.8A
Other languages
Chinese (zh)
Other versions
CN105956133A (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and a device for displaying files on an intelligent terminal are provided, the method comprises the following steps: acquiring file contents of a file to be displayed, analyzing the file contents, and acquiring each content structure of the file contents; converting each content structure into webpage content; and displaying the webpage content obtained after conversion through webpage browsing software. According to the scheme of the embodiment of the invention, various bottom layer interfaces of the system are not required to be used, the bottom layer interfaces are not required to be packaged, the bottom layer interfaces are converted into webpage contents, and the webpage contents are typesetted, rendered and displayed by means of the webpage browsing software webpage displaying technology, so that the whole rendering and displaying process is simplified, the file can be simply and easily displayed on the intelligent terminal, and the displaying efficiency is high.

Description

Method and device for displaying file on intelligent terminal
Technical Field
The invention relates to the field of information display, in particular to a method for displaying files on an intelligent terminal and a device for displaying files on the intelligent terminal.
Background
With the increasingly widespread popularization and application of intelligent terminals, the document content is opened through the mobile terminal to realize the viewing of various document contents, and the document content becomes an important content in the application of the current intelligent terminal.
However, the composition of the document content is complex, and different documents may contain different contents, for example, the document may contain various combinations of one or more of various contents such as pictures, tables, graphs, charts, formulas, symbols, characters, and various typesets of the contents. At present, when an intelligent terminal displays document contents, a system interface carried by the intelligent terminal is generally adopted, different contents in a document are packaged by adopting a specific system interface corresponding to the contents, then, the contents are rendered and drawn into a cache of bitmap (bitmap file, a bitmap is a Windows standard format graphic file, an image is defined to be composed of points (pixels), and each point can be represented by multiple colors), and finally, the bitmap is displayed on a screen. In the process of packaging and drawing, matching and calculation are additionally required for the analyzed attribute information related to drawing, so that the related system interface can be packaged. Taking the document content containing the centrally displayed picture as an example, based on the current display mode, the information of the picture centralized typesetting can be obtained by analyzing the document content, so that the specific picture drawing position needs to be calculated according to the size of the picture and the size of the document page, and then the related system interface is called to draw the picture. In the method for drawing the document content by adopting the system self-contained system interface, the attribute of each content of the document needs to be recalculated, even the attribute of a plurality of contents of the document needs to be further packaged to finish drawing, so that the rendering and drawing are extremely complex when the document content is displayed by the intelligent terminal, and the efficiency of the intelligent terminal for displaying the document content is influenced.
Disclosure of Invention
Accordingly, an object of the embodiments of the present invention is to provide a method for displaying a file on an intelligent terminal and an apparatus for displaying a file on an intelligent terminal, which can easily display a file on an intelligent terminal and have high display efficiency.
In order to achieve the purpose, the embodiment of the invention adopts the following technical scheme:
a method for displaying files on an intelligent terminal comprises the following steps:
acquiring file contents of a file to be displayed, analyzing the file contents, and acquiring each content structure of the file contents;
converting each content structure into webpage content;
and displaying the webpage content obtained after conversion through webpage browsing software.
An apparatus for displaying files on a smart terminal, comprising:
the content acquisition module is used for acquiring the file content of the file to be displayed;
the analysis module is used for analyzing the file content to obtain each content structure of the file content;
the conversion module is used for converting each content structure into webpage content;
and the display module is used for displaying the webpage content obtained after conversion through webpage browsing software.
According to the scheme of the embodiment of the invention, when the file to be displayed of the intelligent terminal is displayed, the file content of the file to be displayed is obtained and then analyzed to obtain the content structure of the file content, the content structure is converted into the webpage content, and then the webpage content is displayed through the webpage browsing software, so that various bottom interfaces of the system are not needed to be used, the bottom interfaces are not needed to be packaged, the webpage content is converted into the webpage content, and the webpage is displayed by means of the webpage browsing software technology for typesetting, rendering and displaying, so that the whole rendering and displaying process is simplified, the file can be displayed on the intelligent terminal in a simplified manner, and the displaying efficiency is high.
Drawings
FIG. 1 is a schematic diagram of an operating environment in which aspects of the present invention may be implemented;
FIG. 2 is a block diagram of a terminal according to an embodiment;
FIG. 3 is a flowchart illustrating a method for displaying files on a smart terminal according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating a method for displaying files on a smart terminal according to another embodiment of the invention;
fig. 5 is a schematic structural diagram of an apparatus for displaying a file on an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
FIG. 1 illustrates a schematic diagram of an operating environment in one embodiment of the invention. The intelligent terminal 101 needs to open a related file, obtain the file content of the file, and display the file, where the file may be stored locally in the intelligent terminal 101 or obtained from the server 102 through a network. The embodiment of the invention relates to a scheme for displaying files on an intelligent terminal 101, the files for displaying can be local to the intelligent terminal 101 or can be obtained by the intelligent terminal 101 from a server 102 through a network, and the sources of the files are not particularly distinguished in the embodiment of the invention.
A schematic diagram of the structure of the intelligent terminal 101 in one embodiment is shown in fig. 2. The intelligent terminal comprises a processor, a storage medium, a communication interface, a power interface and a memory which are connected through a system bus. The storage medium of the intelligent terminal 101 stores a device for displaying files on the intelligent terminal, and the device is used for displaying files on the intelligent terminal. The communication interface of the intelligent terminal 101 may be used for connecting and communicating with the server 102, and the power interface of the intelligent terminal 101 is used for connecting with an external power supply, which supplies power to the intelligent terminal 101 through the power interface. The smart terminal 101 may be any device capable of implementing smart input and output, for example, a mobile terminal, such as a mobile phone, a tablet computer, etc.; other devices having the above-described structure are also possible.
A flowchart of a method for displaying files on a smart terminal in one embodiment is shown in fig. 3. As shown in fig. 3, the method in this embodiment includes the steps of:
step S301: the file content of the file to be displayed is acquired,
step S302: analyzing the file content to obtain each content structure of the file content;
step S303: converting each content structure into webpage content;
step S304: and displaying the webpage content obtained after conversion through webpage browsing software.
According to the scheme of the embodiment of the invention, when the file to be displayed of the intelligent terminal is displayed, the file content of the file to be displayed is obtained and then analyzed to obtain the content structure of the file content, the content structure is converted into the webpage content, and then the webpage content is displayed through the webpage browsing software, so that various bottom interfaces of the system are not needed to be used, the bottom interfaces are not needed to be packaged, the webpage content is converted into the webpage content, and the webpage is displayed by means of the webpage browsing software technology for typesetting, rendering and displaying, so that the whole rendering and displaying process is simplified, the file can be displayed on the intelligent terminal in a simplified manner, and the displaying efficiency is high.
After the file content of the file to be displayed is obtained in step S301, the file content may be loaded into the local memory for storage and then analyzed. Accordingly, fig. 4 is a flowchart illustrating a method for displaying a file on a smart terminal according to another embodiment of the method. As shown in fig. 4, the method in this embodiment includes the steps of:
step S401: the file content of the file to be displayed is acquired,
step S402: loading the acquired file content to a local memory;
step S403: analyzing the file content loaded to the local memory to obtain each content structure of the file content;
step S404: converting each content structure into webpage content;
step S404: and displaying the webpage content obtained after conversion through webpage browsing software.
Therefore, after the file content is obtained, the file content is loaded into the local memory, and then the file content loaded into the local memory is analyzed, so that the continuity and the fluency of the analysis and display processes can be ensured.
It can be understood by those skilled in the art that, in addition to loading the file content into the memory, other manners may also be used to process the file content, and accordingly, the continuity of parsing and displaying is ensured.
When the file content is parsed in the above steps S302 and S403, the specific parsing process may be performed locally in the smart terminal in general, and may also be performed by a third-party device other than the smart terminal, for example, a server, based on actual needs.
On the other hand, in the data stream of the file content, for different file formats in the file content, some specified fields in the related data stream may include information of the file format, and corresponding other related fields may include specific content information of the file format, so that it may be clear to a person skilled in the art that, when parsing the file content, various file formats and related specific contents included in the file content may be determined by analyzing bytes of the related fields based on the difference of the file formats, and this analysis and parsing process may be performed in any possible manner that exists at present and may appear later, and therefore, the parsing process is not repeated.
After the analysis, a content structure of the file content is obtained, where the content structure may specifically include a content type and attribute data corresponding to the content type. The content types may be many, such as pictures, tables, text, graphics, icons, formulas, symbols, audio, video, etc., but may be other content types not listed here. The content types of the content of the file may vary from file to file, and are typically one or more of various content types, as well as various combinations of these content types.
HTML (HyperText Markup Language) is a Markup Language for designing and creating web pages and other information that can be viewed in web browsing software, and its documents are not complicated to make, but powerful, and support the embedding of files in different data formats. Accordingly, in one specific example, the web page content may be HTML content. In addition, because the CSS is a style design language that can truly separate web page representation from content, compared with the representation of the conventional HTML, the CSS can perform pixel-level precise control on the position layout of objects in a web page, support almost all font and font styles, have the capability of editing web page objects and model styles, and can perform preliminary interactive design, and thus, the web page content can also be HTML CSS content. The web page browsing software may be a web page browser in general, and those skilled in the art understand that the web page browsing software may also be other software for browsing a web page as long as the browsing of an HTML web page can be implemented.
In this case, taking the web content as HTML content as an example, when each content structure is converted into the web content in the above steps S303 and S404, the following method may be adopted:
adding a label of an HTML language corresponding to each content type according to the content type contained in each content structure;
and respectively setting the attribute content of each label corresponding to each content type according to the attribute data corresponding to each content type, and obtaining the converted HTML content.
In the HTML language, different labels are configured aiming at different content types, so that the labels corresponding to the related content types in the HTML language are added based on the difference of the content types, and the attribute contents related to the labels in the HTML contents are set based on the related attribute data of the content types, so that the conversion from a content structure to the HTML contents can be conveniently realized, various bottom interfaces of a system are not needed to be used, the bottom interfaces are not needed to be packaged, and the HTML technology is used for typesetting, rendering and displaying, so that the whole rendering and displaying process is simplified.
The following is exemplified in detail with reference to the embodiment in fig. 4, and with reference to a specific process for displaying a file on an intelligent terminal.
When the file to be displayed needs to be displayed, the file to be displayed may be a file stored in the intelligent terminal locally in advance, or may be a file obtained from a server, the file content of the file to be displayed is obtained first, then the obtained file content is loaded into a memory for local analysis, and the analysis process can be performed in any possible way existing at present and possibly appearing in the future, so that the content structure of the analyzed file content is obtained. The content structure specifically includes a content type and attribute data corresponding to the content type.
The content types of the content of the files may vary from file to file, and may be any one or any combination of pictures, tables, text, graphics, icons, formulas, symbols, audio, video, and other various content types not listed.
For different content types, the corresponding attribute data can be used to assist rendering display, and for various content types and the corresponding attribute data contained in the file, the content types and the corresponding attribute data are converted into corresponding web page contents one by one. In view of the fact that HTML is a markup language for designing and creating web pages and other information visible in web browsing software, documents are not complex to make and are powerful, and support the embedding of files of different data formats, and therefore, in the embodiment of the present invention, the web content may be HTML content. In addition, because the CSS is a style design language that can truly separate web page representation from content, compared with the representation of the conventional HTML, the CSS can perform pixel-level precise control on the position layout of objects in a web page, support almost all font and font styles, have the capability of editing web page objects and model styles, and can perform preliminary interactive design, and thus, the web page content can also be HTML CSS content. Then, the HTML content or the HTML CSS content obtained by conversion can be typeset, rendered and displayed by adopting an HTML technology or a CSS technology.
The following will exemplify the way of converting the content of several files into HTML content, taking the content types of the file contents as examples.
Taking the content type as an example, the HTML has a tag img for displaying the picture, and after the file content is analyzed to obtain the picture, the analyzed picture can be stored locally in the intelligent terminal, and a picture storage path for storing the picture is recorded. And then adding an img tag in the HTML content, and setting the src attribute of the img tag as the picture storage path, thereby realizing conversion to the HTML content. For example, by setting the src attribute of the img tag, that is, < img src ═ picture storage path "/>, the conversion from a picture to HTML content can be completed without calling a system bottom interface or packaging the system bottom interface, which is very simple.
On the other hand, for pictures there may be other attribute data, such as a centered display picture. At this time, when the attribute data corresponding to the picture includes the center display picture, the conversion of the attribute data of the center display picture into the HTML content can be realized by setting the style attribute of the div tag to text-align: center. At this time, for a picture with a centered display attribute, as long as < div style ═ text-align: center is set; and if the 'img src ═ is the mobile phone path where the picture is located'/>/</div >, the picture with the centered display attribute is converted into the HTML content, and the picture is displayed in the center.
Taking the content type as an example of a table, a table tag in the HTML is used for displaying the table, and the table in the document can be easily converted into a < table > tag of the HTML, and a specific example manner may be: adding a table tag in HTML content; adding corresponding tr labels for each row of the table respectively; adding td labels and/td labels respectively corresponding to the cells after tr labels corresponding to the rows according to the number of the cells of each row of the table; and adding the text content of each cell between the td label and/td label corresponding to the cell.
Of course, those skilled in the art will understand that the above examples are mainly used to illustrate the position relationship among the text contents of the table tag, tr tag, td tag,/td tag, and cell, and in particular, when performing the conversion, other sequences may be adopted as long as the table can be converted into the HTML content.
On the other hand, for a table, there may be other attribute data, such as the frame width of the table, the cell pitch, and so on. When the attribute data corresponding to the table comprises the frame width of the table and the space between the cells, the border attribute of the table label can be set as the frame width; and setting the cellpacking attribute of the table label as the space of the cells, and realizing the conversion from the two attribute data of the table to the HTML content.
TABLE 1
First Row
Second Row
Taking the table shown in table 1 above as an example, after converting the HTML content, the code of the converted HTML content can be as follows:
Figure GDA0002604546080000081
it can be seen that each row in the table is converted to a < tr > tag, each cell is converted to a < td > tag, and the text content of the cell is converted to text content in the middle of the < td > </td > tag. Compared with the existing mode that the position of the rectangle of each cell needs to be calculated, then the canvas graphic drawing interface drawRect function is called to draw on bitmap, and the text content in the cell also needs to calculate the specific position information of the text and then calls the drawText interface to draw, the process of analyzing and converting is very simple.
Taking the content type as a video as an example, a video tag is arranged in html (hypertext markup language) and used for displaying video files in various formats, after the file content is analyzed, the video obtained by analysis can be stored in the intelligent terminal, and a video storage path for storing the video is recorded; and acquiring the video width, the video height and the video type in the attribute data corresponding to the video. And then adding a video tag in the HTML content, setting the src attribute of the video tag as the video storage path, setting the width attribute as the video width, setting the height attribute as the video height and setting the type attribute as the video type.
Taking an mp4 format video file as an example, after parsing, the code of the converted HTML content may be as follows:
<video width="320"height="240"controls>
< source src ═ video storage Path ═ video/mp4 >
</video>
According to the current technical development situation, web browsing software (such as a browser) generally supports a video tag, and video files are played in the web browsing software. Under the condition that the webpage browsing software does not support the video tag, a player plug-in corresponding to the type attribute can be called to play the video with the src attribute according to the height attribute and the width attribute of the video tag, namely, the video is rendered and displayed by calling the player plug-in. When playing, based on the width attribute and height attribute of the video tag, the video can be zoomed.
Taking the content type as audio, such as an audio file, audio tags in HTML are used for displaying audio files in various formats, and after the file content is analyzed, the audio obtained through analysis can be stored locally in the intelligent terminal, and an audio storage path for storing the audio is recorded. Then, an audio tag is added to the HTML content, and the src attribute of the audio tag is set as the audio storage path.
In an audio file with mp3 format, the html code obtained after parsing and conversion may be as follows:
< audio src ═ handset path where audio file is located "controls ═ controls" >, and
</audio>
according to the current technical development situation, the web browsing software (e.g. browser) generally supports the audio tag, so as to realize the audio playing in the web browsing software. Under the condition that the webpage browsing software does not support the audio tag, a related audio playing plug-in can be called to play the audio with the src attribute according to the audio tag, namely, the audio playing plug-in is called to play and render the audio.
Based on the above exemplary content, it can be determined that, because HTML is a simple language and is easy to master, and HTML encapsulates a plurality of attribute interfaces, which are basically consistent with interfaces required after parsing document content, and correspond to each other one by one during processing, the process of converting file content into HTML content for display reduces the problems of recalculation caused by mismatch between parsed attribute values and interface parameter values provided by a converter and need to encapsulate system interfaces again in many cases, and is more efficient to use, and reduces the complexity of the rendering process of the local rendering technology. The converted HTML content can form an HTML webpage, and then the webpage is displayed through related webpage browsing software (such as a web browser or other HTML webpage browsing software), so that the interactivity can be well improved.
Based on the same idea as the method, an embodiment of the present invention further provides a device for displaying a file on an intelligent terminal, and fig. 5 illustrates a schematic structural diagram of the device for displaying a file on an intelligent terminal in an embodiment.
As shown in fig. 5, the apparatus in the present embodiment includes:
a content obtaining module 501, configured to obtain file content of a file to be displayed;
an analyzing module 502, configured to analyze the file content to obtain each content structure of the file content;
a conversion module 503, configured to convert each content structure into web page content;
and a display module 504, configured to display the converted web page content through web page browsing software.
According to the scheme of the embodiment of the invention, when the file to be displayed of the intelligent terminal is displayed, the file content of the file to be displayed is obtained and then analyzed to obtain the content structure of the file content, the content structure is converted into the webpage content, and then the webpage content is displayed through the webpage browsing software, so that various bottom interfaces of the system are not needed to be used, the bottom interfaces are not needed to be packaged, the webpage content is converted into the webpage content, and the webpage is displayed by means of the webpage browsing software technology for typesetting, rendering and displaying, so that the whole rendering and displaying process is simplified, the file can be displayed on the intelligent terminal in a simplified manner, and the displaying efficiency is high.
The file content of the file to be displayed, which is obtained by the content obtaining module 501, may be loaded into a local memory for storage and then analyzed. Accordingly, as shown in fig. 5, in a specific example, the apparatus in the present embodiment further includes a memory loading module 505.
The memory loading module 505 is configured to load the file content acquired by the content acquiring module 501 into the local memory.
At this time, the analysis module 502 is configured to analyze the file content loaded into the local memory to obtain each content structure of the file content.
Therefore, after the file content is obtained, the file content is loaded into the local memory, and then the file content loaded into the local memory is analyzed, so that the continuity and the fluency of the analysis and display processes can be ensured.
It can be understood by those skilled in the art that, in addition to loading the file content into the memory, other manners may also be used to process the file content, and accordingly, the continuity of parsing and displaying is ensured.
In the data stream of the file content, for different file formats in the file content, some specified fields in the related data stream may include information of the file format, and corresponding other related fields may include specific content information of the file format, so a person skilled in the art can clearly understand that, when the file content is analyzed, various file formats and related specific contents included in the file content may be determined by analyzing bytes of the related fields based on the difference of the file formats, and the analysis and analysis processes may be performed in any possible manner existing at present and possibly occurring later, and thus, the analysis process is not expanded to be described repeatedly.
After the analysis, a content structure of the file content is obtained, where the content structure may specifically include a content type and attribute data corresponding to the content type. The content types may be many, such as pictures, tables, text, graphics, icons, formulas, symbols, audio, video, etc., but may be other content types not listed here. The content types of the content of the file may vary from file to file, and are typically one or more of various content types, as well as various combinations of these content types.
HTML (HyperText Markup Language) is a Markup Language for designing and creating web pages and other information that can be viewed in web browsing software, and its documents are not complicated to make, but powerful, and support the embedding of files in different data formats. Accordingly, in one specific example, the web page content may be HTML content. In addition, because the CSS is a style design language that can truly separate web page representation from content, compared with the representation of the conventional HTML, the CSS can perform pixel-level precise control on the position layout of objects in a web page, support almost all font and font styles, have the capability of editing web page objects and model styles, and can perform preliminary interactive design, and thus, the web page content can also be HTML CSS content.
At this time, taking the web page content as HTML content as an example, as shown in fig. 5, in a specific example, the converting module 503 includes:
a tag adding module 5031, configured to add, according to content types respectively included in the content structures, tags corresponding to the content types in an HTML language;
a tag attribute setting module 5032, configured to set attribute contents of each tag corresponding to each content type according to the attribute data corresponding to each content type, respectively, so as to obtain the converted HTML content.
The following description will illustrate the parsing and conversion process related thereto by taking several different content types as examples.
Taking the content type including the picture as an example, the parsing module 502 may store the parsed picture locally in the intelligent terminal, and record a picture storage path for storing the picture. At this time, the tag adding module 5031 may add img tags in the HTML content, and the tag attribute setting module 5032 sets src attributes of the img tags as the picture storage paths, so as to implement conversion from pictures to corresponding HTML content.
On the other hand, for pictures there may be other attribute data, such as a centered display picture. At this time, when the attribute data corresponding to the picture includes the center display picture, the conversion of the attribute data of the center display picture into the HTML content can be realized by setting the style attribute of the div tag to text-align: center.
Taking the content type including the table as an example, the tag adding module 5031 may add a table tag in the HTML content; adding corresponding tr labels for each row of the table respectively; adding td labels and/td labels respectively corresponding to the cells after tr labels corresponding to the rows according to the number of the cells of each row of the table; the tag attribute setting module 5032 adds the text content of each cell to the td tag and/td tag corresponding to the cell, thereby realizing the conversion from the picture to the corresponding HTML content.
On the other hand, for a table, there may be other attribute data, such as the frame width of the table, the cell pitch, and so on. When the attribute data corresponding to the table comprises the frame width of the table and the space between the cells, the border attribute of the table label can be set as the frame width; and setting the cellpacking attribute of the table label as the space of the cells, and realizing the conversion from the two attribute data of the table to the HTML content.
Taking the case that the content type includes a video as an example, the attribute data corresponding to the video generally includes a video width, a video height, and a video type; at this time, the analysis module 502 may store the video obtained by analysis locally in the intelligent terminal, and record a video storage path in which the video is stored; and acquiring the video width, the video height and the video type in the attribute data corresponding to the video. In specific conversion, the tag adding module 5031 may add a video tag to the HTML content, and the tag attribute setting module 5032 sets the src attribute of the video tag as the video storage path, the width attribute is the video width, the height attribute is the video height, and the type attribute is the video type, so as to implement conversion from the video to the corresponding HTML content.
According to the current technical development situation, web browsing software generally supports video tags, and video files are played in the web browsing software. Under the condition that the webpage browsing software does not support the video tag, a player plug-in corresponding to the type attribute can be called to play the video with the src attribute according to the height attribute and the width attribute of the video tag, namely, the video is rendered and displayed by calling the player plug-in. When playing, based on the width attribute and height attribute of the video tag, the video can be zoomed.
Taking the content type including the audio as an example, at this time, the analysis module 502 may store the audio obtained by analysis locally in the intelligent terminal, and record an audio storage path for storing the audio. Specifically, when the conversion is performed, the tag adding module 5031 may add an audio tag in the HTML content, and the tag attribute setting module 5032 sets the src attribute of the audio tag as the audio storage path, thereby implementing the conversion from the audio to the corresponding HTML content.
According to the current technical development situation, the webpage browsing software generally supports the audio tag, and the audio is played in the webpage browsing software. Under the condition that the webpage browsing software does not support the audio tag, a related audio playing plug-in can be called to play the audio with the src attribute according to the audio tag, namely, the audio playing plug-in is called to play and render the audio.
It will be understood by those skilled in the art that the apparatus for displaying files on an intelligent terminal according to the above-described embodiment of the present invention may be integrated with web browsing software and used as a part of the web browsing software. In view of the data flow of the web browsing software and the difficulty level of maintaining the web browsing software, the apparatus for displaying files on the intelligent terminal according to the embodiment of the present invention may also be implemented in the form of a plug-in. The webpage browsing software can provide a file path of a file to be displayed to the plug-in, the plug-in acquires the file content of the file to be displayed, analyzes and converts the file content to obtain converted HTML content, and then transmits the converted HTML content to the webpage browsing software for display, and the HTML content can be directly displayed in a form of an HTML webpage by means of the self-capability of the webpage browsing software. In fact, the device for displaying files on the smart terminal according to the embodiment of the present invention is not limited to the above two modes, and the object of the embodiment of the present invention may be achieved.
It will be understood by those skilled in the art that all or part of the processes in the methods of the embodiments described above may be implemented by a computer program, which is stored in a non-volatile computer readable storage medium, and in the embodiments of the present invention, the program may be stored in the storage medium of a computer system and executed by at least one processor in the computer system to implement the processes of the embodiments including the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for displaying files on an intelligent terminal is characterized by comprising the following steps:
acquiring file contents of a file to be displayed, and loading the acquired file contents into a local memory;
analyzing the file content loaded to the local memory to obtain each content structure of the file content, wherein the content structure comprises a content type and attribute data corresponding to the content type; the content type includes but is not limited to any one or any combination of pictures, tables, characters, graphs, icons, formulas, symbols, audio and video; the attribute data is used for assisting rendering display, and when the content type comprises a table, the corresponding attribute data comprises the frame width of the table and the space between the cells;
converting each content structure into web page content, wherein the web page content comprises HTML content; the method for converting each content structure into the webpage content comprises the following steps: adding a label of an HTML language corresponding to each content type according to the content type contained in each content structure; respectively setting attribute contents of each label corresponding to each content type according to the attribute data corresponding to each content type, and obtaining converted HTML contents;
displaying the webpage content obtained after conversion through webpage browsing software;
when the content type includes audio, the mode of converting the content structure of which the content type is audio into HTML content includes: storing the audio obtained by analysis to the local intelligent terminal, recording an audio storage path for storing the audio, adding an audio tag in HTML (hypertext markup language) content, and setting the src attribute of the audio tag as the audio storage path; displaying the webpage content obtained after conversion through webpage browsing software, wherein the displaying comprises the following steps: under the condition that the webpage browsing software does not support the audio tag, calling a related audio playing plug-in to play the audio with the src attribute according to the audio tag;
when the content type comprises a table, the mode of converting the content structure of which the content type is the table into the HTML content comprises the following steps: adding a table tag in HTML content; adding corresponding tr labels for each row of the table respectively; adding td labels and/td labels respectively corresponding to the cells after tr labels corresponding to the rows according to the number of the cells of each row of the table; adding the text content of each cell between the td label and/td label corresponding to the cell; when the attribute data corresponding to the table comprises the frame width of the table and the space between the cells, setting the pointer attribute of the table label as the frame width; and setting the cellpacking attribute of the table label as the distance of the cells.
2. The method for displaying files on the intelligent terminal according to claim 1, wherein:
when the content type includes a picture, the mode of converting the content structure of which the content type is the picture into the HTML content comprises the following steps: storing the picture obtained by analysis in the local intelligent terminal, and recording a picture storage path for storing the picture; and adding an img tag in the HTML content, and setting the src attribute of the img tag as the picture storage path.
3. The method for displaying files on the intelligent terminal according to claim 1, wherein:
when the content type includes a video, the mode of converting the content structure of which the content type is the video into the HTML content includes: storing the video obtained by analysis to the local intelligent terminal, and recording a video storage path for storing the video; acquiring video width, video height and video type in attribute data corresponding to the video; adding a video tag in HTML content, setting the src attribute of the video tag as the video storage path, the width attribute as the video width, the height attribute as the video height, and the type attribute as the video type.
4. The method for displaying the file on the intelligent terminal according to any one of claims 1 to 3, characterized by comprising at least one of the following items:
when the attribute data corresponding to the picture includes the center display picture, the manner of converting the content structure whose content type is the picture into the HTML content further includes: setting the style attribute of the div label as text-align to center;
and when the content type comprises a video, calling a player plug-in corresponding to the type attribute to play the video with the src attribute according to the height attribute and the width attribute of the video tag when the converted HTML content is displayed through webpage browsing software.
5. The utility model provides a device that shows file on intelligent terminal which characterized in that includes:
the content acquisition module is used for acquiring the file content of the file to be displayed and loading the acquired file content to a local memory;
the analysis module is used for analyzing the file content loaded to the local memory to obtain each content structure of the file content, wherein the content structure comprises a content type and attribute data corresponding to the content type; when the content type comprises audio, the analysis module stores the audio obtained by analysis to the local intelligent terminal and records an audio storage path for storing the audio; the content type includes but is not limited to any one or any combination of pictures, tables, characters, graphs, icons, formulas, symbols, audio and video; the attribute data is used for assisting rendering display, and when the content type comprises a table, the corresponding attribute data comprises the frame width of the table and the space between the cells;
the conversion module is used for converting each content structure into webpage content, and the webpage content comprises HTML content;
the display module is used for displaying the converted webpage content through webpage browsing software;
the conversion module includes:
the tag adding module is used for adding tags corresponding to the content types in the HTML language according to the content types respectively contained in the content structures; when the content type comprises audio, the tag adding module adds an audio tag in HTML content, and the tag attribute setting module sets the src attribute of the audio tag as the audio storage path; when the content type comprises a table, the tag adding module adds a table tag in HTML content; adding corresponding tr labels for each row of the table respectively; adding td labels and/td labels respectively corresponding to the cells after tr labels corresponding to the rows according to the number of the cells of each row of the table; the label attribute setting module adds the text content of each cell between the td label and/td label corresponding to the cell, and sets the border attribute of the table label as the border width when the attribute data corresponding to the table comprises the border width of the table and the space between the cells; setting the cellpacking attribute of the table label as the distance of the cells;
the tag attribute setting module is used for respectively setting the attribute content of each tag corresponding to each content type according to the attribute data corresponding to each content type to obtain the converted HTML content;
and when the content type comprises audio, the display module calls a related audio playing plug-in to play the audio with the src attribute according to the audio tag under the condition that the webpage browsing software does not support the audio tag.
6. The apparatus for displaying files on a smart terminal according to claim 5, wherein:
when the content type comprises a picture, the analysis module stores the picture obtained by analysis locally in the intelligent terminal and records a picture storage path for storing the picture; the tag adding module adds img tags in HTML content, and the tag attribute setting module sets src attributes of the img tags as the picture storage paths.
7. The apparatus for displaying files on a smart terminal according to claim 5, wherein:
when the content type comprises a video, the attribute data corresponding to the video comprises a video width, a video height and a video type;
the analysis module stores the video obtained by analysis to the local intelligent terminal and records a video storage path for storing the video; acquiring video width, video height and video type in attribute data corresponding to the video;
the tag adding module adds a video tag in HTML content, the tag attribute setting module sets the src attribute of the video tag as the video storage path, the width attribute is the video width, the height attribute is the video height, and the type attribute is the video type.
8. The apparatus for displaying files on a smart terminal according to any one of claims 5 to 7, comprising at least one of:
when the attribute data corresponding to the picture comprises a centered display picture, the tag attribute setting module further sets the style attribute of the div tag as text-align, namely center;
and when the content type comprises a video, calling a player plug-in corresponding to the type attribute to play the video with the src attribute by the display module according to the height attribute and the width attribute of the video tag.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
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 CN105956133A (en) 2016-09-21
CN105956133B true 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)

Families Citing this family (5)

* 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
CN113516737B (en) * 2020-03-27 2024-09-03 北京小米松果电子有限公司 Animation conversion method and device and intelligent equipment
CN116108492B (en) * 2023-04-07 2023-06-30 安羚科技(杭州)有限公司 Laterally expandable data leakage prevention system

Citations (3)

* 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
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

Family Cites Families (5)

* 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
CN103353878A (en) * 2013-06-14 2013-10-16 陆昀 Method for displaying files of different file formats in webpage
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
CN105095160B (en) * 2015-07-31 2018-12-28 河南大学 A kind of document conversion reading method and system

Patent Citations (3)

* 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
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

Also Published As

Publication number Publication date
CN105956133A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
CN105956133B (en) Method and device for displaying file on intelligent terminal
CN104346322B (en) Document format processing unit and document format processing method
EP1460848B1 (en) Apparatus and method for converting multimedia contents
US8923651B2 (en) Data system and method
CN111553131B (en) PSD file analysis method, device, equipment and readable storage medium
CN108040278A (en) Active page processing method, server, system and the storage medium of smart television
JP5439454B2 (en) Electronic comic editing apparatus, method and program
JP5439456B2 (en) Electronic comic editing apparatus, method and program
CN110415319B (en) Animation production method and device based on PPT, electronic equipment and storage medium
CN104850388A (en) Method and apparatus for drafting webpage
US9727293B1 (en) Method and apparatus for paginating electronic documents
CN104820589A (en) Method and device for dynamically adapting webpage
CN111915705B (en) Picture visual editing method, device, equipment and medium
CN106776994B (en) Application method and system of engineering symbols in engineering report forms and web pages
CN109190078A (en) Webpage construction method, device and storage medium
CN114791988A (en) Browser-based PDF file analysis method, system and storage medium
CN104424174B (en) Document processing system and document processing method
KR102087274B1 (en) Web electric document editing apparatus for rendering object and operating method thereof
CN115268904A (en) User interface design file generation method, device, equipment and medium
CN112433995A (en) File format conversion method, system, computer equipment and storage medium
CN112416340A (en) Webpage generation method and system based on sketch
CN113535151B (en) Code generation method and device
US20100017708A1 (en) Information output apparatus, information output method, and recording medium
KR102087247B1 (en) Web electric document editing apparatus for rendering drawing object and operating method thereof

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