Data processing method and device, storage medium and electronic equipment
By defining the field information of data objects through base class design, and constructing data objects suitable for the target platform, the problem of low data exchange efficiency in existing technologies is solved, and efficient data processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI BILIBILI TECH CO LTD
- Filing Date
- 2022-12-28
- Publication Date
- 2026-06-19
Smart Images

Figure CN115857897B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer technology and data exchange technology, and in particular to a data processing method, apparatus, storage medium and electronic device. Background Technology
[0002] With the development of computer technology, various enterprises have established their own data integration platforms to facilitate data management and provide efficient data services. This has led to the need for data exchange before data can be used between different data application platforms.
[0003] Currently, the common data exchange method is to use protobuf technology to serialize the original data object and then deserialize it to obtain a usable data object. However, the protobuf method also has at least the following disadvantages: the memory layout is not compact enough, the compilation efficiency is low, and the scalability is poor. Summary of the Invention
[0004] This application provides a data processing method, apparatus, storage medium, and electronic device to solve the problems existing in related technologies. The technical solution is as follows:
[0005] In a first aspect, embodiments of this application provide a data processing method, including:
[0006] Retrieve the first field information of the first data object;
[0007] Based on the information in the first field, determine the information in the second field of the second data object;
[0008] Based on the information in the second field, obtain the second data object;
[0009] Send the second data object to the data application platform;
[0010] The first data object is a data object of the original class, which is a data structure used by the original application platform; the second data object is a data object of the user class, which is a data structure used by the data application platform. The original class and the user class inherit from the same base class.
[0011] Secondly, embodiments of this application provide a data processing apparatus, including:
[0012] The first field information acquisition module is used to acquire the first field information of the first data object;
[0013] The second field information determination module is used to determine the second field information of the second data object based on the first field information.
[0014] The data object acquisition module is used to obtain the second data object based on the information in the second field;
[0015] The application module is used to send the second data object to the data application platform;
[0016] The first data object is a data object of the original class, which is a data structure used by the original application platform; the second data object is a data object of the user class, which is a data structure used by the data application platform. The original class and the user class inherit from the same base class.
[0017] Thirdly, embodiments of this application provide an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described data processing method.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium that stores computer instructions, wherein when the computer instructions are executed on a computer, the methods in any of the above-described embodiments are performed.
[0019] The advantages or beneficial effects of the above technical solutions include at least the following:
[0020] This application embodiment determines the second field information of a second data object based on the first field information of a first data object, and then obtains the second data object based on the second field information for use by a data application platform, thereby realizing data exchange between the first and second data objects. The data processing method provided by this application embodiment is simple, requires no serialization or deserialization operations, and both data construction and data parsing processes can be performed offline, greatly reducing memory consumption and improving data processing efficiency.
[0021] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of this application will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description
[0022] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in this application and should not be construed as limiting the scope of this application.
[0023] Figure 1 A schematic diagram of the architecture of a data processing method according to an embodiment of this application is shown.
[0024] Figure 2 A schematic flowchart of a data processing method according to an embodiment of this application is shown.
[0025] Figure 3 It shows Figure 2 A flowchart illustrating the sub-steps of step S220.
[0026] Figure 4 It shows Figure 3 A flowchart illustrating the sub-step of step S221.
[0027] Figure 5 This is a schematic structural block diagram of a data processing apparatus according to an embodiment of this application.
[0028] Figure 6 This is a block diagram of an electronic device used to implement the data processing method of the embodiments of this application. Detailed Implementation
[0029] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0030] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0031] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order of the steps, but are only used to facilitate the description of this application and to distinguish each step, and therefore should not be construed as a limitation of this application.
[0032] Figure 1 A schematic diagram illustrating the architecture of a data processing method according to an embodiment of this application is shown. Figure 1 As shown, service platforms (2, 3) can provide services such as data processing, and can be a single server, a server cluster, or a cloud computing service center. Service platforms 2 / 3 have a built-in data processing system that interacts with service platform 3 / 2 and provides real-time or offline processing.
[0033] It should be noted that, Figure 1 The number of servers shown is merely illustrative and is not intended to limit the scope of patent protection in this application.
[0034] The following will provide several embodiments, using the aforementioned service platform 2 as the executing entity, to illustrate the data processing scheme.
[0035] This application provides a new data processing solution for the following situations:
[0036] Using Protobuf (Protocol Buffers) for data format exchange requires serialization and deserialization steps, resulting in high memory overhead and low processing efficiency. Furthermore, it is difficult to apply to complex data type conversions, custom data types, data bridging, and other application scenarios.
[0037] The data processing solution provided in this application implements a one-to-one data type design through a base class, ensuring that the second data type of any required second data object can find a corresponding first data type. Based on the found first data type, the corresponding field names and positions are determined. Based on the data type, field names, and field positions, the second data object is compiled and obtained; this second data object is a usable data object. The entire process does not involve serialization or deserialization and does not require online parsing, greatly reducing memory overhead and improving data processing efficiency.
[0038] The data processing scheme of this application will be described in detail below through several embodiments.
[0039] The following is a definition of the terminology used in this application:
[0040] ProtoBuf (Protocol Buffers) is an open-source data format from Google, suitable for high-performance data transmission scenarios with high response speed requirements. Because ProtoBuf is a binary data format, it requires encoding and decoding. The data itself is not readable; therefore, truly readable data can only be obtained after deserialization.
[0041] XML (Extensible Markup Language): is a subset of Standard Generalized Markup Language (SGML) and is a markup language used to mark up electronic documents to give them structure.
[0042] JSON (JavaScript Object Notation) is a lightweight data-interchange format. Based on a subset of ECMAScript (the JavaScript specification defined by the European Computer Association), it uses a text format completely independent of programming languages to store and represent data. Its concise and clear hierarchical structure makes JSON an ideal data exchange language. It is easy for humans to read and write, as well as easy for machines to parse and generate, effectively improving network transmission efficiency.
[0043] A stub class is a class that implements all the methods in an interface with an empty method body. This allows you to create a class that implements the interface by inheriting from the stub. In other words, by defining a stub class, you can derive several subclasses that conform to the same semantics but have different functions.
[0044] Example 1
[0045] Figure 2 A flowchart illustrating a data processing method according to an embodiment of this application is shown. Figure 2 As shown, the data method may include:
[0046] S210, obtain the first field information of the first data object.
[0047] The first data object is the data object in the original application platform, i.e., the source data object.
[0048] This application embodiment achieves data exchange or data transmission between the original application platform and this data application platform by exchanging the acquired source data object.
[0049] Data objects can be of complex data types or custom data types, such as an IP (Internet Protocol) address.
[0050] Data objects can include experimental parameters, configuration information, and vocabulary indexes in JSON format, or they can be markup languages in XML format.
[0051] The first field information may include one or more of the following: data type, field name, field identifier, etc. Based on this first field information, the corresponding field data can be found.
[0052] Retrieving the first field information of a first data object can be done in response to a data processing (data exchange or data transmission) request, by obtaining the corresponding first data object, and then retrieving the first field information of the first data object based on that first data object. There can be one or multiple first data objects. The data types of multiple first data objects can be different or the same.
[0053] When multiple first data objects have different data types, the first field information of each first data object can be obtained simultaneously or separately.
[0054] S220, Based on the first field information, determine the second field information of the second data object.
[0055] In one example, a correspondence can be established between the first field information and the second field information, so that the second field information of the second data object can be determined through the first field information.
[0056] In one example, a correspondence can be established between the positions of the first and second fields. For instance, if there is a one-to-one correspondence between the positions of the first and second fields, then the field data at the corresponding field position can be retrieved based on the known field positions. The known field positions can be either the field positions of the first or second data object.
[0057] In one example, a data type correspondence can be established between the first and second field information. For instance, the data types of the first and second field information can have a one-to-one or many-to-many correspondence. Then, based on a known data type, the field data with the same data type in the corresponding data object can be retrieved. The known data type can be either the data type of the first or the data type of the second data object.
[0058] In one example, an association can be established between a first data object and a second data object. This allows us to obtain multiple second data types of the second data object and determine that all the first data types of the first data object are contained within multiple second data types. Through this association, we can obtain the fields of the first data types that are identical to the second data types. This allows us to determine the field names, field identifiers, field keys, or field numbers of the second data object—in other words, to determine the second field information of the second data object.
[0059] S230, obtain the second data object based on the second field information.
[0060] In this embodiment of the application, by determining the second field information of the second data object, the second data object can be obtained based on the second field information and the data structure of the data application platform, thereby realizing the exchange of the first data object for the use of the second data object.
[0061] The second data object is compiled based on the information in the second field, according to the data structure of this data application platform. This compilation process can be performed offline, reducing bandwidth consumption. The field data of the second data object and the first data object can be the same or different.
[0062] In this embodiment, the second field information determined based on the first field information can be one or more of the following: field name, field identifier, field key value, and field sequence number. That is, the second field information to be determined can be partial field information of the second data object; based on this partial field information, the construction of the second data object can be completed.
[0063] S240, send the second data object to the data application platform.
[0064] The data processing method in this embodiment is based on the C++ language, and the C++ language module can be stored in the service platform 2; furthermore, the C++ language module can also be stored in this data application platform.
[0065] The data processing method of this application embodiment is applicable to Java (a computer programming language), Python (a computer programming language), and C++ language modules.
[0066] When the data application platform is written in C++, the obtained second data object can be directly accessed.
[0067] If the data application platform is written in Java or Python, it can be parsed and used as needed.
[0068] In this embodiment, the first data object is a data object of the original class, which is a data structure used by the original application platform; the second data object is a data object of the user class, which is a data structure used by the data application platform. The original class and the user class inherit from the same base class.
[0069] The data processing method in this embodiment does not require the construction of structured data when online (i.e., when service platform 3 is connected to service platform 2 via the network, or when this data application platform is connected to the original application platform via the network). The construction of structured data can be performed offline. Furthermore, when online, there is no need to perform operations such as parsing, serialization, and deserialization, which can greatly reduce bandwidth consumption and further improve data processing efficiency.
[0070] In this embodiment, the first field information can be stored in a separate first structure, and the second field information can be stored in a separate second structure. The original class maintains information such as the field name, memory offset, and data type of each field in the user class. The original class can compactly write fields from JSON or other serialized data into the first data object, and the user class can also be compactly distributed in memory. Based on the first field information, the second field information of the second data object is determined, and then the second data object is constructed according to the second field information. Throughout the data exchange process, the structure type information is independent of the data itself. When accessing the user class, the CPU (central processing unit) has a greater chance of loading the current structure completely into the cache, or loading more data that will be accessed in the future into the cache, thereby significantly improving system performance.
[0071] The data processing method of this application embodiment can be used in data bridging scenarios or data indexing scenarios to determine the data object to be obtained based on the index value.
[0072] In one implementation, such as Figure 3 As shown, step S220 includes:
[0073] S221, determine multiple second data types of the second data object.
[0074] In this embodiment, multiple second data types of a second data object can be determined through various methods now and in the future known to those skilled in the art. This is based on the fact that the second data type can correspond to a corresponding field in the first data object.
[0075] S222, Based on multiple second data types, determine multiple first data types corresponding to the multiple second data types from the first data object.
[0076] Based on the correspondence between the first data type and the second data type, multiple first data types corresponding to multiple second data types can be determined from the first data object.
[0077] Multiple secondary data types can be different, or they can be the same.
[0078] For example, if multiple second data types include short, int, and string, then the short, int, and string fields are found from the first data object, respectively.
[0079] For example, if multiple data types are of type short, then the short type field is found from the first data object.
[0080] S223, determine multiple fields corresponding to multiple first data types respectively, and obtain the multiple field names and multiple field positions of the multiple fields.
[0081] In the examples above, for instance, after locating a short field from the first data object, the field name, field identifier, or field position of that short field is determined. The field position can be represented by an address offset.
[0082] S224, determine the second field information of the second data object, which includes multiple second data types, multiple field names, and multiple field positions.
[0083] A second data object is obtained by acquiring multiple secondary data types, multiple field names, and multiple field positions. This second data object can then be used by a data application platform.
[0084] In this embodiment, a second data type is used to obtain the corresponding first data type from the first data object, and to determine the corresponding field names, field positions, and other information. This determines the second data type, field names, and field positions of the second data object, thus constructing the second data object. Since the original class and the user class inherit from the same base class, related data types can be defined through the base class. Both the first and second data objects include these related data types, and the corresponding first data type can be obtained from the first data object through the association relationship between the data types. These related data types can be defined according to user requirements.
[0085] In one implementation, such as Figure 3 As shown, step S221 includes:
[0086] S2211 defines multiple data types in the base class.
[0087] In this embodiment, the Stub design pattern in C++ can be used to define a Stub class. Both the original class and the user class inherit from the Stub class. The Stub class defines multiple data types, ensuring that both the original class and the user class possess these data types. This establishes a one-to-one correspondence between the second data type and the first data type.
[0088] The original class and the class being used have the same data type, but their functions can be different. For example, they can have different field values, but their field names, data types, and field positions can be the same.
[0089] Since the primitive class and the utilizing class inherit from the same base class, it can be determined that the data types of the primitive class and the utilizing class must be within the range of multiple data types defined in the base class.
[0090] This application embodiment defines multiple data types of a base class, which can define the complete data type of the first data object. This ensures that when the first data object needs to be used interchangeably, the corresponding data type of the first data object can be obtained through this data processing method.
[0091] S2212, Determine multiple second data types as multiple second data objects.
[0092] In this embodiment, by determining multiple data types as multiple second data types for a second data object, and then using these second data types to correspond to the first data type of a first data object, multiple fields of the first data object can be obtained, thereby acquiring complete second field information. Then, based on this complete second field information, a second data object is generated.
[0093] In this embodiment, a connection is established between a first data object and a second data object using the Stub design pattern in C++. Based on this connection, the second field information of the second data object is obtained, and a second data object is generated based on the second field information, thus realizing data exchange between the first and second data objects. The entire online process only involves data retrieval and does not involve data construction, serialization, or deserialization, which can greatly reduce memory overhead and improve data processing efficiency.
[0094] In this embodiment, the original class and the user class inherit from the same Stub class, and the definition process can be as follows:
[0095]
[0096] In this example, "using Date" is the using class, and "Impl" is the original class. The Stub class defines four exemplary data types: data0, data1, data2, and data3. Through data0, data1, data2, and data3 defined in the Stub class, the field data in the first data object of the original class can be accessed.
[0097] In one implementation, the data processing method further includes: defining a pointer variable for a second data object in the class, the pointer variable pointing to a field of a first data type corresponding to the second data type.
[0098] By defining a pointer variable to a second data object within the class, the field pointed to by that pointer variable can be used to construct the second data object. By defining a pointer variable, values can be assigned to data0, data1, data2, and data3 within the class.
[0099] In one example, each `data` member in the first data object can be a key-value pair. By assigning a key to `data0`, `data1`, `data2`, and `data3` in the class respectively, the corresponding field value can be obtained through the assigned key. Therefore, constructing the second data object does not require obtaining the specific field values from the first data object, further reducing memory overhead.
[0100] The data processing method in this embodiment achieves the data processing task by defining a pointer variable for the user class. The code is simple, minimal, and easy to use, further improving compilation speed.
[0101] For example, the process of defining a class can be as follows:
[0102]
[0103] In this embodiment, a pointer is defined in the class. Since a pointer occupies 8 bytes in memory in a 64-bit system, the fields of the class and the original class can have a one-to-one correspondence.
[0104] In this embodiment, the memory layout of each usage class is completely identical to that of the void* pointer. Furthermore, no other elements in either the Stub base class or the usage class would corrupt the memory structure. Therefore, an array of pointers can be defined in the usage class, where each element points to a field in the first data object. In one implementation, the original class can be defined as follows:
[0105]
[0106] The primitive class maintains information about all fields, including field names and positions. It can be used to load field data and maintain a data object with the same data structure as the class being used. This allows the class being used to access the primitive class's field data based on the base class, thereby obtaining the data object to be constructed.
[0107] Because the original class and the user class inherit from the same base class, it can be ensured that the fields in the original class and the user class correspond one-to-one and have the same data structure. Each field in the original class can satisfy the expected data structure in the corresponding field in the user class.
[0108] In an exemplary application scenario, it can be defined as follows:
[0109]
[0110] In the above definition, based on user needs, the base class (-tSideAbyssData) is defined, which determines the data structure of the original class (BsAbyssData).
[0111] using BsRuntimeAbyssData=BsAbyssData<::abyss::RuntimeE×pParamData>;
[0112] BsRuntimeAbyssData is an implementation that inherits from the base class RuntimeExpParamData.
[0113] using BsIndexAbyssData=BsAbyssData<::abyss::IndexExpParamData>;
[0114] BsIndexAbyssData is an implementation that inherits from the base class IndexExParamData.
[0115] Through the implementation of the two code segments above, the Index is loaded from the index data into memory, or loaded into a data format that is easy to use, and the Runtime indexes the data that needs to be used from the Index.
[0116] The base class provides ExpParam (experimental parameters), each of which provides a data type and field name, thus enabling the simultaneous definition of both the Runtime (access) side and the Index (index) side classes.
[0117] After the index data is loaded on the Index side, the Runtime side only needs to provide the key for each experimental parameter to initialize the value of each member in the Runtime from the object list on the Index side.
[0118] In another exemplary application scenario, the base class (Impl) can be defined as follows:
[0119]
[0120] In this embodiment, the Creative class may include two parts: jstruct and jbuild. jstruct contains the code for accessing data on the business side, and jbuild contains the code for parsing JSON data on the framework side. jbuild can be set to be hidden from the user.
[0121] The jstruct definition can be as follows:
[0122]
[0123] In jstruct, you only need to pass a Unit template parameter to jstruct::load.
[0124] The class (unit) can be defined as follows:
[0125]
[0126] In this embodiment, the class includes cases where each element is not necessarily 8 bytes. In this case, memory alignment can be used to achieve byte alignment for each Data member.
[0127] In one example, byte alignment can be achieved by padding the alignment.
[0128] For example, if the first data is 2 bytes, the second data is 4 bytes, and the third data is 8 bytes, the first data can be padded to 4 bytes, and the first and second data can be combined to 8 bytes. This allows for reading two data items at once, thus reducing memory overhead.
[0129] In this embodiment of the application, the user only needs to maintain a base class and a usage class, so as to maintain the data structure to be constructed by defining the base class and obtain data from the original class by defining the usage class.
[0130] In one implementation, step S230 includes:
[0131] Generate a data channel based on the first or second data type;
[0132] Based on the field name and data channel, determine the second field information of the second data object.
[0133] In this embodiment, based on the Stub design pattern, a one-to-one correspondence is established between the first data type and the second data type. By obtaining either the first or second data type, a data channel corresponding to that data type can be established, thereby achieving data bridging between the first and second data types.
[0134] By building a data bridge, fields in the first data object can be called to perform parsing or data construction related to this data application platform. Alternatively, the first data object can be swapped and used in this data application platform.
[0135] In one example, based on the constructed data bridge, this data application platform can copy or view fields in the first data object.
[0136] In one implementation, step S230 includes: obtaining a second data object by taking multiple second data types, multiple field names, and multiple field positions in a manner that matches the data structure of the data application platform.
[0137] Because the data structure of the original application platform differs from that of this data application platform, the data objects need to be exchanged. Only the exchanged second data object is suitable for this data application platform.
[0138] In one example, the second field information obtained has the same field position, field name, and field identifier as the first data object. By matching the data structure of the data application platform, the data is constructed, and only then can the obtained second data object be applicable to this data application platform.
[0139] In this embodiment, after obtaining multiple second data types, multiple field names, and multiple field positions, the multiple second data types, multiple field names, and multiple field positions are compiled into a second data object according to the data structure of the matching data application platform; this enables data construction in offline mode and further reduces bandwidth consumption.
[0140] In one implementation, the data processing method further includes: parsing the second data object based on a data application platform, so that the data application platform applies the parsed second data object.
[0141] In one example, after obtaining the second data object, it is parsed to make the data application platform suitable for it. Since the original application platform and this data application platform are two different data platforms based on different data integration methods, applying the obtained second data object to this data application platform also requires parsing the second data object so that the data application platform can read and apply it.
[0142] In this embodiment of the application, by obtaining multiple second data objects and then parsing the second data objects, offline parsing can be achieved, further reducing bandwidth consumption.
[0143] Example 2
[0144] Figure 5 A structural block diagram of a data processing apparatus 500 according to an embodiment of this application is shown. Figure 5 As shown, the data processing device 500 may include:
[0145] The first field information acquisition module 510 is used to acquire the first field information of the first data object;
[0146] The second field information determination module 520 is used to determine the second field information of the second data object based on the first field information;
[0147] The data object acquisition module 530 is used to obtain the second data object based on the second field information;
[0148] Application module 540 is used to send the second data object to the data application platform;
[0149] The first data object is a data object of the original class, which is a data structure used by the original application platform; the second data object is a data object of the user class, which is a data structure used by the data application platform. The original class and the user class inherit from the same base class.
[0150] In one implementation, the second field information determination module 520 is used for:
[0151] The second data type determination module is used to determine multiple second data types of a second data object;
[0152] The first data type determination module is used to determine multiple first data types corresponding to multiple second data types from a first data object based on multiple second data types;
[0153] The field determination module is used to determine multiple fields corresponding to multiple first data types, and to obtain multiple field names and multiple field positions of multiple fields. The second field information determination submodule is used to determine the second field information of multiple second data types, multiple field names and multiple field positions as second data objects.
[0154] In one implementation, the second data type determination module is used to:
[0155] Define multiple data types in the base class;
[0156] Identify multiple data types as secondary data types for a secondary data object.
[0157] In one embodiment, the data processing apparatus 500 further includes:
[0158] The pointer module is used to define pointer variables for second data objects in the class, where the pointer variables point to fields of the first data type that correspond to multiple second data types.
[0159] In one implementation, the data object acquisition module 530 is configured to:
[0160] Generate a data channel based on the first or second data type;
[0161] Based on the field name and data channel, determine the second field information of the second data object.
[0162] In one implementation, the data object acquisition module 530 includes: a data construction module, used to obtain a second data object by taking multiple second data types, multiple field names, and multiple field positions in a manner that matches the data structure of the data application platform.
[0163] In one embodiment, the data processing apparatus 500 further includes a data continuation module, used to parse the second data object based on the data application platform, so that the data application platform applies the parsed second data object.
[0164] The functions of each module in each device in the embodiments of this application can be found in the corresponding descriptions in the above methods, and will not be repeated here.
[0165] Figure 6 A structural block diagram of an electronic device according to an embodiment of this application is shown. Figure 6 As shown, the electronic device includes a memory 610 and a processor 620. The memory 610 stores instructions that can be executed on the processor 620. When the processor 620 executes the instructions, it implements the data processing method described in the above embodiments. The number of memories 610 and processors 620 can be one or more. This electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0166] The electronic device may also include a communication interface 630 for communicating with external devices and exchanging data. The devices are interconnected using different buses and can be mounted on a common motherboard or otherwise as needed. The processor 620 can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). The bus can be divided into address buses, data buses, control buses, etc. For ease of illustration, Figure 6The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0167] Optionally, in a specific implementation, if the memory 610, processor 620, and communication interface 630 are integrated on a single chip, then the memory 610, processor 620, and communication interface 630 can communicate with each other through an internal interface.
[0168] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.
[0169] This application provides a computer-readable storage medium (such as the memory 610 described above) that stores computer instructions, which, when executed by a processor, implement the method provided in this application.
[0170] Optionally, memory 610 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device according to the data processing method. Furthermore, memory 610 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 610 may optionally include memory remotely located relative to processor 620, and these remote memories can be connected to the electronic device of the data processing method via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0171] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0172] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more (two or more) executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0173] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0174] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0175] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0176] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized by, include: Retrieve the first field information of the first data object; Based on the first field information, determine the second field information of the second data object; Based on the information in the second field, the second data object is obtained; Send the second data object to the data application platform; Wherein, the first data object is a data object of the original class, and the original class is a data structure that matches the original application platform; the second data object is a data object of the usage class, and the usage class is a data structure that matches the data application platform, and the original class and the usage class inherit from the same base class; The step of determining the second field information of the second data object based on the first field information includes: Determine multiple second data types for the second data object; Based on the plurality of second data types, a plurality of first data types corresponding to the plurality of second data types are determined from the first data object; Determine multiple fields corresponding to the multiple first data types respectively, and obtain multiple field names and multiple field positions of the multiple fields; The plurality of second data types, the plurality of field names, and the plurality of field positions are determined to be the second field information of the second data object; The method further includes: defining a pointer variable for the second data object in the class of use, the pointer variable pointing to a field of the first data type corresponding to the second data type.
2. The method of claim 1, wherein, The determination of multiple second data types of the second data object includes: Multiple data types are defined in the base class; The base class is determined to contain multiple data types as multiple second data types of the second data object.
3. The method of claim 2, wherein, Obtaining the second data object based on the second field information includes: Generate a data channel based on the first data type or the second data type; Based on the data channel, obtain the second data object.
4. The method of claim 1, wherein, Obtaining the second data object based on the second field information includes: The second data object is obtained by combining the multiple second data types, the multiple field names, and the multiple field positions in a manner that matches the data structure of the data application platform.
5. The method of claim 1, wherein, Also includes: Based on the data application platform, the second data object is parsed so that the data application platform can apply the parsed second data object.
6. A data processing apparatus, characterized by, include: The first field information acquisition module is used to acquire the first field information of the first data object; The second field information determination module is used to determine the second field information of the second data object based on the first field information; A data object acquisition module is used to obtain the second data object based on the second field information; The application module is used to send the second data object to the data application platform; Wherein, the first data object is a data object of the original class, and the original class is a data structure that matches the original application platform; the second data object is a data object of the usage class, and the usage class is a data structure that matches the data application platform, and the original class and the usage class inherit from the same base class; The step of determining the second field information of the second data object based on the first field information includes: Determine multiple second data types for the second data object; Based on the plurality of second data types, a plurality of first data types corresponding to the plurality of second data types are determined from the first data object; Determine multiple fields corresponding to the multiple first data types respectively, and obtain multiple field names and multiple field positions of the multiple fields; The plurality of second data types, the plurality of field names, and the plurality of field positions are determined to be the second field information of the second data object; A pointer module is used to define pointer variables of the second data object in the class of use, the pointer variables pointing to fields of the first data type corresponding to the second data type.
7. An electronic device, comprising: include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-6.
9. A computer program product, characterised in that, The computer program product includes computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-6.