Object data serialization and deserialization system and method based on unreal engine
By using the Unreal Engine-based object data serialization and deserialization system in software development, the problem of time-consuming and error-prone processing of object data is solved, and efficient and reliable object data management is achieved, and system stability and development efficiency are improved.
Patent Information
- Application Number
- CN202411745617.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-02
AI Technical Summary
When the prior art processes massive object data during software development, manual data processing methods are time-consuming and labor-intensive, and data inconsistency or state loss are prone to problems, affecting the reliability and stability of the system.
Design an object data serialization and deserialization system based on Unreal Engine, and obtain object metadata through Unreal Engine's reflection mechanism to realize unified acquisition, serialization processing, data optimization and deserialization processing of object data.
It improves the reliability of object data processing and the stability of system operation, reduces human errors, ensures the integrity and consistency of object data, and improves development efficiency.
Smart Images

Figure CN119806486A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an object data serialization and deserialization system and method based on an Unreal Engine. Background Art
[0002] In the computer field, with the continuous development of information technology, Unreal Engine has become one of the top game engines with its powerful real-time rendering capabilities, high-realistic image quality, developer-friendly editing tools, and a complete system of functional modules. Unreal Engine not only occupies the vast majority of the market in the field of game production, but is also widely used in many industries and fields such as game development, virtual reality, and digital twins.
[0003] At present, in the process of software development, developers need to deal with massive amounts of object data. Traditional manual data processing methods can no longer meet development needs. When dealing with objects with complex hierarchies and diverse attributes, it is usually necessary to write a large amount of repetitive code to handle the serialization and deserialization logic of different types of objects. This is not only time-consuming and labor-intensive, but also prone to data inconsistency or state loss, affecting the reliability and stability of the system.
[0004] In order to avoid data loss, object status errors, and system performance degradation due to human operational errors during object data serialization and deserialization, technical personnel in this field have been seeking an automated object data management method that can efficiently handle the storage and reading of large-scale object data, improve development efficiency, reduce human errors, and ensure the integrity and consistency of object data and the stability of system operation. Summary of the invention
[0005] The purpose of the present invention is to provide an object data serialization and deserialization system and method based on Unreal Engine, which realizes efficient access and state management of objects by providing unified object data acquisition, serialization processing, data optimization and deserialization processing, thereby solving the problems of large workload, easy errors, data inconsistency and so on existing in manual data processing, and improving the reliability of object data processing, the stability of system operation and the development efficiency.
[0006] The Unreal Engine-based object data serialization system designed by the present invention to achieve one of the above purposes is special in that it includes:
[0007] A first acquisition module is used to acquire metadata of each object in the scene through the reflection mechanism of the Unreal Engine;
[0008] The serialization module is used to serialize and transform the class name data in the metadata of each object in turn to obtain the class name data in the string data of each object; traverse the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; serialize and transform the attribute name, attribute type and attribute value of the attribute data to obtain the attribute data in the string data of each object; assemble the class name data in the string data of each object and the attribute data in the string data of the corresponding object to obtain the string data of each object, and add a separator between two adjacent strings of the string data of each object.
[0009] Furthermore, the above system also includes: a serialization submodule; the serialization submodule is used to judge the state type of the state data in the metadata of each object, and when the state data in the metadata of the object is judged to be a dynamic type, the class name data and / or attribute data in the metadata of the dynamic type object are modified based on the attribute change of the dynamic object according to the state data to obtain the class name data and attribute data in the metadata of the modified dynamic type object, and the class name data and attribute data in the metadata of the modified dynamic type object are serialized and converted to obtain the class name data and attribute data in the string data of the dynamic type object; the string data of the dynamic type object is converted to the The class name data in the metadata of the object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the dynamic type object, and a dynamic type object tag is added to the string data of the dynamic type object; when the state data in the metadata of the object is a static type, the class name data and the attribute data in the metadata of the static type object are serialized and converted to obtain the class name data and the attribute data in the string data of the static type object; the class name data in the string data of the static type object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the static type object, and a dynamic type object tag is added to the string data of the dynamic type object.
[0010] Furthermore, the above-mentioned system also includes: a data optimization module; the data optimization module is used to optimize the storage of the string data of each object, including: judging the string data of each object, if the attribute value of the attribute data in the string data of the object is different from the default value of the attribute value, then storing the attribute data in the string data of the object; if the attribute value of the attribute data in the string data of the object is the same as the default value of the attribute value, then not storing the attribute data in the string data of the object; if the attribute data in the string data of multiple objects are the same, then storing the attribute data in the string data once; if the string data of the object is greater than a threshold, then compressing the string data of the object, and storing the compressed data corresponding to the string data of the object.
[0011] The object data serialization method based on Unreal Engine designed by the present invention to achieve the second purpose above is special in that it includes the following steps:
[0012] Get metadata of each object in the scene through the Unreal Engine's reflection mechanism;
[0013] The class name data in the metadata of each object is serialized and converted in turn to obtain the class name data in the string data of each object; the attribute data in the metadata of each object is traversed to obtain the attribute name, attribute type and attribute value of the attribute data of each object; the attribute name, attribute type and attribute value of the attribute data are serialized and converted to obtain the attribute data in the string data of each object; the class name data in the string data of each object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of each object, and a separator is added between two adjacent strings of the string data of each object.
[0014] The object data deserialization system based on Unreal Engine designed by the present invention to achieve the third objective above is special in that it includes:
[0015] The second acquisition module is used to split the string data of each object into a plurality of sub-string data in sequence according to the delimiter, traverse the sub-string data, and obtain the class name data, attribute data and type tag of the string data of each object;
[0016] The deserialization module is used to deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, and deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0017] The recovery module is used to construct each object in the scene according to the class name data in the metadata of each object, set the attributes of each object according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object, and obtain a scene containing each object and corresponding attributes.
[0018] Furthermore, the above-mentioned system also includes: a deserialization submodule; the deserialization submodule is used to judge the type mark in the metadata of each object, and when the type mark in the string data of the object is a dynamic type, the class name data and attribute data in the string data of the dynamic type object are modified based on the attribute change of the dynamic object according to the class name data and attribute data in the string data of the current dynamic type object, so as to obtain the class name data and attribute data in the string data of the modified dynamic type object, and the class name data and attribute data in the string data of the modified dynamic type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the dynamic type object; when the type mark in the string data of the object is a static type, the class name data and attribute data in the string data of the static type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the static type object.
[0019] Furthermore, the recovery module includes:
[0020] A scene construction unit, used to create corresponding objects according to the class name data in the metadata of each object;
[0021] The attribute setting unit is used to assign values to corresponding attributes of each object according to the attribute name, attribute type and attribute value in the attribute data in the metadata of each object, so as to obtain a scene including each object and the corresponding attributes.
[0022] The object data deserialization method based on Unreal Engine designed by the present invention to achieve the fourth objective above is special in that it comprises the following steps:
[0023] The string data of each object is split into a plurality of sub-string data in sequence according to the delimiter, and the sub-string data are traversed to obtain the class name data, attribute data and type tag of the string data corresponding to each object;
[0024] Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0025] According to the class name data in the metadata of each object, each object in the scene is constructed, and the attribute of each object is set according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object to obtain the corresponding scene containing each object.
[0026] The verification method for serializing and deserializing object data based on Unreal Engine designed by the present invention to achieve the fifth objective above is special in that it includes the following steps:
[0027] Get metadata of each object in the scene through the Unreal Engine's reflection mechanism;
[0028] The class name data in the metadata of each object is serialized and converted in sequence to obtain the class name data in the string data of each object; the attribute data in the metadata of each object is traversed to obtain the attribute name, attribute type and attribute value of the attribute data of each object; the attribute name, attribute type and attribute value of the attribute data are serialized and converted to obtain the attribute data in the string data of each object; the class name data in the string data of each object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of each object, and a separator is added between two adjacent strings of the string data of each object;
[0029] Calculate a checksum for the string data of each object to obtain a first checksum;
[0030] The string data of each object is split into a plurality of sub-string data in sequence according to the delimiter, and the sub-string data are traversed to obtain the class name data, attribute data and type tag of the string data corresponding to each object;
[0031] Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0032] Calculating a checksum for the metadata of each object to obtain a second checksum;
[0033] The second checksum is compared with the first checksum. If the first checksum and the second checksum are equal, the data integrity of the serialization and deserialization process is confirmed; if the first checksum and the second checksum are not equal, re-serialization and deserialization are performed.
[0034] The present invention has the following beneficial effects:
[0035] (1) The object data serialization and deserialization system and method based on Unreal Engine obtains the metadata of each object in the scene through the reflection mechanism of Unreal Engine, avoiding the instability caused by direct access to object data. During the serialization process, the system serializes and converts the class name data and attribute data respectively, and adds separators between the strings to ensure the accuracy of data conversion. Serialization also distinguishes between dynamic types and static types, judges the state data through the serialization sub-module, and adopts corresponding processing for different types, thereby improving the system's adaptability to different types of objects. The data optimization module effectively reduces the occupancy of data storage space and improves the operating efficiency of the system through a variety of optimization methods such as comparison of attribute values with default values, one-time storage of the same attribute data, and compression of large data.
[0036] (2) The object data serialization and deserialization system and method based on Unreal Engine splits the serialized string data through the second acquisition module, divides the data into several substrings based on the delimiter, and extracts key information such as class name data, attribute data and type tag through traversal. In the deserialization process, different types of objects are processed differently through the deserialization submodule. Through the scene construction unit and attribute setting unit in the recovery module, the restoration of objects and the assignment of attributes are realized, ensuring the integrity of each object and its attributes in the scene, and providing reliable guarantee for the reconstruction of the scene in Unreal Engine.
[0037] (3) The object data serialization and deserialization system and method based on Unreal Engine verifies that a first checksum is calculated for the string data of each object during the serialization process, and then a second checksum is calculated again after deserialization, and the data integrity of the entire process is confirmed by comparing the values of the two checksums. It is possible to detect errors that may occur during the data conversion process and ensure the accuracy of the data by re-executing the serialization and deserialization process. It is possible to accurately restore each object and its attributes in the scene, further ensuring the integrity of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A module schematic diagram showing a specific embodiment of an Unreal Engine-based object data serialization system of the present invention.
[0039] Figure 2 A flowchart diagram showing a specific embodiment of an object data serialization method based on Unreal Engine of the present invention.
[0040] Figure 3 A module schematic diagram showing a specific embodiment of an Unreal Engine-based object data deserialization system of the present invention.
[0041] Figure 4A flowchart diagram showing a specific embodiment of an object data deserialization method based on Unreal Engine of the present invention.
[0042] Figure 5 A flowchart diagram showing a specific embodiment of a verification method for serialization and deserialization of object data based on Unreal Engine of the present invention is shown. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited by the specific implementation disclosed below.
[0045] like Figures 1 to 5 As shown, the embodiments of the present application provide an object data serialization system based on Unreal Engine, an object data serialization method based on Unreal Engine, an object data deserialization system based on Unreal Engine, and an object data deserialization system based on Unreal Engine. The embodiments of the present application also provide an electronic device. They are described in detail one by one in the following embodiments.
[0046] Example 1
[0047] This embodiment discloses an object data serialization system based on Unreal Engine, the system comprising:
[0048] A first acquisition module is used to acquire metadata of each object in the scene through the reflection mechanism of the Unreal Engine;
[0049] The serialization module is used to serialize and transform the class name data in the metadata of each object in turn to obtain the class name data in the string data of each object; traverse the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; serialize and transform the attribute name, attribute type and attribute value of the attribute data to obtain the attribute data in the string data of each object; assemble the class name data in the string data of each object and the attribute data in the string data of the corresponding object to obtain the string data of each object, and add a separator between two adjacent strings of the string data of each object.
[0050] Based on the above system, optionally, the system further includes: a serialization submodule; the serialization submodule is used to judge the state type of the state data in the metadata of each object, and when the state data in the metadata of the object is judged to be a dynamic type, the class name data and / or attribute data in the metadata of the dynamic type object are modified based on the attribute change of the dynamic object according to the state data to obtain the class name data and attribute data in the metadata of the modified dynamic type object, and the class name data and attribute data in the metadata of the modified dynamic type object are serialized to obtain the class name data and attribute data in the string data of the dynamic type object; the character string data of the dynamic type object is converted into a serialization submodule; The class name data in the string data and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the dynamic type object, and a dynamic type object tag is added to the string data of the dynamic type object; when the state data in the metadata of the object is a static type, the class name data and the attribute data in the metadata of the static type object are serialized and converted to obtain the class name data and the attribute data in the string data of the static type object; the class name data in the string data of the static type object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the static type object, and a dynamic type object tag is added to the string data of the dynamic type object.
[0051] Based on the above system, optionally, the system also includes: a data optimization module; the data optimization module is used to perform storage optimization on the string data of each object, including: judging the string data of each object, if the attribute value of the attribute data in the string data of the object is different from the default value of the attribute value, then storing the attribute data in the string data of the object; if the attribute value of the attribute data in the string data of the object is the same as the default value of the attribute value, then not storing the attribute data in the string data of the object; if the attribute data in the string data of multiple objects are the same, then storing the attribute data in the string data once; if the string data of the object is greater than a threshold value, then compressing the string data of the object, and storing the compressed data corresponding to the string data of the object.
[0052] Through the cooperation of the above-mentioned components, the metadata of each object in the scene is obtained through the reflection mechanism of the Unreal Engine, wherein the metadata of each object includes: class name data, attribute data, and state data of the object; the class name data and attributes in the metadata of each object are serialized and converted to obtain the class name data in the string data of each object; the attribute data in the metadata of each object are traversed to obtain the attribute name, attribute type and attribute value of the attribute data of each object; the attribute name and attribute type of the attribute data are serialized and converted, and the attribute value is converted according to the type, for example: for integer attribute values, the attribute value is directly converted into a string; for list attribute values, each sub-element is converted into a string in turn by recursive traversal of the sub-elements; the attribute data in the string data of each object is obtained; the class name data in the string data of each object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of each object; in the serialization process, not only conventional static object data can be processed, but also the attribute changes of dynamic objects can be captured and serialized in real time, ensuring the integrity and accuracy of the serialized data. Through storage optimization strategies, string data with high repetitiveness, such as strings containing a large number of identical characters and attribute sets stored with default values, are selectively stored; for string data of objects whose value is greater than a threshold, the string data of the object is losslessly or lossily compressed. Optional compression algorithms include: Zlib, LZ4, Deflate, JPEG, Vorbis, and MP3; this effectively reduces the space occupied by data storage and improves the operating efficiency of the system.
[0053] Example 2
[0054] This embodiment discloses an object data serialization method based on Unreal Engine, which includes the following steps:
[0055] Step 1: Obtain metadata of each object in the scene through the reflection mechanism of Unreal Engine;
[0056] It should be noted that the metadata of each object may be a three-dimensional model, a picture, text, or a video.
[0057] Step 2: serialize and transform the class name data in the metadata of each object in turn to obtain the class name data in the string data of each object; traverse the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; serialize and transform the attribute name, attribute type and attribute value of the attribute data to obtain the attribute data in the string data of each object; assemble the class name data in the string data of each object and the attribute data in the string data of the corresponding object to obtain the string data of each object, and add a separator between two adjacent strings of the string data of each object.
[0058] It should be noted that the string data of each object can be data encoded in JSON or XML format; whether on Windows, Mac, Android and iOS platforms, the format of serialized data is always consistent to ensure data consistency.
[0059] Example 3
[0060] This embodiment discloses an object data deserialization system based on Unreal Engine, the system comprising:
[0061] The second acquisition module is used to split the string data of each object into a plurality of sub-string data in sequence according to the delimiter, traverse the sub-string data, and obtain the class name data, attribute data and type tag of the string data of each object;
[0062] The deserialization module is used to deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, and deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0063] The recovery module is used to construct each object in the scene according to the class name data in the metadata of each object, set the attributes of each object according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object, and obtain a scene containing each object and corresponding attributes.
[0064] Based on the above system, optionally, the system also includes: a deserialization submodule; the deserialization submodule is used to judge the type mark in the metadata of each object, and when the type mark in the string data of the object is a dynamic type, the class name data and attribute data in the string data of the dynamic type object are modified based on the attribute change of the dynamic object according to the class name data and attribute data in the string data of the current dynamic type object to obtain the modified class name data and attribute data in the string data of the dynamic type object, and the class name data and attribute data in the string data of the modified dynamic type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the dynamic type object; when the type mark in the string data of the object is a static type, the class name data and attribute data in the string data of the static type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the static type object.
[0065] Specifically, the recovery module includes:
[0066] A scene construction unit, used to create corresponding objects according to the class name data in the metadata of each object;
[0067] The attribute setting unit is used to assign values to corresponding attributes of each object according to the attribute name, attribute type and attribute value in the attribute data in the metadata of each object, so as to obtain a scene including each object and the corresponding attributes.
[0068] Through the coordinated cooperation of the above components, the string data is split into structured substring data through delimiters, and the class name data, attribute data and type tag information of the object are extracted through traversal operations. Corresponding deserialization and restoration are performed according to different data types, and the data in string form is restored to the metadata of the object through the reflection mechanism. Through the cooperation of the scene construction unit and the attribute setting unit, the reconstruction of the object and the assignment of attributes are realized, and the restoration of the scene is completed; it provides effective technical support for the loading and state restoration of scene data in the Unreal Engine.
[0069] Example 4
[0070] This embodiment discloses an object data deserialization system based on Unreal Engine, the method comprising the following steps:
[0071] Step 1: Split the string data of each object into a plurality of substring data in sequence according to the delimiter, traverse the substring data, and obtain the class name data, attribute data and type tag of the string data corresponding to each object;
[0072] Step 2: Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0073] Step 3: construct each object in the scene according to the class name data in the metadata of each object, set the attribute of each object according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object, and obtain the corresponding scene containing each object.
[0074] It should be noted that the string data of each object is deserialized to obtain the metadata of each object. The string data of each object will be restored to a data format that can be processed by a computer to facilitate subsequent scene recovery operations.
[0075] For example, if the attribute data in the string data of each object contains description information of the scene, the deserialization process will convert the data into a format that can be understood by a computer, such as a structure, an object, or a variable.
[0076] The metadata of each object contains parameters related to each element of the scene, such as lighting, shadows, camera position, etc. These parameters are matched to the parameters required by the rendering engine of the scene. This ensures the consistency and quality of the rendering. For example, if the rendering engine requires the position of the sun and lighting information in the scene, this information must be extracted from the string data of each object and matched to the rendering engine's parameters. The material information of the object is extracted from the string data of each object, including texture, color, reflection properties, etc. This information will be used to ensure that the objects in the scene present the correct appearance. For example, if the scene description contains a tree, the scene material extraction will include the texture and color properties of the leaves and trunk. Finally, using the corrected rendering parameters, the scene can be rendered. This includes generating images, rendering animations, processing sounds, etc. to present the final interactive scene, and the user will be able to interact with the rendered scene.
[0077] Example 5
[0078] This embodiment discloses a verification method for object data serialization and deserialization based on Unreal Engine, the method comprising the following steps:
[0079] Step 1: Obtain metadata of each object in the scene through the reflection mechanism of Unreal Engine;
[0080] Step 2: sequentially serialize and transform the class name data in the metadata of each object to obtain the class name data in the string data of each object; traverse the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; serialize and transform the attribute name, attribute type and attribute value of the attribute data to obtain the attribute data in the string data of each object; assemble the class name data in the string data of each object and the attribute data in the string data of the corresponding object to obtain the string data of each object, and add a separator between two adjacent strings of the string data of each object;
[0081] Step 3: Calculate the checksum of the string data of each object to obtain the first checksum
[0082] Step 4: Split the string data of each object into a plurality of substring data in sequence according to the delimiter, traverse the substring data, and obtain the class name data, attribute data and type tag of the string data corresponding to each object;
[0083] Step 5: Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object;
[0084] Step 6: Calculate the checksum for the metadata of each object to obtain a second checksum;
[0085] Step 7: compare the second checksum with the first checksum. If the first checksum and the second checksum are equal, confirm the data integrity of the serialization and deserialization process; if the first checksum and the second checksum are not equal, re-serialize and deserialize.
[0086] Example 6
[0087] The present embodiment discloses a computer program product, such as a computer program instruction, which, when executed by a computer, can be called or provided through the operation of the computer according to the method and / or technical solution of the present invention. It should be understood by those skilled in the art that the existence form of the computer program instruction in the computer-readable medium includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer. It can be clearly understood by those skilled in the art that for the convenience and simplicity of description, the specific working process of the program and module described above can refer to the corresponding process description in the aforementioned method embodiment, and will not be repeated here.
[0088] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0089] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0090] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0091] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, as an independent software package, partially on the machine and partially on a remote machine or completely on a remote machine or server. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described equipment and modules can refer to the corresponding process description in the aforementioned method embodiment, and will not be repeated here.
[0092] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0093] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0094] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
Claims
1. An object data serialization system based on Unreal Engine, characterized in that: include: A first acquisition module is used to acquire metadata of each object in the scene through the reflection mechanism of the Unreal Engine; A serialization module is used to serialize and convert the class name data in the metadata of each object in turn to obtain the class name data in the string data of each object; Traversing the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; The attribute name, attribute type and attribute value of the attribute data are serialized and converted to obtain the attribute data in the string data of each object; the class name data in the string data of each object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of each object, and a separator is added between two adjacent strings in the string data of each object.
2. The object data serialization system based on Unreal Engine according to claim 1, characterized in that: Also includes: Serialize submodules; The serialization submodule is used to judge the state type of the state data in the metadata of each object. When the state data in the metadata of the object is judged to be a dynamic type, the class name data and / or attribute data in the metadata of the dynamic type object are modified based on the attribute change of the dynamic object according to the state data to obtain the modified class name data and attribute data in the metadata of the dynamic type object, and the class name data and attribute data in the metadata of the modified dynamic type object are serialized and converted to obtain the class name data and attribute data in the character string data of the dynamic type object; The class name data in the string data of the dynamic type object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the dynamic type object, and a dynamic type object tag is added to the string data of the dynamic type object; when the state data in the metadata of the object is a static type, the class name data and the attribute data in the metadata of the static type object are serialized and converted to obtain the class name data and the attribute data in the string data of the static type object; the class name data in the string data of the static type object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of the static type object, and a dynamic type object tag is added to the string data of the dynamic type object.
3. The object data serialization system based on Unreal Engine according to claim 1, characterized in that: Also includes: Data optimization module; The data optimization module is used to perform storage optimization on the string data of each object, including: judging the string data of each object, if the attribute value of the attribute data in the string data of the object is different from the default value of the attribute value, then storing the attribute data in the string data of the object; if the attribute value of the attribute data in the string data of the object is the same as the default value of the attribute value, then not storing the attribute data in the string data of the object; if the attribute data in the string data of multiple objects are the same, then storing the attribute data in the string data once; if the string data of the object is greater than a threshold value, then compressing the string data of the object, and storing the compressed data corresponding to the string data of the object.
4. An object data serialization method based on Unreal Engine, characterized in that: The steps include: Get metadata of each object in the scene through the Unreal Engine's reflection mechanism; The class name data in the metadata of each object is serialized and converted in turn to obtain the class name data in the string data of each object; Traversing the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; The attribute name, attribute type and attribute value of the attribute data are serialized and converted to obtain the attribute data in the string data of each object; the class name data in the string data of each object and the attribute data in the string data of the corresponding object are assembled to obtain the string data of each object, and a separator is added between two adjacent strings in the string data of each object.
5. An object data deserialization system based on Unreal Engine, characterized in that: include: The second acquisition module is used to split the string data of each object into a plurality of sub-string data in sequence according to the delimiter, traverse the sub-string data, and obtain the class name data, attribute data and type tag of the string data of each object; The deserialization module is used to deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, and deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object; The recovery module is used to construct each object in the scene according to the class name data in the metadata of each object, set the attributes of each object according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object, and obtain a scene containing each object and corresponding attributes.
6. The object data deserialization system based on Unreal Engine according to claim 5, characterized in that: Also includes: Deserialize submodules; The deserialization submodule is used to judge the type mark in the metadata of each object. When the type mark in the string data of the object is a dynamic type, the class name data and attribute data in the string data of the dynamic type object are modified based on the attribute change of the dynamic object according to the class name data and attribute data in the string data of the current dynamic type object to obtain the modified class name data and attribute data in the string data of the dynamic type object, and the class name data and attribute data in the string data of the modified dynamic type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the dynamic type object; when the type mark in the string data of the object is a static type, the class name data and attribute data in the string data of the static type object are deserialized and restored to obtain the class name data and attribute data in the metadata of the static type object.
7. The object data deserialization system based on Unreal Engine according to claim 5, characterized in that: The recovery module comprises: A scene construction unit, used to create corresponding objects according to the class name data in the metadata of each object; The attribute setting unit is used to assign values to corresponding attributes of each object according to the attribute name, attribute type and attribute value in the attribute data in the metadata of each object, so as to obtain a scene including each object and the corresponding attributes.
8. A method for deserializing object data based on Unreal Engine, characterized in that: The steps include: The string data of each object is split into a plurality of sub-string data in sequence according to the delimiter, and the sub-string data are traversed to obtain the class name data, attribute data and type tag of the string data corresponding to each object; Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object; According to the class name data in the metadata of each object, each object in the scene is constructed, and the attribute of each object is set according to the attribute name, attribute type and attribute value of the attribute data in the metadata of each object to obtain the corresponding scene containing each object.
9. A verification method for object data serialization and deserialization based on Unreal Engine, characterized in that: The steps include: Get metadata of each object in the scene through the Unreal Engine's reflection mechanism; The class name data in the metadata of each object is serialized and converted in turn to obtain the class name data in the string data of each object; Traversing the attribute data in the metadata of each object to obtain the attribute name, attribute type and attribute value of the attribute data of each object; Serializing and converting the attribute name, attribute type and attribute value of the attribute data to obtain the attribute data in the string data of each object; assembling the class name data in the string data of each object and the attribute data in the string data of the corresponding object to obtain the string data of each object, and adding a separator between two adjacent strings in the string data of each object; Calculate a checksum for the string data of each object to obtain a first checksum; The string data of each object is split into a plurality of sub-string data in sequence according to the delimiter, and the sub-string data are traversed to obtain the class name data, attribute data and type tag of the string data corresponding to each object; Deserialize and restore the class name data of the string data of each object in turn to obtain the class name data in the metadata of each object; split the attribute data in the string data of each object to obtain the attribute name, attribute type and attribute value contained in the attribute data in the string data of each object, deserialize and restore the attribute name, attribute type and attribute value contained in the attribute data to obtain the attribute data in the metadata of each object; Calculating a checksum for the metadata of each object to obtain a second checksum; The second checksum is compared with the first checksum. If the first checksum and the second checksum are equal, the data integrity of the serialization and deserialization process is confirmed; if the first checksum and the second checksum are not equal, re-serialization and deserialization are performed.
10. A computer program product comprising a computer program or instructions, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the object data serialization method based on the Unreal Engine as described in claim 1, or executes the object data deserialization method based on the Unreal Engine as described in claim 8, or executes the object data serialization and deserialization verification method based on the Unreal Engine as described in claim 9.
Citation Information
Patent Citations
Object serializing method, object deserializing method, device and system
CN101661391A
Java object serialization method and system
CN105335156A
Serialization method and apparatus, deserialization method and apparatus, serialization and deserialization system, and electronic device
CN106570018A
Data processing method, device and equipment and computer readable storage medium
CN110781208A
Object serialization method and device, machine readable medium and system
CN111241346A