Data processing method and device, electronic equipment and storage medium
By obtaining component objects and engine objects when copying components, determining the target storage data and storing it to the clipboard, the memory leakage and data format confusion caused by engine objects in the clipboard is solved, and higher system stability and data are achieved Convenience of maintenance.
Patent Information
- Application Number
- CN202311077172.4
- 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, when copying components, engine objects are stored in the clipboard, resulting in memory leakage or program crashes. The clipboard has a large memory footprint, chaotic data format, and is inconvenient for maintenance.
By responding to the copy trigger operation, obtain the objects to be copied, determine the target components, obtain component objects and engine objects, and determine the target storage data based on these objects, including component object type fields, engine object type fields, component object serialization data and engine object sequence and store the data to the clipboard.
It solves the memory leak or program crash caused by engine coupling, reduces the memory usage caused by copy operations, improves system stability, and makes the data stored in the clipboard more streamlined and clean, making it easier to maintain.
Smart Images

Figure CN119513187A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer technology, and more particularly to a data processing method, device, electronic device, and storage medium. Background Art
[0002] The ECS (Entity-Component-System) architecture is widely used in Internet applications and game development. In the ECS architecture, components are the core elements that constitute entity objects and behaviors. By copying components, it is easy to quickly reuse components, expand existing component functions, and save time in function design and development.
[0003] In the prior art, when copying a component, it is necessary to obtain the attribute data of the component, store the engine object corresponding to the component and the attribute data of the component in the clipboard, so as to complete the copy operation of the component. The shortcomings of the prior art include at least: since the engine object is stored in the clipboard during the copying process, the engine object in the clipboard is easily coupled with the entity engine, causing memory leakage or program crash; and copying the engine object and attribute data to the clipboard causes the clipboard to occupy a large amount of memory, the data format is chaotic, and it is not easy to maintain. Summary of the invention
[0004] The present disclosure provides a data processing method to achieve the purpose of reducing memory usage, improving system stability, and making the data format stored in the clipboard more concise and clean for easy maintenance.
[0005] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:
[0006] In response to a replication trigger operation, obtaining an object to be replicated, and determining a target component corresponding to the object to be replicated;
[0007] For each of the target components, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data;
[0008] The target storage data corresponding to the target component is stored in a clipboard.
[0009] In a second aspect, an embodiment of the present disclosure further provides a data processing device, including:
[0010] A replication operation triggering module, used to obtain an object to be replicated and determine a target component corresponding to the object to be replicated in response to a replication triggering operation;
[0011] a storage data generation module, configured to obtain, for each target component, a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data;
[0012] The clipboard data storage module is used to store the target storage data corresponding to the target component in the clipboard.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a 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 data processing method as described in any one of the embodiments of the present disclosure.
[0017] 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 data processing method as described in any one of the embodiments of the present disclosure.
[0018] The disclosed embodiment obtains the object to be copied and determines the target component corresponding to the object to be copied in response to the copy trigger operation, so as to complete the copy operation of the object to be copied by copying each target component; for each target component, obtains the component object and engine object of the target component, determines the target storage data corresponding to the target component based on the component object and the engine object, so that the target storage data can reflect the characteristics of the component object and the engine object; and completes the copying of the target component by storing the target storage data corresponding to the target component in the clipboard. Since the target storage data includes the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, that is, the engine itself is not stored in the clipboard, the problem of memory leakage or program crash caused by engine coupling is solved, and the memory usage caused by the copy operation is reduced, which is conducive to improving the stability of the system; and the component object type field, the engine object type field, the component object serialization data and the engine object serialization data are stored in the clipboard, so that the data format stored in the clipboard is more concise and clean, which is convenient for maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of the format of the storage data corresponding to the entity to be copied in the clipboard provided in the embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of a replication process of a component to be replicated provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of a pasting process of a component to be copied provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of a copying process of an entity to be copied provided by an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of a pasting process of an entity to be copied provided by an embodiment of the present disclosure;
[0028] Fig. 9 A schematic diagram of the structure of a data processing device provided by an embodiment of the present disclosure;
[0029] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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".
[0035] 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.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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.
[0041] Figure 1 A flow chart of a data processing method provided in an embodiment of the present disclosure is applicable to a situation where an object to be copied in an ECS architecture is copied to a clipboard. The method can be executed by a data 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.
[0042] like Figure 1 As shown, the method of this embodiment may specifically include:
[0043] S110. In response to a replication trigger operation, an object to be replicated is obtained, and a target component corresponding to the object to be replicated is determined.
[0044] The object to be copied may be the object of the copy trigger operation. In this embodiment, when it is detected that the copy trigger operation is triggered, the object of the copy trigger operation is obtained as the object to be copied. Exemplarily, the copy trigger operation may include clicking a "copy" control, inputting a 'copy' voice command, and the like. The object of the "copy" control or voice command is obtained as the object to be copied.
[0045] It should be noted that the ECS architecture consists of three parts: entity, component and system. Among them, component is an object with attribute data, system is an object that processes data according to component, entity includes at least one sub-entity and / or at least one component; sub-entity may include at least one sub-entity and / or at least one component.
[0046] In a specific implementation, the object to be replicated may be an entity and / or component in the ECS architecture. The specific implementation methods for determining the target component corresponding to the object to be replicated may include the following two methods: 1. When the object to be replicated is a single component to be replicated, the component to be replicated is used as the target component; 2. When the object to be replicated is an entity to be replicated, the component contained in the entity to be replicated is used as the target component corresponding to the object to be replicated.
[0047] In a specific implementation, when the object to be copied is an entity to be copied, the target component corresponding to the entity to be copied can be determined according to the data structure of the entity to be copied. Exemplarily, if it is determined according to the data structure that the entity to be copied is composed of components, then the components that constitute the entity to be copied can be determined as target components; if it is determined according to the data structure that the entity to be copied includes components and sub-entities, then the first component and the first sub-entity contained in the entity to be copied can be determined, and then based on the sub-entity structure in the first sub-entity, the second component and the second sub-entity contained in the first sub-entity can be determined; based on the sub-entity structure in the second sub-entity, the third component contained in the second sub-entity can be determined; for example, if the second sub-entity in the entity to be copied includes only the third component, then the first component, the second component and the third component can be determined as the target component corresponding to the object to be copied. If the second sub-entity also includes the third sub-entity, continue to determine the components included in the third sub-entity until the components of all sub-entities are determined and each component is determined as the target component.
[0048] This embodiment describes the method of determining the target component in two cases where the object to be copied is a component or an entity, which is helpful for accurately determining the target component based on the structure of the object to be copied.
[0049] S120. For each target component, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object.
[0050] In this embodiment, the target component may include a component object and an engine object. When the target component has been determined, the component object and the engine object of the target component may be obtained accordingly. The target storage data corresponding to the target component is determined based on the component object and the engine object.
[0051] The target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data. The component object type field is used to reflect the component type of the target component. For example, in a game application scenario, the component type may include clothing type, weapon type, etc. The engine object type field is used to reflect the type of engine corresponding to the target component. Both the component object serialization data and the engine object serialization data are data obtained after serialization processing.
[0052] In a specific implementation, the component characteristic data of the component object and the engine characteristic data of the engine object can be obtained; the component characteristic data reflects the type, attribute and other information of the component object; the engine characteristic data reflects the type, attribute and other information of the engine object. For example, the component characteristic data can be used to determine whether the component object is a moving type component or a stationary type component, and to determine the attribute data of the component object such as the moving speed, direction and position.
[0053] In this embodiment, the component serialization data and the component type field can be determined by the component characteristic data; the engine serialization data and the engine type field can be determined by the engine characteristic data. It should be noted that the component characteristic data and the engine characteristic data can be set by those skilled in the art according to the application conditions of the actual scenario when creating the target component.
[0054] In a specific implementation, the target storage data corresponding to the target component is determined based on the component object and the engine object, including: calling a predefined component serialization interface, determining the component object type field corresponding to the component object and the engine object type field corresponding to the engine object, and serializing the component attribute data of the component object and the engine attribute data of the engine object respectively to obtain component object serialization data and engine object serialization data.
[0055] Specifically, before determining the target storage data, a component serialization interface can be predefined, and the serialization processing of the data can be realized by calling the component serialization interface. In a specific implementation, the component object type field of the component object is determined by the type information of the component object included in the component characteristic data of the component object; the engine object type field of the engine object is determined by the type information of the engine object included in the engine characteristic data of the engine object.
[0056] Further, the component attribute data included in the component characteristic data and the engine attribute data included in the engine characteristic data are determined. The component attribute data and the engine attribute data reflect the attributes of the component object and the corresponding engine object. For example, if the component object is a mobile component object, the component attribute data includes data such as the position, speed and direction of the component object.
[0057] In a specific implementation, the component serialization interface can be called to serialize the component attribute data to obtain the component object serialization data; the engine attribute data can be serialized to obtain the engine object serialization data. The obtained component serialization data, engine serialization data, component type field and engine type field are combined to form the target storage data.
[0058] This embodiment obtains component serialization data, engine serialization data, component type field and engine type field by calling the serialization interface, and the target storage data is composed of the component serialization data, engine serialization data, component type field and engine type field, so that the target storage data is more concise and clean, and it is beneficial to reduce memory usage while completing the acquisition of the characteristic data of the target component.
[0059] S130. Store the target storage data corresponding to the target component in the clipboard.
[0060] In a specific implementation, the clipboard can be used as a temporary storage area, and the target storage data corresponding to each target component can be stored in the clipboard. Furthermore, in the case where the number of target components is greater than the preset number, in order to avoid confusion of the target storage data stored in the clipboard, a unique identifier can be set for the target storage data corresponding to each target component, and the unique identifier and the target storage data can be stored in the clipboard accordingly, thereby avoiding data confusion during operations such as copying and pasting, which is conducive to improving the accuracy of the operation.
[0061] The technical solution of the disclosed embodiment is to obtain the object to be copied and determine the target component corresponding to the object to be copied in response to the copy trigger operation, so as to complete the copy operation of the object to be copied by copying each target component; for each target component, the component object and engine object of the target component are obtained, and the target storage data corresponding to the target component is determined based on the component object and the engine object, so that the target storage data can reflect the characteristics of the component object and the engine object; and the target storage data corresponding to the target component is stored in the clipboard to complete the copying of the target component. Since the target storage data includes the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, that is, the engine itself is not stored in the clipboard, the problem of memory leakage or program crash caused by engine coupling is solved, and the memory usage caused by the copy operation is reduced, which is conducive to improving the stability of the system; and the component object type field, the engine object type field, the component object serialization data and the engine object serialization data are stored in the clipboard, so that the data format stored in the clipboard is more concise and clean, which is convenient for maintenance.
[0062] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure. The technical solution of this embodiment is based on the above embodiment. After the target storage data corresponding to the target component is stored in the clipboard, it also includes: when it is detected that the preset paste condition is met, the target paste data corresponding to the object to be copied is determined based on the target storage data corresponding to the target component stored in the clipboard. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiments are not repeated here.
[0063] like Figure 2 As shown, the method of this embodiment may specifically include:
[0064] S210. In response to a replication trigger operation, obtain an object to be replicated, and determine a target component corresponding to the object to be replicated.
[0065] S220. For each target component, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object.
[0066] S230. Store the target storage data corresponding to the target component in the clipboard.
[0067] S240: When it is detected that a preset paste condition is met, determine target paste data corresponding to the object to be copied based on target storage data corresponding to the target component stored in the clipboard.
[0068] The target paste data may be data required when pasting the object to be copied; for example, the target paste data may be data reflecting information such as the type and attributes of the object to be copied.
[0069] Specifically, the component paste data corresponding to the target component when pasting the target component can be determined based on the target storage data corresponding to the target component, and the target paste data corresponding to the object to be copied can be determined based on the component paste data.
[0070] Exemplarily, when the object to be copied is a single component, the component paste data can be directly determined as the target paste data; when the object to be copied is an entity, the target paste data can be composed based on the component paste data corresponding to each target component, and the pasting of each target component can be completed through the target paste data, thereby completing the operation on the object to be copied.
[0071] In this embodiment, the preset paste condition includes at least one of the following conditions: receiving a paste trigger operation input for the object to be copied; having the paste permission to paste the target component to the target paste position; the paste operation permission has been opened at the paste position corresponding to the target component; and the associated entity corresponding to the target component does not contain any component that conflicts with the target component.
[0072] Exemplarily, it can be detected whether a paste trigger operation input for the object to be copied is received. If received, it means that the preset paste condition is currently met, and the target paste data corresponding to the object to be copied can be determined to complete the paste operation on the object to be copied; if not received, it means that the preset paste condition is currently met, and in order to avoid erroneous paste operations on the object to be copied, the paste operation is not performed.
[0073] Furthermore, to avoid the failure of the paste operation, it is possible to consider from the perspective of the location to be pasted whether the location to be pasted has the permission to paste the operation. If the location to be pasted has the permission to paste the operation, it is possible to further consider whether the target component can be pasted to the location to be pasted. If the location to be pasted does not have the permission to paste the operation, the paste operation can be stopped directly, and a prompt message can be generated and fed back to the user terminal to prompt that the location to be pasted does not have the permission to paste the operation. For example, a pop-up window can be generated on the display interface of the user terminal to prompt that the paste operation has failed.
[0074] Furthermore, in order to ensure that the entity to which the target component belongs can work normally after it is pasted and to improve the safety during the operation, whether the target component has the paste permission to paste to the target paste position and / or that the associated entity corresponding to the target component does not contain components that conflict with the target component can be used as preset paste conditions, thereby ensuring that after the paste operation is completed, there is no conflict between the target component and the components in the associated entity, and the target component can work normally at the target paste position.
[0075] This embodiment sets a preset paste condition, thereby generating target paste data corresponding to the object to be copied when the preset paste condition is met, which can avoid the occurrence of erroneous pasting and is conducive to improving the accuracy and effectiveness of the paste operation.
[0076] In order to save storage space and improve the accuracy of the copy and paste process, after determining the target paste data, the data stored in the clipboard can be cleared to facilitate the next storage; or, when it is detected that new data needs to be stored in the clipboard, the data currently stored in the clipboard can be cleared; or, in order to avoid the clipboard being occupied for a long time, the clipboard can be cleared when the data storage time in the clipboard reaches the preset storage time. This embodiment can make the clipboard cleaner and tidier by clearing the clipboard in time, saving storage space, and facilitating the improvement of the accuracy of the operation in the subsequent copy and paste process.
[0077] In this embodiment, the entity to which the target component belongs after pasting can be used as an associated entity. The associated entity can include at least one component. In order to simplify the steps of the pasting operation and improve the efficiency of the pasting operation, before determining the target pasting data, it can be detected whether the associated entity contains the same component as the target component.
[0078] Specifically, the method of detecting whether the associated entity contains a component identical to the target component may include: determining the associated entity to which the target component belongs after pasting, and detecting the component in the associated entity based on the component object type field corresponding to the target component. If the associated entity contains a component corresponding to the component object type field, it can be determined that the associated entity contains a component identical to the target component; if the associated entity does not contain a component corresponding to the component object type field, it can be determined that the associated entity does not contain a component identical to the target component.
[0079] In order to explain the process of obtaining the target pasted data more clearly and in detail, two cases of whether the associated entity contains the same component as the target component may be explained respectively.
[0080] 1. The associated entity to which the target component belongs after pasting does not contain the same component as the target component
[0081] Optionally, a specific implementation method of determining the target paste data corresponding to the object to be copied based on the target storage data corresponding to the target component stored in the clipboard may include: for each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted does not contain the same component as the target component, creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, and obtaining the target paste data corresponding to the object to be copied.
[0082] Specifically, the associated entity to which the target component belongs after pasting can be determined. Exemplarily, the associated entity corresponding to the target component can be determined based on the received operation information of the paste trigger operation; the operation information can include the pasting position of the target component, the name and identifier of the associated entity, etc.
[0083] In this embodiment, if the same component as the target component is included, the paste operation can be completed based on the same component to simplify the steps of the paste operation; if the same component as the target component is not included, the target component needs to be created in the associated entity. Specifically, the target component is created in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, and the target paste data corresponding to the object to be copied is obtained.
[0084] This embodiment provides a method for obtaining target paste data when the associated entity does not contain the same component as the target component. The target paste data of the object to be copied can be effectively obtained based on the target storage data, which helps to quickly complete the paste operation of the target component.
[0085] Optionally, a target component is created in an associated entity based on target storage data corresponding to the target component stored in a clipboard to obtain target paste data corresponding to the object to be copied, including: creating an engine object and a component object corresponding to the target component based on the engine object type field and the component object type field corresponding to the target component, respectively; deserializing the engine object serialized data and the component object serialized data corresponding to the target component, respectively, to obtain engine attribute data of the engine object and component attribute data of the component object; updating attribute data of the engine object and the component object based on the engine attribute data and the component attribute data, respectively, to obtain component paste data corresponding to the target component; obtaining target paste data corresponding to the object to be copied based on the component paste data.
[0086] In this embodiment, the target component type and the target engine type of the target component can be determined respectively through the engine object type field and the component object type field corresponding to the target component; a component object with the target component type and an engine object with the target engine type are created. It should be noted that the component object can reflect the component structure information of the component of the target component type; the engine object can reflect the engine structure information of the engine of the target engine type.
[0087] In order to obtain the component paste data corresponding to the target component, the component object, the engine object and the target component need to have the same attributes. The specific implementation method can be: deserialize the engine object serialization data and the component object serialization data corresponding to the target component respectively, and obtain the engine attribute data of the engine object and the component attribute data of the component object; update the attribute data of the engine object through the engine attribute data, so that the updated engine object can reflect the engine structure information and the engine attribute information at the same time; update the attribute object through the component attribute data, so that the updated component object can reflect the component structure information and the component attribute information at the same time; thus, based on the updated component object and the engine object, the component paste data of the target component can be determined; and the target paste data is obtained based on the component paste data.
[0088] If the object to be copied is a component to be copied, the component paste data can be determined as the target paste data; if the object to be copied is an entity to be copied, each component in the entity to be copied can be used as a target component, and the target paste data is composed of the component paste data of each target component.
[0089] The advantage of this processing is that by updating the component object and the engine object according to the attribute data, the component object and the engine object have the attributes corresponding to the target component, and the target pasted data can be determined accurately and quickly.
[0090] In order to avoid the situation where the target component after pasting cannot be used in the associated entity, before creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, it also includes: obtaining the dependent component type of the target component based on the component object type field, and determining the dependent component corresponding to the target component in the associated entity based on the dependent component type; when the associated entity includes the dependent component, executing the operation of creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard.
[0091] The dependent component is a component that has a dependency relationship with the target component; when the dependent component that has a dependency relationship with the target component does not exist in the associated entity, the target component created in the associated entity cannot be used normally.
[0092] In a specific implementation, in order to ensure that the target component can be used normally, the dependent component type can be determined based on the component object type field. It is detected whether the associated entity includes the dependent component. If the dependent component is included, the operation of creating the target component in the associated entity is performed; if the dependent component is not included, a pop-up window prompt can be displayed to the user terminal to prompt that the paste operation of the copied object has failed.
[0093] Specifically, the method of detecting whether the associated entity includes a dependent component includes: detecting whether the associated entity includes a component of the dependent component type, if it includes a component of the dependent component type, determining that the dependent component exists in the associated entity; if it does not include a component of the dependent component type, determining that the dependent component does not exist in the associated entity.
[0094] This embodiment determines whether there is a dependent component in the associated entity before creating the target component, and executes the operation of creating the target component if there is a dependent component, thereby ensuring that the created target component can be used normally in the associated entity.
[0095] 2. The associated entity to which the target component belongs after pasting contains the same components as the target component
[0096] Optionally, an implementation method for determining the target paste data corresponding to the object to be copied based on the target storage data corresponding to the target component stored in the clipboard includes: for each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted contains a component identical to the target component, taking the component identical to the target component as the component to be updated; updating the component to be updated based on the target storage data corresponding to the target component stored in the clipboard to obtain the target paste data corresponding to the object to be copied.
[0097] In the case where it is detected that the associated entity contains the same component as the target component, it means that the structural information of the target component can be determined in the associated entity based on the same component as the target component, and the attribute information of the same component as the target component can be updated to obtain the target paste data corresponding to the object to be copied. Specifically, the same component as the target component can be used as the component to be updated, and based on the engine object serialization data and the engine object serialization data in the target storage data, the component to be updated is updated so that the updated component that is the same as the target component has the attribute of the target component, thereby obtaining the target paste data based on the updated component that is the same as the target component.
[0098] In this embodiment, when the associated entity includes a component identical to the target component, the component identical to the target component can be used as the component to be updated and updated based on the target storage data so that the component to be updated has the properties of the target component, thereby obtaining the target pasted data without creating a new component.
[0099] In this embodiment, the component to be updated is updated based on the target storage data corresponding to the target component stored in the clipboard to obtain target paste data corresponding to the object to be copied, including: deserializing the engine object serialization data and the component object serialization data corresponding to the target component respectively to obtain engine attribute data of the engine object and component attribute data of the component object; updating the attribute data of the engine object and the component object corresponding to the component to be updated based on the engine attribute data and the component attribute data respectively to obtain component paste data corresponding to the target component; obtaining the target paste data corresponding to the object to be copied based on the component paste data.
[0100] In a specific implementation, since both the engine object serialized data and the component object serialized data are obtained after serialization processing, a predefined deserialization interface can be called to deserialize the engine object serialized data and the component object serialized data, thereby obtaining the corresponding engine attribute data and component attribute data. The engine attribute data is assigned to the engine object corresponding to the component to be updated, and the component attribute data is assigned to the component object corresponding to the component to be updated, so as to complete the update operation of the component to be updated, so that the updated component to be updated has the same attributes as the target component. The component paste data can be determined based on the component to be updated after being updated; the target paste data is determined based on the component paste data.
[0101] This embodiment determines engine attribute data and component attribute data by deserializing engine object serialized data and component object serialized data, thereby facilitating updating of components to be updated.
[0102] The technical solution of the embodiment of the present disclosure determines the target paste data corresponding to the object to be copied through the component object type field, the engine object type field, the component object serialization data and the engine object serialization data in the clipboard, so as to quickly and efficiently complete the paste operation of the object to be copied. Moreover, after obtaining the target paste data, the clipboard is cleared to save the space occupied by the clipboard.
[0103] Figure 3 A flowchart of another data processing method provided by the embodiment of the present disclosure. The technical solution of this embodiment refines the method of determining the target component on the basis of the above-mentioned embodiment. In the case where the object to be copied is an entity to be copied, the component contained in the entity to be copied is used as the target component corresponding to the object to be copied; specifically, each component contained in the entity to be copied is parsed as the target component according to the data structure corresponding to the entity to be copied, and the relative position relationship between the target components is parsed; in the case where the object to be copied is an entity to be copied, the implementation method of storing the target storage data in the clipboard can be: based on the relative position relationship between the target components, the target storage data corresponding to each target component is stored in the clipboard.
[0104] For detailed implementation, please refer to the description of this embodiment. The technical features that are the same or similar to the above embodiments will not be described in detail here. Figure 3 As shown, the method of this embodiment may specifically include:
[0105] S310. In response to a copy trigger operation, the object to be copied is obtained. When the object to be copied is an entity to be copied, each component contained in the entity to be copied is parsed as a target component according to a data structure corresponding to the entity to be copied, and the relative position relationship between the target components is parsed.
[0106] Exemplarily, the entity to be copied includes at least one sub-entity and / or at least one component, and the sub-entity includes at least one component. It should be noted that the structure of the entity to be copied can be displayed in the form of a tree structure. The data structure can be used to represent the relative positional relationship between each sub-entity and each component contained in the entity to be copied.
[0107] In this embodiment, each component contained in the entity to be copied can be used as a target component, and the relative position relationship between the target components in the tree structure can be determined according to the data structure. For example, if the entity to be copied includes a sub-entity and 10 components, and the sub-entity includes 10 components, the entity to be copied is used as the root node, the sub-entity and 10 components are used as child nodes of the root node, and the 10 components of the sub-entity are used as child nodes of the child node of the sub-entity, then the relative position relationship between the target components can be determined.
[0108] S320: For each target component, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object.
[0109] S330. Store the target storage data corresponding to each target component in the clipboard based on the relative position relationship between the target components.
[0110] Specifically, the target storage data corresponding to the target components can be stored accordingly according to the relative position relationship between the target components. Furthermore, the component serialized data array and the sub-entity array can be stored in the clipboard; wherein the component serialized data array includes the target storage data corresponding to the target components in the entity or sub-entity. The sub-entity array is used to reflect the structural data of the sub-entity.
[0111] For a detailed description of the format of the data stored in the clipboard when the object to be copied is an entity to be copied, see Figure 4 . Figure 4 Each node in the includes a component serialization data array and a sub-entity array. The component serialization data array stores the target storage data of each target component corresponding to the node; the sub-entity array stores the structural data of the sub-entity corresponding to the node. Based on the component serialization data array including the component object type field, engine object type field, component object serialization data and engine object serialization data of the target component. Exemplarily, the entity to be copied may include N sub-entities, where N is a positive integer.
[0112] In this embodiment, for entities to be copied with more complex structures, the relative position relationship between target components is parsed through data structure, and the target storage data is stored in the clipboard based on the relative position relationship, thereby ensuring that the relative position relationship between the components is correctly handled during the copying process, which is conducive to improving the accuracy and effectiveness of the copying process.
[0113] In this embodiment, after the target storage data corresponding to the target component is stored in the clipboard, it also includes: in response to a paste trigger operation input for the entity to be copied, the component paste data corresponding to each target component is determined one by one based on the relative position relationship between the target components to obtain the entity paste data corresponding to the entity to be copied.
[0114] The component paste data includes the component object type field, engine object type field, component object serialization data and engine object serialization data corresponding to the target component. The entity paste data corresponding to the entity to be copied may include the component paste data corresponding to each target component and the relative position relationship between each target component.
[0115] In a specific implementation, before responding to the paste trigger operation input for the entity to be copied, it is detected whether the preset paste condition is met, and if the preset paste condition is met, the paste trigger operation is responded to. Exemplarily, the paste trigger operation may include operations such as clicking a "paste" control and inputting a 'paste' voice command.
[0116] Exemplarily, a component serialized data array and a sub-entity array can be stored in the clipboard. The relative position relationship between the target components can be obtained based on the sub-entity array. Based on the relative position relationship and the component serialized data array corresponding to each node, the component serialized data of each target component is determined one by one as component paste data; the component paste data is combined into entity paste data according to the relative position relationship.
[0117] In this embodiment, for entities to be copied with more complex structures, the component paste data corresponding to each target component is determined one by one based on the relative position relationship between the target components, so that the copied entity can be pasted according to the relative position relationship at the time of copying, ensuring that the relative position relationship between the target components is not lost, thereby improving the accuracy of the paste operation.
[0118] The above describes in detail the embodiments corresponding to the transmission status detection method. In order to make the technical scheme of the method further clear to those skilled in the art, a specific application scenario is given below.
[0119] This embodiment can be applied to the scenario of copying and pasting objects in the ECS architecture. This embodiment provides a clipboard that can store data in a preset data format; when copying an object to be copied, the corresponding target storage data can be stored in the clipboard in a preset data format, that is, the component object type field, the engine object type field, the component object serialization data, and the engine object serialization data are stored in the clipboard. As a result, there is no engine in the clipboard, avoiding coupling, memory leaks, or program crashes.
[0120] Furthermore, this embodiment constructs a component serialization interface, a component deserialization interface, an entity serialization interface, and an entity deserialization interface corresponding to the clipboard. The component serialization interface and the component deserialization interface are used to serialize and deserialize component data, respectively. Since an entity object includes multiple component objects and child entity objects, the data structure is more complex. When copying an entity object, the entity serialization interface can be called to parse the data structure of the entity object, obtain the serialized data of the internal components of the entity object, and paste the entity object through the entity deserialization interface when pasting.
[0121] The clipboard provided in this embodiment is introduced above. To explain the process of copying and pasting the object to be copied using the clipboard more clearly and in detail, the following explanation is given by taking the object to be copied as an entity to be copied and a component to be copied as examples.
[0122] 1. The object to be copied is the component to be copied
[0123] Figure 5 A schematic diagram of a replication process of a component to be replicated provided by an embodiment of the present disclosure, such as Figure 5 As shown; the user generates a copy trigger operation by clicking the component copy button. When the copy trigger operation is detected, the serialization interface of the component can be called, and the component object type field and the engine object type field can be determined based on the type of the component to be copied, and the component attribute data of the component to be copied and the engine attribute data of the engine object are serialized to obtain component object serialization data and engine object serialization data. The component object type field, the engine object type field, the component object serialization data, and the engine object serialization data are stored in the clipboard for calling when pasting.
[0124] Figure 6 A schematic diagram of a pasting process of a component to be copied provided by an embodiment of the present disclosure, such as Figure 6 As shown. The user generates a paste trigger operation by clicking the component paste button. When a paste trigger operation is detected, it is necessary to determine whether the component to be copied corresponding to the paste trigger operation meets the preset paste conditions. If the preset paste conditions are not met, the paste failure information can be fed back in the form of a prompt window to indicate the reason for the paste failure. If the preset paste conditions are met, the serialized data stored in the clipboard is obtained, namely, the component object type field, the engine object type field, the component object serialized data, and the engine object serialized data; the deserialization interface of the component clipboard is called to complete the paste operation of the component to be copied.
[0125] Furthermore, it is determined based on the component object type field whether there is a component identical to the component to be copied in the associated entity to which the component to be copied belongs; if so, the component object serialization data and the engine object serialization data are deserialized through the deserialization interface to obtain the component attribute data and the engine attribute data corresponding to the component to be copied, and the attributes of the same component are updated based on the component attribute data and the engine attribute data to complete the paste operation of the component to be copied. If it does not exist, the dependent component type is determined based on the component type field, and it is determined whether the associated entity includes the dependent component based on the dependent component type. In the case where the dependent component is included in the associated entity, the engine object and the component object are created based on the engine object type field and the component object type field, and the paste operation of the component to be copied is completed by deserializing the engine object and the component object.
[0126] 2. The object to be copied is the entity to be copied
[0127] The entity to be copied includes at least one sub-entity and / or at least one component, and the sub-entity includes at least one component and / or at least one sub-entity. Therefore, the data obtained after serializing the entity object is more complex. In order to satisfy the requirement that the serialized data of the entity object can be stored more clearly in the clipboard, the format of the storage data corresponding to the entity to be copied in the clipboard is as follows: Figure 4 shown.
[0128] based on Figure 4 In the data structure, the present disclosure provides a copying process of an entity to be copied as follows Figure 7 In a specific implementation, after a copy trigger operation is generated based on a user click operation, the entity clipboard serialization interface is called to obtain the root entity and read the component array therein, and traverse the component array. According to the component array, all components included in the entity to which it belongs can be determined.
[0129] For each component included in each component root entity, the serialization interface is called respectively to obtain the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, and the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, the component serialization data array and the sub-entity array are stored in the clipboard. For the sub-entities included in the root entity, the sub-entity array is obtained, and the sub-entity objects are traversed based on the sub-entity array; the components and sub-entities contained in the sub-entity are determined; for the contained sub-entities, the components and sub-entities contained in the sub-entity are determined again according to the corresponding sub-entity array until all the corresponding components are determined; for the components included in the sub-entity, the above operation is repeated, and the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, the component serialization data array and the sub-entity array are stored in the clipboard.
[0130] Figure 8 A schematic diagram of a pasting process of an entity to be copied provided by an embodiment of the present disclosure, such as Figure 8 As shown; after the user clicks the entity paste button, the deserialization interface corresponding to the entity can be called to obtain the serialized data array of the component stored in the clipboard and the sub-entity array.
[0131] Based on the serialized data array of the component and the sub-entity array, the component objects included in the root entity corresponding to the entity to be copied can be determined; for each component object, the entity object corresponding to the entity to be copied is added to the scene, and based on the serialized data array of the component, the components are added to the entity objects one by one, and the component deserialization interface is called to complete the pasting of each component in the root entity of the entity to be copied.
[0132] Based on the sub-entity array, determine the sub-entities included in the entity to be copied, and traverse each sub-entity; for each sub-entity, add each sub-entity object to the scene, add the components included in the sub-entity to the sub-entity object one by one based on the serialized data array of the component, and call the deserialization interface of the component clipboard to complete the pasting of each component. The paste operation of the entity to be copied is completed by pasting the components in the root entity and the components in the sub-entities of each layer.
[0133] It should be noted that during the copying process, the component or entity stores the data in the clipboard in a serialized manner. When performing a paste operation, the constructor can be used to create an object and the data in the clipboard can be deserialized to generate the corresponding component or entity. In order to ensure the correct handling of the component or resource reference relationship, a unique identifier can be used during the serialization process. Specifically, when component A references component B or a resource object, one or more attributes within component A can be set to the corresponding component B object or resource object. When component A is serialized, the corresponding attributes can be saved as the unique identifier of the corresponding component B or resource object. During the deserialization operation, the marked unique identifier can be used to find the corresponding component or resource object, thereby ensuring the correctness of the reference relationship between the component and the resource object during the copy and paste process.
[0134] In this embodiment, the data format of the clipboard is set to make the clipboard more streamlined and clean; avoid the high coupling caused by the storage engine; and reduce memory usage without affecting the stability of the software. In addition, a unified serialization interface is implemented to ensure the correct replication of entity objects and internal component objects, and a data-driven approach is used to ensure the correctness of the reference relationship between components and the reference relationship to resources through serialization data; it brings a more convenient and efficient clipboard experience and provides better performance for copy and paste operations.
[0135] Fig. 9 A structural diagram of a data processing device provided by an embodiment of the present disclosure is shown in FIG. Fig. 9 As shown, the device includes: a copy operation triggering module 410, a copy operation triggering module 420 and a copy operation triggering module 430.
[0136] The replication operation triggering module 410 is used to obtain the object to be replicated and determine the target component corresponding to the object to be replicated in response to the replication triggering operation.
[0137] The storage data generating module 420 is used to obtain the component object and the engine object of each target component, and determine the target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data;
[0138] The clipboard data storage module 430 is used to store the target storage data corresponding to the target component in the clipboard.
[0139] In some optional implementations, the storage data generation module 420 includes:
[0140] The component serialization interface calling submodule is used to call the predefined component serialization interface, determine the component object type field corresponding to the component object and the engine object type field corresponding to the engine object, and serialize the component attribute data of the component object and the engine attribute data of the engine object respectively to obtain component object serialization data and engine object serialization data.
[0141] In some optional implementations, the device further includes:
[0142] The target paste data determination module is used to determine the target paste data corresponding to the object to be copied based on the target storage data corresponding to the target component stored in the clipboard after storing the target storage data corresponding to the target component in the clipboard and detecting that the preset paste condition is met.
[0143] In some optional implementations, the target paste data determination module includes:
[0144] The target component creation submodule is used to create a target component in the associated entity for each target component to be pasted based on the target storage data corresponding to the target component stored in the clipboard when it is detected that the associated entity to which the target component belongs after being pasted does not contain the same component as the target component, so as to obtain the target paste data corresponding to the object to be copied.
[0145] In some optional implementations, the target component creation submodule includes:
[0146] An engine object creation unit, used to create an engine object and a component object corresponding to the target component based on the engine object type field and the component object type field corresponding to the target component respectively;
[0147] A first deserialization processing unit is used to perform deserialization processing on the engine object serialization data and the component object serialization data corresponding to the target component, and obtain engine attribute data of the engine object and component attribute data of the component object;
[0148] The first attribute data updating unit is used to update the attribute data of the engine object and the component object based on the engine attribute data and the component attribute data respectively to obtain the component paste data corresponding to the target component; based on the component paste data, obtain the target paste data corresponding to the object to be copied.
[0149] In some optional implementations, the target component creation submodule further includes:
[0150] a dependent component determining unit, configured to obtain a dependent component type of the target component based on a component object type field before creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, and determine a dependent component corresponding to the target component in the associated entity based on the dependent component type;
[0151] The operation execution unit is used to execute the operation of creating a target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard when the associated entity includes a dependent component.
[0152] In some optional implementations, the target paste data determination module includes:
[0153] The component to be updated determination submodule is used for, for each target component to be pasted, if it is detected that the associated entity to which the target component belongs after pasting contains the same component as the target component, to take the component identical to the target component as the component to be updated;
[0154] The component to be updated updating submodule is used to update the component to be updated based on the target storage data corresponding to the target component stored in the clipboard, and obtain the target pasting data corresponding to the object to be copied.
[0155] In some optional implementations, the component to be updated updates the submodule, including:
[0156] A second deserialization processing unit is used to perform deserialization processing on the engine object serialization data and the component object serialization data corresponding to the target component, and obtain engine attribute data of the engine object and component attribute data of the component object;
[0157] The second attribute data updating unit is used to update the attribute data of the engine object and the component object corresponding to the component to be updated based on the engine attribute data and the component attribute data respectively, and obtain the component paste data corresponding to the target component; based on the component paste data, obtain the target paste data corresponding to the object to be copied.
[0158] In some optional implementations, optionally, the preset pasting condition includes at least one of the following conditions:
[0159] Receiving a paste trigger operation input for the object to be copied;
[0160] Has the paste permission to paste the target component to the target paste position;
[0161] The paste operation permission has been opened at the location to be pasted corresponding to the target component;
[0162] The associated entity corresponding to the target component does not contain any component that conflicts with the target component.
[0163] In some optional implementations, the copy operation triggering module 410 includes:
[0164] A first target component determination submodule is used to use the component to be copied as a target component when the object to be copied is a single component to be copied;
[0165] The second target component determination submodule is used to, when the object to be copied is an entity to be copied, use the component contained in the entity to be copied as the target component corresponding to the object to be copied.
[0166] In some optional implementations, optionally, the entity to be copied includes at least one sub-entity and / or at least one component, and the sub-entity includes at least one component;
[0167] The second target component determines the submodule, including:
[0168] A relative position relationship determination unit, used to parse each component contained in the entity to be copied as a target component according to the data structure corresponding to the entity to be copied, and parse the relative position relationship between the target components;
[0169] The clipboard data storage module 430 includes:
[0170] The clipboard data storage submodule is used to store the target storage data corresponding to each target component into the clipboard based on the relative position relationship between the target components.
[0171] In some optional implementations, the clipboard data storage submodule further includes:
[0172] The entity paste data obtaining unit is used to determine the component paste data corresponding to each target component one by one based on the relative position relationship between the target components in response to a paste trigger operation input for the entity to be copied after the target storage data corresponding to the target component is stored in the clipboard, so as to obtain the entity paste data corresponding to the entity to be copied.
[0173] The technical solution provided by the embodiment of the present disclosure obtains the object to be copied and determines the target component corresponding to the object to be copied in response to the copy trigger operation, so as to complete the copy operation of the object to be copied by copying each target component; for each target component, obtains the component object and engine object of the target component, determines the target storage data corresponding to the target component based on the component object and the engine object, so that the target storage data can reflect the characteristics of the component object and the engine object; and completes the copying of the target component by storing the target storage data corresponding to the target component in the clipboard. Since the target storage data includes the component object type field, the engine object type field, the component object serialization data and the engine object serialization data, that is, the engine itself is not stored in the clipboard, the problem of memory leakage or program crash caused by engine coupling is solved, and the memory usage caused by the copy operation is reduced, which is conducive to improving the stability of the system; and the component object type field, the engine object type field, the component object serialization data and the engine object serialization data are stored in the clipboard, so that the data format stored in the clipboard is more concise and clean, which is convenient for maintenance.
[0174] The data processing device provided in the embodiments of the present disclosure can execute the data processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0175] 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.
[0176] Fig.10 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Fig.10 , which shows an electronic device (eg, Fig.10 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. Fig.10 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.
[0177] like Fig.10As 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.
[0178] 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 Fig.10 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.
[0179] 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.
[0180] 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.
[0181] The electronic device provided by the embodiment of the present disclosure and the data 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.
[0182] 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 data processing method provided by the above embodiments is implemented.
[0183] 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.
[0184] 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.
[0185] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0186] 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: responds to the copy trigger operation, obtains the object to be copied, and determines the target component corresponding to the object to be copied; for each target component, obtains the component object and engine object of the target component, and determines the target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data and engine object serialization data; and stores the target storage data corresponding to the target component in the clipboard.
[0187] 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).
[0188] 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 the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0189] 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".
[0190] 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.
[0191] 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.
[0192] According to one or more embodiments of the present disclosure, [Example 1] provides a data processing method, including:
[0193] In response to the replication trigger operation, obtaining the object to be replicated, and determining the target component corresponding to the object to be replicated;
[0194] For each target component, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data;
[0195] Stores the target storage data corresponding to the target component to the clipboard.
[0196] According to one or more embodiments of the present disclosure, [Example 2] provides a data processing method, further comprising:
[0197] In some optional implementations, a predefined component serialization interface is called to determine the component object type field corresponding to the component object and the engine object type field corresponding to the engine object, and the component attribute data of the component object and the engine attribute data of the engine object are serialized respectively to obtain component object serialization data and engine object serialization data.
[0198] According to one or more embodiments of the present disclosure, [Example 3] provides a data processing method, further comprising:
[0199] In some optional implementations, after the target storage data corresponding to the target component is stored in the clipboard, when it is detected that the preset paste condition is met, the target paste data corresponding to the object to be copied is determined based on the target storage data corresponding to the target component stored in the clipboard.
[0200] According to one or more embodiments of the present disclosure, [Example 4] provides a data processing method, further comprising:
[0201] In some optional implementations, for each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted does not contain a component identical to the target component, the target component is created in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, and target paste data corresponding to the object to be copied is obtained.
[0202] According to one or more embodiments of the present disclosure, [Example 5] provides a data processing method, further comprising:
[0203] In some optional implementations, an engine object and a component object corresponding to the target component are created based on the engine object type field and the component object type field corresponding to the target component, respectively;
[0204] Deserialize the engine object serialization data and component object serialization data corresponding to the target component to obtain engine attribute data of the engine object and component attribute data of the component object;
[0205] Based on the engine attribute data and the component attribute data, the attribute data of the engine object and the component object are updated respectively to obtain the component pasting data corresponding to the target component;
[0206] Based on the component paste data, target paste data corresponding to the object to be copied is obtained.
[0207] According to one or more embodiments of the present disclosure, [Example 6] provides a data processing method, further comprising:
[0208] In some optional implementations, before creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, obtaining a dependent component type of the target component based on the component object type field, and determining a dependent component corresponding to the target component in the associated entity based on the dependent component type;
[0209] In the case where the dependent component is included in the associated entity, an operation of creating a target component in the associated entity based on target storage data corresponding to the target component stored in the clipboard is performed.
[0210] According to one or more embodiments of the present disclosure, [Example 7] provides a data processing method, further comprising:
[0211] In some optional implementations, for each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted contains a component identical to the target component, the component identical to the target component is used as the component to be updated;
[0212] The component to be updated is updated based on the target storage data corresponding to the target component stored in the clipboard, and the target pasting data corresponding to the object to be copied is obtained.
[0213] According to one or more embodiments of the present disclosure, [Example 8] provides a data processing method, further comprising:
[0214] In some optional implementations, engine object serialization data and component object serialization data corresponding to the target component are deserialized to obtain engine attribute data of the engine object and component attribute data of the component object;
[0215] Based on the engine attribute data and the component attribute data, the attribute data of the engine object and the component object corresponding to the component to be updated are updated respectively to obtain the component pasting data corresponding to the target component;
[0216] Based on the component paste data, target paste data corresponding to the object to be copied is obtained.
[0217] According to one or more embodiments of the present disclosure, [Example 9] provides a data processing method, further comprising:
[0218] In some optional implementations, the preset pasting condition includes at least one of the following conditions:
[0219] Receiving a paste trigger operation input for the object to be copied;
[0220] Has the paste permission to paste the target component to the target paste position;
[0221] The paste operation permission has been opened at the location to be pasted corresponding to the target component;
[0222] The associated entity corresponding to the target component does not contain any component that conflicts with the target component.
[0223] According to one or more embodiments of the present disclosure, [Example 10] provides a data processing method, further comprising:
[0224] In some optional implementations, when the object to be copied is a single component to be copied, the component to be copied is used as a target component;
[0225] In the case where the object to be copied is an entity to be copied, the components contained in the entity to be copied are used as target components corresponding to the object to be copied.
[0226] According to one or more embodiments of the present disclosure, [Example 11] provides a data processing method, further comprising:
[0227] In some optional implementations, the entity to be copied includes at least one sub-entity and / or at least one component, and the sub-entity includes at least one component;
[0228] Accordingly, the components contained in the entity to be copied are used as target components corresponding to the object to be copied, including:
[0229] According to the data structure corresponding to the entity to be copied, each component contained in the entity to be copied is parsed as a target component, and the relative position relationship between the target components is parsed;
[0230] Store the target storage data corresponding to the target component into the clipboard, including:
[0231] The target storage data corresponding to each target component is stored in the clipboard based on the relative position relationship between the target components.
[0232] According to one or more embodiments of the present disclosure, [Example 12] provides a data processing method, further comprising:
[0233] In some optional implementations, after the target storage data corresponding to the target component is stored in the clipboard, in response to a paste trigger operation input for the entity to be copied, the component paste data corresponding to each target component is determined one by one based on the relative position relationship between the target components to obtain the entity paste data corresponding to the entity to be copied.
[0234] According to one or more embodiments of the present disclosure, [Example 13] provides a data processing device, the device comprising:
[0235] A replication operation triggering module, used to obtain the object to be replicated and determine the target component corresponding to the object to be replicated in response to the replication triggering operation;
[0236] A storage data generation module, for obtaining a component object and an engine object of the target component for each target component, and determining target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data;
[0237] The clipboard data storage module is used to store the target storage data corresponding to the target component in the clipboard.
[0238] 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.
[0239] 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.
[0240] 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. A data processing method, characterized in that: include: In response to a replication trigger operation, obtaining an object to be replicated, and determining a target component corresponding to the object to be replicated; For each of the target components, obtain a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data; The target storage data corresponding to the target component is stored in a clipboard.
2. The data processing method according to claim 1, characterized in that: The determining the target storage data corresponding to the target component based on the component object and the engine object includes: A predefined component serialization interface is called to determine a component object type field corresponding to the component object and an engine object type field corresponding to the engine object, and component attribute data of the component object and engine attribute data of the engine object are serialized to obtain component object serialization data and engine object serialization data.
3. The data processing method according to claim 1, characterized in that: After storing the target storage data corresponding to the target component in the clipboard, the method further includes: In the case where it is detected that the preset paste condition is met, target paste data corresponding to the object to be copied is determined based on the target storage data corresponding to the target component stored in the clipboard.
4. The data processing method according to claim 3, characterized in that: The determining the target paste data corresponding to the object to be copied based on the target storage data corresponding to the target component stored in the clipboard includes: For each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted does not contain a component identical to the target component, the target component is created in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, and the target paste data corresponding to the object to be copied is obtained.
5. The data processing method according to claim 4, characterized in that: The step of creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard to obtain target paste data corresponding to the object to be copied includes: Creating an engine object and a component object corresponding to the target component based on the engine object type field and the component object type field corresponding to the target component respectively; Deserializing the engine object serialized data and the component object serialized data corresponding to the target component respectively to obtain engine attribute data of the engine object and component attribute data of the component object; updating the attribute data of the engine object and the component object based on the engine attribute data and the component attribute data respectively, and obtaining the component pasting data corresponding to the target component; Based on the component paste data, target paste data corresponding to the object to be copied is obtained.
6. The data processing method according to claim 4, characterized in that: Before creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard, the method further includes: Acquire a dependent component type of the target component based on the component object type field, and determine a dependent component corresponding to the target component in the associated entity based on the dependent component type; In a case where the dependent component is included in the associated entity, an operation of creating the target component in the associated entity based on the target storage data corresponding to the target component stored in the clipboard is performed.
7. The data processing method according to claim 3, characterized in that: The determining the target paste data corresponding to the object to be copied based on the target storage data corresponding to the target component stored in the clipboard includes: For each target component to be pasted, when it is detected that the associated entity to which the target component belongs after being pasted contains a component identical to the target component, the component identical to the target component is used as a component to be updated; The component to be updated is updated based on the target storage data corresponding to the target component stored in the clipboard to obtain target pasting data corresponding to the object to be copied.
8. The data processing method according to claim 7, characterized in that: The updating of the component to be updated based on the target storage data corresponding to the target component stored in the clipboard to obtain the target paste data corresponding to the object to be copied includes: Deserializing the engine object serialized data and the component object serialized data corresponding to the target component respectively to obtain engine attribute data of the engine object and component attribute data of the component object; Based on the engine attribute data and the component attribute data, the engine object and the component object corresponding to the component to be updated are updated with attribute data to obtain component paste data corresponding to the target component; Based on the component paste data, target paste data corresponding to the object to be copied is obtained.
9. The data processing method according to claim 3, characterized in that: The preset pasting condition includes at least one of the following conditions: Receiving a paste trigger operation input for the object to be copied; Having the paste permission to paste the target component to the target paste position; The location to be pasted corresponding to the target component has the permission for pasting operation opened; The associated entity corresponding to the target component does not include a component that conflicts with the target component.
10. The data processing method according to claim 1, characterized in that: The determining of the target component corresponding to the object to be copied includes: In the case where the object to be copied is a single component to be copied, taking the component to be copied as a target component; In the case that the object to be copied is an entity to be copied, the components contained in the entity to be copied are used as target components corresponding to the object to be copied.
11. The data processing method according to claim 10, characterized in that: The entity to be copied includes at least one sub-entity and / or at least one component, and the sub-entity includes at least one component; The step of using the component contained in the entity to be copied as a target component corresponding to the object to be copied includes: According to the data structure corresponding to the entity to be copied, each component contained in the entity to be copied is parsed as a target component, and the relative position relationship between the target components is parsed; The storing the target storage data corresponding to the target component into the clipboard includes: The target storage data corresponding to each target component is stored in a clipboard based on the relative positional relationship between the target components.
12. The data processing method according to claim 11, characterized in that: After storing the target storage data corresponding to the target component in the clipboard, the method further includes: In response to a paste trigger operation input for the entity to be copied, component paste data corresponding to each target component is determined one by one based on the relative position relationship between the target components to obtain entity paste data corresponding to the entity to be copied.
13. A data processing device, characterized in that: include: A replication operation triggering module, used to obtain an object to be replicated and determine a target component corresponding to the object to be replicated in response to a replication triggering operation; a storage data generating module, configured to obtain, for each target component, a component object and an engine object of the target component, and determine target storage data corresponding to the target component based on the component object and the engine object, wherein the target storage data includes a component object type field, an engine object type field, component object serialization data, and engine object serialization data; The clipboard data storage module is used to store the target storage data corresponding to the target component in the clipboard.
14. 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 data processing method according to any one of claims 1 to 12.
15. 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 data processing method according to any one of claims 1 to 12.