Object processing method and device, electronic equipment and storage medium
By responding to the delete trigger operation in object processing, serializing and deleting the target object, the systemic defects and memory usage problems caused by the implicit survival of the object are solved, real deletion of the object and the release of memory resources are achieved, and the undo/redo logic is simplified.
Patent Information
- Application Number
- CN202311078308.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, objects implicitly survive when undoing/redoing operations, resulting in the existence of binding/dependence relationships, systemic defects and memory usage problems, and the undoing/redoing logic is complex and redundant.
By responding to the delete trigger operation, the target object is obtained, its object attribute data and data association relationship is determined, serialized and stored, the data association relationship is undata association and the target object is deleted, ensuring the real deletion of the object and the release of memory resources.
Realizes the real deletion of objects, avoids the risk of object free and memory resource usage, simplifies the undo/redo logic, and improves the efficiency and reliability of object processing.
Smart Images

Figure CN119513072A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer application technology, and more particularly to an object processing method, device, electronic device, and storage medium. Background Art
[0002] In editor software, the undo / redo function is a very common function and one of the key functions to provide user experience and work efficiency.
[0003] Since each editing operation may involve the creation / deletion of different data objects, in order to ensure the consistency of object data under undo / redo operations, in related technologies, the object state during the undo / redo process is managed based on technologies such as closure mechanisms and object references to ensure that the object is not actually deleted when the deletion action occurs, so that the object survives implicitly. Furthermore, when the undo / redo action occurs, the association between the object and the data is re-established, and the object state is restored, thereby ensuring data consistency.
[0004] However, there are many problems with this way of handling objects. First, since the object is not actually destroyed, some bindings / dependencies may still exist, and there are systemic defects. For example, existing event listeners may still exist, and related logic is still executed after the event is triggered. Secondly, the object still exists in the memory, and the object can still be accessed through the address of the object. There are unpredictable risks, and there is unnecessary memory usage, resulting in consumption of memory resources. At the same time, the complex relationships or data states between objects must also be specially processed again, and similar processing must be done for the undo / redo behaviors of object copy and paste, and the undo / redo logic is scattered, complex and redundant. Summary of the invention
[0005] The present disclosure provides an object processing method, device, electronic device and storage medium to achieve real deletion of a target object.
[0006] In a first aspect, an embodiment of the present disclosure provides an object processing method, the method comprising:
[0007] In response to the deletion trigger operation, obtaining a target object to be deleted;
[0008] Determine object attribute data and data association relationships corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object that includes the target object;
[0009] Serializing the object attribute data to obtain serialized object data, and storing the serialized object data;
[0010] The data association relationship is released, and the target object is deleted.
[0011] In a second aspect, an embodiment of the present disclosure further provides an object processing device, the device comprising:
[0012] A deletion trigger module, used for obtaining a target object to be deleted in response to a deletion trigger operation;
[0013] A data determination module, used to determine object attribute data and a data association relationship corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object containing the target object;
[0014] A serialization module, used for serializing the object attribute data to obtain serialized object data and storing the serialized object data;
[0015] The object deletion module is used to release the data association relationship and delete the target object.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the object processing method as described in any one of the embodiments of the present disclosure.
[0020] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the object processing method as described in any one of the embodiments of the present disclosure.
[0021] The technical solution of the disclosed embodiment, by first responding to the deletion trigger operation, obtains the target object to be deleted, can accurately obtain the target object to be deleted through user operation, and accurately match the user's needs. Then, determine the object attribute data and data association relationship corresponding to the target object, wherein the data association relationship is the reference relationship between the target object and the superior object containing the target object, so as to obtain the key information of the target object. Then, the object attribute data is serialized to obtain serialized object data, and the serialized object data is stored so that the object attribute data can be reused when the deletion is undone. Finally, the data association relationship is released, and the target object is deleted. The reference relationship of the object is processed by the system mechanism itself to ensure the real deletion of the object, release the memory resources occupied by the object, and ensure the integrity of the object life cycle. The technical problems of object freedom risk, memory resource occupation and complex and redundant undo / redo logic dispersion caused by the implicit survival of the object in the related technology are solved, and the target object is truly deleted, avoiding the risk of freedom of the target object, and providing data support for the rapid recovery of the target object. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent 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.
[0023] Figure 1 A flowchart of an object processing method provided by an embodiment of the present disclosure;
[0024] Figure 2 A schematic diagram of an entity-component-system (ECS) architecture provided in an embodiment of the present disclosure and applicable to an object processing method provided in an embodiment of the present disclosure;
[0025] Figure 3 A flowchart of another object processing method provided by an embodiment of the present disclosure
[0026] Figure 4 A schematic diagram of the structure of an object processing device provided by an embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part 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". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0035] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0036] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0038] It is understandable 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 relevant provisions.
[0039] Figure 1 A flow chart of an object processing method provided in an embodiment of the present disclosure is applicable to the situation where an object is deleted and the object is restored after deletion. The method can be executed by an object processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0040] like Figure 1 As shown, the method of this embodiment may specifically include:
[0041] S110. In response to a deletion trigger operation, obtain a target object to be deleted.
[0042] The delete trigger operation can be understood as an operation for executing the delete operation on the object to be deleted after being triggered. The target object can be understood as the operation object of the delete trigger operation, and can also be understood as the object to be executed. In the embodiment of the present disclosure, the object is a computer language with a computer as the carrier. The object is an abstraction of objective things, a specific instance of a class, and a variable of the class type.
[0043] Take the ECS architecture as an example. Figure 2As shown, the ECS architecture may include: scene pairs Scene, entity objects Entity and component objects Component. A scene can contain multiple Entities and corresponding Components and Systems. The included Entities can be identified by the m_entityList attribute of Scene. Entity is the basic unit of Scene, representing an independent individual. In the game field, it can be a player character, enemy, prop or other object. Entity can contain multiple Component objects. The inclusion relationship can be specifically reflected by the m_components attribute, and it references the Scene object. The reference relationship is reflected by the m_scene_weakref attribute. The editor object corresponding to the Entity engine object is ExtraDataEntity, which is used to manage the data maintenance of Entity in the editing state and owns the Entity object. Component is one of the basic components of Entity, which defines the special properties, behaviors or functions of Entity and references the Entity object. The reference relationship is reflected by the attributes of the "m_attachedEntity" field in the Entity object. The corresponding editor object is ExtraDataComponent, which is used to manage the data maintenance of Component in the editing state and owns the Component object. Scene Scene / Entity Entity / Component Component. Among them, ExtraDataEntity and ExtraDataComponent both inherit from the ExtraData base class, and ExtraData defines the common properties of the engine object in editing state.
[0044] Optionally, the target object may be an engine object (eg, ) and an editor object (eg, an ExtraDataXXX object corresponding to Scene / Entity / Component) under the ECS architecture.
[0045] In the embodiments of the present disclosure, there may be multiple ways to input a delete trigger operation. Exemplarily, the delete trigger operation may be a control trigger operation acting on a preset delete control, or an action input trigger operation based on an image acquisition device capturing a preset delete action, or an instruction input trigger operation based on a preset voice instruction for deleting a target object captured by a sound acquisition device, etc. Among them, the preset delete control may be a physical control or a virtual control displayed on the interface. The control trigger operation may be a click operation, a press operation, a slide operation, etc.
[0046] As an optional implementation mode of the embodiment of the present disclosure, a target interface is displayed, wherein the target interface displays at least one candidate object; in response to an object selection operation input for the candidate object, a selected candidate object is determined; in response to a deletion trigger operation, the selected candidate object is obtained as a target object to be deleted.
[0047] S120: Determine object attribute data and data association relationships corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object that includes the target object.
[0048] In the embodiments of the present disclosure, object attribute data can be understood as attribute data used to identify the target object, such as object type and other attribute data in addition to the object type. The object attribute data corresponding to different target objects are often different. It is understandable that the object attribute data specifically includes which data can be set according to actual needs, which can be data corresponding to all fields or part of the fields of the target object, and the content of the object attribute data is not limited here.
[0049] The parent object of the target object may be the nearest level object including the target object. Exemplarily, when the target object is a component, its parent object is an entity including the component. When the target object is an entity, its parent object is a scene including the entity.
[0050] Optionally, the data association relationship corresponding to the target object is determined based on a preset field for indicating the parent object of the target object. For example, when the target object is a component, the preset field for indicating the parent object of the target object may be "attachEntity" or the like.
[0051] Before deleting the target object, a judgment on the feasibility of deleting the target object may be added. Optionally, before determining the object attribute data and data association relationship corresponding to the target object, it also includes: determining the target execution state corresponding to the deletion trigger operation, wherein the target execution state includes an executable state and a prohibited execution state. Furthermore, when the target execution state is an executable state, the object attribute data and data association relationship corresponding to the target object are determined. The advantage of such a setting is that the target object can be deleted when deletion is allowed, so that the deletion process of the target object is more standardized.
[0052] Optionally, determining the target execution state corresponding to the deletion trigger operation includes: determining the target execution state corresponding to the deletion trigger operation based on preset execution verification conditions, wherein the execution verification conditions include at least one of whether there is a dependency relationship between the target object and other objects, whether the object inputting the deletion trigger operation has deletion operation permission, and whether the display area of the target object is an area with open deletion operation permission.
[0053] Exemplarily, when there is a dependency relationship between the target object and other objects, the object inputting the deletion trigger operation does not have the deletion operation permission, or the display area of the target object is an area where the deletion operation permission is not open, the target execution state corresponding to the deletion trigger operation is determined to be a prohibited execution state. Otherwise, the target execution state corresponding to the deletion trigger operation is determined to be an executable state.
[0054] Optionally, when the target execution state is a prohibited execution state, a prompt message is generated and displayed. The prompt message may be in many forms, such as voice, text, picture, or video. The content of the prompt message may include the reason and / or result that the target object cannot be deleted. The advantage of such a setting is that the user can be prompted that the target object cannot be deleted, so that the user can understand the execution status of the deletion operation in a timely manner.
[0055] S130: Serialize the object attribute data to obtain serialized object data, and store the serialized object data.
[0056] Serialization is the process of converting object attribute data into a form that can be stored or transmitted. Serialized data is generally data with a preset data format or a preset data structure. Exemplarily, the serialized data can be Json data or binary data, etc.
[0057] Optionally, a predefined object serialization interface corresponding to the target object is called to serialize the object attribute data of the target object to obtain serialized object data. The advantage of such a setting is that the standardized conversion of the object attribute data can be achieved, and the data format or data structure of the serialized object data is relatively unified, which is convenient for storage, and the storage of serialized object data occupies less storage space than the storage of object attribute data, that is, the memory usage is reduced.
[0058] During serialization, the object writes its current state to a temporary or persistent storage area. Later, the object can be recreated by reading or deserializing the state of the object from the storage area. In the disclosed embodiment, serialized object data can be stored based on a preset storage path. The preset storage path can be a storage path corresponding to the serialized data of the target object that is pre-set according to actual needs, and its specific storage location is not limited here. It is understandable that the serialized object data is stored in association with the target object. For example, the serialized object data of the target object can be associated with the object identifier of the target object, etc.
[0059] S140: Release the data association relationship and delete the target object.
[0060] Specifically, releasing the data association relationship may include: determining the parent object including the target object, and deleting the record corresponding to the target object in the reference relationship list recording the parent object.
[0061] The reference relationship list is an object list that records all subordinate objects contained in the superior object.
[0062] Optionally, determining the parent object including the target object includes: searching for a preset field in an associated field of the target object for indicating the parent object of the target object, and determining the parent object including the target object based on a parameter value corresponding to the preset field.
[0063] Optionally, before deleting the record corresponding to the target object in the reference relationship list recording the parent object, the method further includes: querying a preset identification field corresponding to the reference relationship list in the associated field of the parent object to obtain the reference relationship list recording the parent object based on the parameter corresponding to the identification field. For example, when the parent object is an entity, the identification field corresponding to the reference relationship list may be "entityList" or the like.
[0064] After obtaining the reference relationship list having records of the superior object, the record corresponding to the target object in the reference relationship list is deleted, thereby releasing the data association relationship corresponding to the target object.
[0065] As mentioned above, the target object may include an engine object and an editor object. Specifically, deleting the target object may include: when the target object is a component, deleting the engine object and the editor object corresponding to the target object. In other words, when the Component is deleted, the reference relationship of the Entity is released, and the corresponding ExtraDataComponent object is deleted at the same time. The advantage of this setting is that the component object can be deleted quickly and completely, avoiding the risk of the component object being free, and releasing the memory resources occupied by the component.
[0066] Optionally, when the target object is an entity, deleting the target object includes: determining the sub-object to be deleted in the target object based on the data structure of the target object, wherein the sub-object to be deleted includes at least one sub-entity and / or component mounted under the entity, and the sub-entity includes a component mounted under the sub-entity; starting from the last level of sub-object to be deleted, a depth-first traversal method is used to delete the engine objects and editor objects corresponding to the sub-object to be deleted one by one. Similarly, when the Entity is deleted, the reference relationship of the Scene is released and the attached Component is deleted, and the corresponding ExtraXXX object is deleted at the same time. The advantage of such a setting is that the entity object can be parsed based on the data structure of the entity object, and the entity object can be deleted step by step in a hierarchical manner to achieve complete deletion of the entity object, avoid the risk of the entity object being free, release the memory resources occupied by the entity object, and ensure the smooth progress of the entity object deletion process.
[0067] The technical solution of the disclosed embodiment, by first responding to the deletion trigger operation, obtains the target object to be deleted, can accurately obtain the target object to be deleted through user operation, and accurately match the user's needs. Then, determine the object attribute data and data association relationship corresponding to the target object, wherein the data association relationship is the reference relationship between the target object and the superior object containing the target object, so as to obtain the key information of the target object. Then, the object attribute data is serialized to obtain serialized object data, and the serialized object data is stored so that the object attribute data can be reused when the deletion is undone. Finally, the data association relationship is released, and the target object is deleted. The reference relationship of the object is processed by the system mechanism itself to ensure the real deletion of the object, release the memory resources occupied by the object, and ensure the integrity of the object life cycle. The technical problems of object freedom risk, memory resource occupation and complex and redundant undo / redo logic dispersion caused by the implicit survival of the object in the related technology are solved, and the target object is truly deleted, avoiding the risk of freedom of the target object, and providing data support for the rapid recovery of the target object.
[0068] Figure 3 A flowchart of another object processing method provided by an embodiment of the present disclosure. The technical solution of this embodiment further refines the method for recovering a target object after deletion based on the above-mentioned embodiment. Optionally, after deleting the target object, it also includes: in response to an undo delete trigger operation input for the target object, deserializing the serialized object data to obtain object attribute data, and creating a target object based on the object attribute data. For specific implementation methods, please refer to the description of this embodiment. Among them, technical features that are the same or similar to those of the above-mentioned embodiments are not repeated here.
[0069] like Figure 3 As shown, the method of this embodiment may specifically include:
[0070] S310: In response to a deletion trigger operation, obtain a target object to be deleted.
[0071] S320: Determine object attribute data and data association relationships corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object that includes the target object.
[0072] S330: Serialize the object attribute data to obtain serialized object data, and store the serialized object data.
[0073] S340: Release the data association relationship and delete the target object.
[0074] S350: In response to an undo delete trigger operation input for the target object, deserialize the serialized object data to obtain object attribute data, and create the target object based on the object attribute data.
[0075] Among them, the undo delete trigger operation can be understood as an operation used to restore the deleted target object after being triggered. Similarly, there can be multiple input methods for the undo delete trigger operation. Exemplarily, the delete trigger operation can be a control trigger operation acting on a preset undo delete control, or an action input trigger operation based on an image acquisition device collecting a preset undo delete action, or an instruction input trigger operation based on a sound acquisition device collecting a preset voice instruction for undoing the deletion of the target object, etc. Among them, the undo delete control can be a physical control or a virtual control displayed on the interface. The control trigger operation can be a click operation, a press operation, a sliding operation, etc.
[0076] In the embodiment of the present disclosure, a predefined deserialization interface corresponding to the target object may be called to deserialize the serialized object data to obtain the object attribute data.
[0077] As mentioned above, the object attribute data may include object type data and other attribute data. Specifically, creating a target object based on the object attribute data may include: creating an initial object corresponding to the target object based on the object type data, wherein the attribute data in the initial object is default attribute data; determining the parent object corresponding to the initial object, and establishing a data association relationship between the initial object and the parent object; and updating the default attribute data in the initial object based on other attribute data to obtain the target object.
[0078] It is understandable that the initial objects corresponding to target objects of different object types are often different. The initial object can be understood as an object generated based on the common fields of objects under the object type.
[0079] The superior object corresponding to the initial object is the superior object corresponding to the target object. Specifically, the superior object corresponding to the initial object can be determined based on the data in the object attribute data indicating the superior object corresponding to the target object.
[0080] The data association relationship between the initial object and the superior object is established by adding a record corresponding to the initial object to a reference relationship list of the superior object.
[0081] The default attribute data in the initial object is updated based on other attribute data. Specifically, the other attribute data may be copied to the initial object to overwrite or replace the default attribute data in the initial object, thereby obtaining the target object.
[0082] As mentioned above, an entity may include sub-entities and / or components, and a sub-entity may also include its corresponding sub-entities and / or components of the next level. The method of creating a target object based on object attribute data may be to create it level by level using a breadth-first traversal method based on the object attribute data. Specifically, when the target object is an entity, starting from the first-level sub-object to be created (root node) of the entity, a breadth-first traversal method is used to create engine objects and editor objects corresponding to the sub-object to be created level by level. The sub-object to be created can be understood as the sub-entities and / or components contained in the entity.
[0083] The technical solution of the disclosed embodiment, after receiving an undo delete trigger operation input for a target object, can obtain key data of the target object by deserializing the serialized object data to obtain object attribute data, create a target object based on the object attribute data, re-establish the association relationship between the object and the data, restore the object state, ensure data consistency, and be able to simply and quickly restore the target object, thereby improving the user experience of object processing.
[0084] Figure 4 A schematic diagram of the structure of an object processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the object processing device includes: a deletion trigger module 410, a data determination module 420, a serialization module and an object deletion module 430.
[0085] Among them, the deletion trigger module 410 is used to obtain the target object to be deleted in response to the deletion trigger operation; the data determination module 420 is used to determine the object attribute data and data association relationship corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and the parent object containing the target object; the serialization module 430 is used to serialize the object attribute data to obtain serialized object data and store the serialized object data; the object deletion module 440 is used to release the data association relationship and delete the target object.
[0086] The technical solution of the disclosed embodiment first obtains the target object to be deleted in response to the deletion trigger operation through the deletion trigger module, and can accurately obtain the target object to be deleted through the user operation, accurately matching the user needs. Then, the object attribute data and data association relationship corresponding to the target object are determined by the data determination module, wherein the data association relationship is the reference relationship between the target object and the superior object containing the target object, so as to obtain the key information of the target object. Then, the object attribute data is serialized by the serialization module to obtain the serialized object data, and the serialized object data is stored so that the object attribute data can be reused when the deletion is cancelled. Finally, the data association relationship is released by the object deletion module, and the target object is deleted. The reference relationship of the object is processed based on the logic of the system mechanism itself, so as to ensure the real deletion of the object, release the memory resources occupied by the object, and ensure the integrity of the object life cycle. The technical problems of object free risk, memory resource occupation and complex and redundant undo / redo logic dispersion caused by the implicit survival of the object in the related technology are solved, and the target object is truly deleted, avoiding the free risk of the target object, and providing the beneficial technical effect of data support for the rapid recovery of the target object.
[0087] Based on the above optional technical solutions, optionally, the object deletion module 440 is specifically used to:
[0088] Determine the parent object that contains the target object, and delete the record corresponding to the target object in the reference relationship list that records the parent object, wherein the reference relationship list is an object list that records all subordinate objects contained in the parent object.
[0089] Based on the above optional technical solutions, optionally, the object deletion module 440 is specifically used to:
[0090] When the target object is a component, the engine object and the editor object corresponding to the target object are deleted.
[0091] Based on the above optional technical solutions, optionally, the object deletion module 440 is specifically used to:
[0092] In the case where the target object is an entity, determining a sub-object to be deleted in the target object based on a data structure of the target object, wherein the sub-object to be deleted includes at least one sub-entity and / or component mounted under the entity, and the sub-entity includes a component mounted under the sub-entity;
[0093] Starting from the last level of the to-be-deleted sub-objects, a depth-first traversal method is adopted to delete the engine objects and editor objects corresponding to the to-be-deleted sub-objects one by one.
[0094] Based on the above optional technical solutions, optionally, the object processing device further includes:
[0095] an undo delete trigger module, configured to, after deleting the target object, deserialize the serialized object data in response to an undo delete trigger operation input for the target object to obtain the object attribute data;
[0096] An object creation module is used to create the target object based on the object attribute data.
[0097] Based on the above optional technical solutions, optionally, the object attribute data includes object type data and other attribute data; accordingly, the object creation module includes: an initial object creation unit, a data association establishment unit and a target object generation unit.
[0098] Among them, the initial object creation unit is used to create an initial object corresponding to the target object based on the object type data, wherein the attribute data in the initial object is default attribute data; the data association establishment unit is used to determine the parent object corresponding to the initial object and establish a data association relationship between the initial object and the parent object; the target object generation unit is used to update the default attribute data in the initial object based on the other attribute data to obtain the target object.
[0099] On the basis of the above-mentioned optional technical solutions, optionally, the data determination module 420 includes: an execution state determination unit and an object data acquisition unit.
[0100] Among them, the execution status determination unit is used to determine the target execution status corresponding to the deletion trigger operation, wherein the target execution status includes an executable state and a prohibited execution state; the object data acquisition unit is used to determine the object attribute data and data association relationship corresponding to the target object when the target execution state is an executable state.
[0101] Based on the above optional technical solutions, optionally, the execution state determination unit is specifically used to:
[0102] The target execution state corresponding to the deletion trigger operation is determined based on preset execution verification conditions, wherein the execution verification conditions include at least one of whether there is a dependency relationship between the target object and other objects, whether the operation object that inputs the deletion trigger operation has deletion operation permission, and whether the display area of the target object is an area with open deletion operation permission.
[0103] The object processing device provided in the embodiments of the present disclosure can execute the object processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0104] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0105] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg, Figure 5 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0106] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0107] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0108] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through 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, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0109] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0110] The electronic device provided by the embodiment of the present disclosure and the object processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0111] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the object processing method provided by the above embodiments is implemented.
[0112] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0113] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0114] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0115] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the target object to be deleted in response to the deletion trigger operation; determines the object attribute data and data association relationship corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and the parent object containing the target object; serializes the object attribute data to obtain serialized object data, and stores the serialized object data; releases the data association relationship, and deletes the target object.
[0116] Computer program code for performing the operations of the present disclosure may 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, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0120] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0121] According to one or more embodiments of the present disclosure, [Example 1] provides an object processing method, including:
[0122] In response to the deletion trigger operation, obtaining a target object to be deleted;
[0123] Determine object attribute data and data association relationships corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object that includes the target object;
[0124] Serializing the object attribute data to obtain serialized object data, and storing the serialized object data;
[0125] The data association relationship is released, and the target object is deleted.
[0126] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, further comprising:
[0127] Optionally, the releasing the data association relationship includes:
[0128] Determine the parent object that contains the target object, and delete the record corresponding to the target object in the reference relationship list that records the parent object, wherein the reference relationship list is an object list that records all subordinate objects contained in the parent object.
[0129] According to one or more embodiments of the present disclosure, [Example 3] provides the method of Example 1, further comprising:
[0130] Optionally, deleting the target object includes:
[0131] When the target object is a component, the engine object and the editor object corresponding to the target object are deleted.
[0132] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 1, further comprising:
[0133] Optionally, deleting the target object includes:
[0134] In the case where the target object is an entity, determining a sub-object to be deleted in the target object based on a data structure of the target object, wherein the sub-object to be deleted includes at least one sub-entity and / or component mounted under the entity, and the sub-entity includes a component mounted under the sub-entity;
[0135] Starting from the last level of the to-be-deleted sub-objects, a depth-first traversal method is adopted to delete the engine objects and editor objects corresponding to the to-be-deleted sub-objects one by one.
[0136] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 1, further comprising:
[0137] Optionally, after deleting the target object, the method further includes:
[0138] In response to an undo delete trigger operation input for the target object, the serialized object data is deserialized to obtain the object attribute data, and the target object is created based on the object attribute data.
[0139] According to one or more embodiments of the present disclosure, [Example 6] provides the method of Example 5, further comprising:
[0140] Optionally, the object attribute data includes object type data and other attribute data;
[0141] The step of creating the target object based on the object attribute data comprises:
[0142] Creating an initial object corresponding to the target object based on the object type data, wherein the attribute data in the initial object is default attribute data;
[0143] Determine a superior object corresponding to the initial object, and establish a data association relationship between the initial object and the superior object;
[0144] The default attribute data in the initial object is updated based on the other attribute data to obtain the target object.
[0145] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 1, further comprising:
[0146] Optionally, the determining the object attribute data and the data association relationship corresponding to the target object includes:
[0147] Determine a target execution state corresponding to the deletion trigger operation, wherein the target execution state includes an executable state and a prohibited execution state;
[0148] When the target execution state is an executable state, object attribute data and a data association relationship corresponding to the target object are determined.
[0149] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 7, further comprising:
[0150] Optionally, determining the target execution state corresponding to the deletion trigger operation includes:
[0151] The target execution state corresponding to the deletion trigger operation is determined based on preset execution verification conditions, wherein the execution verification conditions include at least one of whether there is a dependency relationship between the target object and other objects, whether the operation object that inputs the deletion trigger operation has deletion operation permission, and whether the display area of the target object is an area with open deletion operation permission.
[0152] According to one or more embodiments of the present disclosure, [Example 9] provides an object processing device, including:
[0153] A deletion trigger module, used for obtaining a target object to be deleted in response to a deletion trigger operation;
[0154] A data determination module, used to determine object attribute data and a data association relationship corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object containing the target object;
[0155] A serialization module, used for serializing the object attribute data to obtain serialized object data and storing the serialized object data;
[0156] The object deletion module is used to release the data association relationship and delete the target object.
[0157] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0158] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0159] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, 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. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An object processing method, characterized in that: include: In response to the deletion trigger operation, obtaining a target object to be deleted; Determine object attribute data and data association relationships corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object that includes the target object; Serializing the object attribute data to obtain serialized object data, and storing the serialized object data; The data association relationship is released, and the target object is deleted.
2. The object processing method according to claim 1, characterized in that: The releasing of the data association relationship comprises: Determine the parent object that contains the target object, and delete the record corresponding to the target object in the reference relationship list that records the parent object, wherein the reference relationship list is an object list that records all subordinate objects contained in the parent object.
3. The object processing method according to claim 1, characterized in that: The deleting the target object includes: When the target object is a component, the engine object and the editor object corresponding to the target object are deleted.
4. The object processing method according to claim 1, characterized in that: The deleting the target object includes: In the case where the target object is an entity, determining a sub-object to be deleted in the target object based on a data structure of the target object, wherein the sub-object to be deleted includes at least one sub-entity and / or component mounted under the entity, and the sub-entity includes a component mounted under the sub-entity; Starting from the last level of the to-be-deleted sub-objects, a depth-first traversal method is adopted to delete the engine objects and editor objects corresponding to the to-be-deleted sub-objects one by one.
5. The object processing method according to claim 1, characterized in that: After deleting the target object, the method further includes: In response to an undo delete trigger operation input for the target object, the serialized object data is deserialized to obtain the object attribute data, and the target object is created based on the object attribute data.
6. The object processing method according to claim 5, characterized in that: The object attribute data includes object type data and other attribute data; The step of creating the target object based on the object attribute data comprises: Creating an initial object corresponding to the target object based on the object type data, wherein the attribute data in the initial object is default attribute data; Determine a superior object corresponding to the initial object, and establish a data association relationship between the initial object and the superior object; The default attribute data in the initial object is updated based on the other attribute data to obtain the target object.
7. The object processing method according to claim 1, characterized in that: The determining of the object attribute data and the data association relationship corresponding to the target object includes: Determine a target execution state corresponding to the deletion trigger operation, wherein the target execution state includes an executable state and a prohibited execution state; When the target execution state is an executable state, object attribute data and a data association relationship corresponding to the target object are determined.
8. The object processing method according to claim 7, characterized in that: The determining of the target execution state corresponding to the deletion trigger operation includes: The target execution state corresponding to the deletion trigger operation is determined based on preset execution verification conditions, wherein the execution verification conditions include at least one of whether there is a dependency relationship between the target object and other objects, whether the operation object that inputs the deletion trigger operation has deletion operation permission, and whether the display area of the target object is an area with open deletion operation permission.
9. An object processing device, characterized in that: include: A deletion trigger module, used for obtaining a target object to be deleted in response to a deletion trigger operation; A data determination module, used to determine object attribute data and a data association relationship corresponding to the target object, wherein the data association relationship is a reference relationship between the target object and a parent object containing the target object; A serialization module, used for serializing the object attribute data to obtain serialized object data and storing the serialized object data; The object deletion module is used to release the data association relationship and delete the target object.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a 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 object processing method according to any one of claims 1 to 8.
11. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the object processing method according to any one of claims 1 to 8.