A method, device, system and electronic device for updating scene data

By establishing a mapping relationship in the game engine, responding to notification messages of resource updates, and determining and updating the reference relationship of sub-objects, the problem of low resource update efficiency in the existing technology is solved, and the code-free modification effect of efficient update and adaptation to new types of elements is achieved.

CN114416042BActive Publication Date: 2025-09-19XIAMEN YAJI SOFTWARE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210095762.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2025-09-19
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

Existing technologies are inefficient when updating game scene resources, especially when introducing new types of scene elements, which require reconfiguration of filters, resulting in wasteful and inefficient resource loading.

Method used

By pre-establishing the mapping relationship, the corresponding child object is determined in response to the notification message of resource update, and its reference relationship is updated to reference the new resource object, avoiding the reconfiguration of the filter.

Benefits of technology

It achieves efficient updating of scene data, only updating sub-objects with resource changes, improving update efficiency and adapting to new types of elements without modifying the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416042B_ABST
    Figure CN114416042B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device, and computer-readable storage medium for updating scene data, which relate to the field of game development. The method includes: in response to a notification message carrying a resource identifier, determining a sub-object corresponding to the resource identifier based on a pre-established mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object; obtaining a new resource object corresponding to the resource identifier; and updating the reference relationship of the sub-object so as to reference the new resource object. The method determines the sub-object whose reference relationship needs to be updated through the established mapping relationship, and then updates the reference relationship of the sub-object so that the sub-object references the new resource object. Only the sub-object with resource updates needs to be directly updated, thereby achieving the technical effect of efficient update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game development technology, and in particular to a method, device, electronic device, and computer-readable storage medium for updating scene data. Background Art

[0002] Resource development is an important step in developing a game engine. After resource development is completed, how to update the new resources into the game scene becomes a key issue.

[0003] In an existing solution, when resources are updated, element objects are filtered out according to the type of scene elements configured in the filter (the type configured in the filter indicates that the scene elements of this type have configured resources), and all filtered element objects are reinitialized. In this way, the updated resources will be loaded. This operation is not targeted and is obviously very inefficient.

[0004] In addition, if a new type of scene element is introduced into the solution and the scene element has configuration resources, the filter needs to be reconfigured.

[0005] Therefore, the solutions in the prior art are very inefficient. Summary of the Invention

[0006] The purpose of the embodiments of this application is to solve the above technical problems.

[0007] According to one aspect of an embodiment of the present application, a method for updating scene data is provided, the method comprising:

[0008] In response to the notification message carrying the resource identifier, determining the sub-object corresponding to the resource identifier according to a pre-established mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object;

[0009] Get the new resource object corresponding to the resource identifier;

[0010] Update the reference relationship of the child object to reference the new resource object.

[0011] In one possible implementation, the process of establishing the mapping relationship includes:

[0012] After the scene file is loaded, obtain the scene object. The scene object references multiple element objects, and the element object references sub-objects. Perform the following operations for each sub-object referenced by the element object:

[0013] Obtain the reference flag of the sub-object, wherein the reference flag is used to identify whether the sub-object references a resource object;

[0014] If the reference flag is not empty, determine the resource identifier of the resource object referenced by the sub-object;

[0015] A mapping relationship is established based on the sub-object and the determined resource identifier.

[0016] In another possible implementation, updating the reference relationship of the child object includes:

[0017] Replace the old resource object referenced by the child object with the new resource object.

[0018] In another possible implementation, each resource identifier corresponds to at least one sub-object, and determining the sub-object corresponding to the resource identifier according to a pre-established mapping relationship includes:

[0019] Determine all sub-objects corresponding to the resource identifier according to the mapping relationship;

[0020] The old resource object referenced by the child object is replaced with the new resource object, including:

[0021] Replace the resource object referenced by all child objects with the new resource object.

[0022] In yet another possible implementation, the method further includes:

[0023] When adding a new element object, if it is determined that the reference flag of any sub-object of the new element object is not empty, the mapping relationship is updated according to any sub-object;

[0024] When deleting an existing element object, if it is determined that the reference flag of any child object of the existing element object is not empty, the mapping relationship is updated according to any child object.

[0025] According to another aspect of an embodiment of the present application, a device for updating scene data is provided, the device comprising:

[0026] a determination module, configured to, in response to a notification message carrying a resource identifier, determine a sub-object corresponding to the resource identifier according to a pre-established mapping relationship, wherein the mapping relationship indicates a relationship between the resource identifier and the sub-object;

[0027] An acquisition module, used to acquire a new resource object corresponding to a resource identifier;

[0028] The update module is used to update the reference relationship of the sub-object so as to reference the new resource object.

[0029] According to another aspect of an embodiment of the present application, a scene data updating system is provided, the system comprising: a resource manager and a resource change manager, wherein:

[0030] The resource change manager is used to traverse the sub-objects of all element objects in the scene object after obtaining the scene object by loading the scene file, and establish a mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object;

[0031] The resource manager is used to send a notification message to the resource change manager after determining that any resource associated with the scene file is updated;

[0032] The resource change manager is further used to determine the sub-object corresponding to the resource identifier of any resource according to the mapping relationship, obtain the new resource object corresponding to the resource identifier, and update the reference relationship of the sub-object to reference the new resource object.

[0033] In a possible implementation, the process of establishing the mapping relationship includes:

[0034] After the scene file is loaded, a scene object is obtained, wherein the scene object references multiple element objects, and the element objects reference sub-objects;

[0035] For each child object referenced by the element object, perform the following actions:

[0036] Obtaining a reference flag of the sub-object, wherein the reference flag is used to identify whether the sub-object has a referenced resource object;

[0037] If the reference flag is not empty, determining the resource identifier of the resource object referenced by the sub-object;

[0038] The mapping relationship is established according to the sub-object and the determined resource identifier.

[0039] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method shown in the above aspect of the present application.

[0040] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method shown in the above aspect of the present application are implemented.

[0041] The beneficial effects of the technical solution provided by the embodiments of the present application are:

[0042] An embodiment of the present application provides a method for updating scene data, comprising: in response to a notification message carrying a resource identifier, determining a sub-object corresponding to the resource identifier based on a pre-established mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object; obtaining a new resource object corresponding to the resource identifier; and updating the reference relationship of the sub-object so as to reference the new resource object. That is, the sub-object whose reference relationship needs to be updated is determined by a pre-established mapping relationship, thereby updating the reference relationship of the sub-object more quickly. The method determines the sub-object whose reference relationship needs to be updated through a pre-established mapping relationship, and then updates the reference relationship of the sub-object so that the sub-object references the new resource object. Only the sub-object with resource updates needs to be directly updated, thereby achieving the effect of efficient update. At the same time, the technical means adopted by the method also avoid element types. Therefore, even if there are new types of elements that need to update the reference relationship, there is no need to make code modifications. In general, the method can achieve the technical effect of efficient update in solving the problem of how to update scene data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.

[0044] Figure 1 A schematic diagram of a scenario in which errors are cited in the prior art;

[0045] Figure 2 A schematic diagram of a scene in which scene data is updated based on a filter in the prior art;

[0046] Figure 3 A schematic diagram illustrating a process of updating scene data by a scene data updating system provided in an embodiment of the present application;

[0047] Figure 4 A flowchart of a method for updating scene data provided in an embodiment of the present application;

[0048] Figure 5 A schematic structural diagram of a scene data updating device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following describes the embodiments of the present application in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0050] Those skilled in the art will understand that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements, and / or components, but do not exclude implementation as other features, information, data, steps, operations, elements, components, and / or combinations thereof supported by the present technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can refer to the element and the other element establishing a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here can include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".

[0051] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0052] First, several terms involved in this application are introduced and explained:

[0053] Resources: Files in the editor's Assets directory that need to be loaded into memory to generate resource objects before they can be used during game execution. These resources include scene resources, model resources, material resources, and more. In this embodiment of the application, these resources are managed by the terminal's resource manager.

[0054] Resource object: The resource is loaded into memory by the game engine and becomes a usable resource object.

[0055] In the embodiment of the present application, a resource includes multiple attributes, one of which is a resource identification ID; a resource object corresponding to the resource also has multiple attributes, one of which is also a resource identification ID. Both are the same resource identification ID.

[0056] Each game scene is configured with a corresponding scene resource file, which records the various types of elements configured for the game scene (for example, models, particles, etc.), as well as the resources configured for the elements. In the existing game development process, resources are stored in corresponding resource files and are usually uniquely identified using IDs to replace resources appearing in scene resource files. After loading, the resource file will obtain a resource object. After loading the scene resource file, a scene object can be obtained, which references the above-mentioned resource object through the ID. Among them, the scene object includes multiple element objects, each element object can include multiple sub-objects, and the referenced resource object includes the sub-object.

[0057] However, if the resource file is modified, that is, the resource is updated (mainly some parameters of the resource are modified, for example, the color and texture of the material are modified), a new resource object will be obtained based on the updated resource. If the referenced resource object is not updated at this time, the scene object will continue to use the old reference relationship, resulting in incorrect results. For details, see Figure 1 Therefore, how to update the objects generated by the updated resources to the loaded scene in a timely manner is an urgent problem that needs to be solved.

[0058] See also Figure 2 , the prior art provides a filter to solve this technical problem, specifically:

[0059] A bedroom scene exists, comprising scene element 1, scene element 2, and scene element 3. Scene element 1 has material 11 configured, which references material resource A with ID 1001. Scene element 2 has material 21 configured, which references material resource B with ID 1002. Scene element 1 is of model type, and scene element 2 is of particle type. After loading this bedroom scene, the resulting objects are a scene object (corresponding to the bedroom scene), an element object (corresponding to scene elements 1, 2, or 3), a material sub-object (corresponding to material 11 and material 21), and a material resource object (corresponding to material resources A and B, specifically including material object A).

[0060] After updating A, A' is obtained, and all sub-objects that have referenced resource objects are initialized once, so that the new object corresponding to A' will be loaded (for example, Figure 2Specifically, when obtaining A', the terminal traverses all element objects in the current bedroom scene, and then filters all element objects according to the filter (the filter is configured with type parameters, such as model, particle type) (for example: the element objects are filtered according to the model and particle configured in the filter, and scene element 1 and scene element 2 are filtered out). After obtaining the filtering results, the filtered scene elements are reinitialized. Among them, although material 11 and material 21 both reference resource objects, the material resources referenced by material 21 are not updated. If material 21 is reloaded, it is a waste of loading resources. This solution is neither targeted nor efficient, and it wastes loading resources, so it is very inefficient. In addition, if there are new types of scene elements that reference resources, the filter also needs to be adaptively modified.

[0061] The present application provides a method, device, electronic device, and computer-readable storage medium for updating scene data, which are intended to solve the above technical problems in the prior art.

[0062] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on, or combine with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0063] See also Figure 3 , an embodiment of the present application provides a schematic diagram of a demonstration process of updating scene data in a scene data update system, the system includes a resource change manager 310 and a resource manager 320. The resource change manager 310 is configured with a mapping relationship table, and the mapping relationship table includes multiple mapping relationships. It should be noted that the resource manager shown in the present application may include an editor and an engine. The resource manager may also have the following functions: loading scene files to obtain scene objects; loading resource files to obtain resource objects; and managing various types of objects obtained by loading. The resource manager shown in the embodiment of the present application may also have other functions, and those skilled in the art may expand them according to their needs.

[0064] The following will use a bedroom scene in a game as an example to illustrate the specific process of updating scene data in this system.

[0065] First, after loading the scene file of the bedroom scene to generate a scene object, the resource change manager 310 obtains the scene object, traverses all element objects in the scene object, checks the sub-objects in each element object, determines whether the sub-object has a referenced resource object (for example, a material sub-object references a material resource object), and determines the reference relationship as a mapping relationship and records it in the mapping relationship table.

[0066] The scene file records the elements included in the bedroom scene and the resources referenced by these elements, which can be material resources. Resources included in the scene file can include resource identifiers, the path to the resource file containing the resource, or the code content containing the resource can be directly present in the scene file. In short, a scene file is associated with multiple resources.

[0067] In the embodiment of the present application, the mapping relationship includes the ID of the resource object and the identifier of the sub-object. Among them, the identifier of the sub-object can be a unique attribute. For example, the address pointer assigned by the terminal to the sub-object is: 0x112bf000. It should be noted that the scene objects, element objects, sub-objects, etc. in the embodiment of the present application can all be uniquely identified by address pointers. Regarding the function of the address pointer, those skilled in the art can refer to the existing technology, and for the sake of simplicity, it will not be repeated here.

[0068] When a resource associated with the scene object is updated, for example, material resource A is updated to material resource A', and a new resource object material object A' corresponding to A' is generated, the resource manager 320 sends a notification message to the resource change manager 310, and the notification message also carries the resource identification ID.

[0069] After receiving the notification message carrying the ID, the resource change manager 310 queries the mapping relationship table according to the ID, and the result of the query is the identifier of a sub-object. Among them, the sub-object that references the resource object corresponding to the ID can be one or more. Then, the resource change manager 310 sends a query message carrying the resource identifier to the resource object according to the resource identifier to the resource manager 320. After receiving the query message, the resource manager 320 performs a query operation based on all the objects it manages to obtain the resource object, and feeds back to the resource change manager 310 based on the new resource object obtained by the query. After the resource change manager 310 obtains the new resource object, it updates the reference relationship of the sub-object so that when the game scene is running, the sub-object references the new resource object.

[0070] At this point, with the addition of the resource change manager 310, updating resource objects becomes relatively targeted, and there is no waste of loading resources. Compared with updating scene data through filters and other methods, it is more efficient.

[0071] See also Figure 4 The present application also provides a method for updating scene data, which is applied to a terminal. The terminal can be a mobile device, such as a mobile phone, a pad, a personal computer, or an electronic device such as a computer. The method includes: S410-S430.

[0072] S410 , in response to a notification message carrying a resource identifier, determining a sub-object corresponding to the resource identifier according to a pre-established mapping relationship, wherein the mapping relationship indicates a relationship between the resource identifier and the sub-object.

[0073] The terminal runs a scene object corresponding to a scene. This scene is associated with multiple elements, some of which are associated with corresponding materials. For example, the scene can be a bedroom scene, which is configured with several home elements such as a table, chairs, and a bed. For the table alone, the table can be configured with a material, which can reference different resources such as marble, walnut, and plastic. The same material can be configured with different colors. For example, the colors of marble can be configured in black, white, and black and white.

[0074] Specifically, a resource manager and a resource change manager can also be configured on the terminal. The resource change manager is configured with a mapping relationship table, and updates data such as objects in the scene based on the mapping relationship table. After any resource associated with the scene is updated, the resource manager sends a notification message to the resource change manager, and the notification message carries the resource identification ID of any resource. For example, taking the table element as an example, the current table has a selected material, and the currently selected material is marble, and the color is black. When the color of the marble material is updated to black and white, the resource manager can send a notification message to the resource change manager based on the ID of the marble material.

[0075] S420: Acquire a new resource object corresponding to the resource identifier.

[0076] Specifically, the resource change manager sends a query request to the resource manager according to the resource identifier to obtain the resource object corresponding to the resource identifier, such as obtaining the address pointer of the new resource object.

[0077] S430: Update the reference relationship of the sub-object to reference the new resource object.

[0078] Specifically, the resource change manager updates the reference relationship of the sub-object based on the acquired new resource object and sub-object, so that the sub-object can reference the new resource object during the game running process.

[0079] An embodiment of the present application provides a method for updating scene data, comprising: in response to a notification message carrying a resource identifier, determining a sub-object corresponding to the resource identifier based on a pre-established mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object; obtaining a new resource object corresponding to the resource identifier; and updating the reference relationship of the sub-object so as to reference the new resource object. That is, the sub-object whose reference relationship needs to be updated is determined by a pre-established mapping relationship, thereby updating the reference relationship of the sub-object more quickly. The method determines the sub-object whose reference relationship needs to be updated through a pre-established mapping relationship, and then updates the reference relationship of the sub-object so that the sub-object references the new resource object, and only directly updates the sub-object with resource updates, thereby achieving the effect of efficient update. At the same time, the technical means adopted by the method also avoid element types. Therefore, even if there are new types of elements that need to update the reference relationship, there is no need to modify the code. In general, the method can achieve the technical effect of efficient update in solving the problem of how to update scene data.

[0080] This embodiment of the present application provides a possible implementation method, which may include:

[0081] Replace the old resource object referenced by the child object with the new resource object.

[0082] Specifically, after the load operation is complete, an address pointer is typically assigned to the object in memory. This address pointer points to the address that stores the object instance. Therefore, when a sub-object references a resource object, it actually establishes an association with that resource object's address pointer. This replacement process is accomplished by simply replacing the old resource object's address pointer with the new resource object's address pointer.

[0083] In a possible implementation, each resource identifier corresponds to at least one sub-object. Therefore, determining the sub-object corresponding to the resource identifier according to the mapping relationship may specifically include: determining all sub-objects corresponding to the resource identifier according to the mapping relationship.

[0084] The step of replacing the old resource object referenced by the sub-object with the new resource object includes: replacing the resource objects referenced by all sub-objects with the new resource object.

[0085] This embodiment of the present application also provides a possible implementation method, and the process of establishing the mapping relationship includes:

[0086] After the scene file is loaded, the scene object is obtained, where the scene object references multiple element objects, and the element object references sub-objects.

[0087] Among the multiple element objects, some element objects have referenced sub-objects, while others do not. Figure 3 , scene elements 1 and 2 have materials configured, so they have material sub-objects, while scene element 3 does not have a material configured, so there is no referenced material sub-object.

[0088] For each child object referenced by the element object, perform the following actions:

[0089] Obtain the reference flag of the sub-object, where the reference flag is used to identify whether the sub-object has a referenced resource object; if the reference flag is not empty, determine the resource identifier of the resource object referenced by the sub-object; and establish a mapping relationship based on the sub-object and the determined resource identifier.

[0090] Specifically, a sub-object includes multiple attributes, one of which is a reference flag. The reference flag can be a numeric value, such as 0 or 1, where 0 indicates that the resource object is not referenced and 1 indicates that the resource object is referenced. When the reference flag is 1, the attributes of the sub-object may also include the identifier of the referenced resource object, such as an address pointer.

[0091] The present application also provides a possible implementation method, which further includes:

[0092] When a new element object is added, if it is determined that the reference flag of any sub-object of the new element object is not empty, the mapping relationship is updated according to any sub-object.

[0093] Specifically, when a new element object is added to the scene object, the resource change manager traverses all child objects of the new element object. If it is determined that the reference flag of any child object of the new element object is not null, the resource ID of the resource object referenced by the child object is determined, and a mapping relationship is established between the child object and the resource ID.

[0094] When deleting an existing element object, if it is determined that the reference flag of any child object of the existing element object is not empty, the mapping relationship is updated according to any child object.

[0095] Specifically, when deleting an existing element object in a scene object, the resource change manager traverses all sub-objects of the existing element object. If it is determined that the reference flag of any sub-object of the existing element object is not empty, the mapping relationship corresponding to the sub-object is determined from the established mapping relationship based on the identifier of any sub-object (for example, address pointer), and the corresponding mapping relationship is deleted. By updating the mapping relationship and keeping the mapping relationship in the current latest state, a more accurate basis can be provided for subsequent operations to update resource objects.

[0096] See also Figure 5, the embodiment of the present application provides a scene data updating device, the device 500 may include: a determination module 510, an acquisition module 520 and an update module 530, wherein,

[0097] The determination module 510 is used to respond to a notification message carrying a resource identifier and determine the sub-object corresponding to the resource identifier based on a pre-established mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object; the acquisition module 520 is used to obtain a new resource object corresponding to the resource identifier; and the update module 530 is used to update the reference relationship of the sub-object so as to reference the new resource object.

[0098] In a possible implementation, the updating module 530 is specifically configured to:

[0099] Replace the old resource object referenced by the child object with the new resource object.

[0100] In a possible implementation, each resource identifier corresponds to at least one sub-object, and the determination module 510 is specifically configured to determine all sub-objects corresponding to the resource identifier according to the mapping relationship in determining the sub-object corresponding to the resource identifier according to the mapping relationship.

[0101] The updating module 530 is specifically configured to replace the old resource object referenced by the sub-object with the new resource object:

[0102] Replace the resource object referenced by all child objects with the new resource object.

[0103] In a possible implementation, the apparatus 500 further includes an establishing module 540, specifically configured to:

[0104] After the scene file is loaded, the scene object is obtained, wherein the scene object references multiple element objects, and the element object references sub-objects; the following operations are performed for the sub-object referenced by each element object: the reference flag of the sub-object is obtained, wherein the reference flag is used to identify whether the sub-object has a referenced resource object; if the reference flag is not empty, the resource identifier of the resource object referenced by the sub-object is determined; and a mapping relationship is established based on the sub-object and the determined resource identifier.

[0105] In a possible implementation, the establishing module 540 may also be used to:

[0106] When adding a new element object, if it is determined that the reference flag of any sub-object of the new element object is not empty, the mapping relationship is updated according to any sub-object; when deleting an existing element object, if it is determined that the reference flag of any sub-object of the existing element object is not empty, the mapping relationship is updated according to any sub-object.

[0107] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps and corresponding contents of the aforementioned method embodiment.

[0108] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0109] The terms "first," "second," "third," "fourth," "1," "2," and the like (if any) in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that shown or described in the drawings.

[0110] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart can include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. Under different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0111] The above description is only an optional implementation method for some implementation scenarios of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of this application, the use of other similar implementation methods based on the technical ideas of this application also falls within the protection scope of the embodiments of this application.

Claims

1. A method for updating scene data, characterized in that: The method comprises: In response to a notification message carrying a resource identifier, determining a sub-object corresponding to the resource identifier according to a pre-established mapping relationship, wherein the mapping relationship indicates a relationship between the resource identifier and the sub-object; Obtain a new resource object corresponding to the resource identifier; Updating the reference relationship of the sub-object so as to reference the new resource object; The process of establishing the mapping relationship includes: After the scene file is loaded, a scene object is obtained, wherein the scene object references multiple element objects, and the element objects reference sub-objects; For each child object referenced by the element object, perform the following actions: Obtaining a reference flag of the sub-object, wherein the reference flag is used to identify whether the sub-object has a referenced resource object; If the reference flag is not empty, determining the resource identifier of the resource object referenced by the sub-object; The mapping relationship is established according to the sub-object and the determined resource identifier.

2. The method according to claim 1, characterized in that The updating of the reference relationship of the sub-object includes: The old resource object referenced by the child object is replaced with the new resource object.

3. The method according to claim 2, characterized in that Each resource identifier corresponds to at least one sub-object, and determining the sub-object corresponding to the resource identifier according to the pre-established mapping relationship includes: Determine all sub-objects corresponding to the resource identifier according to the mapping relationship; The step of replacing the old resource object referenced by the sub-object with the new resource object includes: The resource objects referenced by all the sub-objects are replaced with the new resource objects.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When a new element object is added, if it is determined that the reference flag of any sub-object of the new element object is not empty, updating the mapping relationship according to the any sub-object; When deleting an existing element object, if it is determined that the reference flag of any sub-object of the existing element object is not empty, the mapping relationship is updated according to the any sub-object.

5. A scene data updating device, characterized in that: The device comprises: a determination module, configured to, in response to a notification message carrying a resource identifier, determine a sub-object corresponding to the resource identifier according to a pre-established mapping relationship, wherein the mapping relationship indicates a relationship between the resource identifier and the sub-object; An acquisition module, configured to acquire a new resource object corresponding to the resource identifier; An updating module, configured to update the reference relationship of the sub-object so as to reference the new resource object; Establish a module for obtaining a scene object after the scene file is loaded, wherein the scene object references multiple element objects, and the element object references a sub-object; perform the following operations on the sub-object referenced by each element object: obtain the reference flag of the sub-object, wherein the reference flag is used to identify whether the sub-object has a referenced resource object; if the reference flag is not empty, determine the resource identifier of the resource object referenced by the sub-object; and establish a mapping relationship based on the sub-object and the determined resource identifier.

6. A scene data updating system, characterized in that: The system includes: a resource manager and a resource change manager, wherein: The resource change manager is used to traverse the sub-objects of all element objects in the scene object after obtaining the scene object by loading the scene file, and establish a mapping relationship, wherein the mapping relationship indicates the relationship between the resource identifier and the sub-object; The resource manager is configured to send a notification message to the resource change manager after determining that any resource associated with the scene file is updated; The resource change manager is further configured to determine, based on the mapping relationship, a sub-object corresponding to the resource identifier of any resource, obtain a new resource object corresponding to the resource identifier, and update a reference relationship of the sub-object so as to reference the new resource object; The process of establishing the mapping relationship includes: After the scene file is loaded, a scene object is obtained, wherein the scene object references multiple element objects, and the element objects reference sub-objects; For each child object referenced by the element object, perform the following actions: Obtaining a reference flag of the sub-object, wherein the reference flag is used to identify whether the sub-object has a referenced resource object; If the reference flag is not empty, determining the resource identifier of the resource object referenced by the sub-object; The mapping relationship is established according to the sub-object and the determined resource identifier.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 4.

8. 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 method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Updating method and system for application client and terminal device

    CN107508846A

  • Data processing method, device and equipment and computer readable storage medium

    CN113656417A