CN110286960B - Image file loading method and device, electronic equipment and storage medium - Google Patents

Image file loading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110286960B
CN110286960B CN201910569374.8A CN201910569374A CN110286960B CN 110286960 B CN110286960 B CN 110286960B CN 201910569374 A CN201910569374 A CN 201910569374A CN 110286960 B CN110286960 B CN 110286960B
Authority
CN
China
Prior art keywords
image file
patch
data
module
identifier
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
CN201910569374.8A
Other languages
Chinese (zh)
Other versions
CN110286960A (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201910569374.8A priority Critical patent/CN110286960B/en
Publication of CN110286960A publication Critical patent/CN110286960A/en
Application granted granted Critical
Publication of CN110286960B publication Critical patent/CN110286960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • A63F2300/538Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing for performing operations on behalf of the game client, e.g. rendering
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/552Details of game data or player data management for downloading to client devices, e.g. using OS version, hardware or software profile of the client device

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a loading method and device of an image file, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring an identifier of an image file to be loaded, wherein the format of the image file is a scalable vector graphics; inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: basic data and attribute data of each patch; if patch data exist in the patch database, patch data are obtained, and format conversion is carried out on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; the method has the advantages that each component corresponding to the image file is rendered, and the loading operation of the image file is completed.

Description

Image file loading method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for loading an image file, an electronic device, and a storage medium.
Background
At present, with the development of computers, applications of loading image files on computers are also increasingly popular, for example, loading game interfaces, images in the game interfaces are vector images, each frame of image needs to be acquired from a server, loaded and rendered, and then displayed on an interface of a terminal device, and it may take tens of seconds to complete the above process. And complex image files may take longer. Therefore, loading an image file causes the user to wait for several tens of seconds or more, which is poor in user experience, resulting in a reduced amount of user retention.
Disclosure of Invention
The present application aims to solve at least one of the technical problems in the related art to some extent.
Therefore, a first objective of the present application is to provide an image file loading method, which effectively reduces the waiting time for local image file loading, and improves the user experience and the number of retained images.
A second object of the present application is to provide an image file loading apparatus.
A third object of the present application is to provide an electronic device.
A fourth object of the present application is to propose a computer readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present application provides a method for loading an image file, including: acquiring an identifier of an image file to be loaded, wherein the format of the image file is a scalable vector graph; inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: basic data and attribute data of each patch; if patch data exist in the patch database, patch data are obtained, and format conversion is carried out on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; and rendering each component corresponding to the image file to finish the loading operation of the image file.
According to one embodiment of the application, if the patch data does not exist in the patch database, an image file loading request carrying an identifier is sent to a server; receiving an image file returned by the server; analyzing the image file and carrying out triangular patch conversion operation to obtain patch data corresponding to the image file; storing the identification of the image file and the corresponding patch data into a patch database; carrying out format conversion on the basic data and the attribute data of each patch in patch data to obtain each component corresponding to the image file; and rendering each component corresponding to the image file to finish the loading operation of the image file.
According to an embodiment of the present application, parsing an image file and performing a triangle patch conversion operation to obtain patch data corresponding to the image file includes: analyzing the image file to obtain basic data and attribute data of each vector graph in the image file; and splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics.
According to one embodiment of the present application, the shape of the patch is triangular; the basic data of a patch includes: coordinate information of three vertices of a triangle, and a connection order of the three vertices. The attribute data of the patch includes any one or more of the following information: color, brightness, texture.
According to an embodiment of the application, the trigger condition for acquiring the identifier of the image file to be loaded is that a preset control is clicked, an interface switching action is detected, or the display time of the image file to be loaded is reached.
According to the loading method of the image file, the format of the image file is a scalable vector graph by acquiring the identifier of the image file to be loaded; inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: basic data and attribute data of each patch; if patch data exist in the patch database, patch data are obtained, and format conversion is carried out on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; the method has the advantages that each component corresponding to the image file is rendered, and the loading operation of the image file is completed, so that the waiting time for loading the local image file is effectively reduced, and meanwhile, the user experience and the retention quantity are improved.
In order to achieve the above object, a second aspect of the present application provides an image file loading apparatus, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an identifier of an image file to be loaded, and the format of the image file is a scalable vector graph; the query module is used for querying a local patch database according to the identifier and judging whether patch data corresponding to the identifier exists in the patch database; the patch data includes: basic data and attribute data of each patch; the format conversion module is used for acquiring the patch data when the patch data exists in the patch database, and performing format conversion on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; and the rendering module is used for rendering each component corresponding to the image file to finish the loading operation of the image file.
According to an embodiment of the present application, the loading apparatus of the image file further includes: the device comprises a sending module, a receiving module, an analysis and conversion module and a storage module; the sending module is used for sending an image file loading request carrying an identifier to the server when the patch data does not exist in the patch database; the receiving module is used for receiving the image file returned by the server; the analysis conversion module is used for carrying out analysis and triangular patch conversion operation on the image file to obtain patch data corresponding to the image file; the storage module is used for storing the identifier of the image file and the corresponding patch data into a patch database; the format conversion module is also used for carrying out format conversion on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file; and the rendering module is also used for rendering each component corresponding to the image file to finish the loading operation of the image file.
According to an embodiment of the application, the parsing conversion module is specifically configured to parse an image file to obtain basic data and attribute data of each vector graph in the image file; splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics.
According to one embodiment of the present application, the shape of the patch is triangular; the basic data of a patch includes: coordinate information of three vertices of the triangle, and a connection order of the three vertices. The attribute data of the patch includes any one or more of the following information: color, brightness, texture.
According to an embodiment of the application, the trigger condition for the acquisition module to acquire the identifier of the image file to be loaded is that a preset control is clicked, an interface switching action is detected, or the display time of the image file to be loaded is reached.
According to the image file loading device, the identifier of the image file to be loaded is obtained, and the format of the image file is a scalable vector graph; inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: basic data and attribute data of each patch; if the patch data exist in the patch database, patch data are obtained, and format conversion is carried out on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file; the device can effectively reduce the waiting time for loading the local image file, and simultaneously improves the user experience and the number of the stored image files.
To achieve the above object, an embodiment of a third aspect of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the loading method of the image file as described above when executing the program.
In order to achieve the above object, a fourth aspect of the present application provides a computer-readable storage medium, where instructions of the storage medium, when executed by a processor, implement the loading method of the image file as described above.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a method for loading an image file according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for loading an image file according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of an image file loading apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an image file loading apparatus according to another embodiment of the present application;
FIG. 5 is a schematic structural diagram of an electronic device according to one embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
A loading method, an apparatus, an electronic device, and a storage medium of an image file according to an embodiment of the present application are described below with reference to the drawings.
It should be noted that the method for loading an image file according to the embodiment of the present application may be applied to the apparatus for loading an image file according to the embodiment of the present application, and the apparatus for loading an image file may be configured on a terminal device, and the terminal device may execute the method for loading an image file.
Fig. 1 is a schematic flowchart of a method for loading an image file according to an embodiment of the present application. As shown in fig. 1, the loading method of the image file includes the following steps:
step 101, obtaining the identifier of the image file to be loaded, wherein the format of the image file is a scalable vector graphics.
In the embodiment of the present application, the identifier of the image file may be a name or a number of the image file, and the format of the image file is Scalable Vector Graphics (SVG).
In addition, in the embodiment of the application, when the terminal equipment needs to load the image file, the identifier of the image file to be loaded is obtained. Optionally, the trigger condition for acquiring the identifier of the image file to be loaded is that a preset control is clicked, an interface switching action is detected, or the display time of the image file to be loaded is reached. For example, in related applications, a user clicks a control for loading an image file in terminal equipment, and the terminal equipment can acquire an identifier of the image file to be loaded; for another example, when the game interface is loaded, and the image in the game interface is a vector image, the terminal device may obtain an identifier of an image file to be loaded, and if the game interface includes a plurality of vector images, the plurality of vector images are all the image files to be loaded; for another example, the display time for loading the image file is set in advance in the terminal device, and when the preset time is reached, the terminal device may obtain the identifier of the image file to be loaded.
Step 102, inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: base data and attribute data of each patch.
In the embodiment of the application, after acquiring the identifier of the image file to be loaded, the terminal device may query a patch database in a local disk according to the identifier of the image file, and determine whether patch data corresponding to the identifier exists in the patch database; wherein the patch data includes: base data and attribute data of each patch. Further, optionally, the shape of the patch is triangular; the basic data of a patch includes: coordinate information of three vertices of a triangle, and a connection order of the three vertices. The attribute data of the patch includes any one or more of the following information: color, brightness, texture. The coordinate information of the three vertices of the triangle may be three-dimensional coordinate information (e.g., X, Y, Z), and the connection order of the three vertices may be clockwise connection or counterclockwise connection.
And 103, if patch data exist in the patch database, acquiring the patch data, and performing format conversion on the basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file.
Further, if patch data corresponding to the identifier exists in a patch database in the local disk, the corresponding patch data is acquired, and then format conversion is performed on the basic data and the attribute data of each patch in the patch data according to a preset code base, so that each component corresponding to the image file is obtained.
In addition, it should be noted that a patch database in the local disk is used to store patch data corresponding to an image file loaded on the terminal device, and if patch data corresponding to an image file exists in the patch database, it is determined that the image file is not loaded for the first time; and if the patch data corresponding to the image file does not exist in the patch database, determining that the image file is loaded for the first time.
And step 104, rendering each component corresponding to the image file, and completing the loading operation of the image file.
In the embodiment of the application, after the basic data and the components corresponding to the attribute data of each patch in the patch data of the image file are acquired, the terminal device renders each component corresponding to the image file by using the preset code library, and the loading operation of the image file is completed. The preset code library may be, but is not limited to, a Unity Vector Graphics library.
In addition, as shown in fig. 2, if there is no patch data corresponding to the identifier in the patch database in the local disk, the specific steps are as follows:
step 201, if the patch database does not have patch data, sending an image file loading request carrying an identifier to a server.
In this embodiment of the present application, if there is no patch data corresponding to the identifier in the patch database in the local disk, the terminal device sends an image file loading request to the server, where the image file loading request may include an identifier of an image file of a file to be loaded. Note that the identifier of the image file may be a name or a number of the image file.
Step 202, receiving the image file returned by the server.
Specifically, after receiving an image file loading request carrying an identifier sent by the terminal device, the server may return a corresponding image file to the terminal device according to the identifier of the image file.
Step 203, performing parsing and triangular patch conversion operation on the image file to obtain patch data corresponding to the image file.
In the embodiment of the application, after receiving the image file returned by the server, the terminal device can analyze the image file according to the preset code base to obtain the basic data and the attribute data of each vector graph in the image file; and splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics. The preset code library may be, but is not limited to, a Unity Vector Graphics library.
Step 204, storing the identification of the image file and the corresponding patch data into a patch database.
Specifically, after patch data corresponding to an image file is obtained, the patch data corresponding to the image file may be stored in a file of the local disk, and the file name may be an identifier of the image file. When the image file is stored, whether the image file is an image file is judged according to the storage type of the file. For example, an SVG file is a file stored with SVG as a suffix, and the file with the suffix is an SVG file.
Step 205, performing format conversion on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file.
In the embodiment of the application, the terminal device may perform format conversion on the basic data and the attribute data of each patch in the acquired patch data by using a preset code library to obtain each component corresponding to the image file. For example, the terminal device may perform format conversion on the basic data and attribute data of each of the tiles in the tile data of the image file using a Unity Vector Graphics library, for example, converting triangle tile data into a triangle component.
And step 206, rendering each component corresponding to the image file, and completing the loading operation of the image file.
In the embodiment of the application, after the basic data and the components corresponding to the attribute data of each patch in the patch data of the image file are obtained, the terminal device renders each component corresponding to the image file by using the preset code library, and the loading operation of the image file is completed. The preset code library may be, but is not limited to, a Unity Vector Graphics library.
It should be noted that, in order to better save the loading time of the image file and improve the smoothness of the image for loading the image file, the steps 201 and 204 may be executed by a sub-process of the terminal device, the steps 205 and 206 may be executed by a main process of the terminal device, and the terminal device may invoke the main process and the sub-process. In addition, the identification of the image file and the corresponding patch data are stored in the local patch database, and the total loading time is shortened when the same image file is loaded for multiple times.
According to the image file loading method, the identifier of the image file to be loaded is obtained, and the format of the image file is a scalable vector graph; inquiring a local patch database according to the identifier, and judging whether patch data corresponding to the identifier exists in the patch database; the patch data includes: basic data and attribute data of each patch; if patch data exist in the patch database, patch data are obtained, and format conversion is carried out on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; the method has the advantages that each component corresponding to the image file is rendered, and the loading operation of the image file is completed.
Corresponding to the method for loading an image file provided in the foregoing embodiment, an embodiment of the present application further provides a device for loading an image file, and since the device for loading an image file provided in the present application corresponds to the method for loading an image file provided in the foregoing embodiment, the implementation of the method for loading an image file described above is also applicable to the device for loading an image file provided in the present embodiment, and is not described in detail in the present embodiment. Fig. 3 is a schematic structural diagram of an image file loading apparatus according to an embodiment of the present application. As shown in fig. 3, the image file loading apparatus 300 includes: an obtaining module 310, a query module 320, a format conversion module 330, and a rendering module 340.
Specifically, the obtaining module 310 is configured to obtain an identifier of an image file to be loaded, where the format of the image file is a scalable vector graphics; the query module 320 is configured to query a local patch database according to the identifier, and determine whether patch data corresponding to the identifier exists in the patch database; the patch data includes: basic data and attribute data of each patch; the format conversion module 330 is configured to, when patch data exists in the patch database, obtain patch data, and perform format conversion on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file; and the rendering module 340 is configured to render each component corresponding to the image file, and complete the loading operation on the image file.
As a possible implementation manner of the embodiment of the present application, as shown in fig. 4, on the basis of fig. 3, the image file loading apparatus 300 further includes: a sending module 350, a receiving module 360, an analysis and conversion module 370 and a storage module 380;
specifically, the sending module 350 is configured to send an image file loading request carrying the identifier to a server when the patch data does not exist in the patch database; a receiving module 360, configured to receive the image file returned by the server; the analysis conversion module 370 is configured to perform analysis and triangular patch conversion operations on the image file to obtain patch data corresponding to the image file; the storage module 380 is configured to store the identifier of the image file and the corresponding patch data into a patch database; the format conversion module 330 is further configured to perform format conversion on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file; the rendering module 340 is further configured to render each component corresponding to the image file, so as to complete the loading operation on the image file.
As a possible implementation manner of the embodiment of the present application, the parsing conversion module 370 is specifically configured to parse an image file, and obtain basic data and attribute data of each vector graphic in the image file; splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics.
As a possible implementation manner of the embodiment of the present application, the shape of the patch is triangular; the basic data of the patch includes: coordinate information of three vertices of the triangle, and a connection order of the three vertices. The attribute data of the patch includes any one or more of the following information: color, brightness, texture.
As a possible implementation manner of the embodiment of the application, the trigger condition for the obtaining module 310 to obtain the identifier of the image file to be loaded is that a preset control is clicked, an interface switching action is detected, or the display time of the image file to be loaded is reached.
According to the loading device of the image file, the format of the image file is a scalable vector graph by acquiring the identifier of the image file to be loaded; inquiring a local patch database according to the identification, and judging whether patch data corresponding to the identification exists in the patch database; the patch data includes: basic data and attribute data of each patch; if the patch data exist in the patch database, patch data are obtained, and format conversion is carried out on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file; the device can effectively reduce the waiting time for loading the local image file, and simultaneously improves the user experience and the number of the stored image files.
In order to implement the foregoing embodiment, an electronic device is further provided in the embodiment of the present application, and fig. 5 is a schematic structural diagram of the electronic device provided in the embodiment of the present application. The electronic device may include a memory 1001, a processor 1002, and a computer program stored on the memory 1001 and executable on the processor 1002. The processor 1002 implements the loading method of the image file provided in the above-described embodiment when executing the program.
Further, the electronic device further includes: a communication interface 1003 for communicating between the memory 1001 and the processor 1002. A memory 1001 for storing computer programs that may be run on the processor 1002. Memory 1001 may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory. The processor 1002 is configured to implement the image file loading method according to the foregoing embodiment when executing the program. If the memory 1001, the processor 1002, and the communication interface 1003 are implemented independently, the communication interface 1003, the memory 1001, and the processor 1002 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but that does not indicate only one bus or one type of bus.
Optionally, in a specific implementation, if the memory 1001, the processor 1002, and the communication interface 1003 are integrated on one chip, the memory 1001, the processor 1002, and the communication interface 1003 may complete communication with each other through an internal interface.
The processor 1002 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
In order to implement the foregoing embodiments, the present application further provides a computer-readable storage medium, on which a computer program is stored, so as to implement the method for loading an image file according to the embodiments of the present application.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate 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 the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are well known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried out in the method of implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are exemplary and should not be construed as limiting the present application and that changes, modifications, substitutions and alterations in the above embodiments may be made by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. An image file loading method is characterized by comprising the following steps:
acquiring an identifier of an image file to be loaded, wherein the format of the image file is a scalable vector graphics;
inquiring a local patch database according to the identifier, and judging whether patch data corresponding to the identifier exists in the patch database; the patch data includes: basic data and attribute data of each patch;
if the patch data exist in the patch database, acquiring the patch data, and performing format conversion on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file;
rendering each component corresponding to the image file to finish the loading operation of the image file; further comprising:
if the patch data does not exist in the patch database, the terminal subprocess sends an image file loading request carrying the identifier to a server;
the terminal subprocess receives the image file returned by the server;
the terminal subprocess analyzes the image file and performs triangular patch conversion operation to obtain patch data corresponding to the image file;
the terminal subprocess stores the identifier of the image file and the corresponding patch data into the patch database;
the terminal main thread performs format conversion on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file;
and rendering each component corresponding to the image file by the main thread of the terminal to finish the loading operation of the image file.
2. The method of claim 1, wherein performing parsing and triangle patch conversion operations on the image file to obtain patch data corresponding to the image file comprises:
analyzing the image file to obtain basic data and attribute data of each vector graph in the image file;
and splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics.
3. The method of claim 1, wherein the patch is triangular in shape;
the basic data of the patch comprises: coordinate information of three vertexes of the triangle, and a connection order of the three vertexes;
the attribute data of the patch includes any one or more of the following information: color, brightness, texture.
4. The method according to claim 1, wherein the trigger condition for obtaining the identifier of the image file to be loaded is,
and clicking a preset control, detecting an interface switching action, or reaching the display time of the image file to be loaded.
5. An apparatus for loading an image file, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an identifier of an image file to be loaded, and the format of the image file is a scalable vector graph;
the query module is used for querying a local patch database according to the identifier and judging whether patch data corresponding to the identifier exists in the patch database; the patch data includes: basic data and attribute data of each patch;
the format conversion module is used for acquiring the patch data when the patch data exists in the patch database, and performing format conversion on basic data and attribute data of each patch in the patch data to obtain each component corresponding to the image file;
the rendering module is used for rendering each component corresponding to the image file to finish the loading operation of the image file;
the device, still include: the device comprises a sending module, a receiving module, an analysis and conversion module and a storage module;
the sending module is used for sending an image file loading request carrying the identifier to a server by the terminal subprocess when the patch data does not exist in the patch database;
the receiving module is used for the terminal subprocess to receive the image file returned by the server;
the analysis conversion module is used for the terminal subprocess to analyze the image file and perform triangular patch conversion operation to obtain patch data corresponding to the image file;
the storage module is used for the terminal subprocess to store the identifier of the image file and the corresponding patch data into the patch database;
the format conversion module is also used for the terminal main thread to perform format conversion on the basic data and the attribute data of each patch in the patch data to obtain each component corresponding to the image file;
and the rendering module is also used for rendering each component corresponding to the image file by the terminal main thread to finish the loading operation of the image file.
6. The apparatus according to claim 5, wherein the parsing conversion module is specifically configured to,
analyzing the image file to obtain basic data and attribute data of each vector graph in the image file;
and splitting the vector graphics aiming at each vector graphics in the image file to obtain at least one triangular vector graphics, and determining the basic data and the attribute data of at least one triangular patch according to the at least one triangular vector graphics.
7. The apparatus of claim 5, wherein the patch is triangular in shape;
the basic data of the patch comprises: coordinate information of three vertexes of the triangle, and a connection order of the three vertexes;
the attribute data of the patch includes any one or more of the following information: color, brightness, texture.
8. The apparatus according to claim 5, wherein the trigger condition for the obtaining module to obtain the identifier of the image file to be loaded is,
the preset control is clicked, an interface switching action is detected, or the display time of the image file to be loaded is reached.
9. An electronic device, comprising:
memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the loading method of image files according to any of claims 1 to 4 when executing the program.
10. 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 a method of loading an image file according to any one of claims 1 to 4.
CN201910569374.8A 2019-06-27 2019-06-27 Image file loading method and device, electronic equipment and storage medium Active CN110286960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910569374.8A CN110286960B (en) 2019-06-27 2019-06-27 Image file loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910569374.8A CN110286960B (en) 2019-06-27 2019-06-27 Image file loading method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110286960A CN110286960A (en) 2019-09-27
CN110286960B true CN110286960B (en) 2022-07-22

Family

ID=68019933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910569374.8A Active CN110286960B (en) 2019-06-27 2019-06-27 Image file loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110286960B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111617473A (en) * 2020-05-28 2020-09-04 腾讯科技(深圳)有限公司 Display method and device of virtual attack prop, storage medium and electronic equipment
CN111883233A (en) * 2020-07-14 2020-11-03 上海商汤智能科技有限公司 Image acquisition method and device, electronic equipment and storage medium
CN112199538B (en) * 2020-09-30 2023-12-12 北京达佳互联信息技术有限公司 Picture processing method, device, electronic equipment, system and storage medium
CN113342916B (en) * 2021-06-22 2024-01-26 中煤航测遥感集团有限公司 Geographic tag image file format data processing method and device and electronic equipment
CN115599491A (en) * 2022-12-14 2023-01-13 西安纽扣软件科技有限公司(Cn) SVG vector diagram display method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104066485A (en) * 2012-01-24 2014-09-24 索尼电脑娱乐公司 Information processing device and information processing system
CN105069839A (en) * 2015-08-03 2015-11-18 清华大学深圳研究生院 Computed hologram generation method for three-dimensional point cloud model
CN105488833A (en) * 2014-10-09 2016-04-13 华为技术有限公司 Method and apparatus for realizing 3D transition animation for 2D control
CN106651992A (en) * 2016-11-18 2017-05-10 武汉斗鱼网络科技有限公司 Method and system for optimizing Android resource picture
CN107122099A (en) * 2017-04-28 2017-09-01 网易(杭州)网络有限公司 Method, device, storage medium, processor and the terminal at association user interface

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849491B2 (en) * 2002-12-10 2010-12-07 Onlive, Inc. Apparatus and method for wireless video gaming
CN101593209B (en) * 2008-12-30 2011-03-30 中国科学院地理科学与资源研究所 Alternating type online statistical map generation and releasing device and method thereof
CN101916277B (en) * 2010-08-11 2012-08-08 武大吉奥信息技术有限公司 XML format-based geographic tile multi-pyramid temporal dataset generation method and device thereof
CN103186924B (en) * 2011-12-30 2015-12-16 国际商业机器公司 For the treatment of the method and apparatus of three-dimensional modeling data
US20140256420A1 (en) * 2013-03-11 2014-09-11 Microsoft Corporation Univied game preview
CN104808907B (en) * 2015-05-20 2018-01-09 腾讯科技(深圳)有限公司 A kind of content Display on the same screen method, apparatus and terminal device
CN105630483B (en) * 2015-12-16 2019-01-04 青岛海信网络科技股份有限公司 A kind of display methods and device of configuration pel
CN105740029B (en) * 2016-03-03 2019-07-05 腾讯科技(深圳)有限公司 A kind of method, user equipment and system that content is presented
GB201604362D0 (en) * 2016-03-15 2016-04-27 Tangentix Ltd Computer system and method for sandboxed applications
CN106846460B (en) * 2016-12-30 2020-07-14 译筑信息科技(上海)有限公司 Method and device for realizing three-dimensional BIM image
KR20180087060A (en) * 2017-01-24 2018-08-01 라인 가부시키가이샤 Method, apparatus, computer program and recording medium for providing game service
CN108346169B (en) * 2018-02-09 2021-08-24 城市生活(北京)资讯有限公司 Two-dimensional vector rendering method and device
CN109816762B (en) * 2019-01-30 2023-08-22 网易(杭州)网络有限公司 Image rendering method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104066485A (en) * 2012-01-24 2014-09-24 索尼电脑娱乐公司 Information processing device and information processing system
CN105488833A (en) * 2014-10-09 2016-04-13 华为技术有限公司 Method and apparatus for realizing 3D transition animation for 2D control
CN105069839A (en) * 2015-08-03 2015-11-18 清华大学深圳研究生院 Computed hologram generation method for three-dimensional point cloud model
CN106651992A (en) * 2016-11-18 2017-05-10 武汉斗鱼网络科技有限公司 Method and system for optimizing Android resource picture
CN107122099A (en) * 2017-04-28 2017-09-01 网易(杭州)网络有限公司 Method, device, storage medium, processor and the terminal at association user interface

Also Published As

Publication number Publication date
CN110286960A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN110286960B (en) Image file loading method and device, electronic equipment and storage medium
CN110554958B (en) Graph database testing method, system, device and storage medium
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN107317853B (en) Method, device and system for displaying dynamic effect of message popup window
CN111563014A (en) Interface service performance test method, device, equipment and storage medium
US20230214989A1 (en) Defect detection method, electronic device and readable storage medium
CN108536467B (en) Code positioning processing method and device, terminal equipment and storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN111737618A (en) Vector diagram display method and device for Web end and computer equipment
CN110287431B (en) Image file loading method and device, electronic equipment and storage medium
CN111949513A (en) Configuration file loading method and device, electronic equipment and readable storage device
CN116662038A (en) Industrial information detection method, device, equipment and medium based on shared memory
CN117077599B (en) Method and device for generating field programmable gate array view
CN113448730A (en) Service processing method and device, computer equipment and storage medium
CN111123728A (en) Unmanned vehicle simulation method, device, equipment and computer readable medium
CN110290201B (en) Picture acquisition method, mobile terminal, server and storage medium
CN113852763B (en) Audio and video processing method and device, electronic equipment and storage medium
CN107767434B (en) Method for acquiring texture mapping configuration information in virtual reality technology and storage medium
CN114519739A (en) Direction positioning method and device based on recognition device and storage medium
CN111368120B (en) Target fingerprint database construction method and device, electronic equipment and storage medium
CN115129659A (en) Main and auxiliary kernel computer processing platform
CN111124862B (en) Intelligent device performance testing method and device and intelligent device
CN110515834B (en) Interface testing method and device, mobile terminal and storage medium
CN114092590A (en) Electronic device and evaluation method and medium for image rendering performance of electronic device
CN110471851B (en) Automatic testing method and device

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