CN110119380B - Storage and reading method and device for scalable vector graphics file - Google Patents

Storage and reading method and device for scalable vector graphics file Download PDF

Info

Publication number
CN110119380B
CN110119380B CN201810028975.3A CN201810028975A CN110119380B CN 110119380 B CN110119380 B CN 110119380B CN 201810028975 A CN201810028975 A CN 201810028975A CN 110119380 B CN110119380 B CN 110119380B
Authority
CN
China
Prior art keywords
file
scalable vector
vector graphics
library
vector map
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
CN201810028975.3A
Other languages
Chinese (zh)
Other versions
CN110119380A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810028975.3A priority Critical patent/CN110119380B/en
Publication of CN110119380A publication Critical patent/CN110119380A/en
Application granted granted Critical
Publication of CN110119380B publication Critical patent/CN110119380B/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/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format

Abstract

The invention discloses a storage and reading method and a device of a scalable vector diagram file, wherein the storage method comprises the following steps: obtaining a plurality of scalable vector map files to be processed, wherein the scalable vector map files comprise a namespace and a frame; classifying the scalable vector graphics file to be processed based on the namespace; archiving the classified scalable vector graphics files based on the frame to obtain an archived first scalable vector graphics file, and constructing a library file organization model based on the first scalable vector graphics file; dividing the head and the description of the first scalable vector map file to obtain a second scalable vector map file; storing the second scalable vector graphics file into the library file organization model. The invention solves the technical problem of low efficiency of storage and reading modes of the SVG file in the prior art.

Description

Storage and reading method and device for scalable vector graphics file
Technical Field
The invention relates to the technical field of information processing, in particular to a method and a device for storing and reading a scalable vector diagram file.
Background
The Scalable Vector Graphics (SVG) standard is a Vector Graphics standard for describing two-dimensional Graphics by using XML (Extensible Markup Language), and if adaptation is performed for each resolution, picture resources in mobile phone applications are suddenly increased, and the size of an application APK (Android package) is increased, which is not beneficial to iterative update of a later application program, because the Scalable Vector Graphics (SVG) file has the advantages of small file size, the Graphics can be enlarged or reduced, the number of supported colors is large, and the network is loaded quickly, and can be well adapted to the multi-scene resolution of the Android device, so that wide application is achieved.
At present, in an android application program, an SVG file is mainly stored in a drawable resource directory, and the format of the stored file is XML, and a vector diagram in the XML format can meet 3 SVG graphic type standards: at present, the SVG files of the above 3 standard types are generally stored and read according to the writing sequence of the SVG files, and when the number of the SVG files becomes huge, the application program loads the SVG files very slowly during the running period, especially for devices with a small running memory (RAM).
Therefore, the storage and reading mode of the SVG file in the prior art has low efficiency.
Disclosure of Invention
The invention provides a method and a device for storing and reading a scalable vector graphics file, which are used for solving the technical problem of low efficiency of a storage and reading mode of an SVG file in the prior art.
In a first aspect, the present invention provides a method for storing a scalable vector map file, including:
obtaining a plurality of scalable vector map files to be processed, wherein the scalable vector map files comprise a namespace and a frame;
classifying the scalable vector graphics file to be processed based on the namespace;
archiving the classified scalable vector graphics files based on the frame to obtain an archived first scalable vector graphics file, and constructing a library file organization model based on the first scalable vector graphics file;
dividing the head and the description of the first scalable vector map file to obtain a second scalable vector map file;
storing the second scalable vector graphics file into the library file organization model.
Optionally, after said storing said second scalable vector map file into said library file organization model, said method further comprises;
and generating an index file and a library file of the second scalable vector map file.
Optionally, after the storing the second scalable vector map file into the library file organization model, the method further comprises:
and setting a management model of the library file organization model, wherein the management model comprises a file interface for reading files and a library interface for adding and deleting files.
Based on the same inventive concept, a second aspect of the present invention provides a method for reading a scalable vector map file, comprising:
acquiring an index file of a scalable vector map file, wherein the scalable vector map file comprises a namespace and a frame, the index file is generated after the scalable vector map file is stored in a library file organization model, the library file organization model is constructed and obtained based on a first scalable vector map file after being filed, the first scalable vector map file is obtained after the scalable vector map file after being classified is filed based on the frame, and the scalable vector map file after being classified is obtained after the scalable vector map file is classified based on the namespace;
obtaining a library file of the scalable vector graphics file based on the index file;
and reading a second scalable vector map file from the library file organization model based on the index file and the library file, wherein the second scalable vector map file is obtained by dividing the header and the description by the first scalable vector map file.
Optionally, after the reading of the second scalable vector map file from the library file organization model, the method further comprises:
and inserting the header and the description into the second scalable vector map file to obtain the original scalable vector map file.
Based on the same inventive concept, a third aspect of the present invention provides a storage apparatus for a scalable vector map file, comprising:
an obtaining module, configured to obtain a plurality of scalable vector map files to be processed, where the scalable vector map files include a namespace and a frame;
the classification module is used for classifying the scalable vector graphics file to be processed based on the namespace;
the filing module is used for filing the classified scalable vector graphics files based on the framework, obtaining filed first scalable vector graphics files and constructing a library file organization model based on the first scalable vector graphics files;
a dividing module, configured to divide the header and the description of the first scalable vector map file to obtain a second scalable vector map file;
a storage module for storing the second scalable vector graphics file into the library file organization model.
Optionally, the apparatus further comprises a generating module, configured to, after storing the second scalable vector map file into the library file organization model:
and generating an index file and a library file of the second scalable vector map file.
Based on the same inventive concept, a fourth aspect of the present invention provides an apparatus for reading a scalable vector map file, comprising:
an obtaining module, configured to obtain an index file of a scalable vector graphics file, where the scalable vector graphics file includes a namespace and a frame, the index file is generated after the scalable vector graphics file is stored in a library file organization model, the library file organization model is constructed and obtained based on a first scalable vector graphics file after being archived, the first scalable vector graphics file is obtained after the first scalable vector graphics file is archived based on the frame, and the scalable vector graphics file after being categorized is obtained after the scalable vector graphics file is categorized based on the namespace;
an obtaining module for obtaining a library file of the scalable vector graphics file based on the index file;
and the reading module is used for reading a second scalable vector map file from the library file organization model based on the index file and the library file, wherein the second scalable vector map file is obtained by dividing the head and the description of the first scalable vector map file.
Based on the same inventive concept, a fifth aspect of the present invention provides a computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
Based on the same inventive concept, a sixth aspect of the present invention provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method in the first aspect when executing the program.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
the storage method of the scalable vector graphics file provided by the embodiment of the invention comprises the steps of firstly classifying based on the name space of the scalable vector graphics file, distinguishing different scalable vector graphics files, archiving the classified scalable vector graphics file based on the frame, obtaining the archived first scalable vector graphics file, constructing a library file organization model based on the first scalable vector graphics file, and well organizing and classifying the various scalable vector graphics files due to the fact that the library file organization model is processed in a mode of combining the name space with the frame, thereby improving the storage efficiency, and the method in the embodiment of the invention also comprises the steps of obtaining a second scalable vector graphics file by dividing the head and description of the archived first scalable vector graphics file, and then storing the second scalable vector graphics file into the library file organization model, the space occupied by the second scalable vector map can be reduced, thereby reducing the storage space and further improving the storage efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts;
FIG. 1 is a flow chart of a method for storing a scalable vector map file according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for reading a scalable vector graphics file according to an embodiment of the present invention;
FIG. 3 is a block diagram of a scalable vector graphics file storage device according to an embodiment of the present invention;
fig. 4 is a block diagram showing the construction of a scalable vector image file reading apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in an embodiment of the present invention.
Detailed Description
The invention provides a method and a device for storing and reading a scalable vector graphics file, which are used for solving the technical problem of low efficiency of a storage and reading mode of an SVG file in the prior art.
The technical scheme in the embodiment of the application has the following general idea:
a method for reading scalable vector graphics file comprises obtaining index file of scalable vector graphics file, and obtaining library file of scalable vector graphics file according to index file; and finally, reading the second scalable vector diagram file from the library file organization model based on the index file and the library file.
In the method, the scalable vector graphics file is obtained from the library file organization model through the index file and the library file, compared with the existing reading mode according to the storage sequence, the searching time can be greatly reduced, and the efficiency of reading the file can be improved, and the second scalable vector graphics file stored in the library file organization model is obtained by dividing the head and the description of the filed first scalable vector graphics file, and the space occupied by the second scalable vector graphics file can be reduced, so that the reading time can be further reduced by obtaining the divided second scalable vector graphics file first, and then inserting the head and the description to obtain the required original scalable vector graphics file, and the reading efficiency can be improved.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Before specifically describing particular embodiments of the present invention, the following presents a simplified summary of terms to which the invention may be directed:
● SVG (scalable Vector graphics) scalable Vector graphics, which is a graphics format based on the extensible markup language (a subset of the standard generalized markup language) for describing two-dimensional Vector graphics. It is an open standard, established by the world wide web consortium.
● XML (extensible Markup language), a subset of standard generalized Markup language, is a Markup language for Markup electronic documents to be structured.
● Camera android system, which is a driver for users to drive camera hardware to collect images.
● View is a super class of the Android system, and is a basic component unit for application layer interface visualization of the Android system.
● inherited class of SurfaceView views (View), which have independent drawing surfaces, i.e., it does not share the same drawing surface with its host window. Because of the independent drawing surface, the UI of SurfaceView can draw in an independent thread.
● SurfaceHolder an abstract interface to SurfaceView, which controls the size and format of the SurfaceView, edits pixels on the SurfaceView, and monitors changes to the SurfaceView.
● Activity is one of the four major components of the android system, Activity is usually a single screen on which controls can be displayed and in which user events can be monitored and processed in response.
● Service one of the four major components of android system, Service is a system component that does not allow users to interact directly, and it runs in the background for a long time, for example, music player plays music and is in Service;
● Broadcast recipient one of the four major components of the android system, Broadcast is commonly used to communicate between threads within application processes, or between different processes.
● Content Provider one of the four major components of the android system, is typically used for data transfer across processes.
● Handler is mainly used for the processing of asynchronous messages: when a message is sent, the message enters a message queue first, the function for sending the message returns immediately, and the other part takes out the messages one by one in the message queue and processes the message, namely the message sending and the message receiving are not synchronous processing.
● Process is a running activity of a program in a computer on a data set, is a basic unit for resource allocation and scheduling of a system, and is the basis of an operating system structure;
● Main Thread (Main Thread) is also called as UI Thread, and refers to the Main Thread (Main Thread) of the application runtime in the android system, and the Main Thread is responsible for distributing events (including drawing events) to UI components, and the Thread cannot perform time-consuming operation (network request, database operation), otherwise ANR exception is easily caused.
● Sub Thread (Sub Thread) non-system-created threads are generally called Sub threads, and are usually created by users themselves, the threads generally process time-consuming operations, and the number of Sub threads is generally 2 CPU cores.
The ● Bitmap extension may be either the.bmp or the.dib. A bitmap is a Windows standard format graphics file that defines an image as being made up of dots (pixels) that can be represented by a variety of colors, including 2, 4, 8, 16, 24, and 32 bit colors.
● JPEG (Joint Photographic Experts group) is a committee under the lead of the International organization for standardization (ISO) for the formulation of the standard for still image compression, the first set of the international standard for still image compression ISO 10918-1(JPEG) being defined by the committee;
● PNG (Portable Network graphics) is a lossless compressed bitmap graphics format designed to attempt to replace GIF and TIFF file formats while adding features not available to some GIF file formats.
● RGB (Red As Interger, Green As Integer, BlueAs Integer) is a color standard in the industry, which obtains various colors by changing and superposing three color channels of red (R), green (G) and blue (B), wherein RGB is the color representing the three channels of red, green and blue, the standard almost includes all colors which can be sensed by human vision, and is one of the most widely used color systems at present.
● ARGB (Alpha As Integer, GreenAs Integer, BlueAs Integer) a color standard, that is, RGB color patterns, is attached to an Alpha channel, which is commonly found in 32-bit memory structures.
● ARGB888ARGB, the image formed is called true color, each color is represented by 8, each channel has 256 steps, three colors of light are alternately increased and decreased, and the RGB three colors can display 24 bits at most 1677 ten thousand colors on one pixel (256 × 256 ═ 16,777,216).
● YUV is also called YCrCb, Y represents color brightness, U represents color, V represents saturation, YUV is a color coding mode, and is a color space with analog color as standard, in modern color television system, a three-tube color camera or a color CCD camera is usually used for image capture, and then the obtained color image signals are subjected to color separation and respective amplification correction to obtain RGB;
● YUV422 is a special YUV color coding standard, 422 represents YUV at a ratio of 4:2:2, representing a halving of the UV component samples, such as the first pixel sample Y, U, the second pixel sample Y, V, and so on, such that each point occupies 2 bytes, two pixels making up a macropixel.
● BGR (BlueAs Integer, GreenAsInteger, RedAs Integer) is a color standard similar to RGB, except that the Red channel (Red) is swapped with the green channel (Blue), which becomes the upper color channel.
Example one
The embodiment provides a storage method of a scalable vector diagram file, which is applied to an android system, and please refer to fig. 1, where the method includes:
step S101: a plurality of scalable vector map files to be processed is obtained, wherein the scalable vector map files comprise a namespace and a frame.
Specifically, a scalable vector graphics file, i.e., an SVG file, is a file for describing two-dimensional graphics using an XML language. Typically, an SVG file includes the following components: XML Header (Header), SVG NameSpace (NameSpace), SVG Framework (Framework), Description (Object indication and Description), and SVG graphics Object (Graphic Object).
Step S102: and classifying the scalable vector graphics file to be processed based on the namespace.
In particular, to better classify different scalable vector graphics files, classification may be based on a namespace, which is a file marking method, e.g., with 5 different SVG files, A, B, C, D, E5 SVG files may be distinguished by way of the namespace and marked accordingly.
Step S103: and archiving the classified scalable vector graphics files based on the frame to obtain an archived first scalable vector graphics file, and constructing a library file organization model based on the first scalable vector graphics file.
Specifically, as the namespaces of the SVG types of the same type are the same, in order to better manage the SVG files, the classified files can be filed through an SVG Framework, and the SVG Framework is a unique identifier which is different from the SVG files and other SVG files, so that the Framework + namespace mode can be used as a standard for classified filing, and then a library file organization model is constructed. The library file organization model may be a tree structure or other structure.
In a specific implementation process, the classified scalable vector graphics files are archived based on a framework, and the 5 SVG files may be respectively archived: AB is classified as first gear, CDE is classified as first gear.
Step S104: and segmenting the head and the description of the first scalable vector map file to obtain a second scalable vector map file.
Specifically, because the header and description of the SVG file only describe some description information of the file, the embodiment of the present invention can reduce the space occupied by the SVG by dividing the above parts, thereby improving the storage efficiency.
Step S105: storing the second scalable vector graphics file into the library file organization model.
In an alternative embodiment, after storing the second scalable vector map file into the library file organization model, the method further comprises;
and generating an index file and a library file of the second scalable vector map file.
Specifically, each line of the index file includes a file or a directory name, a starting line number (begin line) and an ending line number (end line) of the file in the library, and in a specific implementation process, a library file index format needs to be defined first, and the format of the index file is as follows:
Directoryname1beginline endline;
Filename1beginline endline;
Filename1beginline endline;
Directoryname2beginline endline;
……
FilenameN beginline endline;
wherein, Directoryname1 and Directoryname2 represent folder names, Filename1 represents file names, begin line represents start line number, and end line represents end line number.
In an alternative embodiment, after storing the second scalable vector map file into the library file organization model, the method further comprises:
and setting a management model of the library file organization model, wherein the management model comprises a file interface for reading files and a library interface for adding and deleting files.
Particularly, in order to manage the library file organization model, the invention also provides a management model of the library file organization model, because large batch of SVG files in the library file organization model need a management interface for external access and processing. In a specific implementation process, the implementation of the file interface and the library interface is as follows:
interface SVGFile:SVGElement{
readonly attribute unsigned long SVGFilelength;
readonly attribute unsigned short SVGFilemode;
}
the SVGFilength is a read-only unsigned long integer parameter, and the parameter SVGFilength is a read-only unsigned long integer parameter.
interface SVGFileLib:SVGFile{
readonly attribute unsigned long SVGFileNumber;
readonly attribute unsigned long FileName;
Bool ReadFile(Cstring Filename);
Bool WriteFile(Cstring Filename);
Bool DeleteFile(Cstring Filename);
Bool FindFile(Cstring Filename);
}
Wherein, SVGFileLib is the library interface class, SVGFElement is the subclass of SVGFile class, contain parameter SVGFileNumber (SVG file quantity) and parameter FileName (SVG file name), the method of Boolean type in the library interface class: a read file method ReadFile, a write file method WriteFile, a delete file method DeleteFile and a find file method FindFile.
In a specific implementation process, the method can be realized by adopting a language combining Java and C + +, firstly, classifying the SVG files through a file marking method, namely a name space, distinguishing different SVG files, and then filing the classified SVG files through frame marking, so that a library file organization model of the SVG is constructed; in addition, the SVG file is managed by setting a library file organization model file interface and a library interface; the SVG file is divided through a dividing method, so that the storage efficiency of the SVG file is improved.
Based on the same inventive concept, the invention also provides a method for reading the scalable vector diagram file, which is specifically referred to as embodiment two.
Example two
An embodiment of the present invention provides a method for reading a scalable vector diagram file, please refer to fig. 2, where the method includes:
s201: acquiring an index file of a scalable vector map file, wherein the scalable vector map file comprises a namespace and a frame, the index file is generated after the scalable vector map file is stored in a library file organization model, the library file organization model is constructed and obtained based on a first scalable vector map file after being filed, the first scalable vector map file is obtained after the scalable vector map file after being classified is filed based on the frame, and the scalable vector map file after being classified is obtained after the scalable vector map file is classified based on the namespace;
in an optional implementation mode, if an SVG file does not have an index file, it indicates that the SVG file is not in the library file organization model, and directly returns the information that the SVG file does not exist.
Since the process of acquiring the first scalable vector graphics file and the library file organization model has been described in detail in the first embodiment, it is not described herein again.
S202: obtaining a library file of the scalable vector graphics file based on the index file;
specifically, the index file is generated after the SVG file is stored in the library file organization model, the index file comprises the SVG file name, the starting line number and the ending line number, and the library file of the scalable vector graphics file can be obtained through the index file, wherein the library file is a library information file stored by the SVG file and can comprise information such as the type of the file in the library, the library interface address and the like.
S203: and reading a second scalable vector map file from the library file organization model based on the index file and the library file, wherein the second scalable vector map file is obtained by dividing the header and the description by the first scalable vector map file.
In an alternative embodiment, after reading the second scalable vector map file from the library file organization model, the method further comprises:
and inserting the header and the description into the second scalable vector map file to obtain the original scalable vector map file.
Specifically, since the SVG file stored in the library file organization model is divided, in this embodiment, after the second scalable vector graphics file is obtained, the header and the description need to be supplemented, so as to obtain a complete SVG file.
When the library file organization model is in a tree structure, the SVG file is searched or read by adopting the existing method. Generally, searching is started from a treetop point or a treetop point of a tree structure until a corresponding file is found, when the number of files stored in a library file organization model library is large, the efficiency of the existing searching mode is low, and the searching and reading mode of the index file in the application can greatly improve the searching efficiency, so that the efficiency of reading the SVG file is improved. Furthermore, when the SVG file is searched by using the index file, the SVG file can be further searched by combining a binary search method.
To describe the SVG file reading method in the embodiment of the present invention more clearly, as will be described in detail below by using a specific example, it is first determined whether an index file exists in an SVG file, if so, a library file is obtained from the index file, and then a second scalable vector image file is read from the constructed library file organization model based on the index file and the library file, and a binary search algorithm may be further incorporated in the process of reading the file, thereby further improving efficiency.
Various changes and specific examples of the storage method of the scalable vector map file in the foregoing embodiment in fig. 1 are also applicable to the reading method of the present embodiment, and the implementation of the method in the present embodiment will be clear to those skilled in the art from the foregoing detailed description of the storage method of the scalable vector map file, so that the detailed description is omitted here for brevity of the description.
Based on the same inventive concept, the invention further provides a device corresponding to the storage method of the scalable vector graphics file in the first embodiment, which is specifically referred to in the third embodiment.
EXAMPLE III
An embodiment of the present invention provides a storage apparatus for a scalable vector graphics file, please refer to fig. 3, the apparatus includes:
an obtaining module 301, configured to obtain a plurality of scalable vector map files to be processed, where the scalable vector map files include a namespace and a frame;
a classification module 302, configured to classify the scalable vector map file to be processed based on the namespace;
the filing module 303 is configured to file the classified scalable vector graphics files based on the frame, obtain a first archived scalable vector graphics file, and construct a library file organization model based on the first scalable vector graphics file;
a dividing module 304, configured to divide the header and the description of the first scalable vector map file to obtain a second scalable vector map file;
a storage module 305, configured to store the second scalable vector graphics file into the library file organization model.
Various modifications and specific examples of the storage method of the scalable vector map file in the embodiment of fig. 1 are also applicable to the apparatus of the present embodiment, and the apparatus of the present embodiment is clearly known to those skilled in the art from the foregoing detailed description of the storage method of the scalable vector map file, so that the detailed description is omitted here for the brevity of the description.
Based on the same inventive concept, the invention further provides a device corresponding to the method for reading the scalable vector graphics file in the second embodiment, which is specifically referred to as the fourth embodiment.
Example four
An embodiment of the present invention provides a device for reading a scalable vector graphics file, please refer to fig. 4, where the device includes:
an obtaining module 401, configured to obtain an index file of a scalable vector graphics file, where the scalable vector graphics file includes a namespace and a frame, and the index file is generated after the scalable vector graphics file is stored in a library file organization model, where the library file organization model is constructed and obtained based on a first scalable vector graphics file after being archived, the first scalable vector graphics file is obtained after the scalable vector graphics file classified based on the frame is archived, and the scalable vector graphics file classified based on the namespace is obtained after the scalable vector graphics file is classified;
an obtaining module 402, configured to obtain a library file of the scalable vector graphics file based on the index file;
a reading module 403, configured to read a second scalable vector map file from the library file organization model based on the index file and the library file, where the second scalable vector map file is obtained by segmenting the header and the description of the first scalable vector map file.
Various modifications and specific examples of the method for reading the scalable vector map file in the embodiment of fig. 2 are also applicable to the apparatus of the present embodiment, and the apparatus of the present embodiment will be apparent to those skilled in the art from the foregoing detailed description of the reading of the scalable vector map file, so that the detailed description is omitted here for the brevity of the description.
Based on the same inventive concept, the invention also provides a computer-readable storage medium corresponding to the storage method of the scalable vector graphics file, and the specific reference is made to the fifth embodiment
EXAMPLE five
An embodiment of the present invention provides a computer-readable storage medium 500, please refer to fig. 5, on which a computer program 511 is stored, which when executed by a processor implements a method in one embodiment.
Various modifications and specific examples of the storage method of the scalable vector map file in the embodiment of fig. 1 are also applicable to the computer-readable storage medium of the embodiment, and the computer-readable storage medium in the embodiment is clear to those skilled in the art from the foregoing detailed description of the storage method of the scalable vector map file, so that the detailed description is omitted here for the brevity of the description.
Based on the same inventive concept, the invention also provides a computer device corresponding to the storage method of the scalable vector graphics file, and particularly refers to the sixth embodiment.
EXAMPLE six
An embodiment of the present invention provides a computer apparatus, please refer to fig. 6, which includes a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and running on the processor, where the processor 602 implements a method in one embodiment when executing the program.
Various modifications and specific examples of the storage method of the scalable vector map file in the embodiment of fig. 1 are also applicable to the computer device of the present embodiment, and the computer device in the present embodiment is clearly known to those skilled in the art from the foregoing detailed description of the storage method of the scalable vector map file, so that the detailed description is omitted here for brevity of the description.
Similarly, the present invention further includes a computer-readable storage medium and a computer device corresponding to the method for reading the scalable vector graphics file in the second embodiment, which are not described herein again.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
the embodiment of the invention provides a method for storing and reading a scalable vector diagram file, which comprises the steps of firstly classifying based on the name space of the scalable vector diagram file, distinguishing different scalable vector diagram files, archiving the classified scalable vector diagram file based on a frame, obtaining a first scalable vector diagram file after archiving, constructing a library file organization model based on the first scalable vector diagram file, and well organizing and classifying various scalable vector diagram files because the library file organization model is processed by adopting the name space combined with the frame, thereby improving the storage efficiency, and the method in the embodiment of the invention also comprises the steps of obtaining a second scalable vector diagram file by dividing the head and description of the first scalable vector diagram file after archiving, and then storing the second scalable vector diagram file into the library file organization model, the space occupied by the second scalable vector map can be reduced, thereby reducing the storage space and further improving the storage efficiency.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (8)

1. A method of storing a scalable vector graphics file, comprising:
obtaining a plurality of scalable vector map files to be processed, wherein the scalable vector map files comprise a namespace and a frame; the frame is a unique identifier that distinguishes the scalable vector graphics file from other scalable vector graphics files;
classifying the scalable vector graphics file to be processed based on the namespace;
archiving the classified scalable vector graphics files based on the frame to obtain an archived first scalable vector graphics file, and constructing a library file organization model based on the first scalable vector graphics file;
dividing the head and the description of the first scalable vector map file to obtain a second scalable vector map file;
storing the second scalable vector graphics file into the library file organization model;
and generating an index file and a library file of the second scalable vector map file.
2. The method of claim 1, wherein after said storing said second scalable vector map file into said library file organization model, said method further comprises:
and setting a management model of the library file organization model, wherein the management model comprises a file interface for reading files and a library interface for adding and deleting files.
3. A method for reading a scalable vector graphics file, comprising:
acquiring an index file of a scalable vector map file, wherein the scalable vector map file comprises a namespace and a frame, the index file is generated after the scalable vector map file is stored in a library file organization model, the library file organization model is constructed and obtained based on a first scalable vector map file after being filed, the first scalable vector map file is obtained after the scalable vector map file after being classified is filed based on the frame, and the scalable vector map file after being classified is obtained after the scalable vector map file is classified based on the namespace; the frame is a unique identifier that distinguishes the scalable vector graphics file from other scalable vector graphics files;
obtaining a library file of the scalable vector graphics file based on the index file;
and reading a second scalable vector map file from the library file organization model based on the index file and the library file, wherein the second scalable vector map file is obtained by dividing the header and the description by the first scalable vector map file.
4. The method of claim 3, wherein after said reading a second scalable vector map file from said library file organization model, said method further comprises:
and inserting the header and the description into the second scalable vector map file to obtain the original scalable vector map file.
5. An apparatus for storing a scalable vector graphics file, comprising:
an obtaining module, configured to obtain a plurality of scalable vector map files to be processed, where the scalable vector map files include a namespace and a frame; the frame is a unique identifier that distinguishes the scalable vector graphics file from other scalable vector graphics files;
the classification module is used for classifying the scalable vector graphics file to be processed based on the namespace;
the filing module is used for filing the classified scalable vector graphics files based on the framework, obtaining filed first scalable vector graphics files and constructing a library file organization model based on the first scalable vector graphics files;
a dividing module, configured to divide the header and the description of the first scalable vector map file to obtain a second scalable vector map file;
a storage module for storing the second scalable vector graphics file into the library file organization model;
and the generating module is used for generating an index file and a library file of the second scalable vector graphics file.
6. An apparatus for reading a scalable vector graphics file, comprising:
an obtaining module, configured to obtain an index file of a scalable vector graphics file, where the scalable vector graphics file includes a namespace and a frame, the index file is generated after the scalable vector graphics file is stored in a library file organization model, the library file organization model is constructed and obtained based on a first scalable vector graphics file after being archived, the first scalable vector graphics file is obtained after the first scalable vector graphics file is archived based on the frame, and the scalable vector graphics file after being categorized is obtained after the scalable vector graphics file is categorized based on the namespace; the frame is a unique identifier that distinguishes the scalable vector graphics file from other scalable vector graphics files;
an obtaining module for obtaining a library file of the scalable vector graphics file based on the index file;
and the reading module is used for reading a second scalable vector map file from the library file organization model based on the index file and the library file, wherein the second scalable vector map file is obtained by dividing the head and the description of the first scalable vector map file.
7. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 2.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 2 when executing the program.
CN201810028975.3A 2018-01-12 2018-01-12 Storage and reading method and device for scalable vector graphics file Active CN110119380B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810028975.3A CN110119380B (en) 2018-01-12 2018-01-12 Storage and reading method and device for scalable vector graphics file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810028975.3A CN110119380B (en) 2018-01-12 2018-01-12 Storage and reading method and device for scalable vector graphics file

Publications (2)

Publication Number Publication Date
CN110119380A CN110119380A (en) 2019-08-13
CN110119380B true CN110119380B (en) 2022-02-22

Family

ID=67519115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810028975.3A Active CN110119380B (en) 2018-01-12 2018-01-12 Storage and reading method and device for scalable vector graphics file

Country Status (1)

Country Link
CN (1) CN110119380B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599491A (en) * 2022-12-14 2023-01-13 西安纽扣软件科技有限公司(Cn) SVG vector diagram display method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105427353A (en) * 2015-11-12 2016-03-23 小米科技有限责任公司 Compression and drawing method and device of scalable vector graphic
US9582232B2 (en) * 2014-06-30 2017-02-28 Canon Kabushiki Kaisha Information processing apparatus, processing method, and storage medium for building a print application using a hybrid application
CN107193791A (en) * 2017-05-16 2017-09-22 北京四方继保自动化股份有限公司 Action report visual presentation method based on transient data interchange general format

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9582232B2 (en) * 2014-06-30 2017-02-28 Canon Kabushiki Kaisha Information processing apparatus, processing method, and storage medium for building a print application using a hybrid application
CN105427353A (en) * 2015-11-12 2016-03-23 小米科技有限责任公司 Compression and drawing method and device of scalable vector graphic
CN107193791A (en) * 2017-05-16 2017-09-22 北京四方继保自动化股份有限公司 Action report visual presentation method based on transient data interchange general format

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于SVG 的矢量图形库管理模型》;万本庭等;《计算机工程》;20060205;第32卷(第3期);65-67,78 *

Also Published As

Publication number Publication date
CN110119380A (en) 2019-08-13

Similar Documents

Publication Publication Date Title
US11200426B2 (en) Video frame extraction method and apparatus, computer-readable medium
US8213747B2 (en) Variable resolution images
US7933473B2 (en) Multiple resolution image storage
US7978922B2 (en) Compressing images in documents
US8319987B2 (en) Image processing apparatus and control method for compressing image data by determining common images amongst a plurality of page images
CN101884221A (en) System and method for encoding video
US9286228B2 (en) Facilitating caching in an image-processing system
CN109272449A (en) Image display method and device, computer installation and readable storage medium storing program for executing
CN110119380B (en) Storage and reading method and device for scalable vector graphics file
CN105721810A (en) Image compression storage method and apparatus
US10032290B2 (en) Method for synthesizing dynamic virtual figures
CN108989704B (en) Image generation method and device and terminal equipment
CN110971958A (en) Live broadcast gift banner frame-by-frame animation display method, storage medium, equipment and system
CN113742284A (en) Method and system for converting OFD file into picture based on Java
CN110457264B (en) Conference file processing method, device, equipment and computer readable storage medium
US20080170805A1 (en) Method and system for adding dynamic pictures to real-time image
CN108154542B (en) Method for adding semitransparent property to JPG file
KR101652740B1 (en) System and method for image processing and restoring
CN117671042A (en) Compression method and device of mapping resource, storage medium and electronic equipment
CN111158564B (en) Method and terminal for restoring picture clipping effect in PowerPoint
CN1551210A (en) Method for storing additional data relating to menu data
WO2023050423A1 (en) Image processing method and device, and storage medium
CN112182458B (en) Page data processing method and device
WO2023127366A1 (en) Image file conversion method, image file conversion device, and program
JP5612851B2 (en) Information processing apparatus, information processing method, and program

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
GR01 Patent grant
GR01 Patent grant