WO2023125083A1 - 资源文件加载方法、装置、电子设备及存储介质 - Google Patents

资源文件加载方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023125083A1
WO2023125083A1 PCT/CN2022/139761 CN2022139761W WO2023125083A1 WO 2023125083 A1 WO2023125083 A1 WO 2023125083A1 CN 2022139761 W CN2022139761 W CN 2022139761W WO 2023125083 A1 WO2023125083 A1 WO 2023125083A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource file
file
loading
resource
cache data
Prior art date
Application number
PCT/CN2022/139761
Other languages
English (en)
French (fr)
Inventor
李宇
王晶
胡博远
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023125083A1 publication Critical patent/WO2023125083A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • 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/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • G06F16/152File search processing using file content signatures, e.g. hash values
    • 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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of the Internet, and in particular to a resource file loading method, device, electronic equipment and storage medium.
  • An engine is a core component for developing a program or system on an electronic platform. Using the engine, developers can quickly build and lay out the functions required by the program, or use it to assist the operation of the program. According to different functions, the engine may include a game engine, a special effect engine, and the like.
  • the resource file format of the engine is mostly designed for runtime. In order to keep the size of the package as small as possible, the cost of learning and editing for developers is relatively high. Therefore, the editor adds a unique file format (such as material) to some resource files that need to be edited frequently by the editor or uses other third-party file formats, such as FBX (model format), PNG (picture format), etc. .
  • FBX model format
  • PNG picture format
  • the present application provides a resource file loading method, device, electronic equipment and storage medium.
  • a resource file loading method including:
  • the method also includes:
  • the judging whether the first resource file has changed includes:
  • the method also includes:
  • storing the first resource file and cache data of the first resource file includes:
  • the method also includes:
  • the second resource file In response to a loading operation on the second resource file, the second resource file is loaded.
  • the data type of the cached data of the first resource file is the same as the data type of the second resource file.
  • the generating ID information corresponding to the first resource file according to the first resource file includes:
  • the hash value is determined as ID information corresponding to the first resource file.
  • a resource file loading device including:
  • the first storage module is configured to obtain an editable first resource file, and store the first resource file and the cache data of the first resource file; wherein, the cache data is not editable, and the file of the cache data The size is smaller than the file size of the first resource file;
  • a resource file judging module configured to judge whether the first resource file has changed in response to a loading instruction for the first resource file
  • a cache data loading module configured to acquire the cache data of the first resource file if the first resource file has not changed, and load the cache data of the first resource file;
  • the first resource file loading module is configured to acquire the first resource file and load the first resource file if the first resource file changes.
  • the resource file loading device also includes:
  • An ID information storage module configured to generate ID information corresponding to the first resource file according to the first resource file, and store the ID information corresponding to the first resource file;
  • the resource file judging module is specifically configured to obtain the first resource file in response to a loading instruction for the first resource file, and generate current ID information of the first resource file according to the first resource file ; If the current ID information is not equal to the ID information, determine that the first resource file has changed; if the current ID information is equal to the ID information, determine that the first resource file has not changed .
  • the resource file loading device also includes:
  • An ID information update module configured to update the stored ID information to the current ID information if the first resource file changes
  • a cache data update module configured to update the stored cache data to the current cache data of the first resource file.
  • the first storage module is specifically configured to obtain an editable first resource file, store the first resource file in the first directory; store the cached data of the first resource file in the second Table of contents.
  • the resource file loading device also includes:
  • the second storage module is configured to acquire a second resource file and store the second resource file; wherein, the second resource file is not editable;
  • the second resource file loading module is configured to load the second resource file in response to a loading operation on the second resource file.
  • the data type of the cached data of the first resource file is the same as the data type of the second resource file.
  • the ID information storage module is specifically configured to perform hash calculation on the first resource file to obtain a hash value of the first resource file; determine the hash value as the first ID information corresponding to the resource file, and store the ID information corresponding to the first resource file.
  • an electronic device including: a processor, the processor is configured to execute a computer program stored in a memory, and when the computer program is executed by the processor, the method described in the first aspect is implemented .
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
  • a computer program product includes instructions, and when the instructions are executed by a processor, the method described in the first aspect is implemented.
  • a computer program includes instructions, and when the instructions are executed by a processor, the method described in the first aspect is implemented.
  • FIG. 1 shows a schematic diagram of the system architecture of an exemplary application environment that can be applied to the resource file loading method of the embodiment of the present application;
  • Fig. 2 is a kind of flowchart of resource file loading method in the embodiment of the present application
  • Fig. 3 is another flow chart of the resource file loading method in the embodiment of the present application.
  • Fig. 4 is a schematic diagram of a catalog of projects in the embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a resource file loading device in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • stickers animations can generate sticker animations through special effects editing tools, and provide sticker animations to video platforms. For example, call a certain material (such as plush, smooth or others), after clipping, add textures, animations and render to generate texture animations.
  • a certain material such as plush, smooth or others
  • the video platform can add the sticker animation to the appropriate position through face detection, and generate image data or video data containing the sticker animation.
  • the texture animation is a kind of resource file, and the format of the resource file is the unique file format of the editor.
  • FBX model format
  • PNG picture format
  • FBX is the Kaydara FiLMBOX file format.
  • Kaydara FiLMBOX is a system for creating, editing and mixing motion capture and keyframe animation, usually a motion recording file in 3Dmax.
  • embodiments of the present application provide a resource file loading method, device, electronic equipment, media, and program product, so as to improve resource file loading efficiency.
  • FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment that can be applied to the resource file loading method of the embodiment of the present application.
  • the system architecture 100 includes: a terminal device 101 , a network 102 and a server 103 .
  • the network 102 is used as a medium for providing a communication link between the terminal device 101 and the server 103 .
  • Network 102 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
  • the terminal device 101 includes, but is not limited to, a desktop computer, a portable computer, a smart phone, a tablet computer, and the like. It should be understood that the numbers of terminal devices, networks and servers in Fig. 1 are only illustrative. According to implementation needs, there can be any number of terminal devices, networks and servers.
  • the server 103 may be a server cluster composed of multiple servers.
  • the resource file loading method provided in the embodiment of the present application can be executed by the terminal device 101 , and accordingly, the resource file loading device can be set in the terminal device 101 .
  • the developer can obtain the first resource file of the special effect engine through the terminal device 101 , and the user can edit the first resource file through the editor in the terminal device 101 . If the developer does not edit the first resource file, the first resource file and the cached data of the first resource file may be stored locally.
  • the first resource file is to be loaded, if the first resource file has not changed, the cached data of the first resource file can be loaded preferentially, which can improve loading efficiency.
  • the corresponding sticker animation can be generated and uploaded to the server 103 for use by the user.
  • FIG. 2 is a flow chart of a resource file loading method in an embodiment of the present application, which may include the following steps:
  • Step S210 obtaining an editable first resource file, and storing the first resource file and cache data of the first resource file.
  • the first resource file refers to the resource file of the engine (such as game engine, special effect engine, etc.), the first resource file is editable, and the developer can edit and modify the first resource file during the development process to meet different development requirements. need.
  • the first resource file may be a resource file generated by an editor, or a resource file generated by other third-party tools. Since the first resource file is editable, but the resource file of the engine is not editable, the file format of the first resource file is different from the file format of the resource file of the engine.
  • cache data of the first resource file may be stored at the same time, and the cache data is also non-editable.
  • the cached data cannot be edited. Therefore, compared with the first resource file, there is no need to store more edited data in the cached data, and the amount of data stored in the cached data is less.
  • the file size of the data is smaller than the file size of the first resource file.
  • Step S220 in response to the loading instruction for the first resource file, determine whether the first resource file has changed.
  • the developer When the developer wants to use the first resource file to generate the desired texture animation, he can perform a loading operation on the first resource file and generate a corresponding loading instruction at the same time. Since the first resource file is editable, the developer may or may not have modified the first resource file when the first resource file is loaded.
  • the terminal device may first determine whether the first resource file has changed. If the first resource file has not changed, then the content of the first resource file is consistent with the cached data, and step S230 can be performed; if the first resource file has changed, then the content of the first resource file and the cached data are inconsistent, and step S240 can be performed.
  • Step S230 acquiring cached data of the first resource file, and loading the cached data of the first resource file.
  • the file size of the cached data is also smaller than the file size of the first resource file. Therefore, when the first resource file is to be loaded, the cached data is directly loaded without changing the first resource file. Can improve loading efficiency.
  • the format of the cache data may be the same as the file format of the engine's resource files. In this way, under the condition that the file format is the same, the loading speed is faster, so that the loading efficiency can be further improved.
  • Step S240 acquiring the first resource file and loading the first resource file.
  • the first resource file changes, since the cached data is inconsistent with the current content of the first resource file, loading the cached data directly will result in the updated first resource file not being used, which may be contrary to the actual intention of the developer do not match. Therefore, at this time, the first resource file can be obtained and loaded, so that the developer can use the latest content.
  • the first resource file and the cache data of the first resource file can be stored at the same time.
  • FIG. 3 is another flow chart of the resource file loading method in the embodiment of the present application, which may include the following steps:
  • Step S310 obtaining an editable first resource file, and storing the first resource file and cache data of the first resource file. Wherein, the cached data cannot be edited, and the file size of the cached data is smaller than the file size of the first resource file.
  • the root directory of the project loaded by the editor usually includes two resource-related folders, namely the first folder and the second folder.
  • the first folder is used to store the resource files imported by the user into the project.
  • ResourceManager will monitor this folder for changes and trigger import jobs. Users can modify resource files from the editor resource inspector or directly from the file system.
  • the second folder can save the resource files of the engine.
  • the resource files of the engine are not editable. For example, the resource files of the engine can be saved in a binary format.
  • FIG. 4 is a schematic diagram of a catalog of projects in the embodiment of the present application.
  • the first folder may also include a third folder and a fourth folder, and the second folder may also include a fifth folder. Since the first resource file can be edited but the cached data cannot be edited, in some embodiments, the first resource file can be stored in the first directory; the cached data of the first resource file can be stored in the second directory. In this way, storing the editable first resource file and the non-editable cache data separately can improve the developer's development experience.
  • the first resource file may be stored in the first folder, and the cached data may be stored in the second folder.
  • the developer can directly enter the first folder to search for the first resource file, thereby improving query efficiency and further improving editing efficiency.
  • Step S320 according to the first resource file, generate ID information corresponding to the first resource file, and store the ID information corresponding to the first resource file.
  • unique ID information is corresponding to different first resource files, and the ID information may change as the content in the first resource file changes. In this way, through the ID information, it can be determined whether the content of the first resource file has changed.
  • a hash calculation may be performed on the first resource file to obtain a hash value of the first resource file, and the hash value is determined as ID information corresponding to the first resource file. After determining the ID information corresponding to the first resource file, the ID information may be stored in the second folder as non-editable data.
  • Step S330 in response to the loading instruction for the first resource file, acquire the first resource file, and generate current ID information of the first resource file according to the first resource file.
  • the first resource file In response to the loading instruction for the first resource file, the first resource file can be obtained from the first directory, because the developer may have modified the content in the first resource file, or may not have modified the content in the first resource file Therefore, after the first resource file is acquired, the ID information corresponding to the first resource file, that is, the current ID information, can be regenerated according to the first resource file.
  • Step S340 judging whether the current ID information is equal to the stored ID information.
  • step S350 may be performed; if the current ID information is not equal to the ID information, step S360 may be performed.
  • Step S350 determining that the first resource file has not changed, acquiring cached data of the first resource file, and loading the cached data of the first resource file.
  • Step S360 determining that the first resource file has changed, acquiring the first resource file, and loading the first resource file.
  • the cached data is loaded preferentially to improve loading efficiency.
  • the first resource file is loaded to use the latest content in the first resource file.
  • Step S370 updating the stored ID information to the current ID information, and updating the stored cache data to the current cache data of the first resource file.
  • the stored ID information and cache data can also be updated in time, so that the ID information and cache data correspond to the content in the first resource file. In this way, when the first resource file is loaded next time, if no further modification is made to the first resource file, the cached data can be directly loaded to improve loading efficiency.
  • the second resource file may also be acquired and stored.
  • the second resource file refers to the resource file of the engine, and the resource file cannot be edited.
  • the data type of the cached data of the first resource file is the same as the data type of the second resource file.
  • both the cache data of the first resource file and the second resource file may be binary data. In this way, directly storing the cached data of the first resource file as the data type of the resource file of the engine can increase the loading speed of the cached data.
  • the second resource file may be stored in the second folder.
  • the second resource file is loaded, and the loading speed of the second resource file is relatively fast.
  • the editable first resource file after obtaining the first resource file, the editable first resource file can be stored in the first directory, and the non-editable cache data and ID information Stored in the second directory, when the developer wants to modify the first resource file, he can directly search it in the first directory, which can improve the efficiency of modification.
  • it may first be determined according to the ID information whether the first resource file has changed, and if the first resource file has not changed, the cached data of the first resource file is preferentially loaded. Since there is no need to store more editing data in the cache data, the file size of the cache data is smaller than the file size of the first resource file.
  • the cache data can be binary data.
  • Loading efficiency can be improved by prioritizing loading of cached data. If the first resource file changes, it means that the developer has re-edited the first resource file, and the cached data at this time is inconsistent with the first resource file, so the first resource file is directly loaded to use the latest content.
  • the embodiment of the present application also provides a resource file loading device.
  • the resource file loading device 500 includes:
  • the first storage module 510 is configured to obtain an editable first resource file, and store the first resource file and the cache data of the first resource file; wherein, the cache data cannot be edited, and the file size of the cache data is smaller than that of the first resource file File size;
  • a resource file judging module 520 configured to judge whether the first resource file has changed in response to a loading instruction for the first resource file
  • the cache data loading module 530 is configured to obtain the cache data of the first resource file and load the cache data of the first resource file if the first resource file has not changed;
  • the first resource file loading module 540 is configured to acquire the first resource file and load the first resource file if the first resource file changes.
  • the resource file loading device 500 also includes:
  • the ID information storage module is used for, according to the first resource file, generates the ID information corresponding to the first resource file, and stores the ID information corresponding to the first resource file;
  • the resource file judging module 520 is specifically configured to obtain the first resource file in response to the loading instruction for the first resource file, and generate the current ID information of the first resource file according to the first resource file; if the current ID information and the ID information are not If they are equal, it is determined that the first resource file has changed; if the current ID information is equal to the ID information, it is determined that the first resource file has not changed.
  • the resource file loading device 500 also includes:
  • An ID information updating module configured to update the stored ID information to current ID information if the first resource file changes
  • the cache data update module is used to update the stored cache data to the current cache data of the first resource file.
  • the first storage module 510 is specifically configured to obtain an editable first resource file, store the first resource file in the first directory, and store cached data of the first resource file in the second directory.
  • the resource file loading device 500 also includes:
  • the second storage module is used to obtain the second resource file and store the second resource file; wherein, the second resource file cannot be edited;
  • the second resource file loading module is configured to load the second resource file in response to the loading operation on the second resource file.
  • the data type of the cached data of the first resource file is the same as the data type of the second resource file.
  • the ID information storage module is specifically used to perform hash calculation on the first resource file to obtain the hash value of the first resource file; determine the hash value as the ID information corresponding to the first resource file, and store the first resource file ID information corresponding to a resource file.
  • an electronic device including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the resource file loading described above in this exemplary embodiment method.
  • FIG. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application. It should be noted that the electronic device 600 shown in FIG. 6 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.
  • an electronic device 600 includes a central processing unit (CPU) 601, which can operate according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603 Instead, various appropriate actions and processes are performed.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data necessary for system operation are also stored.
  • the central processing unit 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604 .
  • the following components are connected to the I/O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 608 including a hard disk, etc. and a communication section 609 including a network interface card such as a local area network (LAN) card, a modem, or the like.
  • the communication section 609 performs communication processing via a network such as the Internet.
  • a drive 610 is also connected to the I/O interface 605 as needed.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 610 as necessary so that a computer program read therefrom is installed into the storage section 608 as necessary.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication portion 609 and/or installed from removable media 611 .
  • the central processing unit 601 When the computer program is executed by the central processing unit 601, various functions defined in the apparatus of the present application are executed.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method for loading a resource file is implemented.
  • the computer-readable storage medium described in this application may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more conductors, portable computer diskettes, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM) or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • Program code contained on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wires, optical cables, radio frequency, etc., or any suitable combination of the above.
  • a computer program product is also provided.
  • the computer program product is run on a computer, the computer is made to execute the above resource file loading method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请涉及一种资源文件加载方法、装置、电子设备及存储介质,应用于互联网技术领域,所述方法包括:获取可编辑的第一资源文件,存储第一资源文件以及第一资源文件的缓存数据;其中,缓存数据不可编辑,且缓存数据的文件大小小于第一资源文件的文件大小;响应于针对第一资源文件的加载指令,判断第一资源文件是否发生改变;如果第一资源文件未发生改变,获取第一资源文件的缓存数据,并加载第一资源文件的缓存数据;如果第一资源文件发生改变,获取第一资源文件,并加载第一资源文件。

Description

资源文件加载方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2021年12月29日递交、申请号为202111636944.4、名称为“资源文件加载方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用并入本文。
技术领域
本申请涉及互联网技术领域,尤其涉及一种资源文件加载方法、装置、电子设备及存储介质。
背景技术
引擎是电子平台上开发程序或系统的核心组件。利用引擎,开发者可迅速建立、铺设程序所需的功能,或利用其辅助程序的运转。根据不同的功能,引擎可以包括游戏引擎、特效引擎等。
引擎的资源文件格式多是针对运行时设计,为了包的大小尽可能小,开发者的学习和编辑成本较大。因此,编辑器端对部分需要用户频繁编辑的资源文件加入了编辑器独有的文件格式(例如材质)或使用了其他第三方的文件格式,例如FBX(模型格式)、PNG(图片格式)等。
发明内容
本申请提供了一种资源文件加载方法、装置、电子设备及存储介质。
根据本申请的第一方面,提供了一种资源文件加载方法,包括:
获取可编辑的第一资源文件,存储所述第一资源文件以及所述第一资源文件的缓存数据;其中,所述缓存数据不可编辑,且所述缓存数据的文件大小小于所述第一资源文件的文件大小;
响应于针对所述第一资源文件的加载指令,判断所述第一资源文件是否发生改变;
如果所述第一资源文件未发生改变,获取所述第一资源文件的缓存数据,并加载所述第一资源文件的缓存数据;
如果所述第一资源文件发生改变,获取所述第一资源文件,并加载所述第一资源文件。
可选的,所述方法还包括:
根据所述第一资源文件,生成所述第一资源文件对应的ID信息,并存储所述第一资源文件对应的ID信息;
所述判断所述第一资源文件是否发生改变,包括:
获取所述第一资源文件,根据所述第一资源文件,生成所述第一资源文件的当前ID信息;
如果所述当前ID信息与所述ID信息不相等,则确定所述第一资源文件发生改变;
如果所述当前ID信息与所述ID信息相等,则确定所述第一资源文件未发生改变。
可选的,所述方法还包括:
如果所述第一资源文件发生改变,将已存储的所述ID信息更新为所述当前ID信息;
将已存储的所述缓存数据更新为所述第一资源文件的当前缓存数据。
可选的,存储所述第一资源文件以及所述第一资源文件的缓存数据,包括:
将所述第一资源文件存储至第一目录;
将所述第一资源文件的缓存数据存储至第二目录。
可选的,所述方法还包括:
获取第二资源文件,并存储所述第二资源文件;其中,所述第二资源文件不可编辑;
响应于针对所述第二资源文件的加载操作,加载所述第二资源文件。
可选的,所述第一资源文件的缓存数据的数据类型与所述第二资源文件的数据类型相同。
可选的,所述根据所述第一资源文件,生成所述第一资源文件对应的ID信息,包括:
对所述第一资源文件进行哈希计算,得到所述第一资源文件的哈希值;
将所述哈希值确定为所述第一资源文件对应的ID信息。
根据本申请的第二方面,提供了一种资源文件加载装置,包括:
第一存储模块,用于获取可编辑的第一资源文件,存储所述第一资源文件以及所述第一资源文件的缓存数据;其中,所述缓存数据不可编辑,且所述缓存数据的文件大小小于所述第一资源文件的文件大小;
资源文件判断模块,用于响应于针对所述第一资源文件的加载指令,判断所述第一资源文件是否发生改变;
缓存数据加载模块,用于如果所述第一资源文件未发生改变,获取所述第一资源文件的缓存数据,并加载所述第一资源文件的缓存数据;
第一资源文件加载模块,用于如果所述第一资源文件发生改变,获取所述第一资源文件,并加载所述第一资源文件。
可选的,所述资源文件加载装置还包括:
ID信息存储模块,用于根据所述第一资源文件,生成所述第一资源文件对应的ID信息,并存储所述第一资源文件对应的ID信息;
所述资源文件判断模块,具体用于响应于针对所述第一资源文件的加载指令,获取所述第一资源文件,根据所述第一资源文件,生成所述第一资源文件的当前ID信息;如果所述当前ID信息与所述ID信息不相等,则确定所述第一资源文件发生改变;如果所述当前ID信息与所述ID信息相等,则确定所述第一资源文件未发生改变。
可选的,所述资源文件加载装置还包括:
ID信息更新模块,用于如果所述第一资源文件发生改变,将已存储的所述ID信息更新为所述当前ID信息;
缓存数据更新模块,用于将已存储的所述缓存数据更新为所述第一资源文件的当前缓存数据。
可选的,所述第一存储模块,具体用于获取可编辑的第一资源文件,将所述第一资源文件存储至第一目录;将所述第一资源文件的缓存数据存储至第二目录。
可选的,所述资源文件加载装置还包括:
第二存储模块,用于获取第二资源文件,并存储所述第二资源文件;其中,所述第二资源文件不可编辑;
第二资源文件加载模块,用于响应于针对所述第二资源文件的加载操作,加载所述第二资源文件。
可选的,所述第一资源文件的缓存数据的数据类型与所述第二资源文件的数据类型相同。
可选的,所述ID信息存储模块,具体用于对所述第一资源文件进行哈希计算,得到所述第一资源文件的哈希值;将所述哈希值确定为所述第一资源文件对应的ID信息,并存储所述第一资源文件对应的ID信息。
根据本申请的第三方面,提供了一种电子设备,包括:处理器,所述处理器用于执行 存储于存储器的计算机程序,所述计算机程序被处理器执行时实现第一方面所述的方法。
根据本申请的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面所述的方法。
根据本申请的第五方面,提供了一种计算机程序产品,所述计算机程序产品包括指令,所述指令被处理器执行时实现第一方面所述的方法。
根据本申请的第六方面,提供了一种计算机程序,所述计算机程序包括指令,所述指令被处理器执行时实现第一方面所述的方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1示出了可以应用于本申请实施例的资源文件加载方法的示例性应用环境的系统架构的示意图;
图2为本申请实施例中资源文件加载方法的一种流程图;
图3为本申请实施例中资源文件加载方法的又一种流程图;
图4为本申请实施例中工程的一种目录示意图;
图5为本申请实施例中资源文件加载装置的一种结构示意图;
图6为本申请实施例中电子设备的一种结构示意图。
具体实施方式
为了能够更清楚地理解本申请的上述目的、特征和优点,下面将对本申请的方案进行进一步描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,但本申请还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本申请的一部分实施例,而不是全部的实施例。
随着互联网的发展,越来越多的用户通过视频来分享自己的工作和生活。视频平台的 开发者可以通过特效编辑工具(即编辑器)生成特效供用户使用。这样,用户在制作视频的过程中,可以添加一些特效来增加视频的趣味性。
开发者可以通过特效编辑工具生成贴图动画,并将贴图动画提供给视频平台。例如,调用一定的材质(例如毛绒的、光滑的或者其他),在裁剪之后,添加贴图、动画并进行渲染,生成贴图动画。用户在拍摄图像或视频时,可以选择用户感兴趣的贴图动画,用户选择贴图动画后,视频平台通过人脸检测,可以将贴图动画添加至适当的位置,生成包含贴图动画的图像数据或视频数据。其中,贴图动画即为一种资源文件,该资源文件的格式为编辑器独有的文件格式。
或者,也可以使用其他第三方的资源文件,第三方的资源文件的文件格式包括FBX(模型格式)、PNG(图片格式)等。其中,FBX是Kaydara FiLMBOX文件格式。Kaydara FiLMBOX用于创建、编辑和混合运动捕捉和关键帧动画的系统,通常是3Dmax里调的动作记录文件。
针对编辑器独有的文件格式,或者第三方的文件格式,由于与引擎自身的文件格式不同,因此,在加载资源文件时需要编辑器对资源文件进行解析,并转化为引擎的资源。然而,由于要存储更多的编辑信息,并且和引擎自身的文件格式不一致,导致加载资源文件时更加耗时,加载效率较低。为了解决该问题,本申请实施例提供了一种资源文件加载方法、装置、电子设备、介质及程序产品,以提高资源文件的加载效率。
参见图1,图1示出了可以应用于本申请实施例的资源文件加载方法的示例性应用环境的系统架构的示意图。系统架构100包括:终端设备101、网络102和服务器103。网络102用以在终端设备101和服务器103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。终端设备101包括但不限于台式计算机、便携式计算机、智能手机和平板电脑等等。应该理解,图1中的终端设备、网络和服务器的数量仅仅是示意性的。根据实现需要,可以具有任意数量的终端设备、网络和服务器。比如服务器103可以是多个服务器组成的服务器集群等。
本申请实施例所提供的资源文件加载方法可以由终端设备101执行,相应地,资源文件加载装置可以设置于终端设备101中。举例而言,开发者可以通过终端设备101获取特效引擎的第一资源文件,用户可以通过终端设备101中的编辑器对该第一资源文件进行编辑。开发者如果不对该第一资源文件进行编辑,可以将第一资源文件和第一资源文件的缓存数据存储至本地。在要加载第一资源文件时,在第一资源文件未发生改变的情况下,可 以优先加载第一资源文件的缓存数据,这样可以提高加载效率。加载完成之后,可以生成对应的贴图动画,并将贴图动画上传至服务器103供用户使用。
参见图2,图2为本申请实施例中资源文件加载方法的一种流程图,可以包括以下步骤:
步骤S210,获取可编辑的第一资源文件,存储第一资源文件以及第一资源文件的缓存数据。
第一资源文件指引擎(例如游戏引擎、特效引擎等)的资源文件,该第一资源文件是可编辑的,开发者在开发过程中可以对第一资源文件进行编辑修改,以满足不同的开发需求。该第一资源文件可以是编辑器生成的资源文件,或其他第三方工具生成的资源文件。由于第一资源文件是可编辑的,而引擎的资源文件是不可编辑的,因此,该第一资源文件的文件格式和引擎的资源文件的文件格式不同。在存储第一资源文件时,可以同时存储第一资源文件的缓存数据,该缓存数据也是不可编辑的。
需要说明的是,由于第一资源文件可编辑,缓存数据不可编辑,因此,与第一资源文件相比,缓存数据中可以不用存储较多的编辑数据,缓存数据存储的数据量更少,缓存数据的文件大小小于第一资源文件的文件大小。
步骤S220,响应于针对第一资源文件的加载指令,判断第一资源文件是否发生改变。
在开发者要使用第一资源文件生成所需的贴图动画时,可以对第一资源文件执行加载操作,同时生成对应的加载指令。由于第一资源文件是可编辑的,因此,在加载第一资源文件之时,开发者可能对第一资源文件进行了修改,也可能没有对第一资源文件进行修改。
基于此,终端设备响应于该加载指令后,可以先判断第一资源文件是否发生了改变。如果第一资源文件未发生改变,那么第一资源文件和缓存数据内容一致,可以执行步骤S230;如果第一资源文件发生改变,那么第一资源文件和缓存数据内容不一致,可以执行步骤S240。
步骤S230,获取第一资源文件的缓存数据,并加载第一资源文件的缓存数据。
由于缓存数据是不可编辑的,缓存数据的文件大小也小于第一资源文件的文件大小,因此,在要加载第一资源文件时,在第一资源文件没有发生改变的情况下直接加载缓存数据,可以提高加载效率。在一些实施例中,缓存数据的格式可以与引擎的资源文件的文件格式相同。这样,在文件格式相同的情况下,加载速度较快,从而可以进一步提高加载效率。
步骤S240,获取第一资源文件,并加载第一资源文件。
在第一资源文件发生改变的情况下,由于缓存数据已经与第一资源文件当前的内容不一致,直接加载缓存数据,将导致已经更新的第一资源文件没有被使用,可能与开发者的实际意图不符。因此,此时可以获取第一资源文件并加载第一资源文件,以使开发者能够使用最新的内容。
本申请实施例的资源文件加载方法,针对可编辑的第一资源文件,在获取第一资源文件后,可以同时存储第一资源文件和第一资源文件的缓存数据。在加载第一资源文件时,可以先判断第一资源文件是否发生改变,如果未发生改变,优先加载第一资源文件的缓存数据。由于缓存数据不可编辑,其中不需要存储较多的编辑数据,因此,缓存数据的文件大小小于第一资源文件的文件大小,因此,在第一资源文件未发生改变时,通过优先加载缓存数据可以提高加载效率。如果发生改变,表示开发者对第一资源文件重新进行了编辑,此时的缓存数据与第一资源文件不一致,直接加载第一资源文件。
参见图3,图3为本申请实施例中资源文件加载方法的又一种流程图,可以包括以下步骤:
步骤S310,获取可编辑的第一资源文件,存储第一资源文件以及第一资源文件的缓存数据。其中,缓存数据不可编辑,且缓存数据的文件大小小于第一资源文件的文件大小。
在编辑器加载的工程的根目录中通常包括两个与资源相关的文件夹,即第一文件夹和第二文件夹,第一文件夹用于存储用户导入到项目中的资源文件。ResourceManager(资源管理器)将监视此文件夹下的更改并触发导入工作。用户可以从编辑器资源检查器或直接从文件系统修改资源文件。第二文件夹可以保存引擎的资源文件,引擎的资源文件是不可编辑的,例如,可以以二进制格式保存引擎的资源文件。
参见图4,图4为本申请实施例中工程的一种目录示意图,第一文件夹中还可以包括第三文件夹和第四文件夹,第二文件夹中也可以包括第五文件夹。由于第一资源文件可编辑,缓存数据不可编辑,在一些实施例中,可以将第一资源文件存储至第一目录;将第一资源文件的缓存数据存储至第二目录。这样,将可编辑的第一资源文件和不可编辑的缓存数据分开存储,可以提升开发者的开发体验。
例如,针对图4所示的目录,可以将第一资源文件存储至第一文件夹,将缓存数据存储至第二文件夹。这样,开发者在对第一资源文件进行编辑时,可以直接进入第一文件夹查找第一资源文件即可,从而可以提高查询效率,进而提高编辑效率。
步骤S320,根据第一资源文件,生成第一资源文件对应的ID信息,并存储第一资源文件对应的ID信息。
本申请实施例中,针对不同的第一资源文件,均对应有唯一的ID信息,并且,该ID信息可以随着第一资源文件中内容的变化而变化。这样,通过ID信息,可以判断第一资源文件的内容是否发生改变。在一些实施例中,可以对第一资源文件进行哈希计算,得到第一资源文件的哈希值,将哈希值确定为第一资源文件对应的ID信息。在确定第一资源文件对应的ID信息后,可以将该ID信息作为不可编辑的数据存储至第二文件夹中。
步骤S330,响应于针对第一资源文件的加载指令,获取第一资源文件,根据第一资源文件,生成第一资源文件的当前ID信息。
响应于针对第一资源文件的加载指令,可以从第一目录中获取第一资源文件,由于开发者可能对第一资源文件中的内容进行了修改,也可能没有对第一资源文件中的内容进行修改,因此,在获取第一资源文件后,可以根据第一资源文件重新生成第一资源文件对应的ID信息,即当前ID信息。
步骤S340,判断当前ID信息与已存储的ID信息是否相等。
如果当前ID信息与已存储的ID信息相等,可以执行步骤S350;如果当前ID信息与ID信息不相等,可以执行步骤S360。
步骤S350,确定第一资源文件未发生改变,获取第一资源文件的缓存数据,并加载第一资源文件的缓存数据。
步骤S360,确定第一资源文件发生改变,获取第一资源文件,并加载第一资源文件。
与前述图2实施例相同,在第一资源文件未发生改变时,优先加载缓存数据,以提高加载效率。在第一资源文件发生改变时,加载第一资源文件,以使用第一资源文件中最新的内容。
步骤S370,将已存储的ID信息更新为当前ID信息,以及将已存储的缓存数据更新为第一资源文件的当前缓存数据。
在第一资源文件发生改变时,还可以及时对已存储的ID信息和缓存数据进行更新,使ID信息和缓存数据与第一资源文件中的内容对应。这样,在下一次加载第一资源文件时,如果没有对第一资源文件做进一步修改,可以直接加载缓存数据,以提高加载效率。
本申请实施例中,还可以获取第二资源文件,并存储第二资源文件。其中,第二资源文件指引擎的资源文件,资源文件不可编辑。可选的,第一资源文件的缓存数据的数据类 型与第二资源文件的数据类型相同。例如,第一资源文件的缓存数据和第二资源文件均可以是二进制数据。这样,将第一资源文件的缓存数据直接存储为引擎的资源文件的数据类型,可以提高缓存数据的加载速度。
与前述将第一资源文件存储至第一文件夹不同,可以将第二资源文件存储至第二文件夹中。响应于针对第二资源文件的加载操作,加载第二资源文件,该第二资源文件的加载速度较快。
本申请实施例的资源文件加载方法,针对可编辑的第一资源文件,在获取第一资源文件后,可以将可编辑的第一资源文件存储至第一目录,不可编辑的缓存数据和ID信息存储至第二目录,开发者要修改第一资源文件时,直接在第一目录中查找即可,可以提高修改效率。在加载第一资源文件时,可以先根据ID信息判断第一资源文件是否发生改变,如果第一资源文件未发生改变,优先加载第一资源文件的缓存数据。由于缓存数据中不需要存储较多的编辑数据,因此,缓存数据的文件大小小于第一资源文件的文件大小,例如,缓存数据可以是二进制数据,因此,在第一资源文件未发生改变时,通过优先加载缓存数据可以提高加载效率。如果第一资源文件发生改变,表示开发者对第一资源文件重新进行了编辑,此时的缓存数据与第一资源文件不一致,直接加载第一资源文件,以使用最新的内容。
相应于上述方法实施例,本申请实施例还提供了一种资源文件加载装置,参见图5,资源文件加载装置500包括:
第一存储模块510,用于获取可编辑的第一资源文件,存储第一资源文件以及第一资源文件的缓存数据;其中,缓存数据不可编辑,且缓存数据的文件大小小于第一资源文件的文件大小;
资源文件判断模块520,用于响应于针对第一资源文件的加载指令,判断第一资源文件是否发生改变;
缓存数据加载模块530,用于如果第一资源文件未发生改变,获取第一资源文件的缓存数据,并加载第一资源文件的缓存数据;
第一资源文件加载模块540,用于如果第一资源文件发生改变,获取第一资源文件,并加载第一资源文件。
可选的,资源文件加载装置500还包括:
ID信息存储模块,用于根据第一资源文件,生成第一资源文件对应的ID信息,并存 储第一资源文件对应的ID信息;
资源文件判断模块520,具体用于响应于针对第一资源文件的加载指令,获取第一资源文件,根据第一资源文件,生成第一资源文件的当前ID信息;如果当前ID信息与ID信息不相等,则确定第一资源文件发生改变;如果当前ID信息与ID信息相等,则确定第一资源文件未发生改变。
可选的,资源文件加载装置500还包括:
ID信息更新模块,用于如果第一资源文件发生改变,将已存储的ID信息更新为当前ID信息;
缓存数据更新模块,用于将已存储的缓存数据更新为第一资源文件的当前缓存数据。
可选的,第一存储模块510,具体用于获取可编辑的第一资源文件,将第一资源文件存储至第一目录;将第一资源文件的缓存数据存储至第二目录。
可选的,资源文件加载装置500还包括:
第二存储模块,用于获取第二资源文件,并存储第二资源文件;其中,第二资源文件不可编辑;
第二资源文件加载模块,用于响应于针对第二资源文件的加载操作,加载第二资源文件。
可选的,第一资源文件的缓存数据的数据类型与第二资源文件的数据类型相同。
可选的,ID信息存储模块,具体用于对第一资源文件进行哈希计算,得到第一资源文件的哈希值;将哈希值确定为第一资源文件对应的ID信息,并存储第一资源文件对应的ID信息。
上述装置中各模块或单元的具体细节已经在对应的方法中进行了详细的描述,因此此处不再赘述。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
在本申请的示例性实施例中,还提供一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,处理器被配置为执行本示例实施方式中上述资源文件加载方法。
图6为本申请实施例中电子设备的一种结构示意图。需要说明的是,图6示出的电子设备600仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统操作所需的各种程序和数据。中央处理单元601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如局域网(LAN)卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元601执行时,执行本申请的装置中限定的各种功能。
本申请实施例中,还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述资源文件加载方法。
需要说明的是,本申请所示的计算机可读存储介质例如可以是—但不限于—电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器、只读存储器、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、 射频等等,或者上述的任意合适的组合。
本申请实施例中,还提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述资源文件加载方法。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (12)

  1. 一种资源文件加载方法,包括:
    获取可编辑的第一资源文件,存储所述第一资源文件以及所述第一资源文件的缓存数据;其中,所述缓存数据不可编辑,且所述缓存数据的文件大小小于所述第一资源文件的文件大小;
    响应于针对所述第一资源文件的加载指令,判断所述第一资源文件是否发生改变;
    如果所述第一资源文件未发生改变,获取所述第一资源文件的缓存数据,并加载所述第一资源文件的缓存数据;
    如果所述第一资源文件发生改变,获取所述第一资源文件,并加载所述第一资源文件。
  2. 根据权利要求1所述的方法,还包括:
    根据所述第一资源文件,生成所述第一资源文件对应的ID信息,并存储所述第一资源文件对应的ID信息;
    所述判断所述第一资源文件是否发生改变,包括:
    获取所述第一资源文件,根据所述第一资源文件,生成所述第一资源文件的当前ID信息;
    如果所述当前ID信息与所述ID信息不相等,则确定所述第一资源文件发生改变;
    如果所述当前ID信息与所述ID信息相等,则确定所述第一资源文件未发生改变。
  3. 根据权利要求2所述的方法,还包括:
    如果所述第一资源文件发生改变,将已存储的所述ID信息更新为所述当前ID信息;
    将已存储的所述缓存数据更新为所述第一资源文件的当前缓存数据。
  4. 根据权利要求1所述的方法,其中,存储所述第一资源文件以及所述第一资源文件的缓存数据,包括:
    将所述第一资源文件存储至第一目录;
    将所述第一资源文件的缓存数据存储至第二目录。
  5. 根据权利要求1所述的方法,还包括:
    获取第二资源文件,并存储所述第二资源文件;其中,所述第二资源文件不可编辑;
    响应于针对所述第二资源文件的加载操作,加载所述第二资源文件。
  6. 根据权利要求5所述的方法,其中,所述第一资源文件的缓存数据的数据类型与所 述第二资源文件的数据类型相同。
  7. 根据权利要求2所述的方法,其中,所述根据所述第一资源文件,生成所述第一资源文件对应的ID信息,包括:
    对所述第一资源文件进行哈希计算,得到所述第一资源文件的哈希值;
    将所述哈希值确定为所述第一资源文件对应的ID信息。
  8. 一种资源文件加载装置,包括:
    第一存储模块,用于获取可编辑的第一资源文件,存储所述第一资源文件以及所述第一资源文件的缓存数据;其中,所述缓存数据不可编辑,且所述缓存数据的文件大小小于所述第一资源文件的文件大小;
    资源文件判断模块,用于响应于针对所述第一资源文件的加载指令,判断所述第一资源文件是否发生改变;
    缓存数据加载模块,用于如果所述第一资源文件未发生改变,获取所述第一资源文件的缓存数据,并加载所述第一资源文件的缓存数据;
    第一资源文件加载模块,用于如果所述第一资源文件发生改变,获取所述第一资源文件,并加载所述第一资源文件。
  9. 一种电子设备,包括:处理器,所述处理器用于执行存储于存储器的计算机程序,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的资源文件加载方法。
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的资源文件加载方法。
  11. 一种计算机程序产品,所述计算机程序产品包括指令,所述指令被处理器执行时实现如权利要求1-7任一项所述的资源文件加载方法。
  12. 一种计算机程序,所述计算机程序包括指令,所述指令被处理器执行时实现如权利要求1-7任一项所述的资源文件加载方法。
PCT/CN2022/139761 2021-12-29 2022-12-16 资源文件加载方法、装置、电子设备及存储介质 WO2023125083A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111636944.4 2021-12-29
CN202111636944.4A CN116414474A (zh) 2021-12-29 2021-12-29 资源文件加载方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023125083A1 true WO2023125083A1 (zh) 2023-07-06

Family

ID=86897736

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/139761 WO2023125083A1 (zh) 2021-12-29 2022-12-16 资源文件加载方法、装置、电子设备及存储介质

Country Status (3)

Country Link
US (1) US20230205494A1 (zh)
CN (1) CN116414474A (zh)
WO (1) WO2023125083A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140359423A1 (en) * 2013-06-03 2014-12-04 Microsoft Corporation Local caching to improve remote site editing
US20190212987A1 (en) * 2017-12-21 2019-07-11 Nintendo Co., Ltd. Content development device
CN112379944A (zh) * 2020-11-18 2021-02-19 深圳康佳电子科技有限公司 一种资源文件的加载方法、装置、存储介质及终端设备
CN112506584A (zh) * 2020-12-21 2021-03-16 北京百度网讯科技有限公司 资源文件加载方法、装置、设备、存储介质以及产品
CN113296778A (zh) * 2020-04-13 2021-08-24 阿里巴巴集团控股有限公司 一种资源文件的处理方法、装置、服务器、客户端及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140359423A1 (en) * 2013-06-03 2014-12-04 Microsoft Corporation Local caching to improve remote site editing
US20190212987A1 (en) * 2017-12-21 2019-07-11 Nintendo Co., Ltd. Content development device
CN113296778A (zh) * 2020-04-13 2021-08-24 阿里巴巴集团控股有限公司 一种资源文件的处理方法、装置、服务器、客户端及系统
CN112379944A (zh) * 2020-11-18 2021-02-19 深圳康佳电子科技有限公司 一种资源文件的加载方法、装置、存储介质及终端设备
CN112506584A (zh) * 2020-12-21 2021-03-16 北京百度网讯科技有限公司 资源文件加载方法、装置、设备、存储介质以及产品

Also Published As

Publication number Publication date
CN116414474A (zh) 2023-07-11
US20230205494A1 (en) 2023-06-29

Similar Documents

Publication Publication Date Title
TWI808393B (zh) 頁面處理方法、裝置、設備及儲存媒體
WO2020119485A1 (zh) 一种页面显示方法、装置、设备及存储介质
WO2018177260A1 (zh) 一种应用程序开发方法及其工具、设备、存储介质
CN111158818B (zh) 一种页面渲染方法和装置
WO2020063019A1 (zh) 信息处理方法、装置、存储介质、电子设备及系统
US8982132B2 (en) Value templates in animation timelines
US20160170712A1 (en) Method for integrally implementing development and release of APP
US20130132840A1 (en) Declarative Animation Timelines
US20130127877A1 (en) Parameterizing Animation Timelines
CN112395253B (zh) 索引文件生成方法、终端设备、电子设备及介质
WO2020216310A1 (zh) 用于生成应用的方法、终端设备和计算机可读介质
CN111408138A (zh) 基于游戏引擎的渲染方法、装置及电子设备
CN110554874A (zh) 用于复用SaaS平台网页组件的方法和装置
WO2022033131A1 (zh) 基于json数据格式的动画渲染方法
CN109582317B (zh) 用于调试寄宿应用的方法和装置
CN112817657A (zh) 一种应用程序启动项加载方法、装置、系统及存储介质
US20130007377A1 (en) Message oriented middleware with integrated rules engine
CN115202729A (zh) 基于容器服务的镜像生成方法、装置、设备及介质
CN113495730A (zh) 资源包的生成及解析方法和装置
CN113656005B (zh) 应用组件库构建方法、应用组件配置方法及相关装置
CN110083351B (zh) 用于生成代码的方法和装置
CN110647327B (zh) 基于卡片的用户界面动态控制的方法和装置
WO2023125083A1 (zh) 资源文件加载方法、装置、电子设备及存储介质
US8615744B2 (en) Methods and system for managing assets in programming code translation
WO2023207981A1 (zh) 配置文件生成方法、装置、电子设备、介质及程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22914337

Country of ref document: EP

Kind code of ref document: A1