CN110908697B - Resource packaging method, device, server and storage medium - Google Patents

Resource packaging method, device, server and storage medium Download PDF

Info

Publication number
CN110908697B
CN110908697B CN201911195357.9A CN201911195357A CN110908697B CN 110908697 B CN110908697 B CN 110908697B CN 201911195357 A CN201911195357 A CN 201911195357A CN 110908697 B CN110908697 B CN 110908697B
Authority
CN
China
Prior art keywords
resource
packaging
resources
file
dependency relationship
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
CN201911195357.9A
Other languages
Chinese (zh)
Other versions
CN110908697A (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.)
Mihoyo Technology Shanghai Co ltd
Original Assignee
Mihoyo Technology Shanghai 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 Mihoyo Technology Shanghai Co ltd filed Critical Mihoyo Technology Shanghai Co ltd
Priority to CN201911195357.9A priority Critical patent/CN110908697B/en
Publication of CN110908697A publication Critical patent/CN110908697A/en
Application granted granted Critical
Publication of CN110908697B publication Critical patent/CN110908697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • 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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • A63F13/69Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor by enabling or updating specific game elements, e.g. unlocking hidden features, items, levels or versions
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a resource packaging method, a device, a server and a storage medium, wherein the method comprises the following steps: determining resource dependency relationships among the resources based on the identification information corresponding to the resources; packaging each resource according to a preset rule to obtain a plurality of packaging files; the package file comprises at least one resource; and merging the packaged files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaged file. According to the technical scheme, the technical problems that for a game with huge resources, more time is required to be consumed when each resource is packaged, and when the packaged resource is called, more useless resources are called due to unreasonable resource packaging modes, memory is occupied and time is wasted are solved, and the reasonable packaging of each resource is realized, so that the calling efficiency of the resource is improved when the resource is called, the resource calling time is saved, and the user experience is improved are solved.

Description

Resource packaging method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the technical field of video game development, in particular to a resource packaging method, a device, a server and a storage medium.
Background
Unity is a multi-platform comprehensive game development tool developed by UnityTechnologies for creating types of interactive content such as three-dimensional video games, architectural visualizations, real-time three-dimensional animations, etc., and is a fully integrated professional game engine.
In view of the limitations of the operation platform and the Unity itself, the Unity resource is generally dynamically updated and loaded in a manner of being packaged into a resource package (Asset Bundle). The Unity resource refers to elements used to generate a scene and various objects in the scene, such as model map material, scene source files, plug-ins, and the like. Asset bundle is a function provided by Unity Pro, which can encapsulate a plurality of game objects or resource binary files into Asset bundle, and provides encapsulation and unpacking methods.
For games with huge resources, the needed resource types are larger, various dependency relationship processing and packaging time consumption among the resources are a great problem, and meanwhile, when the packaging resources are called, the technical problem of time waste of calling the resources is caused due to unreasonable resource packaging modes.
Disclosure of Invention
The invention provides a resource packaging method, a device, a server and a storage medium, which are used for realizing reasonable packaging of resources, thereby improving the technical effect of resource calling efficiency.
In a first aspect, an embodiment of the present invention provides a method for packaging resources, where the method includes:
determining resource dependency relationships among the resources based on the identification information corresponding to the resources;
packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource;
and merging the packaged files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaged file.
In a second aspect, an embodiment of the present invention further provides a resource packaging device, where the device includes:
the resource dependency relationship determining module is used for determining resource dependency relationships among the resources based on the identification information corresponding to the resources;
the packaging file determining module is used for packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource;
and the packed file merging module is used for merging the packed files with the identical dependency relationships based on the resource dependency relationships to obtain merged packed files.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the resource packaging method as described in any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a resource packaging method according to any of the embodiments of the present invention.
According to the technical scheme, the resource dependency relationship among the resources is determined based on the identification information corresponding to the resources; packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; based on the resource dependency relationship, the packaging files with the same dependency relationship are combined to obtain the combined packaging file, so that the technical problems that in the prior art, for games with huge resources, more types of resources are needed, more time is needed to be consumed when each resource is packaged, and when the packaging resources are called, more useless resources are called due to unreasonable resource packaging modes, namely, the resource calling efficiency is lower and more time is occupied are solved, the reasonable packaging of each resource is realized, so that the calling efficiency of the resource is improved when the resource is called, the resource calling time is saved, and the technical effect of user experience is improved.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a resource packaging method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a resource dependency structure according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram of a resource dependency structure according to a first embodiment of the present invention;
FIG. 4 is a flowchart of a resource packaging method according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a resource packaging device according to a third embodiment of the present invention;
fig. 6 is a schematic diagram of a server structure according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of a resource packaging method according to an embodiment of the present invention, where the method may be applied to a case of packaging various resources in advance, and the method may be performed by a resource packaging device, where the device may be implemented in a software and/or hardware form, and the hardware may be an electronic device, optionally, a PC side, a mobile terminal, or the like.
As shown in fig. 1, the method of the present embodiment includes:
s110, determining resource dependency relations among the resources based on the identification information corresponding to the resources.
For the sake of clearly describing the technical solution of this embodiment, the description may be given by taking the processing of resources corresponding to the three-dimensional video game as an example.
Among them, unity is a multi-platform integrated game development tool developed by Unity Technologies for creating types of interactive content such as three-dimensional video games, building visualizations, real-time three-dimensional animations, etc. The Unity resource is generally dynamically updated and loaded by being packaged into a resource package (Asset Bundle). The Unity resource refers to elements used to generate a scene and various objects in the scene, such as model map materials, scene source files, plug-ins, and the like. That is, the resources include renderers, maps, models, animations, networks, scenes. Because a certain dependency relationship exists between each resource, the identification information is used for representing the resource dependency relationship between each resource, namely the resource dependency relationship is a reference relationship between each resource.
Specifically, a resource dependency relationship determination program is called to acquire identification information corresponding to each resource, and resource dependency relationships among the resources are determined based on the identification information corresponding to each resource.
S120, packaging each resource according to a preset rule to obtain a plurality of packaging files.
The preset rule may be that a single dependency relationship exists according to the dependency relationship between the resources, and the resources located on the same branch are packaged as a group of resources. And calling a packaging application program, packaging a group of resources in the same file, and respectively packaging the rest of the resources to obtain a plurality of packaged files. I.e. two types of package files are included in the plurality of package files. The package file includes a file size, an MD5 value, a package name of the package, and a name of each resource in the package file, which correspond to each package resource.
Specifically, according to the resource dependency relationship, the resources with single dependency relationship in all the resources are obtained, and a group of resources with single dependency relationship is used as target resources. And calling a packaging application program to package the target resource to obtain a target package file. Of course, there will be no single dependency resources and the packaging can be done separately.
Optionally, determining at least one group of target resources with single dependency relationship according to the resource dependency relationship, and packaging each group of target resources respectively to obtain a target packaging file; and packaging each of the remaining all resources respectively to obtain a packaging file to be processed.
Wherein, a single dependency can be understood as: the dependent resources are only dependent on one dependent resource. For example, resource B depends on resource a, and resource a is only relied on by resource B, which may be referred to as a relied resource, and resource B as a dependent resource, then resource a and resource B may be considered as a set of target resources. That is, the resources on which each dependent resource is dependent only by one resource are selected from all the resources, and the dependent resources satisfying the condition are set as a set of target resources. That is, a set of target resources includes at least two resources, a dependent resource and a dependent resource, respectively. The target package file is a file that packages a set of resources that have a single dependency relationship.
Specifically, after determining the resource dependency relationship between the resources, at least two resources having a single dependency relationship may be determined according to the resource dependency relationship, and at least two resources having a single dependency relationship are used as a set of target resources. And calling a packing program code to pack a group of target resources, namely, packing the resources with single dependency relationship as a whole to obtain target packing resources, namely, target packing files. That is, at least two resources having a single dependency relationship are packaged in the same package file, i.e., the asset bundle. If a specific resource is to be loaded, a specific package file and a dependent package file need to be loaded. In order to avoid the problems of occupying memory and reducing the calling efficiency when loading a series of useless resources when a specific resource is called, the remaining resources can be respectively packaged to obtain a plurality of packaged files to be processed.
For example, assuming that the three-dimensional video game includes fifteen resources (assets), invoking a resource dependency relationship determination program to acquire identification information corresponding to the fifteen resources, respectively, and determining the dependency relationship between the respective resources may be: resource 1 (asset 1) depends on resource 3 and resource 4, resource 3 depends on resource 7, and the corresponding relationship among resource 1, resource 3 and resource 4 is that resource 1 is a dependent resource, and resource 3 and resource 4 are dependent resources; resource 2 depends on resource 4, resource 5, resource 6, and resource 11, resource 5 depends on resource 8 and resource 9, and resource 6 depends on resource 10; resource 11 depends on resource 13; resource 12 depends on resource 14 and resource 15. Because the resource 3 is only depended on by the resource 1, and the resource 7 is only depended on by the resource 3, namely, the resource 1, the resource 3 and the resource 7 are in a single dependency relationship, the resource 1, the resource 3 and the resource 7 are taken as a group of target resources and packaged under the same file to be taken as target packaged files; the resource 4 is dependent on the resource 1 and the resource 2, so that the resource 4, the resource 1 and the resource 2 are not in a single dependency relationship, and cannot be used as a group of target resources, namely cannot be packaged together, and can be packaged respectively to obtain a plurality of packaged files to be processed; resource 14 is only relied upon by resource 12 and resource 15 is only relied upon by resource 12, so that resource 12, resource 14 and resource 15 can be packaged in the same file as a target packaged file as a set of target resources. Packaging the rest of each resource respectively to obtain a plurality of packaged files to be processed
S130, merging the packaged files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaged file.
For a clear understanding of the packed files where the dependencies are identical, reference can be made to fig. 2 and 3. Wherein ASB1 (asset bundle package file) represents package file 1, ASB2 represents package file 2, ASB3 represents package file 3, and ASB4 represents package file 4, and ASB1 depends on ASB3 and ASB4, and ASB2 also depends on ASB3 and ASB4, i.e., the dependent relationships of the dependent package files ASB3 and ASB4 are identical, so that ASB3 and ASB4 can be combined to obtain a combined package file. Referring to fig. 3, ASB5 depends on ASB4, that is, the dependent relationships of ASB3 and ASB4 are not exactly the same, so ASB3 and ASB4 cannot be merged and packed.
Specifically, since the package file includes a name corresponding to each resource, the dependency relationship between the individual package files can be determined based on the resource dependency relationship. If the dependency relationships of the package files are identical, that is, the dependent relationships of the package files are identical, the package files with identical dependent relationships can be combined to obtain a combined package file.
Correspondingly, if the packaging file comprises the target packaging file and the packaging file to be processed, optionally, when the target packaging file and the packaging file to be processed are determined to be identical in dependence relationship based on the resource dependence relationship, combining and packaging the packaging files with identical dependence relationship to obtain a combined packaging file; wherein, the single dependency relationship is that the dependent resource is referenced by a dependent resource; the dependent resource is the resource corresponding to the father node, and the dependent resource is the resource corresponding to the child node of the next level of the dependent resource.
That is, according to the resource dependency relationship, the dependency relationship between the package files can be determined, and the resource package files with identical dependency relationship are combined to obtain the combined package file.
According to the technical scheme, the resource dependency relationship among the resources is determined based on the identification information corresponding to the resources; packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; based on the resource dependency relationship, the packaging files with the same dependency relationship are combined to obtain the combined packaging file, so that the technical problems that in the prior art, for games with huge resources, more types of resources are needed, more time is needed to be consumed when each resource is packaged, and when the packaging resources are called, more useless resources are called due to unreasonable resource packaging modes, namely, the resource calling efficiency is lower and more time is occupied are solved, the reasonable packaging of each resource is realized, so that the calling efficiency of the resource is improved when the resource is called, the resource calling time is saved, and the technical effect of user experience is improved.
On the basis of the technical scheme, after the resource dependency relationship between each resource is determined, in order to facilitate management of the resource relationship, the resource dependency relationship can be stored in a pre-established resource mapping relationship table, so that each target packaging file and/or the packaging file to be processed can be called based on the resource mapping relationship table when the resource is called.
In the actual application process, the dependency relationship among the resources may change, so that whether the resource dependency relationship changes or not can be queried regularly, or whether the resource dependency relationship changes or not can be checked after the user exits the game. And if the resource changes, re-executing the packaging of each resource, merging the packaging files, and updating the re-determined resource dependency relationship in a resource mapping relationship table so as to call each resource according to the updated mapping relationship table when the resource is called again, and further calling the packaging file corresponding to each resource, thereby improving the technical effect of the resource calling accuracy.
According to the technical scheme, the problem that the memory pressure is high because each scene needs to be connected with nearly half of the asset bundle files is solved, the problem that the redundant asset bundle files are loaded can be reduced, and the problem that the occupied memory is large is avoided. If the game is installed on the intelligent terminal, optionally, the intelligent mobile phone achieves the technical effects of fewer loaded asset bundle files, smaller occupied memory and wider application range.
Example two
On the basis of the technical scheme, the preset rule can be that firstly, the resources with single dependency relationships are packed together according to the resource dependency relationships, and the resources are combined and packed to obtain combined and packed files, or the resources are respectively packed to obtain a plurality of packed files, and the packed files with the completely same dependency relationships are combined and packed according to the resource dependency relationships to obtain a plurality of combined and packed files. Fig. 4 is another flow chart of a resource packaging method according to a fourth embodiment of the present invention. As shown in fig. 4, the method includes:
s410, determining resource dependency relations among the resources based on the identification information corresponding to the resources.
The identification information is used for representing the resource dependency relationship among the resources, namely the resource dependency relationship is a reference relationship among the resources, because a certain dependency relationship exists among the resources.
Specifically, a resource dependency relationship determination program is called to acquire identification information corresponding to each resource, and resource dependency relationships among the resources are determined based on the identification information corresponding to each resource.
S420, packaging each resource respectively to obtain a plurality of packaged files; wherein the number of packed files is the same as the number of resources.
Wherein the number of packaged files may be one, two, or more. The number of packed files is the same as the number of resources. For example, there are 20 resources, and correspondingly, 20 packaged files.
Specifically, a three-dimensional video game is acquired, that is, resources corresponding to a game application program are acquired, and a packaging application program is called to package each resource respectively, so that a plurality of package files are obtained, that is, each package file only comprises one resource.
In this embodiment, the dependency relationship between the resources may be determined in advance according to the identification information between the resources; or respectively packaging each resource to obtain a plurality of packaged files, and determining the dependency relationship among each resource.
S430, determining the dependency relationship of each packaged file based on the resource dependency relationship table, and merging the packaged files with identical dependency relationships together to be used as merged packaged files.
Specifically, based on the resource dependency relationship table, determining the dependency relationship between each package file, and merging the dependent package files with the same dependency relationship together to be used as a merged package file.
According to the technical scheme, the resource dependency relationship among the resources is determined based on the identification information corresponding to the resources; packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; based on the resource dependency relationship, the packaging files with the same dependency relationship are combined to obtain the combined packaging file, so that the technical problems that in the prior art, for games with huge resources, more types of resources are needed, more time is needed to be consumed when each resource is packaged, and when the packaging resources are called, more useless resources are called due to unreasonable resource packaging modes, namely, the resource calling efficiency is lower and more time is occupied are solved, the reasonable packaging of each resource is realized, so that the calling efficiency of the resource is improved when the resource is called, the resource calling time is saved, and the technical effect of user experience is improved.
Example III
Fig. 5 is a schematic structural diagram of a resource packaging device according to a third embodiment of the present invention, where the device includes: a resource dependency determination module 510, a packaged file determination module 520, and a packaged file merge module 530.
The resource dependency relationship determining module 510 is configured to determine a resource dependency relationship between the resources based on the identification information corresponding to the resources; the package file determining module 520 is configured to package each resource according to a preset rule to obtain a plurality of package files; wherein the package file comprises at least one resource; the package file merging module 530 is configured to merge package files with exactly the same dependency relationship based on the resource dependency relationship, to obtain a merged package file.
According to the technical scheme, the resource dependency relationship among the resources is determined based on the identification information corresponding to the resources; packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; based on the resource dependency relationship, the packaging files with the same dependency relationship are combined to obtain the combined packaging file, so that the technical problems that in the prior art, for games with huge resources, more types of resources are needed, more time is needed to be consumed when each resource is packaged, and when the packaging resources are called, more useless resources are called due to unreasonable resource packaging modes, namely, the resource calling efficiency is lower and more time is occupied are solved, the reasonable packaging of each resource is realized, so that the calling efficiency of the resource is improved when the resource is called, the resource calling time is saved, and the technical effect of user experience is improved.
On the basis of the above technical solutions, the package file determining module is further configured to:
packaging each resource respectively to obtain a plurality of packaging files; wherein the number of the package files is the same as the number of the resources;
correspondingly, the package file merging module is further configured to:
and determining the dependency relationship of each packaged file based on the resource dependency relationship table, and merging the packaged files with identical dependency relationships together to be used as merged packaged files.
On the basis of the above technical solutions, the package file determining module is further configured to:
determining at least one group of target resources with single dependency relationship according to the resource dependency relationship, and respectively packaging each group of target resources to obtain a target packaging file; packaging each of the remaining all resources respectively to obtain a packaging file to be processed;
correspondingly, the package file merging module is further configured to:
when the dependency relationship of the target packaging file and the to-be-processed packaging file is determined to be identical based on the dependency relationship, combining and packaging the packaging files with identical dependency relationship to obtain a combined packaging file;
wherein the single dependency relationship is that the dependent resource is referenced by a dependent resource; the dependent resource is a resource corresponding to a parent node, and the dependent resource is a resource corresponding to a child node of the next level of the dependent resource.
On the basis of the above technical solutions, the package file merging module is further configured to:
according to the resource dependency relationship, selecting the resource of which each dependent resource is only dependent on one resource from all the resources, and taking the dependent resource and the dependent resource as a group of target resources;
packaging the set of target resources as a target packaged file based on the packaging program code;
wherein the set of target resources includes at least one dependent resource and at least one dependent resource.
On the basis of the above technical solutions, the package file determining module is further configured to:
and storing the resource dependency relationship into a pre-established resource mapping relationship table so as to call a target packaging file and/or a packaging file to be processed based on the resource mapping relationship table when the resource is called.
On the basis of the technical schemes, the resources comprise a renderer, a map, a model, an animation, a network and a scene; the package file comprises a file size, an MD5 value, a package name and a name of each resource in the package file, wherein the file size, the MD5 value and the package name correspond to each package resource.
Based on the technical schemes, the resources are resources for supporting the three-dimensional video game.
The resource packaging device provided by the embodiment of the invention can execute the resource packaging method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example IV
Fig. 6 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. Fig. 6 shows a block diagram of an exemplary server 60 suitable for use in implementing the embodiments of the present invention. The server 60 shown in fig. 6 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
As shown in fig. 6, the server 60 is in the form of a general purpose computing device. The components of server 60 may include, but are not limited to: one or more processors or processing units 601, a system memory 602, and a bus 603 that connects the different system components (including the system memory 602 and the processing units 601).
Bus 603 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Server 60 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by server 60 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 602 may include computer system readable media in the form of volatile memory such as Random Access Memory (RAM) 604 and/or cache memory 605. The server 60 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 606 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 603 through one or more data medium interfaces. Memory 602 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 608 having a set (at least one) of program modules 607 may be stored in, for example, memory 602, such program modules 607 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 607 generally perform the functions and/or methods of the described embodiments of the invention.
The server 60 can also communicate with one or more external devices 609 (e.g., keyboard, pointing device, display 610, etc.), one or more devices that enable a user to interact with the server 60, and/or any device (e.g., network card, modem, etc.) that enables the server 60 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 611. Also, the server 60 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via a network adapter 612. As shown, the network adapter 612 communicates with other modules of the server 60 over the bus 603. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in connection with server 60, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 601 executes various functional applications and data processing by running programs stored in the system memory 602, for example, implementing the resource packaging method provided by the embodiment of the present invention.
Example five
A fifth embodiment of the present invention also provides a storage medium containing computer-executable instructions for performing a resource packaging method when executed by a computer processor.
The method comprises the following steps:
determining resource dependency relationships among the resources based on the identification information corresponding to the resources;
packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource;
based on the resource dependency relationship, merging the packaged files with the identical dependency relationship to obtain a merged packaged file
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. A method for packaging resources, comprising:
determining resource dependency relationships among the resources based on the identification information corresponding to the resources;
packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; the preset rule is that firstly, according to the dependency relationship among the resources, a single dependency relationship exists, and the resources on the same branch are packaged as a group of resources;
merging the packaging files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaging file;
packaging each resource according to a preset rule to obtain a plurality of packaged files, wherein the method comprises the following steps:
determining at least one group of target resources with single dependency relationship according to the resource dependency relationship, and respectively packaging each group of target resources to obtain a target packaging file; packaging each of the remaining all resources respectively to obtain a packaging file to be processed;
correspondingly, the merging the packaging files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaging file comprises the following steps:
when the dependency relationships of the target packaging file and the packaging file to be processed are completely identical based on the resource dependency relationships, combining and packaging the packaging files with the completely identical dependency relationships to obtain a combined packaging file;
wherein the single dependency relationship is that the dependent resource is referenced by a dependent resource; the dependent resource is a resource corresponding to a father node, and the dependent resource is a resource corresponding to a child node of the next level of the dependent resource;
after the processing is performed based on the identification information corresponding to each resource, determining the resource dependency relationship between each resource, the method further comprises:
and storing the resource dependency relationship into a pre-established resource mapping relationship table so as to call a target packaging file and/or a packaging file to be processed based on the resource mapping relationship table when the resource is called.
2. The method of claim 1, wherein the packaging each resource according to a preset rule to obtain a plurality of packaged files includes:
packaging each resource respectively to obtain a plurality of packaging files; wherein the number of the package files is the same as the number of the resources;
correspondingly, the merging the packaging files with the identical dependency relationship based on the resource dependency relationship to obtain a merged packaging file comprises the following steps:
and determining the dependency relationship of each packaged file based on the resource dependency relationship table, and merging the packaged files with identical dependency relationships together to be used as merged packaged files.
3. The method of claim 1, wherein determining at least one group of target resources having a single dependency relationship according to the resource dependency relationship, and packaging each group of target resources to obtain a target packaged file, respectively, includes:
according to the resource dependency relationship, selecting the resource of which each dependent resource is only dependent on one resource from all the resources, and taking the dependent resource and the dependent resource as a group of target resources;
packaging the set of target resources as a target packaged file based on the packaging program code;
wherein the set of target resources includes at least one dependent resource and at least one dependent resource.
4. A method according to any of claims 1-3, wherein the resources comprise renderers, maps, models, animations, networks, scenes; the package file comprises a file size, an MD5 value, a package name and a name of each resource in the package file, wherein the file size, the MD5 value and the package name correspond to each package resource.
5. A method according to any one of claims 1-3, wherein the resource is a resource supporting a three-dimensional video game.
6. A resource packaging apparatus, comprising:
the resource dependency relationship determining module is used for determining resource dependency relationships among the resources based on the identification information corresponding to the resources;
the packaging file determining module is used for packaging each resource according to a preset rule to obtain a plurality of packaging files; wherein the package file comprises at least one resource; the preset rule is that firstly, according to the dependency relationship among the resources, a single dependency relationship exists, and the resources on the same branch are packaged as a group of resources;
the package file merging module is used for merging package files with identical dependency relationships based on the resource dependency relationships to obtain merged package files;
the package file determining module is further configured to:
determining at least one group of target resources with single dependency relationship according to the resource dependency relationship, and respectively packaging each group of target resources to obtain a target packaging file; packaging each of the remaining all resources respectively to obtain a packaging file to be processed;
correspondingly, the package file merging module is further configured to:
when the dependency relationship of the target packaging file and the to-be-processed packaging file is determined to be identical based on the dependency relationship, combining and packaging the packaging files with identical dependency relationship to obtain a combined packaging file;
wherein the single dependency relationship is that the dependent resource is referenced by a dependent resource; the dependent resource is a resource corresponding to a father node, and the dependent resource is a resource corresponding to a child node of the next level of the dependent resource;
the package file determining module is further configured to:
and storing the resource dependency relationship into a pre-established resource mapping relationship table so as to call a target packaging file and/or a packaging file to be processed based on the resource mapping relationship table when the resource is called.
7. A server, the server comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the resource packaging method of any of claims 1-5.
8. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the resource packaging method of any of claims 1-5.
CN201911195357.9A 2019-11-28 2019-11-28 Resource packaging method, device, server and storage medium Active CN110908697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911195357.9A CN110908697B (en) 2019-11-28 2019-11-28 Resource packaging method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911195357.9A CN110908697B (en) 2019-11-28 2019-11-28 Resource packaging method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN110908697A CN110908697A (en) 2020-03-24
CN110908697B true CN110908697B (en) 2023-06-16

Family

ID=69820375

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911195357.9A Active CN110908697B (en) 2019-11-28 2019-11-28 Resource packaging method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN110908697B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562929A (en) * 2020-04-29 2020-08-21 米哈游科技(上海)有限公司 Method, device and equipment for generating patch file and storage medium
CN111949312B (en) * 2020-08-14 2024-02-09 曙光信息产业(北京)有限公司 Packaging method and device for data module, computer equipment and storage medium
CN112445500A (en) * 2020-11-30 2021-03-05 北京达佳互联信息技术有限公司 Application processing method, application running method and related equipment
CN112822514B (en) * 2020-12-30 2022-06-28 北京大学 Video stream packet transmission method, system, terminal and medium based on dependency relationship
CN113127012B (en) * 2021-03-09 2022-03-15 深圳市星锐游戏有限公司 Software resource construction method based on software engine
CN113384896A (en) * 2021-06-25 2021-09-14 苏州沁游网络科技有限公司 Unity-based resource packaging method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509209A (en) * 2018-04-08 2018-09-07 平安普惠企业管理有限公司 A kind of generation method, device, computer equipment and the storage medium of resource packet
CN108536463A (en) * 2018-04-09 2018-09-14 深圳市腾讯网络信息技术有限公司 Obtain method, apparatus, equipment and the computer readable storage medium of resource packet
CN109725909A (en) * 2018-05-07 2019-05-07 中国平安人寿保险股份有限公司 Code file is packaged dispositions method, continuous integrating server and system
CN110032384A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 Method, apparatus, equipment and the storage medium of resource updates

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2779993C (en) * 2012-06-15 2019-05-07 Ibm Canada Limited - Ibm Canada Limitee Configurable resource policies
US10146885B1 (en) * 2012-12-10 2018-12-04 Emc Corporation Method and system for deciding on ordering of scripting language source code for dependency resolution
CN110152299B (en) * 2018-11-22 2022-01-14 腾讯科技(深圳)有限公司 Game resource construction method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509209A (en) * 2018-04-08 2018-09-07 平安普惠企业管理有限公司 A kind of generation method, device, computer equipment and the storage medium of resource packet
CN108536463A (en) * 2018-04-09 2018-09-14 深圳市腾讯网络信息技术有限公司 Obtain method, apparatus, equipment and the computer readable storage medium of resource packet
CN109725909A (en) * 2018-05-07 2019-05-07 中国平安人寿保险股份有限公司 Code file is packaged dispositions method, continuous integrating server and system
CN110032384A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 Method, apparatus, equipment and the storage medium of resource updates

Also Published As

Publication number Publication date
CN110908697A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110908697B (en) Resource packaging method, device, server and storage medium
CN110908707B (en) Resource packaging method, device, server and storage medium
US20150324174A1 (en) Dynamically building locale objects or subsections of locale objects based on historical data
CN110865888A (en) Resource loading method and device, server and storage medium
US9720824B2 (en) Garbage collection handler to update object pointers
CN113126990B (en) Page development method, device, equipment and storage medium
CN109542459A (en) Application program packaging method and device, computer installation and computer storage medium
US20170004074A1 (en) Garbage collection absent use of special instructions
CN113127050B (en) Application resource packaging process monitoring method, device, equipment and medium
CN111651219A (en) Method and equipment for managing multi-module project configuration file
CN112181542A (en) Function calling method and device, electronic equipment and storage medium
CN111562929A (en) Method, device and equipment for generating patch file and storage medium
CN107301220B (en) Method, device and equipment for data driving view and storage medium
CN110888972A (en) Sensitive content identification method and device based on Spark Streaming
US9141352B2 (en) Dynamically building locale objects at run-time
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
US9122696B2 (en) Sharing electronic file metadata in a networked computing environment
CN110928941A (en) Data fragment extraction method and device
CN113590221B (en) Method and device for detecting number of shader variants, electronic equipment and storage medium
US9229659B2 (en) Identifying and accessing reference data in an in-memory data grid
US11640281B2 (en) Tool for introspection in object-oriented source code
US20170199729A1 (en) Application developing method and system
US20210303322A1 (en) Using binaries of container images as operating system commands
CN106844056B (en) Hadoop big data platform multi-tenant job management method and system
JP6697486B2 (en) Garbage collection without special instructions

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