Image loading method, device, system, electronic device and storage medium

By updating the resource configuration file and loading the picture set to be loaded to the game control resources, the problem of large storage space for image loading, many redundant and difficult version upgrades is solved, and the lightweight and fast loading of H5 game pictures and the efficiency of version upgrades is improved.

CN115253305BActive Publication Date: 2025-03-14HANGZHOU MOXI TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210878194.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-25
Publication Date
2025-03-14
Estimated Expiration
2042-07-25

AI Technical Summary

Technical Problem

In the prior art, the storage space for image loading is large, the image redundancy is large, and the version upgrade is difficult, and there is a lack of effective solutions.

Method used

By obtaining the default picture set, generate the initial resource configuration file; obtain the picture to be loaded, incorporate it into the default picture set, generate the picture set to be loaded; update the resource configuration file according to the picture set to be loaded, load the picture set to the game control resource, generate the game package and send it to the terminal device for display.

Benefits of technology

It realizes the lightweight and fast loading of H5 game pictures, reduces storage space usage and image redundancy, simplifies the version upgrade process, and improves release efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115253305B_ABST
    Figure CN115253305B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, system, electronic device and storage medium for loading pictures, wherein the method for loading pictures includes: obtaining a default atlas, generating an initial resource configuration file according to the default atlas; obtaining a picture to be loaded, merging the picture to be loaded into the default atlas, generating an atlas to be loaded; updating the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file; loading the atlas to be loaded into the game control resource according to the loading resource configuration file to obtain a game package, and sending the game package to the first terminal device for display. Through this application, the problems of large storage space occupied by picture loading, large amount of picture redundancy, and difficulty in version upgrade are solved, and the lightweight and fast loading of H5 game pictures is realized, thereby improving the efficiency of version upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, system, electronic device and storage medium for loading an image. Background Art

[0002] In the field of lightweight H5 game technology, in order to fit different themes, the design of the game screen is very different. For example, for the same game, with season as the theme, there are different game display interfaces in different seasons. In the traditional design of game display interfaces for different themes, different display interfaces are generally drawn for different themes, and different game package paths are generated based on the different theme interfaces and the same game. Therefore, during the display of different themes, resources are obtained from the corresponding game package paths to generate H5 games with different themes. In the traditional technical solution, this method requires customized design and development for different themes, which is cumbersome to operate, has a long update and iteration cycle, and has low publishing efficiency.

[0003] In the related art, in order to improve the efficiency of theme game publishing, multiple sets of combined image materials are generally placed in a material resource package in advance, and the material resource package is obtained by modifying the configuration file to control the image combination displayed in the current game, so as to achieve the display results of different screens of the same game. However, in the existing technology, since multiple sets of image materials need to be stored in advance, when the theme needs to be changed frequently, the material resource package needs to contain multiple sets of image combinations, the original project is huge, the resources are complicated, and the storage space is large, the image redundancy is large, and the version upgrade is difficult.

[0004] There is currently no effective solution to the problems in related technologies such as large storage space occupied by image loading, large amount of image redundancy, and difficulty in version upgrading. Summary of the invention

[0005] In this embodiment, a method, device, system, electronic device and storage medium for loading an image are provided to solve the problems in the related art of large storage space occupied by image loading, large amount of image redundancy and difficulty in version upgrading.

[0006] In a first aspect, a method for loading an image is provided in this embodiment, including:

[0007] Obtain a default atlas, and generate an initial resource configuration file according to the default atlas;

[0008] Acquire the image to be loaded, merge the image to be loaded into the default atlas, and generate an atlas to be loaded; update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file;

[0009] The atlas to be loaded is loaded into the game control resource according to the loading resource configuration file to obtain a game package, and the game package is sent to the first terminal device for display.

[0010] In some embodiments, the updating of the initial resource configuration file to generate a loaded resource configuration file according to the atlas to be loaded further includes:

[0011] Obtain the current resource configuration file of the atlas to be loaded;

[0012] Obtain the next picture to be loaded, merge the next picture to be loaded into the atlas to be loaded, and generate the next atlas to be loaded;

[0013] The current resource configuration file is updated according to the next atlas to be loaded to generate a loading resource configuration file.

[0014] In some of the embodiments, before obtaining the next picture to be loaded, the method further includes:

[0015] Obtain user login information and user authentication information;

[0016] According to the user login information and the user authentication information, a to-be-loaded atlas corresponding to the user authentication information is matched.

[0017] In some embodiments, obtaining a default atlas includes:

[0018] Obtain a set of preset default images, and obtain default size information of the default images;

[0019] When the default size information is less than or equal to the preset atlas size, the default pictures corresponding to the default size information are packaged into a packaged atlas;

[0020] When the default size information is larger than the preset atlas size, the default image is packaged into an original image atlas;

[0021] The default atlas is obtained according to the packaged atlas and the original atlas.

[0022] In some of the embodiments, generating an initial resource configuration file according to the default atlas includes:

[0023] Obtain a game engine packaged plug-in, and parse the default atlas according to the game engine packaged plug-in to obtain at least atlas configuration information;

[0024] The initial resource configuration file is generated according to the atlas configuration information and the game engine packaged plug-in.

[0025] In some embodiments, the step of merging the to-be-loaded picture into the default atlas to generate the to-be-loaded atlas includes:

[0026] Get atlas update instructions;

[0027] When the atlas update instruction indicates to replace an image in the default atlas, obtaining an image to be replaced in the default atlas;

[0028] In the case where the picture to be replaced is a picture in a packed atlas, obtaining atlas configuration information of the picture to be replaced, and deleting the picture to be replaced; merging the picture to be loaded with the packed atlas according to the atlas configuration information to generate a packed atlas to be loaded;

[0029] In the case where the picture to be replaced is a picture in the original picture atlas, inserting the picture to be loaded into the default atlas to generate the original picture atlas to be loaded, and deleting the picture to be replaced;

[0030] The atlas to be loaded is obtained according to the packaged atlas to be loaded and the original atlas to be loaded.

[0031] In a second aspect, a picture loading device is provided in this embodiment, including: an acquisition module, a generation module and a loading module;

[0032] The acquisition module is used to acquire a default atlas and generate an initial resource configuration file according to the default atlas;

[0033] The generating module is used to obtain a group of images to be loaded, merge the images to be loaded into the default atlas, and generate an atlas to be loaded; update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file;

[0034] The loading module is used to load the to-be-loaded atlas into the game control resource according to the loading resource configuration file to obtain a game package, and send the game package to the first terminal device for display.

[0035] In a third aspect, a picture loading system is provided in this embodiment, including: a first terminal device, a transmission device and a server device; wherein the first terminal device is connected to the server device via the transmission device;

[0036] The server device is used to implement the image loading method described in the first aspect above;

[0037] The transmission device is used to send the game package to the terminal device;

[0038] The first terminal device is used to parse the game package for display.

[0039] In a fourth aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image loading method described in the first aspect when executing the computer program.

[0040] In a fifth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the image loading method described in the first aspect is implemented.

[0041] Compared with the related art, the image loading method, device, system, electronic device and storage medium provided in this embodiment obtain a default atlas and generate an initial resource configuration file according to the default atlas; obtain the image to be loaded, merge the image to be loaded into the default atlas to generate an atlas to be loaded; update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file; load the atlas to be loaded into the game control resource according to the loading resource configuration file to obtain a game package, and send the game package to the first terminal device for display, thereby solving the problems of large storage space occupied by image loading, large amount of image redundancy and great difficulty in version upgrading, realizing lightweight and fast loading of H5 game images and improving version upgrade efficiency.

[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0044] Figure 1 This is an application scenario diagram of a method for loading an image in an embodiment;

[0045] Figure 2 A schematic diagram of a process of loading a picture in one embodiment;

[0046] Figure 3 It is a flowchart of a method for loading pictures in another embodiment;

[0047] Figure 4 is a structural block diagram of a picture loading device in one embodiment;

[0048] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] The image loading method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the first terminal device 102 communicates with the server device 104 through the network. The server device 104 obtains the default atlas and generates an initial resource configuration file according to the default atlas; the server device 104 obtains the picture to be loaded, merges the picture to be loaded into the default atlas, and generates the atlas to be loaded; updates the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file; the server device 104 loads the atlas to be loaded into the game control resource according to the loading resource configuration file to obtain a game package, and sends the game package to the first terminal device for display. Among them, the first terminal device 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server device 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0052] In this embodiment, a method for loading an image is provided. Figure 2 is a flowchart of the picture loading method of this embodiment. Figure 2 As shown, the process includes the following steps:

[0053] Step S202, obtaining a default atlas, and generating an initial resource configuration file according to the default atlas.

[0054] Among them, the initial resource configuration file at least includes the relative path information of the default atlas; the relative path information does not refer to the actual online resource address, but refers to the relative address in the build path. The default atlas is obtained by splicing the remote resource path (generally the path uploaded to the CDN (Content Delivery Network)) based on the relative address.

[0055] The default atlas contains at least one default image, and there may be only one default atlas; the default atlas may be obtained from a preset atlas stored on hardware, or may be a default atlas generated by obtaining at least one preset default image.

[0056] Step S204, obtaining the image to be loaded, merging the image to be loaded into the default atlas, and generating an atlas to be loaded; and updating the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file.

[0057] Among them, the image to be loaded can be one or a group; the step of merging the image to be loaded into the default atlas can be triggered by obtaining the user's loading operation instruction; the loading operation instruction can be a replacement instruction, which instructs to delete the default image specified by the user, and store the image to be loaded in the default atlas to obtain and store the atlas to be loaded; the loading operation instruction can also be a new instruction, which instructs to directly upload the image to be loaded in the default atlas to obtain and store the atlas to be loaded; the loading resource configuration file is obtained by updating the initial resource configuration file according to the relative path information of the atlas to be loaded, and at least includes the path mapping information of the atlas to be loaded; the path mapping information does not refer to the actual online resource address, but to the relative address in the build path, and the atlas to be loaded is obtained by splicing the remote resource path (generally uploaded to the CDN path) according to the relative address; the initial resource configuration file and the loading resource configuration file are .json files.

[0058] It should be noted that, when the image to be loaded is incorporated into the default atlas according to the replacement instruction, the default image specified by the user is replaced with the image to be loaded, and the atlas to be loaded is generated. The path mapping information of the image to be loaded is the same as the relative path information of the default atlas, and the rotation information is also the same. For example, the image to be loaded A, the default image B specified by the user, and the default atlas C are obtained. The default image B specified by the user is in the default atlas C. After the user selects the default image B, the image to be loaded A is uploaded. The server device 104 replaces the default image B in the default atlas C with the image to be loaded A. The position of the image to be loaded A in the default atlas C (the position is the x, y coordinate information in the default atlas C), rotation and other information are the same as the position and rotation information of the default image B specified by the user in the default atlas C; the atlas D to be loaded is obtained according to the replaced default atlas.

[0059] Step S206: load the to-be-loaded atlas into the game control resource according to the loading resource configuration file to obtain a game package, and send the game package to the first terminal device for display.

[0060] Among them, the game control resource can be the underlying logic control resource of the game created by Unity or cocos creator, etc. The game package obtains the path mapping information of the atlas to be loaded from the loading resource configuration file through the resource parser, and obtains the atlas to be loaded according to the path mapping information, thereby loading the atlas to be loaded into the game control resource to obtain the game package.

[0061] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0062] Through the above steps, there can be only one default atlas, and the default atlas can be updated according to the pictures to be loaded to obtain the atlas to be loaded, so that the default size of the game package is small, and the dynamic update of the atlas is allowed, and any picture can be dynamically replaced with a high degree of freedom. The separation of game control resources and the atlas to be loaded makes it unnecessary to re-develop the game when the version is upgraded, reducing resource redundancy and labor costs, solving the problems of large storage space occupied by picture loading, large amount of picture redundancy, and difficulty in version upgrade, realizing lightweight and fast loading of H5 game pictures, and improving version upgrade efficiency.

[0063] In some of the embodiments, updating the initial resource configuration file to generate a loaded resource configuration file according to the atlas to be loaded further includes:

[0064] Get the current resource configuration file of the atlas to be loaded;

[0065] Get the next picture to be loaded, merge the next picture to be loaded into the atlas to be loaded, and generate the next atlas to be loaded;

[0066] The current resource configuration file is updated and generated into a loading resource configuration file according to the next atlas to be loaded.

[0067] After the next to-be-loaded picture generates the next to-be-loaded atlas, the next to-be-loaded atlas can be stored.

[0068] Through the above steps, the atlas to be loaded can be updated according to the next image to be loaded to obtain the next atlas to be loaded, thereby allowing dynamic update of the atlas and dynamically replacing any image with high freedom, reducing resource redundancy and labor costs, solving the problems of large storage space occupied by image loading, large amount of image redundancy, and difficulty in version upgrades, realizing lightweight and fast loading of H5 game images and improving version upgrade efficiency.

[0069] In some of the embodiments, before obtaining the next picture to be loaded, the method further includes:

[0070] Obtain user login information and user authentication information;

[0071] According to the user login information and the user authentication information, the atlas to be loaded corresponding to the user authentication information is matched.

[0072] Specifically, the user login information at least indicates the user's username; the user authentication information refers to the user's permission range information; there is a binding relationship between the atlas and the user, and different atlases are assigned to different users with different modification permissions. Before obtaining the next picture to be loaded, it is necessary to authenticate the user's permissions based on the obtained user login information and user authentication information. If the authentication is passed, the operable atlas to be loaded corresponding to the user is obtained, and the next picture to be loaded uploaded by the user is obtained to operate on the atlas to be loaded. Another embodiment is that after the first user successfully logs in, the server device 104 matches the atlas to be loaded corresponding to the operable permission of the first user according to the user login information and user authentication information of the first user and processes the next atlas to be loaded; if the second user also has operable permission for the same atlas to be loaded, the second user can obtain the next atlas to be loaded after the first user's operation, and has operable permission for the next atlas to be loaded; and vice versa.

[0073] Through the above steps, the user-operable atlas is matched according to the user login information and user authentication information, which can limit the user's operation scope. Only those with corresponding atlas operation permissions can operate the matched atlas, thereby protecting the privacy of users with different permissions and improving the security of image loading.

[0074] In some of the embodiments, obtaining a default atlas includes:

[0075] Get a set of preset default images and get the default size information of the default images;

[0076] When the default size information is smaller than or equal to the preset atlas size, the default pictures corresponding to the default size information are packaged into a packaged atlas;

[0077] When the default size information is larger than the preset atlas size, the default image is packaged as an original image atlas;

[0078] The default atlas is obtained according to the packaged atlas and the original atlas.

[0079] Among them, the packed atlas is an atlas with a preset number of pictures. When the number of default pictures that need to be packed into the packed atlas exceeds the preset number of pictures, in order to reduce the number of resource requests and reduce the performance consumption (drawcall) during game runtime, the default pictures are merged into one picture to obtain at least one merged picture, and the picture correspondence between all merged pictures and the default pictures is recorded, and the packed atlas is generated according to the merged picture; the preset number of pictures can be obtained from the game engine configuration parameters corresponding to the default atlas; the picture correspondence includes the rotation and position information of the default picture after the packed atlas is generated.

[0080] It should be noted that when the default image is packaged into an unpackaged atlas or an original atlas, it is necessary to obtain the default storage location of the default image. Only when the default storage locations are consistent, the default images are packaged into the same packaged atlas or the same original atlas, thereby obtaining a default atlas with consistent default storage locations; the packaged packaged atlas, original atlas and default atlas are all encrypted atlases.

[0081] It can be understood that the operation of the server device 104 generating the atlas for the above-mentioned picture to be loaded and the next picture to be loaded is the same as the operation of generating the default atlas for the default picture, which will not be repeated here.

[0082] Through the above steps, by packaging the preset default images into a default atlas, the number of resource requests can be reduced, the performance consumption during game operation can be reduced, and the problems of large storage space occupied by image loading, large amount of image redundancy, and difficulty in version upgrades can be solved. The lightweight and fast loading of H5 game images is achieved, and the efficiency of version upgrades is improved.

[0083] In some of the embodiments, generating an initial resource configuration file according to the default atlas includes:

[0084] Obtain a game engine packaged plug-in, and parse the default atlas according to the game engine packaged plug-in to obtain at least atlas configuration information;

[0085] The initial resource configuration file is generated according to the atlas configuration information and the game engine package plug-in.

[0086] Among them, the game engine packaging plug-in is used to generate a resource configuration file based on the atlas, which matches different game engines, and one game engine corresponds to one game engine packaging plug-in; the atlas configuration information includes: picture name, picture size information, picture correspondence, and encrypted names of the packaged atlas, original atlas and default atlas.

[0087] Specifically, taking the cocos creator game engine as an example, the cocos creator packaged plug-in is obtained, and the onBeforeBuildFinish lifecycle function in the cocoscreator game engine parses the default atlas to obtain the atlas name, atlas path information, atlas attribute information and atlas configuration information; the atlas path information refers to the relative path information of the default atlas; the atlas attribute information refers to the atlas containing the merged atlas, the encryption information of the atlas, the game engine information and the game version; according to the game engine packaged plug-in, the atlas encryption information is used to decrypt the atlas, and the resource configuration file is generated according to the atlas name, atlas path information, atlas attribute information, atlas configuration information, game engine information, game version and the game engine packaged plug-in; for the original atlas, the atlas configuration information is recorded; for the packaged atlas, according to the cocos Creator's engine rules parse out the atlas configuration information of the default image before merging, as well as the position and rotation information merged into the default atlas, and write the atlas configuration information, game engine information and game version into the initial resource configuration file; the initial resource configuration file is used to load the parsed image into the game control resource to obtain a game package.

[0088] It can be understood that the step in which the server device 104 updates the initial resource configuration file according to the atlas to be loaded to generate the loading resource configuration file may be to update the initial resource configuration file according to the game engine packaged plug-in to obtain the loading resource configuration file corresponding to the atlas to be loaded. The specific process corresponds to the process in the above-mentioned embodiment and will not be repeated here.

[0089] Through the above steps, the initial resource file is generated by the plug-in, which can reduce resource redundancy and labor costs, solve the problems of large storage space occupied by image loading, large amount of image redundancy, and difficulty in version upgrade, and realize lightweight and fast loading of H5 game images, thereby improving the efficiency of version upgrade.

[0090] In some embodiments, the to-be-loaded picture is incorporated into the default atlas to generate the to-be-loaded atlas, including:

[0091] Get atlas update instructions;

[0092] When the atlas update instruction indicates to replace an image in the default atlas, obtaining the image to be replaced in the default atlas;

[0093] In the case where the image to be replaced is a picture in a packed atlas, obtaining atlas configuration information of the image to be replaced, and deleting the image to be replaced; merging the image to be loaded with the packed atlas according to the atlas configuration information to generate a packed atlas to be loaded;

[0094] In the case where the image to be replaced is a picture in the original image atlas, the image to be loaded is inserted into the default atlas to generate the original image atlas to be loaded, and the image to be replaced is deleted;

[0095] The atlas to be loaded is obtained according to the packaged atlas to be loaded and the original atlas to be loaded.

[0096] Among them, the image to be replaced is a default image specified by the user that needs to be replaced; specifically, first determine whether the image to be replaced is a picture in a packed atlas or a picture in an original atlas. If it is a picture in the original atlas, obtain the image to be loaded and insert the image to be loaded into the default atlas to generate an original atlas to be loaded, delete the image to be replaced, and generate path mapping information of the original atlas; if the image to be replaced is a picture in a packed atlas, obtain the atlas configuration information of the image to be replaced, that is, the position, rotation and other information of the image to be replaced in the packed atlas, merge the image to be loaded into the packed atlas according to the atlas configuration information of the image to be replaced, delete the image to be replaced, and generate a packed atlas to be loaded and path mapping information of the packed atlas; the path mapping information of the original atlas and the path mapping information of the packed atlas are both written into the path mapping information of the atlas to be loaded, as well as the loading resource configuration file corresponding to the atlas to be loaded, so that the server device 104 can load the atlas to be loaded according to the path mapping information in the loading resource configuration file.

[0097] Figure 3 This is a schematic diagram of the display interface of the second terminal device of this embodiment. The second terminal device refers to the game management control terminal. The user (collection manager) can dynamically replace and submit pictures (for example, game skin resources) on this operation page. Figure 3 As shown, the second terminal device display interface is used to display the default image, image attribute information, and obtain the new material imported by the user after obtaining the atlas update instruction. The upper left corner of the second terminal device display interface is a search area / filter area, which is used to obtain the keyword entered by the user and filter the images in all atlases according to the keyword; the keyword can be atlas attribute information, etc.; the lower left corner of the second terminal device display interface is a picture list, which is used to display the pictures in all atlases that the current user has operation authority; the upper right corner of the second terminal device display interface is used to display the preview of the currently selected picture and the corresponding path / name / size and other information, that is, to display the atlas attribute information of the picture matched according to the atlas update instruction, etc.; the lower right corner of the second terminal device display interface is used to provide the user with the selection of importing new materials, and obtain the new materials imported by the user, that is, to obtain the picture to be loaded. When importing the picture to be loaded, this embodiment can provide the user with a visual method to obtain the information of the picture to be replaced, and the operation is quick and simple, reducing labor costs.

[0098] Through the above steps, the images can be replaced and updated according to the user's operation, so as to obtain the updated atlas to be loaded, so that the default size of the game package is small, and the dynamic update of the atlas is allowed. Any image can be dynamically replaced with a high degree of freedom. The separation of game control resources and the atlas to be loaded makes it unnecessary to re-develop the game when the version is upgraded, reducing resource redundancy and labor costs, solving the problems of large storage space occupied by image loading, large amount of image redundancy, and difficulty in version upgrading, realizing lightweight and fast loading of H5 game images, and improving version upgrade efficiency.

[0099] In this embodiment, a picture loading device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0100] Figure 4 is a structural block diagram of the picture loading device of this embodiment, such as Figure 4 As shown, the device includes: an acquisition module 10, a generation module 20 and a loading module 30;

[0101] The acquisition module 10 is used to acquire a default atlas and generate an initial resource configuration file according to the default atlas;

[0102] The generating module 20 is used to obtain a group of images to be loaded, merge the images to be loaded into the default atlas, and generate an atlas to be loaded; update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file;

[0103] The loading module 30 is used to load the to-be-loaded atlas into the game control resource according to the loading resource configuration file to obtain a game package, and send the game package to the first terminal device for display.

[0104] For the specific definition of the image loading device, please refer to the definition of the image loading method above, which will not be repeated here. Each module in the above-mentioned image loading device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0105] In this embodiment, a picture loading system is also provided, including: a first terminal device 102, a transmission device and a server device 104; wherein the first terminal device 102 is connected to the server device 104 via the transmission device;

[0106] The server device 104 is used to execute the steps in any of the above method embodiments;

[0107] The transmission device is used to send the game package to the terminal device;

[0108] The first terminal device 102 is used to parse the game package for display.

[0109] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0110] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0111] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0112] S1, obtaining a default atlas, and generating an initial resource configuration file according to the default atlas;

[0113] S2, obtaining the image to be loaded, merging the image to be loaded into the default atlas, and generating an atlas to be loaded; updating the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file;

[0114] S3, loading the to-be-loaded atlas into the game control resource according to the loading resource configuration file to obtain a game package, and sending the game package to the first terminal device for display.

[0115] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0116] In addition, in combination with the image loading method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the image loading method. The storage medium stores a computer program; when the computer program is executed by a processor, any image loading method in the above embodiments is implemented.

[0117] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store image loading data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for loading an image is implemented.

[0118] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0119] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0120] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0121] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0122] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0123] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A method for loading an image, characterized in that: include: Obtain a default atlas, and generate an initial resource configuration file according to the default atlas; Acquire the image to be loaded, merge the image to be loaded into the default atlas, and generate the atlas to be loaded, including: Obtaining an atlas update instruction; wherein, after obtaining the atlas update instruction, the second terminal device display interface displays a default image, image attribute information, and obtains new materials imported by the user; the upper right corner of the second terminal device display interface is used to display a preview of the currently selected image and the corresponding path / name / size information, that is, to display the atlas attribute information of the image matched according to the atlas update instruction; the second terminal device is a game management control terminal; When the atlas update instruction indicates to replace an image in the default atlas, obtaining an image to be replaced in the default atlas; In the case where the picture to be replaced is a picture in a packed atlas, obtaining atlas configuration information of the picture to be replaced, and deleting the picture to be replaced; merging the picture to be loaded with the packed atlas according to the atlas configuration information to generate a packed atlas to be loaded; In the case where the picture to be replaced is a picture in the original picture atlas, inserting the picture to be loaded into the default atlas to generate the original picture atlas to be loaded, and deleting the picture to be replaced; Obtain the atlas to be loaded according to the packaged atlas to be loaded and the original atlas to be loaded; Update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file; The atlas to be loaded is loaded into the game control resource according to the loading resource configuration file to obtain a game package, and the game package is sent to the first terminal device for display.

2. The image loading method according to claim 1, characterized in that: The updating of the initial resource configuration file to generate a loading resource configuration file according to the atlas to be loaded also includes: Obtain the current resource configuration file of the atlas to be loaded; Obtain the next picture to be loaded, merge the next picture to be loaded into the atlas to be loaded, and generate the next atlas to be loaded; The current resource configuration file is updated according to the next atlas to be loaded to generate a loading resource configuration file.

3. The image loading method according to claim 2, characterized in that: Before obtaining the next picture to be loaded, the method further includes: Obtain user login information and user authentication information; According to the user login information and the user authentication information, a to-be-loaded atlas corresponding to the user authentication information is matched.

4. The image loading method according to claim 1, characterized in that: The step of obtaining the default atlas includes: Obtain a set of preset default images, and obtain default size information of the default images; When the default size information is less than or equal to the preset atlas size, the default pictures corresponding to the default size information are packaged into a packaged atlas; When the default size information is larger than the preset atlas size, the default image is packaged into an original image atlas; The default atlas is obtained according to the packaged atlas and the original atlas.

5. The image loading method according to claim 1, characterized in that: The generating an initial resource configuration file according to the default atlas includes: Obtain a game engine packaged plug-in, and parse the default atlas according to the game engine packaged plug-in to obtain at least atlas configuration information; The initial resource configuration file is generated according to the atlas configuration information and the game engine packaged plug-in.

6. A picture loading device, characterized in that: include: Get modules, generate modules and load modules; The acquisition module is used to acquire a default atlas and generate an initial resource configuration file according to the default atlas; The generating module is used to obtain a group of images to be loaded, merge the images to be loaded into the default atlas, and generate an atlas to be loaded; update the initial resource configuration file according to the atlas to be loaded to generate a loading resource configuration file; The generation module is also used to obtain an atlas update instruction; wherein, after obtaining the atlas update instruction, the second terminal device display interface displays a default image, image attribute information, and obtains new materials imported by the user; the upper right corner of the second terminal device display interface is used to display a preview of the currently selected image and the corresponding path / name / size information, that is, to display the atlas attribute information of the image matched according to the atlas update instruction; the second terminal device is a game management control terminal; The generating module is further configured to obtain a to-be-replaced picture in the default atlas when the atlas updating instruction indicates to replace a picture in the default atlas; The generating module is further configured to obtain atlas configuration information of the image to be replaced and delete the image to be replaced when the image to be replaced is an image in a packed atlas; merge the image to be loaded and the packed atlas according to the atlas configuration information to generate a packed atlas to be loaded; The generating module is further configured to, when the picture to be replaced is a picture in the original picture atlas, insert the picture to be loaded into the default atlas, generate the original picture atlas to be loaded, and delete the picture to be replaced; The generating module is further used to obtain the atlas to be loaded according to the packaged atlas to be loaded and the original atlas to be loaded; The loading module is used to load the to-be-loaded atlas into the game control resource according to the loading resource configuration file to obtain a game package, and send the game package to the first terminal device for display.

7. A picture loading system, characterized in that: include: A first terminal device, a transmission device and a server device; wherein the first terminal device is connected to the server device via the transmission device; The server device is used to execute the image loading method according to any one of claims 1 to 5; The transmission device is used to send the game package to the first terminal device; The first terminal device is used to parse the game package for display.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the image loading method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image loading method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Webgame data processing method and device, electronic equipment and storage medium

    CN114676372A