CN113312318A - File display method and device and computer equipment - Google Patents

File display method and device and computer equipment Download PDF

Info

Publication number
CN113312318A
CN113312318A CN202110662429.7A CN202110662429A CN113312318A CN 113312318 A CN113312318 A CN 113312318A CN 202110662429 A CN202110662429 A CN 202110662429A CN 113312318 A CN113312318 A CN 113312318A
Authority
CN
China
Prior art keywords
layer
file
target
converted
layers
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.)
Pending
Application number
CN202110662429.7A
Other languages
Chinese (zh)
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202110662429.7A priority Critical patent/CN113312318A/en
Publication of CN113312318A publication Critical patent/CN113312318A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a file display method, a file display device and computer equipment, wherein the method comprises the following steps: acquiring a target file; analyzing the target file to obtain a layer set corresponding to the target file; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set; and displaying all layers in the converted layer set on a preset page. The present application also provides a computer-readable storage medium. According to the method and the device, the layer analysis and the layer format conversion are carried out on the file, the converted layer is directly displayed, and the processing of the special attribute of the layer is abandoned, so that the time for displaying the file is shortened, and the file display efficiency is improved.

Description

File display method and device and computer equipment
Technical Field
The present application relates to the field of internet technologies, and in particular, to a file display method and apparatus, and a computer device.
Background
The PSD (Photoshop document) file is a special format file of the image processing software Photoshop. The format file can store meta information of all layers in Photoshop software, including data such as coordinates, sizes and colors.
In order to display and edit a PSD file on a browser or an intelligent terminal device (such as a smart phone) and realize online design of advertisement image visualization, layer data of the PSD file is usually derived into a picture, meta-information of each layer is recorded, and then restored on the browser or the intelligent terminal device. However, there are several disadvantages to doing so: when the number of the layers of the PSD file is large, the exporting of the pictures is time-consuming and labor-consuming; the PSD file layer has some special attributes, such as layer pattern, mixed pattern and the like, which cannot be exported in a picture form; the PSD file layers have no incidence relation, manual marking is needed, and marking rules are lacked.
That is, in the prior art, the method of converting the PSD file into the format file suitable for the browser page is very complicated, and the conversion efficiency is very low.
Disclosure of Invention
The application provides a file display method, a file display device and computer equipment, and can solve the problems that in the prior art, the file display time is long and the file display efficiency is low in the file display process.
First, to achieve the above object, the present application provides a file display method, including:
acquiring a target file; (ii) a For the target file; analyzing to obtain the target file; a corresponding layer set; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set; and displaying all layers in the converted layer set on a preset page.
In one example, when the target file is a PSD document, the analyzing the target file to obtain the layer set corresponding to the target file includes: and carrying out layer analysis on the target PSD document through a preset PSD document analysis tool to obtain the layer set.
In one example, the performing layer parsing on the target PSD document to obtain the layer set includes: traversing each node in the tree data structure corresponding to the target PSD document by adopting a depth-first principle, and sequentially analyzing each node according to a traversal sequence to output layer data in a corresponding one-dimensional array format.
In one example, before converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, the method further includes: and filtering useless special effects, layer grouping nodes and empty character layers in the layer set according to a preset filtering rule.
In one example, the data field includes at least one of a layer number, a layer name, a layer content category, a layer length, a layer width, a layer color, a layer offset horizontal axis, a layer offset vertical axis, a layer rotation, a layer transparency, a layer shadow horizontal axis, and a layer shadow color.
In an example, when the page is a browser page, the converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set further includes: and storing the second image layer to a static resource server in a picture form and generating a corresponding static resource URL to obtain a URL set corresponding to the converted image layer set.
In one example, the layer set includes layers and corresponding layer description information, where the layer description information includes position information and offset angles of the layers, and displaying all the layers in the converted layer set on a preset page includes: and obtaining corresponding layer pictures from the static resource server according to each URL of the URL set, and rendering each layer picture to a Canvas of a browser in sequence according to the position information and the offset angle for drawing to a browser view.
Further, to achieve the above object, the present application also provides a document display apparatus, comprising:
the acquisition module is used for acquiring a target file; the analysis module is used for analyzing the target file to obtain a layer set corresponding to the target PSD document; the conversion module is configured to convert all data fields of a first layer in the layer set into a target format to obtain a second layer and store the second layer in the converted layer set, where the first layer is any layer in the layer set; and the display module is used for displaying all layers in the converted layer set on a preset page.
Further, the present application also proposes a computer device, which includes a memory and a processor, where the memory stores a computer program that can be executed on the processor, and the computer program, when executed by the processor, implements the steps of the file display method as described above.
Further, to achieve the above object, the present application also provides a computer-readable storage medium storing a computer program, which is executable by at least one processor to cause the at least one processor to execute the steps of the file display method as described above.
Compared with the prior art, the file display method, the file display device, the computer equipment and the computer readable storage medium can acquire the target file; analyzing the target file to obtain a layer set corresponding to the target file; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set; and displaying all layers in the converted layer set on a preset page. By carrying out layer analysis and layer format conversion on the file and directly displaying the converted layer, the processing of special attributes of the layer is abandoned, so that the time for displaying the file is shortened, and the file display efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an application environment according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a display method of the present application;
FIG. 3(A), FIG. 3(B) and FIG. 3(C) are flow charts of parsing an uploaded target PSD document in an illustrative example of the application;
FIG. 4 is a flowchart illustrating an effect of traversing each node in the tree data structure corresponding to the target PSD document according to a depth-first principle in an exemplary embodiment of the present application;
FIG. 5 is a diagram of the layer array effect of converting a target PSD document to a one-dimensional array format as described herein;
FIG. 6 is a flowchart illustrating the effect of format conversion on a target PSD document for display to a browser in an exemplary embodiment of the present application;
FIG. 7 is a block diagram of program modules of an embodiment of a display device according to the present disclosure;
FIG. 8 is a diagram of an alternative hardware architecture of the computer device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Fig. 1 is a schematic diagram of an application environment according to an embodiment of the present application. Referring to fig. 1, the computer apparatus 1 and the computer apparatus 2 are connected to each other. The computer device 1 provides a user interface for displaying a browser interface. In this embodiment, the computer device 1 may receive and obtain a target file sent by the computer device 2, and then parse the target file to obtain a layer set corresponding to the target file, where the layer set includes layers and corresponding layer description information, and the layer description information includes position information and offset angles of the layers; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set; and finally, displaying all layers in the converted layer set to a preset display interface, namely the browser interface, according to the position information and the offset angle.
Of course, in another embodiment, the computer device 1 may also directly call and obtain the target file that needs to be format-converted from its own storage unit, thereby omitting the steps of connecting with the computer device 2 and obtaining the target file from the computer device 2.
In the embodiment, the computer device 1 may be a mobile phone, a tablet, a portable device, a PC, or other electronic devices with a display function; the computer device 2 may be a mobile phone, a tablet, a portable device, a PC, a server, or the like.
Example one
FIG. 2 is a flowchart illustrating an embodiment of a display method according to the present application. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by way of example with the computer device 1 in fig. 1 as the execution subject.
As shown in fig. 2, the file display method may include steps S200 to S206.
And step S200, acquiring a target file.
Step S202, analyzing the target file to obtain a layer set corresponding to the target file.
Specifically, when a user needs to perform format conversion on an object file through the computer device 1, the user may obtain the object file through the computer device 1, for example, by connecting with the computer device 2, and then receive the object file sent by the computer device 2; or to call the target file directly in the memory unit of the computer device 1 itself.
In this embodiment, the target file is a PSD document. After obtaining the target PSD document, the computer device 1 analyzes the target PSD document to obtain a layer set corresponding to the target PSD document, where the layer set includes each layer included in the target PSD document and corresponding layer description information, and the layer description information includes position information and an offset angle of the layer.
In an exemplary example, the analyzing, by the computer device 1, the target PSD document to obtain a layer set corresponding to the target PSD document includes: and carrying out layer analysis on the target PSD document through a preset PSD document analysis tool to obtain the layer set. Since there is a mature PSD document parsing tool in the prior art, it may be an independent parsing tool, or it may be a functional plug-in integrated into the computer device 1 that needs to use the PSD document parsing function. For example, when the computer device 1 needs to convert the target PSD document into a document in a format that can be displayed on a browser interface, the computer device 1 may implant the PSD document parsing tool as a plug-in into the browser, and then implement displaying a file and finally displaying and editing the converted layer data in the browser.
Referring to fig. 3(a), fig. 3(B) and fig. 3(C), a flowchart of parsing an uploaded target PSD document in an exemplary example of the present application is shown. In this embodiment, the computer device 1 provides an interactive interface as shown in fig. 3(a) through a preset PSD document parsing tool; then selecting the uploaded target PSD document through an interactive interface of the PSD file analysis tool, wherein the selection interface is shown as a figure 3 (B); after the uploading is confirmed, only the function of analyzing the PSD document is needed to obtain all the layers of the target PSD document, as shown in fig. 3(C), the left column includes a plurality of layers, the middle column includes the picture of the currently selected layer, and the right column includes the related attributes of the currently selected layer.
In this embodiment, the step of performing layer parsing on the target PSD document by the computer device 1 to obtain the layer set includes: traversing each node in the tree data structure corresponding to the target PSD document by adopting a depth-first principle, and sequentially analyzing each node according to a traversal sequence to output layer data in a corresponding one-dimensional array format. Specifically, the PSD documents are generally stored in a tree data structure, where each layer in the PSD document is equivalent to a node on the tree data structure, and a grouping relationship between layers is equivalent to a connection relationship between nodes in the tree data structure. Therefore, in the process of parsing the target PSD document by the computer device 1, it is necessary to traverse each layer in the target PSD document by using a depth-first principle, that is, traverse layer data corresponding to each node in the tree data structure from top to bottom from left to right; and then, sequentially analyzing each node data according to the traversal order, thereby outputting the layer data in the corresponding one-dimensional array format.
Fig. 4 is a flowchart illustrating an effect of a process of traversing each node in the tree data structure corresponding to the target PSD document according to the depth-first principle in an exemplary example of the present application. In this embodiment, the target PSD document includes 10 layers, and therefore, the tree data structure corresponding to the target PSD document includes 10 nodes. The computer device 1 traverses all nodes in the tree data structure by adopting a depth-first principle, wherein the traversal sequence is as follows: node 1-node 2-node 5-node 9-node 3-node 6-node 10-node 7-node 4-node 8. Then, the computer device 1 outputs the layers corresponding to the node 1, the node 2, the node 5, the node 9, the node 3, the node 6, the node 10, the node 7, the node 4 and the node 8 in the one-dimensional array format according to the traversal order.
Fig. 5 is a diagram of the layer array effect of converting the target PSD document into a one-dimensional array format according to the present application. The target PSD document is converted into a layer array in a one-dimensional array format, the layer array comprises a plurality of layers, and each layer comprises layer detailed information, such as id-layer number; name-layer name, category-layer content category, type-layer model, width-layer width, and other layer information, such as layer length, layer color, and the like.
Step S204, converting all data fields of a first layer in the layer set into a target format, obtaining a second layer, and storing the second layer in the converted layer set, where the first layer is any layer in the layer set.
In this embodiment, after the computer device 1 parses the target file to obtain the layer set corresponding to the target file, all data fields of each layer in the layer set are further converted into a preset target format, so as to obtain a corresponding converted layer set. In this embodiment, since the layer includes many data fields, or layer parameters, or layer attributes and layer detail information. In this embodiment, the data field includes at least one of a layer number, a layer name, a layer content type, a layer length, a layer width, a layer color, a layer offset horizontal axis, a layer offset vertical axis, a layer rotation, a layer transparency, a layer shadow horizontal axis, and a layer shadow color. Therefore, the computer device 1 needs to convert the data field of each layer in the layer set into a data field in a target format, so that the obtained converted layer can be displayed on a preset interface.
Of course, in an exemplary embodiment, there may be more data fields included in the layers of a PSD document, for example, as shown in the following table, including most data fields of the layers. Therefore, the format conversion for the data fields of the layer mentioned in the present application is not limited to the above data fields, which are only for illustration and are not intended to be limiting.
Data field table:
field(s) Explaining the meaning Field(s) Explaining the meaning
id Layer id image_url Picture resource linking
name Layer name image_lock Whether the layer can be edited or not
category Content type text Graphic layer text content
bg_color Background color of layer font_family_name Font name
type Identification (recognizing words or picture) font_family_url Font resource
width Width of picture layer font_size Font size
height Height of picture layer font_style Whether or not it is italic
x Layer offset cross axis text_color Color of characters
y Layer offset longitudinal axis text_align Character alignment
rotate Layer rotation font_weight Thickness of character
opacity Layer transparency underline Word underline
seq Layer sequencing shadow_width Width of shadow
shadow_x Cross axis of shadow shadow_y Shadow longitudinal axis
shadow_color Shadow color stroke Whether to delineate
In another exemplary example, before converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, the computer device 1 further performs the steps of: and filtering useless special effects, layer grouping nodes and empty character layers in the layer set according to a preset filtering rule.
For example, the PSD document often includes layer grouping data, text layers with empty content, or other special attribute information; therefore, before performing layer conversion, the computer device 1 may further filter, according to a preset filtering rule, for example, according to a data format of a useless special effect and a layer grouping node, the useless special effect and the layer grouping node data in the layer set corresponding to the target PSD document; and for the text layer, according to the filtering rule, determining whether the content in the text layer is empty, and if the content is empty, the computer device 1 will filter the content from the layer set. Therefore, the effective layer data in the target PSD can be rapidly converted in format, and the efficiency of PSD document format conversion is further improved.
Step S206, displaying all layers in the converted layer set on a preset page.
Specifically, after performing format conversion on the data field of each layer in the layer set, the computer device 1 obtains a corresponding converted layer set; then, the computer device 1 displays the layer corresponding to the converted layer set to a preset display interface according to the position information and the offset angle in the layer description information corresponding to each layer in the layer set, so that a user can view or edit the layer.
In a specific embodiment, when the page is a browser page, the step of converting all data fields of a first layer in the layer set into a target format by the computer device 1 to obtain a second layer and storing the second layer in the converted layer set further includes: and storing the second image layer to a static resource server in a picture form and generating a corresponding static resource URL to obtain a URL set corresponding to the converted image layer set. In this embodiment, the layer set includes layers and corresponding layer description information, where the layer description information includes position information and offset angles of the layers, and the displaying, by the computer device 1, all the layers in the converted layer set to a preset display interface includes: and obtaining corresponding layer pictures from the static resource server according to each URL of the URL set, and rendering each layer picture to a Canvas of a browser in sequence according to the position information and the offset angle for drawing to a browser view.
In this embodiment, the computer device 1 uploads the layer pictures in the converted layer set to the static resource server to generate the corresponding URL, so that a user can quickly respond to the calling of the layers in the converted layer set by the browser.
Referring to FIG. 6, a flowchart illustrating an effect of format conversion of a target PSD document and display of the converted target PSD document to a browser according to an exemplary embodiment of the present application is shown. In this embodiment, the computer device 1 receives a received PSD document, then analyzes a layer set corresponding to the PSD document, and then, the computer device 1 rejects data of special attributes in the layer set, including a text layer of a useless special effect and empty content and layer grouping node data; then converting each layer in the layer set into a layer picture in a target format; then, the computer device 1 may upload the layer image to a remote service for use by other user terminals; meanwhile, the page 1 of the computer device can automatically acquire the layer pictures in the target format, and finally, the layer pictures are sequentially drawn on a Canvas of a browser and displayed.
In summary, the document display method provided by the present application can obtain the target document; analyzing the target file to obtain a layer set corresponding to the target file; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set; and displaying all layers in the converted layer set to a preset display interface. By carrying out layer analysis and layer format conversion on the file and directly displaying the converted layer, the processing of special attributes of the layer is abandoned, so that the time for displaying the file is shortened, and the file display efficiency is improved.
Example two
Fig. 7 schematically shows a block diagram of a document display apparatus according to the second embodiment of the present application, which may be divided into one or more program modules, the one or more program modules being stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can perform specific functions, and the following description will specifically describe the functions of the program modules in the embodiments.
As shown in fig. 7, the file display apparatus 400 may include an obtaining module 410, a parsing module 420, a converting module 430, and a displaying module 440, wherein:
an obtaining module 410, configured to obtain the target file.
And the parsing module 420 is configured to parse the target file to obtain a layer set corresponding to the target file.
A converting module 430, configured to convert all data fields of a first layer in the layer set into a target format, obtain a second layer, and store the second layer in the converted layer set, where the first layer is any layer in the layer set. The data field comprises at least one of a layer number, a layer name, a layer content category, a layer length, a layer width, a layer color, a layer offset horizontal axis, a layer offset vertical axis, a layer rotation, a layer transparency, a layer shadow horizontal axis and a layer shadow color.
A displaying module 440, configured to display all layers in the converted layer set on a preset page.
In an exemplary example, when the target file is a PSD document, the parsing module 420 is further configured to: and carrying out layer analysis on the target PSD document through a preset PSD document analysis tool to obtain the layer set. And traversing each node in the tree data structure corresponding to the target PSD document by adopting a depth-first principle, and analyzing each node in sequence according to a traversal sequence to output layer data in a corresponding one-dimensional array format.
In an exemplary example, the conversion module 430 is further configured to: and filtering useless special effects, layer grouping nodes and empty character layers in the layer set according to a preset filtering rule. And when the page is a browser page, storing the second image layer to a static resource server in a picture mode and generating a corresponding static resource URL to obtain a URL set corresponding to the converted image layer set.
In an exemplary example, the layer set includes a layer and corresponding layer description information, where the layer description information includes position information and an offset angle of the layer, and the display module 440 is further configured to: and obtaining corresponding layer pictures from the static resource server according to each URL of the URL set, and rendering each layer picture to a Canvas of a browser in sequence according to the position information and the offset angle for drawing to a browser view.
EXAMPLE III
Fig. 8 schematically shows a hardware architecture diagram of a computer device corresponding to the computer device 1 suitable for implementing the file display method according to the third embodiment of the present application. In the present embodiment, the computer device 1 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set in advance or stored. For example, the server may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) with a gateway function. As shown in fig. 8, the computer devices include at least, but are not limited to: memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 510 may be an internal storage module of the computer device, such as a hard disk or a memory of the computer device 1. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 1. Of course, the memory 510 may also comprise both an internal memory module and an external memory device of the computer device 1. In this embodiment, the memory 510 is generally used for storing an operating system and various application software installed on the computer device, such as program codes of a file display method. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 520 is generally used for controlling the overall operation of the computer device, such as performing control and processing related to data interaction or communication with the computer device 1. In this embodiment, processor 520 is configured to execute program codes stored in memory 510 or process data.
Network interface 530 may include a wireless network interface or a wired network interface, and network interface 530 is typically used to establish communication links between the computer device and other devices. For example, the network interface 530 is used to connect the computer device to an external terminal via a network, establish a data transmission channel and a communication link between the computer device 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), or Wi-Fi.
It is noted that fig. 8 only shows the computer device 1 with the components 510 and 530, but it is to be understood that not all of the shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the program code of the file display method stored in the memory 510 may also be divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 520) to implement the embodiments of the present application.
Example four
The present embodiments also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring a target file; analyzing the target file to obtain a layer set corresponding to the target file; converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set; and displaying all layers in the converted layer set to a preset display interface.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the file display method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications that can be made by the use of the equivalent structures or equivalent processes in the specification and drawings of the present application or that can be directly or indirectly applied to other related technologies are also included in the scope of the present application.

Claims (10)

1. A method for displaying a document, the method comprising:
acquiring a target file;
analyzing the target file to obtain a layer set corresponding to the target file;
converting all data fields of a first layer in the layer set into a target format to obtain a second layer and storing the second layer in the converted layer set, wherein the first layer is any layer in the layer set;
and displaying all layers in the converted layer set on a preset page.
2. The file display method according to claim 1, wherein when the target file is a PSD document, the analyzing the target file to obtain the layer set corresponding to the target file comprises:
and carrying out layer analysis on the target PSD document through a preset PSD document analysis tool to obtain the layer set.
3. The file display method according to claim 2, wherein the performing layer parsing on the target PSD document to obtain the layer set comprises:
traversing each node in the tree data structure corresponding to the target PSD document by adopting a depth-first principle, and sequentially analyzing each node according to a traversal sequence to output layer data in a corresponding one-dimensional array format.
4. The method for displaying files according to claim 1, wherein before converting all data fields of a first layer in the set of layers to a target format, obtaining a second layer and storing the second layer in the converted set of layers, the method further comprises:
and filtering useless special effects, layer grouping nodes and empty character layers in the layer set according to a preset filtering rule.
5. The file display method according to any one of claims 1 to 4, wherein the data field includes at least one of a layer number, a layer name, a layer content category, a layer length, a layer width, a layer color, a layer offset horizontal axis, a layer offset vertical axis, a layer rotation, a layer transparency, a layer shadow horizontal axis, and a layer shadow color.
6. The file display method according to claim 1, wherein when the page is a browser page, the converting all data fields of a first layer in the layer set to a target format to obtain a second layer and storing the second layer in the converted layer set further comprises:
and storing the second image layer to a static resource server in a picture form and generating a corresponding static resource URL to obtain a URL set corresponding to the converted image layer set.
7. The file display method according to claim 6, wherein the layer set includes layers and corresponding layer description information, the layer description information includes position information and offset angles of the layers, and the displaying all the layers in the converted layer set on a preset page includes:
and obtaining corresponding layer pictures from the static resource server according to each URL of the URL set, and rendering each layer picture to a Canvas of a browser in sequence according to the position information and the offset angle for drawing to a browser view.
8. A document display apparatus, the apparatus comprising:
the acquisition module is used for acquiring a target file;
the analysis module is used for analyzing the target file to obtain a layer set corresponding to the target file;
the conversion module is configured to convert all data fields of a first layer in the layer set into a target format to obtain a second layer and store the second layer in the converted layer set, where the first layer is any layer in the layer set;
and the display module is used for displaying all layers in the converted layer set on a preset page.
9. A computer device, characterized in that the computer device comprises a memory, a processor, the memory having stored thereon a computer program operable on the processor, the computer program, when executed by the processor, implementing the steps of the file display method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executable by at least one processor to cause the at least one processor to perform the steps of the file display method according to any one of claims 1-7.
CN202110662429.7A 2021-06-15 2021-06-15 File display method and device and computer equipment Pending CN113312318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110662429.7A CN113312318A (en) 2021-06-15 2021-06-15 File display method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110662429.7A CN113312318A (en) 2021-06-15 2021-06-15 File display method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN113312318A true CN113312318A (en) 2021-08-27

Family

ID=77378823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110662429.7A Pending CN113312318A (en) 2021-06-15 2021-06-15 File display method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN113312318A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114690982A (en) * 2022-03-31 2022-07-01 呼和浩特民族学院 Intelligent teaching method for physics teaching

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777989A (en) * 2012-10-25 2014-05-07 阿里巴巴集团控股有限公司 Method and system for generating HTML mark for vision draft source file
CN105447096A (en) * 2015-11-09 2016-03-30 百度在线网络技术(北京)有限公司 Web page generation method and apparatus
CN108984172A (en) * 2018-05-31 2018-12-11 北京奇艺世纪科技有限公司 A kind of generation method and device of interface file
CN109241151A (en) * 2017-06-29 2019-01-18 阿里巴巴集团控股有限公司 A kind of conversion method of data structure, device and electronic equipment
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN110975292A (en) * 2019-11-22 2020-04-10 福建天晴在线互动科技有限公司 Game map drawing method and system based on PSD (position sensitive Detector) file
CN111258575A (en) * 2018-11-30 2020-06-09 阿里健康信息技术有限公司 Page layout processing method and device
CN111553131A (en) * 2019-01-24 2020-08-18 北京京东尚科信息技术有限公司 PSD file analysis method, device, equipment and readable storage medium
CN111562919A (en) * 2020-07-14 2020-08-21 成都市映潮科技股份有限公司 Method, system and storage medium for generating front-end webpage code based on PSD file

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777989A (en) * 2012-10-25 2014-05-07 阿里巴巴集团控股有限公司 Method and system for generating HTML mark for vision draft source file
CN105447096A (en) * 2015-11-09 2016-03-30 百度在线网络技术(北京)有限公司 Web page generation method and apparatus
CN109241151A (en) * 2017-06-29 2019-01-18 阿里巴巴集团控股有限公司 A kind of conversion method of data structure, device and electronic equipment
CN108984172A (en) * 2018-05-31 2018-12-11 北京奇艺世纪科技有限公司 A kind of generation method and device of interface file
CN111258575A (en) * 2018-11-30 2020-06-09 阿里健康信息技术有限公司 Page layout processing method and device
CN111553131A (en) * 2019-01-24 2020-08-18 北京京东尚科信息技术有限公司 PSD file analysis method, device, equipment and readable storage medium
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN110975292A (en) * 2019-11-22 2020-04-10 福建天晴在线互动科技有限公司 Game map drawing method and system based on PSD (position sensitive Detector) file
CN111562919A (en) * 2020-07-14 2020-08-21 成都市映潮科技股份有限公司 Method, system and storage medium for generating front-end webpage code based on PSD file

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114690982A (en) * 2022-03-31 2022-07-01 呼和浩特民族学院 Intelligent teaching method for physics teaching

Similar Documents

Publication Publication Date Title
WO2020192391A1 (en) Ocr-based image conversion method and apparatus, device and readable storage medium
CN110334585A (en) Table recognition method, apparatus, computer equipment and storage medium
CN111553131B (en) PSD file analysis method, device, equipment and readable storage medium
CN111240669B (en) Interface generation method and device, electronic equipment and computer storage medium
CN112381907B (en) Multimedia track drawing method and system
CN112579086B (en) Template construction method adaptive to multi-platform front-end View
CN111159597A (en) Skeleton screen generation method and system, computer equipment and storage medium
CN109656652A (en) Webpage graph making method, apparatus, computer equipment and storage medium
CN113312318A (en) File display method and device and computer equipment
CN110175026B (en) Webpage visual editing method, device and storage medium
CN113283231B (en) Method for acquiring signature bit, setting system, signature system and storage medium
CN113345048B (en) Geographic information image editing method and device and computer equipment
CN114416056A (en) Page generation method, system, computer equipment and readable storage medium
CN112328246A (en) Page component generation method and device, computer equipment and storage medium
CN107147732A (en) Image processing method, device, client and service end
CN112416340A (en) Webpage generation method and system based on sketch
CN112486378B (en) Graph generation method, device, terminal and storage medium
CN111079399B (en) Image-text data processing method, image-text data processing device, computer equipment and storage medium
CN114095783A (en) Picture uploading method and device, computer equipment and storage medium
CN113835704A (en) Layout file generation method, device, equipment and storage medium
CN110019968B (en) XML file processing method and device
CN111240679A (en) Page development method and system
CN113177995B (en) Text reorganization method of CAD drawing and computer readable storage medium
CN117574851B (en) Method, device and storage medium for reconstructing circuit schematic diagram in EDA tool
CN117786258A (en) Model display method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination