Object-oriented language data processing method and device

By using the Schema pattern to construct the data model in an object-oriented language and providing deep replication, serialization and upgrade interfaces, the problem of low data processing efficiency in C++ language is solved, and efficient and accurate data processing and automated software development process is achieved.

CN115437614BActive Publication Date: 2025-08-15GLODON CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110609774.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-01
Publication Date
2025-08-15
Estimated Expiration
2041-06-01

AI Technical Summary

Technical Problem

When using object-oriented languages such as C++ for software development, data persistence operations are inefficient and error-prone, especially in the process of serialization, deserialization, data copying and upgrading of model objects, developers need to manually handle each class, resulting in inefficiency and error-prone.

Method used

The Schema pattern is used to determine the class collection and attribute collection, construct the data model through inheritance and association relationships, and provide deep replication, serialization and upgrade interfaces to automatically handle the replication, serialization and upgrade of the data model.

Benefits of technology

It improves the efficiency and accuracy of data processing, reduces the burden on developers, realizes automated data model upgrades and replication, and simplifies the software development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115437614B_ABST
    Figure CN115437614B_ABST
Patent Text Reader

Abstract

The present invention provides an object-oriented data processing method and device, the method comprising the following steps: determining a class set and an attribute set based on a Schema pattern according to the category of the object; each class in the class set is used to represent the nested composition structure of the object, and each attribute in the attribute set is used to represent the description information of the corresponding class; determining the inheritance relationship between the classes and the association relationship between the class and the attribute; obtaining the corresponding data in the class set and the attribute set based on the inheritance relationship and the association relationship, and constructing an object-oriented data model. The present invention provides a complete set of development technology data frameworks, including model object serialization, deserialization, automatic upgrade of stored data, automatic conversion of business objects and data objects, and automatic deep copy of objects, which greatly reduces the development costs of upper-level developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a data processing method and device for an object-oriented language. Background Art

[0002] When developing software using object-oriented languages such as C++, developers often need to pay attention to data persistence operations, which involve the mutual conversion of model objects (which can be any data structure or object model in memory) and storage objects (stored on disk), and implement specific object serialization and deserialization methods. During the deserialization process, developers need to pay attention to changes in the storage structure of model objects under different software versions. During the copying process of model objects, developers also need to pay attention to the deep copying of the data therein. Since each class in the C++ object requires developers to define it separately and is relatively scattered, developers need to handle each class separately during the above-mentioned deserialization, data copying, and data upgrade processes, which is inefficient and prone to errors. Summary of the Invention

[0003] The purpose of the present invention is to provide a technical solution that can realize efficient and accurate data processing in object-oriented languages during deserialization, replication, upgrade, etc., so as to solve the above-mentioned problems existing in the prior art.

[0004] To achieve the above object, the present invention provides an object-oriented language data processing method, comprising the following steps:

[0005] Determine a class set and an attribute set based on the Schema pattern according to the category of the object; each class in the class set is used to represent the nested composition structure of the object, and each attribute in the attribute set is used to represent the description information of the corresponding class;

[0006] Determine the inheritance relationship between the classes and the association relationship between the class and the attribute;

[0007] Based on the inheritance relationship and the association relationship, corresponding data in the class set and the attribute set is obtained to construct an object-oriented data model.

[0008] According to the object-oriented language data processing method provided by the present invention, the step of determining the class set and attribute set based on the Schema pattern according to the category of the object includes:

[0009] Determine the class name, class constructor, class unique identifier, and class version number of each of the classes;

[0010] An attribute name, attribute type, attribute memory size, and attribute memory location of each of the attributes are determined.

[0011] According to the object-oriented language data processing method provided by the present invention, the method further includes:

[0012] When the data model needs to be copied, the preset copy interface is called to perform a deep copy of the class set and attribute set based on the Schema mode.

[0013] According to the object-oriented language data processing method provided by the present invention, the step of deep copying the class set and attribute set based on the Schema mode includes:

[0014] Use the constructor to construct a new Schema object;

[0015] Constructing data to be copied based on the new Schema object, the data to be copied includes, in order, a new Schema object memory space, a virtual table address space, a set of attributes of a parent class member, a constructor of the parent class member, a set of attributes of a child class member, and a constructor of the child class member, wherein the parent class member refers to a class in the class set that has an inherited relationship, and the child class member refers to a class in the class set that has an inheritance relationship;

[0016] The data to be copied is stored in a new memory space to obtain the copied data of the data model.

[0017] According to the object-oriented language data processing method provided by the present invention, the method further includes:

[0018] When the data model needs to be serialized, a preset serialization interface is called to perform nested serialization according to the class set and the attribute set.

[0019] According to the object-oriented language data processing method provided by the present invention, the step of nested serialization based on the class set and the attribute set includes:

[0020] The data model is stored as data to be serialized in a preset format, wherein the data to be serialized includes class header information, parent class header information, parent class attribute header information set, child class header information, and child class attribute header information set, which are sequentially composed; wherein the parent class refers to a class in the class set that has an inherited relationship, and the child class refers to a class in the class set that has an inherited relationship;

[0021] The data to be serialized is uploaded through the serialization interface.

[0022] According to the object-oriented language data processing method provided by the present invention, the method further includes: upgrading the data model, and the specific upgrading steps include:

[0023] Obtaining a macro declaration to determine how the data model is to be upgraded;

[0024] Modifying the deserialized data of the data model based on the upgrade method;

[0025] The modified deserialized data is serialized to complete the upgrade of the data model.

[0026] To achieve the above object, the present invention further provides an object-oriented language data processing device, comprising:

[0027] A framework determination module is adapted to determine a class set and an attribute set based on a Schema pattern according to the category of the object; each class in the class set is used to represent a nested composition structure of the object, and each attribute in the attribute set is used to represent descriptive information of the corresponding class;

[0028] An inheritance association determination module, adapted to determine the inheritance relationship between the classes and the association relationship between the class and the attribute;

[0029] The model construction module is adapted to obtain corresponding data in the class set and the attribute set based on the inheritance relationship and the association relationship, and construct an object-oriented data model.

[0030] To achieve the above objectives, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0031] To achieve the above object, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0032] Compared with the existing technology, the object-oriented language data processing method and device provided by the present invention provide a complete development technology data framework, including model object serialization, deserialization, automatic upgrade of stored data, automatic conversion of business objects and data objects, and automatic deep copy of objects, which greatly reduces the development cost of upper-level developers. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart showing a first embodiment of the object-oriented language data processing method of the present invention is shown;

[0034] Figure 2 A schematic diagram showing inheritance and association relationships in the first embodiment of the present invention is shown;

[0035] Figure 3 A schematic diagram showing deep copying according to the first embodiment of the present invention is shown;

[0036] Figure 4 A schematic diagram of binary data to be serialized according to the first embodiment of the present invention is shown;

[0037] Figure 5 A schematic flow chart of data model upgrade according to the first embodiment of the present invention is shown;

[0038] Figure 6 A schematic diagram of a version upgrade in the first embodiment of the present invention is shown;

[0039] Figure 7 A schematic diagram showing a program module of a first embodiment of an object-oriented language data processing device according to the present invention;

[0040] Figure 8 The figure shows a hardware structure diagram of the first embodiment of the object-oriented language data processing device of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0042] Example 1

[0043] See also Figure 1 This embodiment proposes a data processing method of an object-oriented language, comprising the following steps:

[0044] S100: Determine a class set and an attribute set based on the Schema pattern according to the category of the object; each class in the class set is used to represent the nested composition structure of the object, and each attribute in the attribute set is used to represent the description information of the corresponding class.

[0045] This embodiment introduces the Schema pattern in database technology to define class sets and attribute sets. Those skilled in the art will understand that the Schema in a database is a collection of database objects, and one user generally corresponds to one schema. This embodiment introduces the concept of Schema into C++ objects. The C++ objects referred to in this embodiment generally include a data model, and each data model corresponds to a schema. The categories of different C++ objects constitute different data models. For example, the car data model, the motor vehicle data model, and the vehicle data model correspond to different categories, respectively, where the vehicle data model is larger than the category of the motor vehicle data model, and the category of the motor vehicle data model is larger than the category of the car data model.

[0046] It's understood that a data model is typically composed of multiple classes, each corresponding to a component structure. Taking the car data model as an example, the classes may include a body parent class and a wheel parent class. The body parent class may include a front class, a roof class, and a rear class. The wheel parent class may include a first wheel class, a first wheel class, a first wheel class, a fourth wheel class, and so on. There's a nested structure between parent classes, and classes belong to corresponding parent classes. For example, the first wheel class, the first wheel class, the first wheel class, and the fourth wheel class belong to the wheel parent class. Therefore, the first wheel class, the first wheel class, the first wheel class, and the fourth wheel class have a nested relationship with the wheel parent class. Attributes are associated with each class and describe the characteristics of the corresponding class. It's understood that a class can correspond to multiple attributes. For example, the attributes of the first wheel class may include material attributes, color attributes, pattern attributes, and so on. Specifically, in this embodiment, each class may include a class name, a class constructor, a class unique identifier, and a class version number. Each attribute may include an attribute name, attribute type, attribute memory size, and attribute memory location. The class name represents the name of each class, the class constructor is used to assign initial values to each class member variable, the class unique identifier uniquely identifies a class, and the class version number represents different development versions of the class. Furthermore, the attribute name, attribute type, attribute memory size, and attribute memory location define the attribute's name, type, and storage address, respectively.

[0047] S200: Determine the inheritance relationship between the classes and the association relationship between the class and the attribute.

[0048] The inheritance relationship between classes refers to the absorption and extension relationship between the parent class and the child class, that is, the child class can absorb all the attributes of the parent class and can also extend new attributes. The association relationship between classes and attributes includes two meanings. On the one hand, it refers to the attributes associated with the class. For example, the material attributes, color attributes, and pattern attributes of the first wheel class mentioned above have an association relationship. On the other hand, it refers to the class associated with the attribute. When the scope of the attribute is large, different classes can also correspond to the attribute. For example, the pattern attribute can correspond to the convex pattern class and the concave pattern class, and the convex pattern class and the concave pattern class can correspond to different attributes or subclasses.

[0049] Figure 2 The following diagram shows the inheritance and association relationships of the first embodiment of the present invention. Figure 2 There are two Schema base class patterns, where the class collections in the Schema base class pattern on the left include the Schema base class, parent class 1, parent class 2, and class A. The above classes have inheritance relationships in turn, and each class is associated with corresponding attributes. For example, parent class 2 has an association relationship with three attributes, including attribute 1. Further, in Figure 2 As can be seen from the Schema base class schema on the right, the class set includes the Schema base class, parent class 2, and class B, which have inheritance relationships in sequence. Parent class 2 and class B are associated with corresponding attributes. The Schema base class defines a series of common interfaces for Schema data classes, but does not actually store real data. It should be noted that Figure 2 The Schema base class pattern on the right is associated with attribute 1 in the Schema base class pattern on the left, that is, the attributes in this embodiment can also be expanded to the Schema base class pattern as needed. This can adapt to more application scenarios and improve software development efficiency.

[0050] S300: Based on the inheritance relationship and the association relationship, corresponding data in the class set and the attribute set are obtained to construct an object-oriented data model.

[0051] Based on the determined class set, attribute set, inheritance relationship between classes, and association relationship between classes and attributes in the Schema base class pattern, this embodiment can call the preset interface to obtain instance data, thereby obtaining an instantiated data model. The Schema base class in this embodiment defines a series of interfaces for the framework to call. The most important thing is to obtain the class Schema interface. A series of auxiliary macros facilitate developers to construct their own Schema classes and declare data upgrades and other operations through macro definitions. For example, macros such as DATA_BEGIN(CLASS_NAME, PARENT_NAME, CLASS_ID) and DATA(TYPE, NAME) are used to define data classes and the data therein, and macros such as ADD_PROPERTY(TYPE, NAME) are used to declare data upgrades between versions.

[0052] Through the above steps, this embodiment extracts the class set and attribute set of the object in the Schema mode, and loads different business data through the inheritance relationship and association relationship between classes and attributes, so that one framework can meet a variety of different business scenarios and improve software development efficiency.

[0053] According to an example of the first embodiment of the present invention, when the data model needs to be copied, the preset copy interface is called to perform a deep copy of the class set and attribute set based on the Schema pattern. The specific copy process includes first using the constructor to construct a new Schema object. Then, under the guidance of the parent class and its own attribute Schema, the corresponding attribute memory in the object to be copied is directly copied to the new object to achieve a fully automatic deep copy. It is worth noting that the above-mentioned attributes can be simple attributes, then the copy will be a simple memory copy, and the attribute can also be a complex Schema object attribute, in which case the object copy of the Schema class will be recursively called. Figure 3 FIG1 shows a schematic diagram of deep copying in the first embodiment of the present invention. Figure 3 The left side shows the object to be copied, and the right side shows the object obtained by copying. Figure 3 The objects to be copied in the Schema object include the new Schema object memory space, virtual table address space, attribute set of parent class members (such as parent class member attribute 1, parent class member attribute 2, etc.), constructor of parent class members, attribute set of child class members (such as child class member attribute 1, child class member attribute 2, etc.), constructor of child class members. The parent class member refers to the class with an inherited relationship in the class set, and the child class member refers to the class with an inheritance relationship in the class set. Figure 3As can be seen, the data structure of the object finally copied is exactly the same as the object to be copied. Therefore, developers do not need to focus on individual object classes, but can automatically achieve deep copy of data objects by simply calling the interface.

[0054] According to an example of the first embodiment of the present invention, when the data model needs to be serialized, a preset serialization interface can be called to perform nested serialization based on the class set and the attribute set. Specifically, the data model can be stored as data to be serialized in a preset format, and then the data to be serialized can be uploaded through the serialization interface. Figure 4 Schematic diagram of binary data to be serialized according to the first embodiment of the present invention. Figure 4 As shown, the data to be serialized includes, in order, the class header information, parent class header information, parent class attribute header information set, child class header information, and child class attribute header information set. The class header information contains the binary data length and type of the data model. The parent class header information also contains the binary data length and type of the parent class object. This is followed by the parent class attribute header information and the binary data of the parent class attribute. The attribute header contains the attribute type and attribute length, etc. Then comes the child class attribute header and the binary data of the child class attribute.

[0055] If the stored data format is consistent with the data format of the software, it can be easily deserialized into a C++ memory object based on the above data. If the data format is relatively stable, developers can also make special handling for the upgrade of each data format. However, in the continuous development and release of software, the data format often changes more frequently. The invention also includes a set of automatic data format upgrade frameworks based on Schema. Users can use a series of auxiliary macros to simply declare how to upgrade the data format, such as adding attributes, changing attribute values, moving attributes, etc. When deserializing data, the framework will create intermediate memory model objects to automatically handle these upgrades and obtain the latest C++ objects.

[0056] Figure 5 This is a schematic flow chart of upgrading the data model in the first embodiment of the present invention. Figure 5 As shown, the steps of upgrading the data model include:

[0057] S510: Obtain a macro declaration to determine the data model upgrade method. For example, a macro such as ADD_PROPERTY(TYPE, NAME) may be used to declare data upgrades between versions. Thus, based on the macro declarations related to the version upgrade, the changes made to the new version relative to the old version can be determined, and the old version can be directly upgraded based on these changes.

[0058] S520: Modify the deserialized data of the data model based on the upgrade method.

[0059] Figure 6 This is a schematic diagram of a version upgrade in the first embodiment of the present invention. Figure 6 As shown, the memory object model is a tree structure, including Class A, Parent Class 1, and Parent Class 2, which are sequentially related by inheritance. Parent Class 2 is associated with Attributes 1 and 2, while Parent Class 1 is associated with Attributes 3 and 4. Class A is associated with Attributes 5 and 6. Attributes 1, 3, and 5 are base attributes, containing single data. Attributes 2, 4, and 6 are composite attributes, meaning they are associated with other classes (not shown). Figure 6 In the figure, the tree structure corresponding to version 1 is the old version, and the tree structure corresponding to version 2 is the new version. When the memory object model is upgraded from version 1 to version 2, the specific upgrade method of the data model is determined by macro declaration. For example, when the user adds a new attribute 7 to class A through a macro declaration. When the software opens the old stored data, it will obtain the memory object model in the left figure according to the schema when class A was saved, and load the stored data into each node of the model. According to the user's declaration, the framework adds a leaf node, namely attribute 7, to this memory object model, obtains the new object model shown in the right figure, and then obtains the C++ object according to the new object model. It can be understood that the addition of an attribute during the above-mentioned software upgrade is only an example, not a limitation of this embodiment. Any general upgrade method including adding class attributes, deleting class attributes, modifying attribute names, modifying attribute types, moving attributes to parent classes, etc. are all within the protection scope of this embodiment.

[0060] S530: Serialize the modified deserialized data to complete the upgrade of the data model.

[0061] The serialization process can be referred to Figure 4 Specifically, the upgraded data model is stored as data to be serialized in a preset format, and then the data to be serialized is uploaded through the serialization interface. The data to be serialized includes class header information, parent class header information, parent class attribute header information set, child class header information, child class attribute header information set, etc., which are arranged in sequence.

[0062] Through the above process, the framework provided by this embodiment can automatically realize the upgrade between the new and old versions according to the developer's macro declaration. The upgrade process is simple to operate and highly accurate, which can effectively improve the upgrade efficiency of the data model.

[0063] Please continue reading Figure 7, shows a data processing device for an object-oriented language. In this embodiment, the data processing device 70 for an object-oriented language may include or be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the present invention and implement the above-mentioned C++ object processing method. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions. It is more suitable for describing the execution process of the log management device 70 in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment:

[0064] The framework determination module 71 is adapted to determine a class set and an attribute set based on a Schema pattern according to the category of the object; each class in the class set is used to represent a nested structure of the object, and each attribute in the attribute set is used to represent descriptive information of the corresponding class;

[0065] An inheritance association determination module 72, adapted to determine the inheritance relationship between the classes and the association relationship between the class and the attribute;

[0066] The model construction module 73 is adapted to obtain corresponding data in the class set and the attribute set based on the inheritance relationship and the association relationship, and construct an object-oriented data model.

[0067] Through the above-mentioned device, this embodiment extracts the class set and attribute set of the object in the Schema mode, and loads different business data through the inheritance relationship and association relationship between classes and attributes, so that one framework can meet a variety of different business scenarios and improve software development efficiency.

[0068] This embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including a standalone server or a server cluster composed of multiple servers) that can execute programs. The computer device 80 of this embodiment includes at least but is not limited to: a memory 81 and a processor 82 that can communicate with each other via a system bus, such as Figure 8 It should be pointed out that Figure 8 Computer device 80 is shown having only components 81 - 82 , but it should be understood that implementing all of the components shown is not a requirement, and greater or fewer components may alternatively be implemented.

[0069] In this embodiment, the memory 81 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 81 may be an internal storage unit of the computer device 80, such as the hard disk or memory of the computer device 80. In other embodiments, the memory 81 may also be an external storage device of the computer device 80, such as a plug-in hard disk equipped on the computer device 80, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 81 may also include both the internal storage unit of the computer device 80 and its external storage device. In this embodiment, the memory 81 is generally used to store the operating system and various application software installed on the computer device 80, such as the program code of the object-oriented language data processing device 70 in the first embodiment. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or are to be output.

[0070] In some embodiments, the processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 82 is generally used to control the overall operation of the computer device 80. In this embodiment, the processor 82 is used to execute program code stored in the memory 81 or process data, such as executing the object-oriented language data processing device 70 to implement the object-oriented language data processing method of the first embodiment.

[0071] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic storage device, a disk, an optical disk, a server, an App store, etc., on which a computer program is stored, and when the program is executed by a processor, a corresponding function is implemented. The computer-readable storage medium of this embodiment is used to store an object-oriented language data processing device 70, which, when executed by a processor, implements the object-oriented language data processing method of Example 1.

[0072] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0073] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.

[0074] Those skilled in the art will appreciate that all or part of the steps in the method of the above-mentioned embodiment can be accomplished by instructing the relevant hardware through a program, and the program can be stored in a computer-readable medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0075] Throughout this specification, references to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.

[0077] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data processing method in an object-oriented language, characterized in that: The following steps are involved: Determine a class set and an attribute set based on the Schema pattern according to the category of the object; each class in the class set is used to represent the nested composition structure of the object, and each attribute in the attribute set is used to represent the description information of the corresponding class; Determine the inheritance relationship between the classes and the association relationship between the class and the attribute; Acquire corresponding data in the class set and the attribute set based on the inheritance relationship and the association relationship, and construct an object-oriented data model; The method further comprises: In the case where the data model needs to be serialized, the data model is stored in a preset format as data to be serialized, the data to be serialized including class header information, parent class header information, parent class attribute header information set, child class header information, and child class attribute header information set, which are sequentially composed; wherein the parent class refers to a class in the class set that has an inherited relationship, and the child class refers to a class in the class set that has an inherited relationship; Uploading the data to be serialized through a preset serialization interface; The method further comprises: Obtaining a macro declaration to determine how the data model is to be upgraded; Modifying the deserialized data of the data model based on the upgrade method; The modified deserialized data is serialized to complete the upgrade of the data model.

2. The object-oriented language data processing method according to claim 1, characterized in that: The step of determining a class set and an attribute set based on a Schema pattern according to the category of the object includes: Determine the class name, class constructor, class unique identifier, and class version number of each of the classes; An attribute name, attribute type, attribute memory size, and attribute memory location of each of the attributes are determined.

3. The object-oriented language data processing method according to claim 2, characterized in that: The method further comprises: When the data model needs to be copied, the preset copy interface is called to perform a deep copy of the class set and attribute set based on the Schema mode.

4. The object-oriented language data processing method according to claim 3, characterized in that: The step of deeply copying the class set and attribute set based on the Schema mode includes: Use the constructor to construct a new Schema object; Constructing data to be copied based on the new Schema object, the data to be copied includes, in order, a new Schema object memory space, a virtual table address space, a set of attributes of a parent class member, a constructor of the parent class member, a set of attributes of a child class member, and a constructor of the child class member, wherein the parent class member refers to a class in the class set that has an inherited relationship, and the child class member refers to a class in the class set that has an inheritance relationship; The data to be copied is stored in a new memory space to obtain the copied data of the data model.

5. An object-oriented language data processing device for implementing the method according to any one of claims 1 to 4, characterized in that: include: The framework determination module is used to determine the class set and attribute set based on the Schema pattern according to the scope of the object; Each class in the class set is used to represent a nested structure of the object, and each attribute in the attribute set is used to represent description information of the corresponding class; An inheritance association determination module, adapted to determine the inheritance relationship between the classes and the association relationship between the class and the attribute; The model construction module is adapted to obtain corresponding data in the class set and the attribute set based on the inheritance relationship and the association relationship, and construct an object-oriented data model.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Data schemata in programming language contracts

    US20080147698A1