Resource processing method and device, electronic equipment and storage medium
By creating the target memory object in the editor and reusing the resource attributes of the memory object to be replaced, the problem of repetitive editing during resource replacement is solved, improving the efficiency of resource replacement and the efficiency of attribute editing.
Patent Information
- Application Number
- CN202410509584.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-10-28
Smart Images

Figure CN120852147A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a resource processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, editors are often used to edit image materials, sequence frame materials, and 3D model materials. In this case, editing can be understood as importing or reconstructing the above materials and then editing them.
[0003] However, during the editing process, if modifications are needed to the already edited material, it is necessary to delete the edited material and then re-import it. Furthermore, the editing operations corresponding to the already edited material need to be repeated, which results in high time costs and low editing efficiency. Summary of the Invention
[0004] This disclosure provides a resource processing method, apparatus, electronic device, and storage medium to improve resource editing efficiency.
[0005] In a first aspect, embodiments of this disclosure provide a resource processing method applied in an editor, the method comprising:
[0006] In response to a resource replacement operation, a target memory object is created based on the imported target resource;
[0007] Retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced;
[0008] A resource replacement event is created based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0009] Secondly, embodiments of this disclosure also provide a resource processing apparatus configured in an editor, the apparatus comprising:
[0010] The memory object creation module is used to create a target memory object based on the imported target resource in response to a resource replacement operation.
[0011] The resource attribute reuse module is used to retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced;
[0012] The resource replacement module is used to create a resource replacement event based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0014] One or more processors;
[0015] Storage device for storing one or more programs.
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource processing method as described in any of the embodiments of this disclosure.
[0017] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the resource processing method as described in any of the embodiments of this disclosure.
[0018] The technical solution of this disclosure, upon receiving a resource replacement request, can create a target memory object based on the imported target resource. Simultaneously, it can assign the resource attributes corresponding to the memory object to be replaced to the target memory object, thus reusing the resource attributes corresponding to the edited memory object to be replaced. Furthermore, it replaces all resource files and the resources to be replaced used in functional modules based on the target memory object. This solves the problem in the prior art where, when an edited or currently edited resource (i.e., the resource to be replaced) needs to be replaced, the user must first delete all edited or currently edited resources in all resource files or controls, and then re-import the new target resource and edit it. This involves repeatedly performing all editing operations on the edited or currently edited resource, resulting in low editing efficiency and high time costs. This solution achieves automated replacement of the resource to be replaced based on the target resource, thus improving resource replacement efficiency. Moreover, the resource attributes used in the edited or currently edited resource are edited according to corresponding rules or requirements. Therefore, by reusing all resource attributes of the resource to be replaced in the target resource, the effect of efficient resource attribute editing is achieved. Attached Figure Description
[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 This is a schematic flowchart of a resource processing method provided in an embodiment of this disclosure;
[0021] Figure 2 This is a schematic flowchart of a resource processing method provided in an embodiment of this disclosure;
[0022] Figure 3 This is a schematic flowchart of a resource processing method provided in an embodiment of this disclosure;
[0023] Figure 4 This is a schematic diagram of the structure of a resource processing device provided in an embodiment of this disclosure;
[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0025] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0026] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0027] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0028] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0029] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0030] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0031] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0032] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0033] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0034] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0035] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0036] Before introducing the technical solutions provided by the embodiments of this disclosure, the application scenarios can be illustrated by example. The embodiments of this disclosure can be integrated into an editor. The editor can edit imported materials; in this embodiment, the imported materials can be understood as resources. Resources can be images, sequence frames, 2D models, and / or 3D models, etc. Editing can be performed on any one or more of the resources mentioned above using the editor.
[0037] After editing some resources, it may be necessary to replace some resources. When replacing resources, the solution provided in the embodiments of this disclosure can be used.
[0038] It should also be noted that resources can be stored on disk before being imported into the editor, and stored in the editor's memory after being imported.
[0039] Figure 1 This is a schematic flowchart of a resource processing method provided in an embodiment of the present disclosure. This embodiment of the present disclosure can be applied in an editor, and in scenarios where certain edited resources in the editor can be replaced. The method can be implemented by a resource processing device, which can be deployed in a computer device. Optionally, the computer device can be a PC or a mobile terminal, etc.
[0040] like Figure 1 As shown, the method includes:
[0041] S110. In response to the resource replacement operation, create a target memory object based on the imported target resource.
[0042] When resource replacement is determined to be necessary, a resource replacement control in the editor can be triggered. The operation corresponding to triggering the resource replacement control is considered the resource replacement operation. The target resource is the resource to be replaced; that is, the new resource is used as the target resource. The target memory object can be a memory object created based on the import information of the target resource. The target memory object can be represented by a specific data structure type. The specific data structure type can be a key-value type, where the key corresponds to the memory address of the target resource in the editor, and the value corresponds to the content of the target resource.
[0043] Specifically, when the resource replacement control is detected, the pre-created target resource can be imported into the editor, and a target memory object can be created based on the imported target resource.
[0044] For example, if the target resource is a target image, the target image can be imported into the editor, and a target memory object can be created based on the import information of the target image.
[0045] S120. Retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, where the memory object to be replaced corresponds to the resource to be replaced.
[0046] The memory object to be replaced is a pre-selected object that will be replaced. This memory object primarily corresponds to the resource to be replaced. The resource to be replaced can be the same type as the target resource or a different type. Optionally, both the resource to be replaced and the target resource can be of types such as images, sequence frames, 2D model files, or 3D model files. Of course, the resource to be replaced can also be of a different type than the target resource; whether they are the same or different can be determined according to actual needs and is not limited in this embodiment.
[0047] It should also be noted that the resource to be replaced can be edited within the editor. This means the resource to be replaced can be either an already edited resource or a resource recently imported into the editor. Since there is corresponding editing information for the resource to be replaced, this information can be stored in memory. When resource replacement is detected, this information can be reused on the target resource, thus avoiding the problem of repetitive editing of the target resource, which leads to wasted time and high labor costs.
[0048] Specifically, when editing a memory object to be replaced, the editing information can be recorded and stored in a corresponding storage location. This allows the edited information to be retrieved and reused on the target resource during resource replacement, avoiding the need for repeated editing of the target resource and thus preventing inefficient resource processing. The edited information can be treated as a resource attribute of the memory object to be replaced.
[0049] Specifically, before responding to a resource replacement operation, the memory object to be replaced can be triggered first. After triggering the memory object, the resource attributes corresponding to the memory object can be retrieved. After the target memory object is created, the resource attributes can be assigned to the target memory object, so that the target memory object reuses the resource attributes of the memory object to be replaced.
[0050] S130. Create a resource replacement event based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0051] In this context, a resource replacement event can be understood as an event used to replace a resource to be replaced with a target resource. The editor is used to edit the resources used in a project. Correspondingly, a resource to be replaced may be used multiple times. Based on the resource replacement event, all used resources to be replaced can be replaced with the target resource. At least one resource file can be any of the resource files associated with the project that are edited by the editor. The number of resource files is determined based on the project, and its specific number is not limited in this embodiment. Functional modules can be certain functional modules used in the editor.
[0052] Specifically, resource replacement events can be created based on the target memory object and the memory object to be replaced. Based on these events, it's possible to iterate through all resource files or functional modules associated with the project to see if they use the resource to be replaced. If so, the resource to be replaced is then replaced with the target resource.
[0053] In this embodiment of the disclosure, it is also possible to pre-set which resource files or functional modules to be traversed, that is, to replace the resource to be replaced in a specific resource file or functional module with the target resource. The file identifier of the resource file to be traversed and / or the functional module identifier of the functional module can be edited in the resource replacement event to realize the replacement of the resource to be replaced in a specific resource file and functional module.
[0054] The technical solution of this disclosure, upon receiving a resource replacement request, can create a target memory object based on the imported target resource. Simultaneously, it can assign the resource attributes corresponding to the memory object to be replaced to the target memory object, thus reusing the resource attributes corresponding to the edited memory object to be replaced. Furthermore, it replaces all resource files and the resources to be replaced used in functional modules based on the target memory object. This solves the problem in the prior art where, when an edited or currently edited resource (i.e., the resource to be replaced) needs to be replaced, the user must first delete all edited or currently edited resources in all resource files or controls, and then re-import the new target resource and edit it. This involves repeatedly performing all editing operations on the edited or currently edited resource, resulting in low editing efficiency and high time costs. This solution achieves automated replacement of the resource to be replaced based on the target resource, thus improving resource replacement efficiency. Moreover, the resource attributes used in the edited or currently edited resource are edited according to corresponding rules or requirements. Therefore, by reusing all resource attributes of the resource to be replaced in the target resource, the effect of efficient resource attribute editing is achieved.
[0055] Figure 2 This is a flowchart illustrating a resource processing method provided in an embodiment of this disclosure. Before creating a target memory object based on the imported target resource, the selection of the memory object to be replaced and the determination of the target resource can be triggered first. For specific implementation details, please refer to the detailed description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0056] like Figure 2 As shown, the method in this embodiment may specifically include:
[0057] S210, In response to the first trigger operation, determine the memory object to be replaced.
[0058] The first triggering operation can be a triggering operation on a certain memory object, and the memory object corresponding to the first triggering operation can be used as the memory object to be replaced.
[0059] Specifically, users can select the corresponding memory object by clicking with the mouse or a selection tool, and then use the selected memory object as the memory object to be replaced. In other words, the selection of a memory object as the memory object to be replaced is triggered.
[0060] S220. Import the selected target resource into the target directory so that, in response to a resource replacement operation, the target resource is imported from the target directory to create a target memory object based on the target resource.
[0061] A project may be associated with multiple directory files. These directory files can include the project's project directory files. Temporary directories can be created under the project's project directory files, and these temporary directories can correspond to the target directory. Target resources can be stored in the target directory.
[0062] It should also be noted that a fixed directory can be preset so that the target resource can be copied to that fixed directory. In this case, the fixed directory is the target directory.
[0063] Specifically, after identifying the target resource, it can be copied to a fixed directory (the target directory), or a temporary directory can be created in the project directory and used as the target directory to copy the target resource. When the resource replacement control is triggered, the target resource stored in the target directory can be imported into the editor, and a target memory object can be created based on the target resource.
[0064] S230. In response to the resource replacement operation, create a target memory object based on the imported target resource.
[0065] Specifically, when a resource replacement control is detected, it can be considered that a resource replacement operation has been triggered. At this time, a target memory object can be created based on the imported target resource.
[0066] S240. Retrieve the resource attributes corresponding to the memory object to be replaced from the first storage location, store the resource attributes in the second storage location corresponding to the target memory object, and associate them with the target memory object so that the target memory object can reuse the resource attributes.
[0067] The first storage location can be understood as the location used to store the resource attributes corresponding to the memory object to be replaced. During the editing process of the resource to be replaced, editing information can be recorded and stored, with this storage location serving as the first storage location. After reusing the resource attributes to the target memory object, a mapping relationship between the target memory object and the resource attributes can be established to determine the association between the resource attributes and the target memory object. Alternatively, the resource attributes can be stored in a second storage location corresponding to the target memory object. In other words, the second storage location is the location where the resource attributes corresponding to the target memory object are stored.
[0068] Specifically, after creating the target memory object, the first storage location corresponding to the resource attributes of the memory object to be replaced can be determined, and the resource attributes of the memory object to be replaced can be retrieved from the first storage location. Furthermore, the resource attributes are stored in a second storage location corresponding to the target memory object, and the resource attributes are reused.
[0069] In this embodiment, resource attributes include the editing information of the resource to be replaced, and the currently used editing information. That is, the resource to be replaced can be edited multiple times, and the final editing information used by the resource to be replaced will be used as the resource attribute. The editing information may include the number of bytes occupied by the resource to be replaced, its size, etc.
[0070] S250, Based on the target memory address of the target memory object and the first memory address of the memory object to be replaced, create a replacement sub-event in the resource replacement event; and based on the traversal sub-event in the resource replacement event creation.
[0071] It should be noted that after importing the target resource into the editor, a target memory object corresponding to the target resource can be created. This target memory object mainly includes two aspects: a memory address and the specific content corresponding to that memory address. The memory address can be determined based on the import information of the target resource. The specific content can be the content information of the target resource.
[0072] To facilitate the identification of the memory object to be replaced and the target memory object in a resource replacement event, a data pair can be constructed based on the target memory object and the memory object to be replaced, and then the replacement sub-event in the resource replacement event can be determined based on the data pair.
[0073] In this data pair, to clearly identify the memory object to be replaced and the target memory object, the first position represents the memory object to be replaced, and the second position represents the target memory object. It should also be noted that the target memory object and the memory object to be replaced are represented by memory addresses.
[0074] This can be understood as follows: both the target memory object and the memory object to be replaced are stored in arrays, one representing the memory address and the other representing the actual content of the resource. When generating a replacement sub-event, the first memory address of the memory object to be replaced can be entered at the beginning of the sub-event, and the target memory address of the target memory object can be entered at the end. That is, the first memory address and the target memory address are used as indices to retrieve the corresponding resource for replacement.
[0075] It should also be noted that when performing resource replacement, you can iterate through all resource files and functional modules associated with the project, or you can set which resource files and functional modules to be traversed according to actual needs. Regardless of the method, you can create a traversal sub-event within the resource replacement event to traverse the corresponding resource files and / or functional modules based on the traversal sub-event.
[0076] Specifically, after assigning the resource attributes of the memory object to be replaced to the target memory object, a replacement sub-event of the resource replacement event can be created based on the first memory address of the memory object to be replaced and the target memory address of the target memory object. That is, a replacement data pair is established based on the first memory address and the target memory address to retrieve the corresponding resource for replacement based on the memory address. At the same time, a traversal sub-event in the resource replacement event can be created to traverse resources based on the traversal sub-event, and then perform resource replacement.
[0077] S260. Replace the resource to be replaced in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0078] In this embodiment of the disclosure, the method of performing resource replacement based on resource replacement events may be as follows: based on the memory object to be replaced in the traversal sub-event and the replacement sub-event, the at least one resource file and / or functional module are traversed sequentially, so that when the memory object to be replaced is included in the at least one resource file and / or functional module, the corresponding target resource is retrieved based on the target memory address in the replacement sub-event, and the resource to be replaced is replaced with the target resource.
[0079] This can be understood as follows: based on the traversal sub-events in the resource replacement event, at least one resource file and / or functional module is traversed sequentially. The system then determines whether the memory object to be replaced is present in at least one resource file and / or functional module based on the first memory address of the memory object to be replaced corresponding to the replacement sub-event in the resource replacement event. If so, the target resource is called based on the target memory address in the replacement sub-event, and the resource to be replaced is replaced with the target resource. In this case, the target resource reuses the resource attributes of the resource to be replaced; that is, the target resource is adapted to the project, avoiding the user repeatedly editing the same information on the target resource, which would otherwise be inefficient.
[0080] The technical solution of this disclosure, upon receiving a resource replacement request, can create a target memory object based on the imported target resource. Simultaneously, it can assign the resource attributes corresponding to the memory object to be replaced to the target memory object, thus reusing the resource attributes corresponding to the edited memory object to be replaced. Furthermore, it replaces all resource files and the resources to be replaced used in functional modules based on the target memory object. This solves the problem in the prior art where, when an edited or currently edited resource (i.e., the resource to be replaced) needs to be replaced, the user must first delete all edited or currently edited resources in all resource files or controls, and then re-import the new target resource and edit it. This involves repeatedly performing all editing operations on the edited or currently edited resource, resulting in low editing efficiency and high time costs. This solution achieves automated replacement of the resource to be replaced based on the target resource, thus improving resource replacement efficiency. Moreover, the resource attributes used in the edited or currently edited resource are edited according to corresponding rules or requirements. Therefore, by reusing all resource attributes of the resource to be replaced in the target resource, the effect of efficient resource attribute editing is achieved.
[0081] Based on the above technical solution, after the resource replacement is completed, in order to maximize the use of memory control or disk control, the target resource and the resource to be replaced can be deleted from the disk.
[0082] In this embodiment of the disclosure, the method further includes: determining the target cache locations of the resource to be replaced and the target resource based on the mapping relationship between the resource cache location and the memory object address, the first memory address of the memory object to be replaced, and the target memory address of the target memory object; and deleting the target resource and the resource to be replaced from the target cache location.
[0083] In this context, the resource cache location can be understood as the storage location on disk for resources edited in the editor. The memory address, on the other hand, is the storage location in memory within the editor. A mapping relationship can be established between resource cache locations and memory addresses to facilitate resource tracking.
[0084] This can be understood as follows: A mapping table can be pre-established, storing the correspondence between memory addresses, resource cache locations, and resource identifiers. After importing each resource to be edited from disk into the editor and creating the corresponding memory objects, the memory addresses, resource cache locations, and resource identifiers can be filled into the mapping table accordingly. After resource replacement is detected, the target cache locations of the resource to be replaced and the target resource on disk can be determined based on the mapping relationship, the first memory address, and the target memory address. The resource to be replaced and the target resource stored at the target cache location are then deleted to improve disk space utilization.
[0085] Based on the above technical solution, the method further includes:
[0086] When it is detected that a target memory object is created based on the imported target resource, the correspondence between the target memory address of the target memory object and the resource cache location of the target resource is updated to the mapping table.
[0087] This can be understood as follows: after detecting the import of the target resource into the editor and creating the target memory object, the memory address of the target memory object and the resource cache location can be determined. Storing the target memory address and resource cache location in a mapping table has the advantage of facilitating the deletion of corresponding resources during subsequent resource replacements, thus improving the automation and efficiency of resource processing.
[0088] Figure 3 This is a schematic flowchart of a resource processing method provided in this disclosure. As an optional embodiment of the above embodiments, the resource to be replaced can be a first image, and the target resource can be a second image. The following will combine... Figure 3 The present disclosure provides an example of the methods provided by the embodiments, wherein the same or corresponding technical terms as those in the above embodiments are not repeated in this embodiment.
[0089] like Figure 3 As shown, in editor software that processes various resource materials, if you need to replace a material after editing it or during the editing process, you can click to select the first image to be replaced in the editor. That is, the first image is the resource to be replaced. After the selection is complete, you can select the second image, which is the target resource. Next, create a temporary directory (temp directory) in the project directory corresponding to the project. This temporary directory can store the second image. You can copy the second image to the temporary directory. Alternatively, after creating the temporary directory, select the second image and copy it to the temporary directory.
[0090] Continue to see Figure 3After the temporary directory is created, the second image can be imported into the editor. That is, the second image is imported as the target resource into the editor. Simultaneously, a target memory object corresponding to the target resource is created. This target memory object can include the target memory address key and the corresponding resource content value. The resource attributes corresponding to the memory object to be replaced are retrieved and reused on the target memory object. In other words, the memory object to be replaced is used as the old memory object, and the target memory object is used as the new object. That is, the modified attributes of the old memory object, i.e., the currently used resource attributes, are copied to the new object for use; this is resource attribute reuse. After resource attribute reuse is complete, a replacement event, i.e., a resource replacement event, can be created. The memory addresses of the memory object to be replaced and the target memory object are used as indices in the data pair. Furthermore, traversal sub-events can be generated to traverse all functional modules or at least one resource file based on the traversal sub-events to determine whether the resource file or functional module contains the resource to be replaced. This could be achieved as follows: After the current functional module receives a resource replacement event, it can read the old and new objects from the event and determine whether the old object is present in the current module. If so, it uses the target memory address of the new object as an index to find the target resource and replaces the resource to be replaced based on the target resource. When all resource files or functional modules have been traversed, the resource replacement is considered complete, and a message indicating completion can be displayed.
[0091] The technical solution of this disclosure embodiment, upon receiving a resource replacement request, can create a target memory object based on the imported target resource. Simultaneously, it can assign the resource attributes corresponding to the memory object to be replaced to the target memory object, that is, reuse the resource attributes corresponding to the edited memory object to be replaced, and replace all resource files and the resources to be replaced used in functional modules based on the target memory object. This solves the problem in the prior art that when resources are replaced, new resources need to be edited again, resulting in high costs and low efficiency. It achieves the technical effect of reusing the resource attributes of the resource to be replaced during resource replacement, reducing resource editing costs and labor costs, and improving resource editing efficiency.
[0092] Figure 4 This is a schematic diagram of a resource processing device structure provided in an embodiment of this disclosure, as shown below. Figure 4 As shown, the device includes: a memory object creation module 310, a resource attribute reuse module 320, and a resource replacement module 330.
[0093] The memory object creation module 310 is used to create a target memory object based on the imported target resource in response to a resource replacement operation; the resource attribute reuse module 320 is used to retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced; the resource replacement module 330 is used to create a resource replacement event based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0094] Based on the above technical solution, the device further includes:
[0095] The module for determining the object to be replaced is used to determine the memory object to be replaced in response to the first triggering operation.
[0096] The target resource creation module is used to import the triggered selected target resource into the target directory, so that when a resource replacement operation is performed, the target resource is imported from the target directory to create the target memory object based on the target resource.
[0097] Based on the above technical solutions, the resource attribute reuse module is further configured to retrieve the resource attribute corresponding to the memory object to be replaced from the first storage location, and associate the resource attribute with the target memory object so that the target memory object reuses the resource attribute; wherein, the resource attribute includes editing information that has been edited for the resource to be replaced and is currently in use.
[0098] Based on the above technical solutions, the resource replacement module includes:
[0099] The first sub-event determination unit is configured to create a replacement sub-event in the resource replacement event based on the target memory address of the target memory object and the first memory address of the memory of the memory object to be replaced; and...
[0100] The second sub-event determination unit is used to determine sub-events based on the creation of the resource replacement event.
[0101] Based on the above technical solutions, the resource replacement module is further configured to sequentially traverse the at least one resource file and / or functional module based on the memory object to be replaced in the traversal sub-event and the replacement sub-event, so that when the at least one resource file and / or functional module includes the memory object to be replaced, the corresponding target resource is retrieved based on the target memory address in the replacement sub-event, and the resource to be replaced is replaced with the target resource.
[0102] Based on the above technical solutions, the device further includes:
[0103] The cache location determination module is used to determine the target cache locations of the resource to be replaced and the target resource based on the mapping relationship between the resource cache location and the memory object address, the first memory address of the memory object to be replaced, and the target memory address of the target memory object.
[0104] The resource deletion module is used to delete the target resource and the resource to be replaced from the target cache location.
[0105] Based on the above technical solutions, the device further includes: a data update module, used to update the correspondence between the target memory address of the target memory object and the resource cache location of the target resource to the mapping table when it is detected that a target memory object is created based on the imported target resource.
[0106] The technical solution of this disclosure, upon receiving a resource replacement request, can create a target memory object based on the imported target resource. Simultaneously, it can assign the resource attributes corresponding to the memory object to be replaced to the target memory object, thus reusing the resource attributes corresponding to the edited memory object to be replaced. Furthermore, it replaces all resource files and the resources to be replaced used in functional modules based on the target memory object. This solves the problem in the prior art where, when an edited or currently edited resource (i.e., the resource to be replaced) needs to be replaced, the user must first delete all edited or currently edited resources in all resource files or controls, and then re-import the new target resource and edit it. This involves repeatedly performing all editing operations on the edited or currently edited resource, resulting in low editing efficiency and high time costs. This solution achieves automated replacement of the resource to be replaced based on the target resource, thus improving resource replacement efficiency. Moreover, the resource attributes used in the edited or currently edited resource are edited according to corresponding rules or requirements. Therefore, by reusing all resource attributes of the resource to be replaced in the target resource, the effect of efficient resource attribute editing is achieved. The resource processing apparatus provided in this disclosure can execute the resource processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0107] It is worth noting that the various units and functional modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 5It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 5 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0109] like Figure 5 As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An edit / output (I / O) interface 505 is also connected to bus 504.
[0110] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0111] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0112] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0113] The electronic device provided in this embodiment and the resource processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0114] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the resource processing method provided in the above embodiments.
[0115] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0116] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0117] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0118] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to:
[0119] In response to a resource replacement operation, a target memory object is created based on the imported target resource;
[0120] Retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced;
[0121] A resource replacement event is created based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0122] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a functional module, program segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0124] According to one or more embodiments of this disclosure, [Example 1] provides a resource processing method applied in an editor, the method comprising:
[0125] In response to a resource replacement operation, a target memory object is created based on the imported target resource;
[0126] Retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced;
[0127] A resource replacement event is created based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0128] According to one or more embodiments of this disclosure, [Example 2] provides a resource processing method, the method comprising:
[0129] Optionally, before creating the target memory object based on the imported target resource, the method further includes:
[0130] In response to the first trigger operation, determine the memory object to be replaced;
[0131] The selected target resource is imported into the target directory so that, in response to a resource replacement operation, the target resource is imported from the target directory to create the target memory object based on the target resource.
[0132] According to one or more embodiments of this disclosure, [Example 3] provides a resource processing method, the method comprising:
[0133] Optionally, retrieving the resource attributes corresponding to the memory object to be replaced and assigning them to the target memory object includes:
[0134] Retrieve the resource attributes corresponding to the memory object to be replaced from the first storage location, and associate the resource attributes with the target memory object so that the target memory object can reuse the resource attributes;
[0135] The resource attributes include the editing information that has been edited for the resource to be replaced and is currently in use.
[0136] According to one or more embodiments of this disclosure, [Example 4] provides a resource processing method, the method comprising:
[0137] Optionally, creating a resource replacement event based on the target memory object and the memory object to be replaced includes:
[0138] Based on the target memory address of the target memory object and the first memory address of the memory object to be replaced, a replacement sub-event is created in the resource replacement event; and...
[0139] Based on the traversal of sub-events in the creation of the resource replacement event.
[0140] According to one or more embodiments of this disclosure, [Example 5] provides a resource processing method, which further includes:
[0141] Optionally, replacing the resource to be replaced in at least one resource file and / or functional module with the target resource based on the resource replacement event includes:
[0142] Based on the memory object to be replaced in the traversal sub-event and the replacement sub-event, the at least one resource file and / or functional module are traversed sequentially. When the memory object to be replaced is included in the at least one resource file and / or functional module, the corresponding target resource is retrieved based on the target memory address in the replacement sub-event, and the memory object to be replaced is replaced with the target resource.
[0143] According to one or more embodiments of this disclosure, [Example Six] provides a resource processing method, which further includes:
[0144] Optionally, the target cache locations of the resource to be replaced and the target resource are determined based on the mapping relationship between the resource cache location and the memory object address, the first memory address of the memory object to be replaced, and the target memory address of the target memory object.
[0145] Delete the target resource and the resource to be replaced from the target cache location.
[0146] According to one or more embodiments of this disclosure, [Example Seven] provides a resource processing method, which further includes:
[0147] Optionally, when it is detected that a target memory object is created based on the imported target resource, the correspondence between the target memory address of the target memory object and the resource cache location of the target resource is updated to the mapping table.
[0148] According to one or more embodiments of this disclosure, [Example Eight] provides a resource processing apparatus, characterized in that it is configured in an editor, the apparatus comprising:
[0149] The memory object creation module is used to create a target memory object based on the imported target resource in response to a resource replacement operation.
[0150] The resource attribute reuse module is used to retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced;
[0151] The resource replacement module is used to create a resource replacement event based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
[0152] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0153] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0154] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A resource processing method, characterized in that, When applied in an editor, the method includes: In response to a resource replacement operation, a target memory object is created based on the imported target resource; Retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced; A resource replacement event is created based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
2. The method according to claim 1, characterized in that, Before creating the target memory object based on the imported target resource, the method further includes: In response to the first trigger operation, determine the memory object to be replaced; The selected target resource is imported into the target directory so that, in response to a resource replacement operation, the target resource is imported from the target directory to create the target memory object based on the target resource.
3. The method according to claim 1, characterized in that, The step of retrieving the resource attributes corresponding to the memory object to be replaced and assigning them to the target memory object includes: Retrieve the resource attributes corresponding to the memory object to be replaced from the first storage location, and associate the resource attributes with the target memory object so that the target memory object can reuse the resource attributes; The resource attributes include the editing information that has been edited for the resource to be replaced and is currently in use.
4. The method according to claim 1, characterized in that, The creation of a resource replacement event based on the target memory object and the memory object to be replaced includes: Based on the target memory address of the target memory object and the first memory address of the memory object to be replaced, a replacement sub-event is created in the resource replacement event; and... Based on the traversal of sub-events in the creation of the resource replacement event.
5. The method according to claim 4, characterized in that, The step of replacing the resource to be replaced in at least one resource file and / or functional module with the target resource based on the resource replacement event includes: Based on the memory object to be replaced in the traversal sub-event and the replacement sub-event, the at least one resource file and / or functional module are traversed sequentially. When the memory object to be replaced is included in the at least one resource file and / or functional module, the corresponding target resource is retrieved based on the target memory address in the replacement sub-event, and the memory object to be replaced is replaced with the target resource.
6. The method according to claim 1, characterized in that, The method further includes: Based on the mapping relationship between resource cache location and memory object address, the first memory address of the memory object to be replaced, and the target memory address of the target memory object, the target cache locations of the resource to be replaced and the target resource are determined respectively. Delete the target resource and the resource to be replaced from the target cache location.
7. The method according to claim 6, characterized in that, Also includes: When it is detected that a target memory object is created based on the imported target resource, the correspondence between the target memory address of the target memory object and the resource cache location of the target resource is updated to the mapping table.
8. A resource processing device, characterized in that, Configured in an editor, the device includes: The memory object creation module is used to create a target memory object based on the imported target resource in response to a resource replacement operation. The resource attribute reuse module is used to retrieve the resource attributes corresponding to the memory object to be replaced and assign them to the target memory object, wherein the memory object to be replaced corresponds to the resource to be replaced; The resource replacement module is used to create a resource replacement event based on the target memory object and the memory object to be replaced, so as to replace the resource to be replaced used in at least one resource file and / or functional module with the target resource based on the resource replacement event.
9. An electronic device, characterized in that, The electronic device includes: one or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the resource processing method as described in any one of claims 1-7.
10. A storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform the resource processing method as described in any one of claims 1-7.