Object processing method and device and storage medium

By assigning identification information to the message objects in the object graph and serializing the pointer field, the end-to-end delay problem caused by serialization of multiple object association relationships in the object graph is solved, and parallel deserialization and delay reduction are achieved.

CN120045247APending Publication Date: 2025-05-27HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311587458.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In cross-platform or network transmission, the serialization and deserialization process of multiple objects and their associations in the object graph results in excessive end-to-end delays.

Method used

By assigning identification information to each message object in the object graph, participating in serialization processing instead of its pointer field, serialized data that does not depend on the data sequence is generated, and deserialization is performed in parallel on the peer side.

Benefits of technology

The serial process of serialization processing, network transmission and deserialization processing is reduced, end-to-end delay and transmission efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045247A_ABST
    Figure CN120045247A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an object processing method and device and a storage medium. In the embodiment of the invention, the unique identification information is allocated to each message object in the object graph, and the identification information of each message object replaces the pointer domain of the message object to participate in the serialization processing of the message object, that is, the pointer domains of the plurality of message objects do not participate in the serialization processing; the reference relationship among the plurality of message objects reflected in the pointer domain is replaced by the identification information of the plurality of message objects, so that no data dependency relationship exists among the serialized data of the plurality of message objects contained in the object graph; according to the method, the serialized data without the data dependency relationship is provided for the opposite end, so that the opposite end can execute deserialization processing in a parallel mode to obtain the object graph, the flow of serialization processing, network transmission and deserialization processing is no longer serial, and the end-to-end time delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to an object processing method, device, and storage medium. Background Art

[0002] In cross-platform or network transmission, data processing is often required, such as serialization / deserialization. Among them, serialization processing refers to the process of converting an object (such as various messages or data to be transmitted) into byte information suitable for transmission, and deserialization is the process of restoring byte information to an object.

[0003] In practical applications, there may be multiple objects with an association relationship at a certain moment, and the multiple objects and their association relationships can form an object graph. Currently, considering the association relationships between the objects in the object graph, the entire object graph is serialized and then the serialized data is sent to the peer for deserialization. The end-to-end latency in the entire process is very large. Summary of the Invention

[0004] Multiple aspects of this application provide an object processing method, device, and storage medium to reduce end-to-end latency.

[0005] An embodiment of this application provides an object processing method, including: obtaining an object graph to be serialized, where the object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects; respectively allocating identification information to the multiple message objects; using the identification information of the multiple message objects to replace the pointer fields in the multiple message objects and participating in the serialization processing of the multiple message objects to obtain the serialized data of the multiple message objects; transmitting the serialized data of the multiple message objects to the peer, and the serialized data of the multiple message objects at least includes the identification information of the multiple message objects and the serialization results of the value fields in the multiple message objects.

[0006] An embodiment of this application further provides an object processing method, including: receiving the serialized data of multiple message objects transmitted by the peer, where there is no data dependency between the serialized data of the multiple message objects, the multiple message objects belong to the same object graph, and there is a reference relationship between the multiple message objects; respectively performing parsing processing on the serialized data of the multiple message objects in a parallel manner to obtain the identification information of the multiple message objects and the value fields of the multiple message objects; restoring the pointer fields in the multiple message objects according to the identification information of the multiple message objects to obtain an object graph.

[0007] An embodiment of this application further provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the object processing method provided by the embodiment of this application.

[0008] The embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the object processing method provided by the embodiment of the present application.

[0009] In the embodiment of the present application, identification information is assigned to each message object in the object graph, and the identification information of each message object is used to replace the pointer field of the message object to participate in the serialization process of the message object, that is, the pointer fields of multiple message objects do not participate in the serialization process, and the reference relationships between multiple message objects reflected in the pointer fields are replaced by the identification information of multiple message objects, so that there is no data dependency between the serialization data of multiple message objects included in the object graph; the serialization data without data dependency is provided to the peer end, so that the peer end can perform the deserialization process in a parallel manner to obtain the object graph, so that the processes of serialization, network transmission, and deserialization are no longer serial, reducing the end-to-end delay. Description of the Drawings

[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The exemplary embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0011] Figure 1a It is a schematic diagram of a message object provided by an exemplary embodiment of the present application;

[0012] Figure 1b It is a schematic diagram of a serialized data provided by an exemplary embodiment of the present application;

[0013] Figure 1c It is a schematic diagram of another serialized data provided by an exemplary embodiment of the present application;

[0014] Figure 1d It is a schematic diagram of still another serialized data provided by an exemplary embodiment of the present application;

[0015] Figure 1e It is a schematic diagram of another message object provided by an exemplary embodiment of the present application;

[0016] Figure 1f It is a schematic diagram of a serialized data provided by an exemplary embodiment of the present application;

[0017] Figure 1g It is a schematic diagram of a deserialized data provided by an exemplary embodiment of the present application;

[0018] Figure 1h It is a schematic diagram of a serialization / deserialization process of a serial structure provided by an exemplary embodiment of the present application;

[0019] Figure 2 A flowchart of an object processing method provided for an exemplary embodiment of the present application;

[0020] Figure 3 A schematic diagram of serializing an object graph provided for an exemplary embodiment of the present application;

[0021] Figure 4 A flowchart of an object processing method provided for an exemplary embodiment of the present application;

[0022] Figure 5 A schematic diagram of serialization and deserialization provided for an exemplary embodiment of the present application;

[0023] Figure 6 A flowchart of a data processing method provided for an exemplary embodiment of the present application;

[0024] Figure 7a A schematic diagram of the structure of an object processing device provided for an exemplary embodiment of the present application;

[0025] Figure 7b A schematic diagram of the structure of a data processing device provided for an exemplary embodiment of the present application;

[0026] Figure 7c A schematic diagram of the structure of an object processing device provided for an exemplary embodiment of the present application;

[0027] Figure 7d A schematic diagram of the structure of another data processing device provided for an exemplary embodiment of the present application;

[0028] Figure 8 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of the present application. Detailed implementation manners

[0029] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0030] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0031] Before introducing the embodiments of this application, first introduce the layout of the object diagram and the encoding formats of different serializers / deserializers.

[0032] As Figure 1a shown, each message object includes: a header, a value field, and a reference field. The value field is the object data, and the reference field points to other objects referenced by this object. For example, message object A references message object B. The value field of message object A is represented by V1, and the value field of message object B is represented by V2. The reference field of message object A is implemented as the address information of message object B in memory.

[0033] The following introduces the encoding formats of several serializers / deserializers.

[0034] 1) The built-in serializer / deserializer in Java (Serializer / Deserializer), simply referred to as JavaS / D. Serialize the metadata of the class used by each message object and the value field of this message object. In the case where this message object references other message objects, serialize the metadata and value fields of the other message objects referenced by this reference. Among them, the metadata is serialized using a string type, with a relatively long serialization length and large memory overhead. As Figure 1b shown, the serialized data of message object A contains the serialized data of message object B.

[0035] 2) Kryo is the most representative third-party serialization library that supports Java serialization. Compared with the built-in serialization method in Java, Kryo uses a class identifier (class_ID) to map the classes used, reducing the size of the metadata. As Figure 1c shown, the serialized data of message object A contains the serialized data of message object B.

[0036] 3) Skyway uses a class identifier mechanism similar to Kryo to reduce the length of the metadata, and during the serialization process, converts the absolute address pointed to by the reference field into a relative offset address. As Figure 1d shown, the serialized data of message object A contains the serialized data of message object B.

[0037] Figure 1e Introduced the encoding format adopted by the Cereal serializer. Among them, Cereal is a serialization tool library implemented based on C++. In Figure 1e the object graph includes: message object A, message object B, message object C, and message object D. Message object A references message object B and message object C, message object B references message object D, and message object D references message object A as an example for illustration. Among them, H represents the header of each message object, and V represents the value field of each message object; in memory, the starting address of message object A is 1000, the offset address is 72, and the termination address is 1072. The starting address of message object B is 2000, the offset address is 48, and the termination address is 2048. The starting address of message object C is 3000, the offset address is 40, and the termination address is 3040. The starting address of message object D is 4000, the offset address is 40, and the termination address is 4040. Figure 1f Exemplarily shows the serialization result of the object graph and the relative offset addresses between each message object. For example, the relative offset address of message object A is 0, the relative offset address of message object B is 0 + 72 = 72, the relative offset address of message object C is 72 + 48 = 120, and the relative offset address of message object D is 120 + 40 = 160. Figure 1g Exemplarily shows the deserialization result of the message object graph, and illustrates the restored message object graph with the starting address being 8000 as an example.

[0038] Analyze the above serializer, Figure 1b The built-in Java serializer shown embeds all message objects into the serialization stream. The message objects are strongly correlated. Serialization is a serial process and does not support serializing / deserializing a message object graph with circular references. Figure 1c-1g The serializer shown needs to perform serialization processing on the value fields of all message objects, store the serialization processing results in memory, and encode the pointer fields of the message objects as the relative offset addresses of the message objects relative to the objects they reference in memory. Therefore, it is necessary to perform serialization processing on all message objects in the object graph before encoding the pointer fields. During the deserialization process, it is necessary to receive all serialization data before modifying the relative offset to a pointer. As Figure 1h shown, the above serializer is completely serial in the entire process of "serialization -> network transmission -> deserialization". Therefore, the overall end-to-end latency is very large.

[0039] In an embodiment of the present application, a method is proposed to separately encode the value domain and pointer domain of a message object to ensure the integrity and accuracy of data. Value domain encoding refers to the process of converting the value of a message object into a binary or other format. In value domain encoding, the range, precision, and representation method of the data type need to be considered. For example, for an integer type, a fixed-size byte may be used to represent its value; while for a floating-point type, a floating-point representation method may be used. Pointer encoding refers to the process of converting the pointer reflecting the reference relationship of a message object into a storable or transmissible format. In pointer encoding, the value of the pointer and the data type it points to need to be considered. Usually, pointer encoding needs to include the value of the pointer itself and the offset or address of the message object it points to. Separating value domain encoding and pointer encoding can ensure the integrity and accuracy of data. Encoding the pointer and value domain together may result in inaccurate or damaged decoded data. Therefore, during the serialization process, value domain encoding and pointer encoding can be processed separately to ensure the correct decoding and integrity of data.

[0040] On this basis, an embodiment of the present application provides an object processing method, which assigns unique identification information to each message object in the object graph, and uses the identification information of each message object to replace the pointer domain of the message object to participate in the serialization processing of the message object, that is, the pointer domains of multiple message objects do not participate in the serialization processing, and the reference relationship between multiple message objects reflected in the pointer domain is replaced by the identification information of multiple message objects, so that there is no data dependency relationship between the serialized data of multiple message objects included in the object graph; providing the serialized data without data dependency relationship to the peer end, so that the peer end can perform deserialization processing in a parallel manner to obtain the object graph, so that the processes of serialization processing, network transmission, and deserialization processing are no longer serial, reducing the end-to-end latency.

[0041] Further optionally, since the identification of the message object is used to replace the reference relationship between the message objects represented by the pointer domain, each message object can be independently serialized during the serialization process. Furthermore, in terms of the transmission method, the serialization process and the serialized data transmission process can be overlapped, that is, while serializing the message object, the serialized data of the message object that has been serialized and processed is transmitted to the peer end, which can further reduce the end-to-end latency.

[0042] The following will describe in detail a solution provided by an embodiment of the present application with reference to the accompanying drawings.

[0043] Figure 2 It is a schematic flowchart of an object processing method provided for an exemplary embodiment of the present application. This object processing method is used to serialize an object graph, as Figure 2 shown, the method includes:

[0044] 201. Obtain an object graph to be serialized, where the object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects;

[0045] 202. Assign identification information to the multiple message objects respectively;

[0046] 203. Use the identification information of the multiple message objects to replace the pointer fields in the multiple message objects and participate in the serialization process of the multiple message objects to obtain the serialized data of the multiple message objects;

[0047] 204. Transmit the serialized data of the multiple message objects to the peer end. The serialized data of the multiple message objects includes at least the identification information of the multiple message objects and the serialization results of the value fields in the multiple message objects.

[0048] In this embodiment, an object graph to be serialized is obtained. The object graph includes multiple message objects, and there are reference relationships among the multiple objects. Among them, message objects generally refer to various messages transmitted across platforms or over a network. Depending on the application scenario, the message objects will be different. For example, the message object can be various messages transmitted between the request side and the service side in a remote call scenario, or various messages transmitted between microservices in a microservice scenario, or it can also be the interaction data between the client and the service side, or the interaction data between any two application programs. For example, the client is implemented as an application (APPlication, APP), and the user interacts with the service side through this application. The interaction data generated during the interaction process is the message object. Another example is that the application is a social application, and two users interact through the social applications installed on their respective terminal devices. The interaction data generated during the interaction process is the message object. Taking a shopping APP as an example, the shopping request initiated by the user through the shopping APP is a message object A1. The message object A1 includes: {user identification (ID), request ID, and product ID}; the product ID corresponds to the message object A2. The message object A2 includes: {product category, product price, store id, preferential information}. The preferential information corresponds to the message object A3. The reference relationship existing among the message object A1, the message object A2, and the message object A3 is expressed as: the message object A1 references the message object A2, and the message object A2 references the message object A3. Another example is that in the application scenario of large models, data can be abstracted into multiple dimensions, and the data in each dimension is used as a message object. There is a pointing relationship between the data in different dimensions, and this pointing relationship is the reference relationship between message objects. For example, taking students as an example, the basic information of students belongs to a message object B1 in one dimension, and the grade sheet of students belongs to another message object B2 in another dimension. Among them, the message object B1 can reference the message object B2. The student ID can be obtained from the message object B1, and the student's grades can be queried from the message object B2 through the student ID.

[0049] In this embodiment, multiple message objects include a value field and a pointer field. The pointer fields of the multiple message objects represent the reference relationships among the multiple message objects. Among them, each message object can reference one or more other message objects. At this time, the pointer field includes pointers to one or more other objects; alternatively, a message object may not reference other message objects. At this time, the pointer field of the message object is empty (NULL), that is, the pointer field is a null pointer. The value fields of the multiple message objects are the values of the message objects. The values of the message objects can be integer (int), character (char), floating point (float), boolean (boolean), etc., and no limitation is made thereto. For example, the value field of message object A1 is the user ID and the request ID, and the pointer field of message object A1 is: a pointer to message object A2. The value field of message object A2 is the product category, the product price, and the store ID, and the pointer field of message object A2 is a pointer to message object A3. The value field of message object B1 can be the name, ID, etc. of a student, and the pointer field of message object B1 is a pointer to message object B2; the value field of message object B2 can be course scores such as "Chinese score" or "math score", and message object B2 does not reference other message objects, and the pointer field of message object B2 is empty.

[0050] In Figure 3 an object graph is exemplarily shown, which includes 13 message objects. The value fields of the 13 message objects are respectively: m0, m1, m2,..., m11 and m12. There are reference relationships among the 13 message objects in the object graph. For example, m0 references m1, m2, and m3; m1 references m4; m2 references m4, m5, m6, and m7; m3 references m7, m8, and m9; m5 references m0, etc. Among them, the pointer fields of the message objects are represented by pointers (pointer, ptr). For example, the pointer field of m3 is represented as: ptr1 = m7, ptr2 = m8, and ptr3 = m9.

[0051] In this embodiment, unique identification information can be assigned to each message object for serializing each message object. Among them, the identification information of different message objects is different, and the identification information assigned to the message objects in this embodiment is unique. The identification information can be any single or combination of numbers, letters, and symbols, etc. For example, the identification information can be a1, bb_2, or 3 - 4, etc., and no limitation is made thereto. In an optional embodiment, the message object can be the sequence number or order in which each message object appears in the object graph. Among them, a certain message object can be used as the starting point, and the sequence number or order in which each message object appears in the object graph can be determined by traversing the object graph according to the reference relationships among the message objects.

[0052] Because there are reference relationships among multiple message objects, when encoding the pointer fields, it is necessary to serialize the value fields of multiple message objects, store the serialization results in memory, and encode the pointer fields as the relative offsets in memory of the serialization results of the message objects. Therefore, it is necessary to complete the serialization of the entire object graph before sending the serialized data to the peer for deserialization. Only after the peer receives all the serialized data in the object graph can it perform deserialization, resulting in a relatively large end-to-end latency. In this embodiment, the process of serializing multiple message objects includes two types. One is to encode the value fields of multiple message objects, and for the pointer fields of the message objects, use the identification information of multiple message objects to replace the pointer fields in multiple message objects and participate in the serialization process of these multiple message objects. That is to say, in the embodiment of the present application, the pointer fields of multiple message objects do not participate in the serialization process. The reference relationships among multiple message objects reflected in the pointer fields are replaced by the identification information of multiple message objects, so that there is no data dependency relationship among the serialized data of multiple message objects (such as the encoded data of the value fields and the identification information), that is, the serialized data of multiple message objects are independent of each other. Thus, the serialized data of multiple message objects can be independently transmitted to the peer, providing conditions for the peer to perform deserialization processing on the serialized data of multiple message objects in a parallel manner. Since there is no data dependency relationship among the serialized data of multiple message objects, the peer can perform deserialization processing in a parallel manner, rather than serially deserializing multiple message objects. It can perform deserialization processing on two or more message objects simultaneously, which can shorten the execution time of serialization processing -> network transmission -> deserialization processing and reduce the end-to-end latency.

[0053] Among them, the method of encoding the value ranges of multiple message objects is not limited. Different encoding methods have different encoding rules. For example, when using the Varint encoding method to encode the value range, Varint is a method for encoding the value range (such as a number), and the binary data after encoding is of variable length. For example, if the value range of a message object is implemented as the number 1, and the Varint encoding method is used to encode the number 1, the resulting binary representation is 0000 0001, which occupies 1 byte. Another example is that the ZigZag encoding method can be used. ZigZag is an encoding scheme that maps signed integers to unsigned integers. For example, the signed integers 0, -1, 1, -2 are encoded as the unsigned integers 0, 1, 2, 3. In the embodiments of the present application, identification information is assigned to each message object in the object graph, and the identification information of each message object is used to replace the pointer field of the message object to participate in the serialization process of the message object. That is, the pointer fields of multiple message objects do not participate in the serialization process, and the reference relationships between multiple message objects reflected in the pointer fields are replaced by the identification information of multiple message objects, so that there is no data dependency between the serialized data of multiple message objects included in the object graph; the serialized data without data dependency is provided to the peer end, so that the peer end can perform the deserialization process in parallel to obtain the object graph, making the processes of serialization, network transmission, and deserialization no longer serial, and reducing the end-to-end latency.

[0054] In an optional embodiment, the implementation manner of using the identification information of multiple message objects to replace the pointer fields in multiple message objects and participate in the serialization process of multiple message objects to obtain serialized data of multiple message objects without data dependency includes: generating header information (pack head) for any message object, where the header information at least includes the identification information of any message object and the identification information of other message objects pointed to by the pointer field of any message object when the pointer field is not empty; generating serialized data of any message object according to the header information of any message object and the value range in any message object, where, during the serialization process, the pointer field of any message object is processed as invalid. The above method of creating header information is used to implement replacing the pointer fields in multiple message objects with the identification information of multiple message objects. Compared with the implementation manner of "serializing the message objects and then storing them in memory, and encoding the pointer fields of multiple message objects as the relative offsets in memory of multiple message objects", the method provided in the embodiments of the present application does not need to traverse all message objects in memory to determine the relative offsets, reduces the object graph traversal operation, has a simple implementation manner, high efficiency, and low cost; and helps to reduce the end-to-end delay and improve the transmission efficiency.

[0055] Optionally, before generating the serialized data of any message object based on the header information of any message object and the value field in any message object, the pointer field of any message object can also be invalidated. For example, the pointer field in any message object can be set to null to invalidate the pointer field. Another example is to encode the pointer field in any message object as 0 to invalidate the pointer field. Yet another example is to pre-negotiate with the peer to agree that by default, the pointer field in any message object is not processed, so as to invalidate the pointer field. Among them, the two ends can conduct communication negotiation, or alternatively, the R & D personnel of the two ends can pre-negotiate in advance and use the negotiation result as an ability of the serializer and deserializer, that is, the ability to default not to serialize and deserialize the pointer field to implement the code logic for serialization and deserialization.

[0056] Optionally, the implementation method for generating the header information for any message object includes: for any message object, generating an empty header in a set format, and the empty header in the set format at least includes a sequence number field, a reference field, and a pointer field. Among them, taking the header information of the target message object as an example, the fields in the header information are described. The sequence number field is used to carry the identification information of the target message object, the reference field is used to carry the identification information of the message object referenced by the target message object, and the pointer field is used to carry the pointer information of the target message object, and this pointer information is the address information of the target message object in the local memory space, mainly referring to the address information of the serialized data (especially the serialization result of the value field) of the target message object in the local memory space; configuring the information for each field in the empty header to obtain the header information of any message object, and this header information can be understood as the serialization result of the pointer field; among them, the information configuration includes: adding the identification information of any message object to the sequence number field; adding the pointer information pointing to any message object to the pointer field, and the pointer information is the address information of any message object in the local memory space; adding the identification information of other message objects pointed to by the pointer field in any message object when the pointer field is not null to the reference field. It should be noted that when the pointer field in any message object is null, it means that this any message object does not reference other message objects, the reference field is empty, and the header information does not include the identification information of other message objects.

[0057] Further optionally, the empty header further includes a type field; correspondingly, the above information configuration process further includes: adding the message type to which any message object belongs to the type field; different message types correspond to different serialization methods.

[0058] When the type field is included in the empty packet header, for different types of message objects, the processing methods for the value range during serialization are different. For example, when the message type is implemented as an integer type, the method for serializing the value range is to encode the integer data into byte stream data to obtain the serialized result of the value range. When the message type is implemented as a character type or a byte type, the method for serializing the value range is: without encoding the value range, directly using the character type or byte type data as the serialized result of the value range. When the type field is included in the packet header, the message object can adapt to various message types, rather than a default one, improving the flexibility of the entire serialization scheme.

[0059] Such as Figure 3 and Figure 5 As shown, it exemplarily shows the packet header of the message object. Among them, the packet header is represented as: [id (identification information), type (message type), and ref id (identification information of other message objects pointed to) and msg_ptr (pointer information pointing to the message object)]. For example, the packet header of m0 is represented as [m0_id, type, m1_id, msg_ptr], and the msg_ptr of m0 points to m0; the packet header of m3 is represented as: [m3_id, type, m7_id, m8_id, m9_id, msg_ptr], and msg_ptr points to m3, specifically pointing to the serialized result of the value range of the message object m3. During the serialization process, the pointer field of the message object is processed as invalid. For example, the pointer field of m3 is: ptr1 = m7, ptr2 = m8, and ptr3 = m9. After processing the pointer field of m3 as invalid, it is represented as: ptr1 = NULL, ptr2 = NULL, and ptr3 = NULL.

[0060] Further optionally, according to the packet header information of any message object and the value range in any message object, generate the serialized data of any message object, including: determining the target serialization method according to the message type in the type field; performing serialization processing on the value range in any message object according to the target serialization method to obtain the serialized result of the value range; for example, when the message type is an integer type, encoding the value range of the integer data into byte stream data; when the message type is a character type, directly using the value range of the character type data as the serialized result of the value range; concatenating the packet header information of any message object with the serialized result of the value range and the pointer field processed as invalid to obtain the independent serialized data of any message object. As Figure 3 shown, it exemplarily shows the independent serialized data corresponding to the message object m1 and the message object m3 respectively.

[0061] In an optional embodiment, unique identification information is assigned to multiple message objects, including: determining an initial message object from the multiple message objects; for example, when the object graph is implemented as a graph structure, the initial message object can be any message object; for another example, when the object graph is implemented as a tree structure, the initial message object is implemented as the message object corresponding to the root node in the tree structure. Starting from the initial message object, traverse each message object according to the reference relationship between the multiple message objects; for the currently traversed message object, determine whether identification information has been assigned to it; in the case where the determination result is no, assign identification information to the currently traversed message object. Among them, the identification information of the message object can be a serialization number determined according to the serialization order of the message objects in the object graph, and different serialization orders result in different serialization numbers. The serialization number can be represented by one or more of numbers, letters, and symbols. For example, it can be represented by an integer character. For example, starting from 0 or 1, it is numbered incrementally in sequence according to the serialization order, and this is not limited.

[0062] Optionally, the method for determining whether identification information has been assigned to the currently traversed message object is not limited.

[0063] For example, the local end maintains a hash value list, and the hash values of the message objects to which identification information has been assigned are stored in the hash value list. Based on this, the hash value of the currently traversed message object can be calculated. For example, according to the attribute information of the currently traversed object, the hash value of the currently traversed message object is calculated. The attribute information of the message object can be the address information, value range data, or metadata, etc. of the message object in the memory space. For example, the hash value of the current object can be calculated according to the address of the current message object in the memory, or the hash value of the current message object can be calculated according to the value range of the current message object, and this is not limited. In the case where the hash value does not exist in the hash value list, it is determined that identification information has not been assigned to the currently traversed message object. In the case where the hash value exists in the hash value list, it is determined that identification information has been assigned to the currently traversed message object, and continue to traverse the object graph until identification information has been assigned to all message objects in the object graph.

[0064] For another example, a flag bit is set for each message object. In the case where identification information is assigned to the message object, the flag bit corresponding to the message object is set to a target value. The target value can be 0 or 1, etc. Based on this, determine whether the flag bit corresponding to the currently traversed message object is the target value; in the case where the flag bit is not the target value, it is determined that identification information has not been assigned to the currently traversed message object. In the case where the flag bit is the target value, it is determined that identification information has been assigned to the currently traversed message object, and then continue to traverse the object graph until identification information has been assigned to all message objects in the object graph.

[0065] In this embodiment, there is no limitation on the traversal method used to traverse the object graph. For example, it may adopt, but is not limited to, the breadth - first traversal method or the wide - first traversal method, etc.

[0066] In the embodiments of the present application, there is no limitation on the implementation manner of transmitting the serialized data of multiple message objects to the peer end. In an optional embodiment, after the entire serialization process is completed, the serialized data of the message objects obtained by serialization (that is, all the serialized data obtained by serialization) is transmitted to the peer end together. The way of transmitting together can be serial transmission or parallel transmission. Or, since the value domain and the pointer domain are encoded separately, the identification information of the message object is used to replace the pointer domain for serialization processing, and there is no data - dependency relationship between the serialized data of multiple message objects. There is no need to wait until all message objects are serialized, and then use the relative offset of the message object in memory to encode the pointer domain. Therefore, during the serialization process, while serializing the message objects in the object graph, the serialized data of the message objects that have been serialized can be transmitted to the peer end, realizing the overlap of the serialization process and the transmission process of the serialized data, without waiting until all message objects are serialized before transmission. Correspondingly, there is no need to wait to receive the serialized data of all message objects to perform deserialization, that is, the peer end can receive the serialized data while performing deserialization, reducing the end - to - end latency.

[0067] Corresponding to the above object processing method, the embodiments of the present application also provide another object processing method for deserializing an object graph, as Figure 4 shown. This method includes:

[0068] 401. Receive the serialized data of multiple message objects transmitted from the peer end. There is no data - dependency relationship between the serialized data of multiple message objects. The multiple message objects belong to the same object graph, and there is a reference relationship between the multiple message objects;

[0069] 402. Parse and process the serialized data of multiple message objects respectively in a parallel manner to obtain the identification information of multiple message objects and the value domains of multiple message objects;

[0070] 403. Restore the pointer domains in multiple message objects according to the identification information of multiple message objects to obtain the object graph.

[0071] In this embodiment, the implementation manner of receiving the serialized data of multiple message objects transmitted by the peer is not limited. Depending on the different peer transmission methods, the receiving methods are also different. For example, during the serialization process, the peer sequentially transmits the serialized data of multiple message objects. Correspondingly, the local end can sequentially receive the serialized data of multiple message objects sequentially sent by the peer. Another example is that after the serialization is completed, the peer transmits the serialized data of all message objects at once. If a serial transmission method is adopted, the local end sequentially receives the serialized data transmitted by the peer. If a parallel transmission method is adopted, the local end receives the serialized data of multiple message objects in a parallel manner.

[0072] Furthermore, in this embodiment, multiple serialization threads or serialization processes can be used to receive the serialized data of multiple message objects transmitted by the peer. Further, since there is no data dependency between the serialized data of multiple message objects, the deserialization order between the serialized data of message objects does not need to be concerned about. Therefore, multiple serialization threads or serialization processes are used to perform deserialization processing on the serialized data of multiple message objects in parallel. For example, taking threads 1, 2, and 3 as an example, assume that thread 1 receives the serialized data of message objects a1 and a3, thread 2 receives the serialized data of message objects a2 and a4, and thread 3 receives the serialized data of message objects a5 and a6. Then each thread can perform deserialization processing on the serialized data of the received message objects respectively, that is, realize the parallel processing of deserialization, instead of performing deserialization processing on the serialized data of message objects a1 - a6 in sequence.

[0073] In this embodiment, the serialized data of multiple message objects are respectively subjected to deserialization processing in a parallel manner to obtain the identification information of multiple message objects and the value domains of multiple message objects. The identification information of multiple message objects and the value domains of multiple message objects can be stored in a global linked list or an array for subsequent pointer configuration. Among them, multiple serialization threads can be used to perform deserialization processing in a parallel manner. For example, after each serialization thread receives the serialized data of a message object, it can perform deserialization processing without caring about the progress of deserialization processing of other serialization threads. Of course, in addition to using multiple serialization threads to perform deserialization processing, multiple serialization processes can also be used to perform deserialization processing, which is not limited in this regard.

[0074] In this embodiment, after the deserialization processing for each message object is completed, a pointer configuration operation can be performed, that is, the pointer fields in multiple message objects are restored according to the identification information of multiple message objects, so as to obtain an object graph based on the value domains and pointer fields of multiple message objects.

[0075] Optionally, the embodiment of the present application further provides a pointer configuration thread. After each serialization thread finishes the deserialization operation, it provides an end signal to the pointer configuration thread, and the pointer configuration operation is executed after receiving the end signals of all serialization threads. Of course, a pointer configuration process can be used to execute the pointer configuration operation, which is not limited herein.

[0076] In the embodiment of the present application, there is no data dependency between the serialized data of multiple message objects in the object graph. The deserialization process is performed on the serialized data of multiple message objects in parallel to obtain the unique identification information and value domain of multiple message objects. The pointer domain of multiple message objects is configured according to the identification information of multiple message objects to obtain the pointer domain of multiple message objects, thereby restoring the object graph. Throughout the process, the deserialization process is performed in parallel to improve the deserialization speed and reduce the end-to-end latency. Further, in terms of the transmission method, the deserialization process can be performed while receiving the serialized data, further reducing the end-to-end latency.

[0077] In an optional embodiment, an implementation manner of deserializing the serialized data of multiple message objects in parallel to obtain the identification information of multiple message objects and the value domain of multiple message objects includes: for the serialized data of any message object, parsing the serialized data of any message object to obtain the header information, value domain serialization result, and pointer domain that is invalidated of any message object; wherein, the header information of any message object at least includes the identification information of the any message object, and the identification information of other message objects pointed to by the pointer domain before invalidation in the case of non-empty; performing deserialization processing on the value domain serialization result of any message object to obtain the value domain of any message object. Here, it is explained that if the pointer domain before invalidation is empty, it means that the any message object does not reference other message objects, and the header information does not include the identification information of other message objects. Among them, the detailed introduction of the header information and the pointer domain that is invalidated can be seen in the foregoing, and will not be elaborated herein.

[0078] Optionally, an implementation structure of packet header information includes a sequence number field, a reference field, and a pointer field. For the packet header information of any message object, the sequence number field carries the identification information of the any message object, and the reference field carries the identification information of other message objects pointed to by the pointer field before invalidation when the pointer field is not empty. Of course, if the any message object does not reference other message objects, the pointer field before invalidation is empty. Correspondingly, the reference field is empty and does not carry the identification information of other message objects, which conversely indicates that the any message object does not reference other message objects. The method provided by the embodiments of the present application further includes: when obtaining the value domain of any message object, according to the memory address of the value domain of the any message object, configure pointer information pointing to the any message object in the pointer field, and the pointer information points to the memory address of the deserialized data (especially the deserialization result of the value domain) obtained by deserializing the any message object at the local end (i.e., the deserialization end). For example, in Figure 5 when receiving the value domain of a message object (e.g., m3), store m3 in memory, and according to the memory address of m3, configure the pointer information msr_ptr in the packet header corresponding to m3 as the memory address of m3; when receiving m7, store m7 in memory, and according to the memory address of m7, configure the pointer information msr_ptr in the packet header corresponding to m7 as the memory address of m7; the same operation is performed on the value domains of other message objects, which will not be elaborated here.

[0079] Correspondingly, an implementation manner of restoring the pointer field in multiple message objects according to the identification information of multiple message objects to obtain an object graph includes: when obtaining the value domains of multiple message objects, for any message object, if the identification information of other message objects it references is obtained from the reference field in its packet header information, according to the identification information of other message objects, configure the pointer information in the pointer field of the packet header information of other message objects into the pointer field to be invalidated of the any message object, so as to obtain the reference relationship between the any message object and other message objects; generate an object graph according to the value domains and pointer fields of multiple message objects. Further, for any message object, if the reference field in its packet header information is empty, that is, the identification information of other message objects it references cannot be obtained from the reference field, the pointer field to be invalidated of the any message object can be directly configured to be empty.

[0080] Further optionally, according to the identification information of other message objects, the pointer information in the pointer field of the header information of other message objects is configured into the pointer domain to be invalidated of any message object, so as to obtain the reference relationship between any message object and other message objects, including: obtaining the pointer information of other message objects from the pointer field in the header information of other message objects according to the identification information of other message objects; configuring the pointer information of other message objects into the pointer domain to be invalidated of any message object to implement the reset of the pointer domain.

[0081] For example, in Figure 5 , for the message object corresponding to m3, the identification information of other message objects it references is obtained from the reference field in its header information. For example, the identification information of other objects it references is: m7_id, m8_id, and m9_id; at this time, the pointer domain of the message object corresponding to m3 is processed as invalid; the pointer information (msr_ptr) in the pointer fields of the headers corresponding to m7_id, m8_id, and m9_id respectively is configured into the pointer domain to be invalidated. For example, the pointer information (msr_ptr) is obtained from the header corresponding to m7_id, and this pointer information is the memory address of m7. This pointer information is configured into the pointer domain to be invalidated corresponding to m3, that is, ptr7 = m7. Similarly, ptr8 = m8, and ptr9 = m9.

[0082] Further optionally, the header information further includes a type field, and the type field carries the message type of any message object; deserializing the serialization result of the value domain of any message object to obtain the value domain of any message object, including: determining the target deserialization method according to the message type in the type field; deserializing the serialization result of the value domain of any message object according to the target deserialization method to obtain the value domain of any message object. Among them, different message types apply different serialization methods and deserialization methods. In the embodiments of the present application, the message type is carried by the type field in the header information, which can support the serialization and deserialization processing of various message types, and this solution has higher flexibility.

[0083] In the embodiments of the present application, the implementation manner of the above object processing method in specific applications is not limited. In one implementation manner, the object processing method of the above embodiments can be correspondingly implemented as a serializer and a deserializer, and the serializer and the deserializer are implemented as library functions in a link library. Among them, a link library stores some reusable function codes (such as functions and classes) to facilitate application developers to use. That is to say, application developers can directly reference the existing function codes in the link library during the application development process without developing them by themselves, which is beneficial to improving the application development efficiency. Among them, the link library containing the serializer and the deserializer can be a dynamic link library or a static link library, and the embodiments of the present application do not limit this. In the embodiments of the present application, taking the first application as an example, when developing the first application, developers develop the first application based on the link library containing the serializer and the deserializer, so that the first application has the ability to call the serializer in the link library for serialization processing during the message transmission process, and has the ability to call the deserializer in the link library for deserialization processing when receiving a message.

[0084] Among them, in the case of using a static link library, during the development of the first application, the source code of the serializer or / and deserializer used in the source file of the first application will be merged with the code file of the application to generate an independent executable file. In the case of using a dynamic link library, during the development of the first application, only a small amount of information such as the address of the dynamic link library is recorded in the executable file of the first application. When the executable file of the first application is executed, it is dynamically loaded when encountering the source code of the serializer and / or deserializer in the dynamic link library.

[0085] Based on the above, the embodiments of the present application further provide a data processing method, which is applied to the first application. The first application is developed based on a link library, and the link library includes a serializer. As Figure 6 shown, the method includes:

[0086] 601. In response to a data transmission trigger event, generate an object graph to be transmitted. The object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects;

[0087] 602. Call the serializer in the link library, and the serializer performs serialization processing on the object graph by using the object processing method provided in the embodiments of the present application to obtain independent serialization data for each of the multiple message objects;

[0088] 603. Transmit the independent serialization data for each of the multiple message objects to the peer end. The serialization data of the multiple message objects at least includes the identification information of the multiple message objects and the serialization results of the value fields in the multiple message objects.

[0089] In this embodiment, the serializer refers to the serializer that executes the method described above Figure 2 The first application can be any type of application, such as social, shopping, gaming, or live streaming, etc. For a detailed introduction to this data processing method, please refer to the foregoing, and details will not be elaborated here

[0090] Another data processing method is provided in an embodiment of this application. This method is applied to a first application that is developed based on a link library, and the link library includes a deserializer. This method includes:

[0091] S601. Receive the serialized data of multiple message objects transmitted by the peer end. There is no data dependency between the serialized data of the multiple message objects. The multiple message objects belong to the same object graph, and there is a reference relationship between the multiple message objects

[0092] S602. Call the deserializer in the link library, and the deserializer uses the object processing method provided in the embodiment of this application to parse and process the serialized data of the multiple message objects to obtain an object graph

[0093] For the detailed implementation manner of the data processing method, please refer to the foregoing, and no limitation is made here

[0094] The detailed implementation manners and beneficial effects of each step in the object processing method and data processing method provided in the embodiment of this application have been described in detail in the foregoing embodiments, and will not be elaborated here

[0095] It should be noted that the execution subject of each step of the method provided in the foregoing embodiment can be the same device, or the method can also be executed by different devices as the execution subject. For example, the execution subject of steps 201 to 203 can be a device; or, the execution subject of steps 201 and 202 can be a device, and the execution subject of step 203 can be device B; and so on

[0096] In addition, in some processes described in the foregoing embodiments and the accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations can be executed not in the order in which they appear in this article or in parallel. The operation numbers such as 201, 202, etc. are only used to distinguish different operations, and the numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and these operations can be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are different types

[0097] Figure 7aThe structural schematic diagram of an object processing device provided for an exemplary embodiment of the present application is as follows. Figure 7a As shown, the device includes: an acquisition module 71a, a distribution module 72a, a substitution module 73a, and a first transmission module 74a.

[0098] The acquisition module 71a is configured to acquire an object graph to be serialized. The object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects.

[0099] The distribution module 72a is configured to respectively assign identification information to the multiple message objects.

[0100] The substitution module 73a is configured to use the identification information of the multiple message objects to replace the pointer fields in the multiple message objects and participate in the serialization process of the multiple message objects to obtain the serialized data of the multiple message objects.

[0101] The first transmission module 74a is configured to transmit the serialized data of the multiple message objects to the peer end. The serialized data of the multiple message objects at least includes the identification information of the multiple message objects and the serialization results of the value fields in the multiple message objects.

[0102] In an optional embodiment, the substitution module is specifically configured to: generate header information for any message object. The header information at least includes the identification information of any message object and the identification information of other message objects pointed to by the pointer field of any message object when the pointer field is not empty; generate the serialized data of any message object according to the header information of any message object and the value field in any message object. Wherein, during the serialization process, the pointer field of any message object is processed as invalid.

[0103] Optionally, the substitution module is specifically configured to: generate an empty header in a set format for any message object. The empty header at least includes a sequence number field, a reference field, and a pointer field; perform information configuration on each field in the empty header to obtain the header information of any message object. Wherein, the process of information configuration is: add the identification information of any message object to the sequence number field; add pointer information pointing to any message object to the pointer field. The pointer information is the address information of any message object in the local memory space, specifically the address information of the serialized data of any message object in the local memory space; add the identification information of other message objects pointed to by the pointer field in any message object to the reference field.

[0104] Further optionally, the empty header further includes a type field; the substitution module is further configured to: add the message type to which any message object belongs to the type field during the process of information configuration; different message types correspond to different serialization methods.

[0105] Further optionally, the module is specifically configured to: determine a target serialization method according to the message type in the type field; perform serialization processing on the value domain in any message object according to the target serialization method to obtain a value domain serialization result; splice the header information of any message object, the value domain serialization result, and the pointer domain processed as invalid to obtain independent serialization data of any message object.

[0106] In an alternative embodiment, the apparatus further includes an invalid processing module. Before generating the serialization data of any message object according to the header information of any message object and the value domain in any message object, the invalid processing module is configured to set the pointer domain in any message object to null to perform invalid processing on the pointer domain; or, negotiate with the peer in advance to agree that the pointer domain in any message object is not processed by default to perform invalid processing on the pointer domain.

[0107] In an alternative embodiment, the allocation module is specifically configured to: determine an initial message object from multiple message objects; starting from the initial message object, traverse each message object according to the reference relationship between the multiple message objects; for the currently traversed message object, determine whether identification information has been assigned to it; in the case where the determination result is negative, assign identification information to the currently traversed message object.

[0108] Optionally, the allocation module is specifically configured to: calculate the hash value of the currently traversed message object according to the attribute information of the currently traversed message object; determine that the identification information has not been assigned to the currently traversed message object in the case where the hash value of the currently traversed message object does not exist in the hash value list; where the hash value list stores the hash values of the message objects to which the identification information has been assigned; or determine whether the flag bit corresponding to the currently traversed message object is the target value; in the case where the flag bit is not the target value, determine that the identification information has not been assigned to the currently traversed message object; where the flag bit is set to the target value in the case where the identification information is assigned to its corresponding message object.

[0109] In an alternative embodiment, the first transmission module is specifically configured to: sequentially transmit the serialization data of the serialized message objects to the peer during the serialization process; or transmit the serialization data of the serialized message objects to the peer together after the serialization is completed.

[0110] Figure 7b A data processing apparatus provided for an exemplary embodiment of the present application, the apparatus corresponds to a first application, the first application is developed based on a link library, the link library includes a serializer, and the apparatus includes: a generation module 71b, a call module 72b, and a second transmission module 73b.

[0111] A generation module 71b, configured to generate an object graph to be transmitted in response to a data transmission trigger event, where the object graph includes a plurality of message objects, and pointer fields in the plurality of message objects represent reference relationships between the plurality of message objects;

[0112] An invocation module 72b, configured to invoke a serializer in a link library, and the serializer performs serialization processing on the object graph by using the object processing method provided in the embodiment of the present application to obtain independent serialization data of each of the plurality of message objects;

[0113] A second transmission module 73b, configured to transmit the independent serialization data of each of the plurality of message objects to the peer end, and the serialization data of the plurality of message objects at least includes identification information of the plurality of message objects and serialization results of value fields in the plurality of message objects.

[0114] Figure 7c An object processing device provided for an exemplary embodiment of the present application, the device includes: a first receiving module 71c, a deserialization module 72c, and a restoration module 73c.

[0115] The first receiving module 71c is configured to receive the serialization data of a plurality of message objects transmitted by the peer end, there is no data dependency between the serialization data of the plurality of message objects, the plurality of message objects belong to the same object graph, and there is a reference relationship between the plurality of message objects;

[0116] The deserialization module 72c is configured to perform parsing processing on the serialization data of the plurality of message objects in parallel to obtain identification information of the plurality of message objects and value fields of the plurality of message objects;

[0117] The restoration module 73c is configured to restore pointer fields in the plurality of message objects according to the identification information of the plurality of message objects to obtain an object graph.

[0118] In an optional embodiment, the deserialization module 72c is specifically configured to: for the serialization data of any message object, parse the serialization data of any message object to obtain header information of any message object, a serialization result of a value field, and a pointer field that is invalidated; where the header information at least includes identification information of any message object, and identification information of other message objects pointed to by the pointer field before invalidation when the pointer field is non-empty; perform deserialization processing on the serialization result of the value field of any message object to obtain the value field of any message object.

[0119] Optionally, the packet header information includes a sequence number field, a reference field, and a pointer field. The sequence number field carries the identification information of any message object. The reference field carries the identification information of other message objects pointed to by the pointer field before invalidation when it is non-empty. The apparatus further includes a configuration module, configured to, when obtaining the value range of any message object, configure pointer information pointing to any message object in the pointer field according to the memory address of the value range of any message object. Correspondingly, the restoration module 73c is specifically configured to: when obtaining the value ranges of multiple message objects, for any message object, if the identification information of other message objects it references is obtained from the reference field in its packet header information, configure the pointer information in the pointer field of the packet header information of other message objects into the pointer field to be invalidated of any message object according to the identification information of other message objects, so as to obtain the reference relationship between any message object and other message objects; generate an object graph according to the value ranges and pointer fields of multiple message objects.

[0120] Further optionally, the packet header information further includes a type field, and the type field carries the message type of any message object. The deserialization module 72c is specifically configured to: determine the target deserialization method according to the message type in the type field; perform deserialization processing on the serialized result of the value range of any message object according to the target deserialization method, so as to obtain the value range of any message object.

[0121] The embodiment of the present application further provides another data processing apparatus, which is applied to a first application. The first application is developed based on a link library, and the link library includes a deserializer, as Figure 7d shown, the apparatus includes: a second receiving module 71d and a calling module 72d.

[0122] The second receiving module 71d is configured to receive the serialized data of multiple message objects transmitted by the peer end. There is no data dependency between the serialized data of multiple message objects. Multiple message objects belong to the same object graph, and there is a reference relationship between multiple message objects.

[0123] The calling module 72d is configured to call the deserializer in the link library, and the deserializer parses and processes the serialized data of multiple message objects by using the object processing method provided by the embodiment of the present application, so as to obtain an object graph.

[0124] For the detailed implementation manner of the data processing apparatus, reference may be made to the foregoing, and no limitation is imposed thereon.

[0125] Regarding the Figure 7a-Figure 7d detailed implementation manners and beneficial effects of each step in the apparatus shown have been described in detail in the foregoing embodiments, and will not be elaborated herein.

[0126] Figure 8 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application, as Figure 8 shown, the device includes: a memory 84 and a processor 85.

[0127] The memory 84 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application program or method for operating on the electronic device, etc.

[0128] The processor 85 is coupled to the memory 84 and is used to execute the computer program in the memory 84 for: obtaining an object graph to be serialized, the object graph including a plurality of message objects, and the pointer fields in the plurality of message objects representing the reference relationships between the plurality of message objects; respectively allocating identification information to the plurality of message objects; using the identification information of the plurality of message objects to replace the pointer fields in the plurality of message objects and participating in the serialization process of the plurality of message objects to obtain serialized data of the plurality of message objects; and transmitting the serialized data of the plurality of message objects to the peer end, where the serialized data of the plurality of message objects at least includes the identification information of the plurality of message objects and the serialization results of the value fields in the plurality of message objects.

[0129] In an optional embodiment, when the processor 85 uses the identification information of the plurality of message objects to replace the pointer fields in the plurality of message objects and participates in the serialization process of the plurality of message objects to obtain serialized data of the plurality of message objects, it is specifically used for: generating header information for any message object, the header information at least including the identification information of any message object and the identification information of other message objects pointed to by the pointer field of any message object when the pointer field is not empty; generating serialized data of any message object according to the header information of any message object and the value field in any message object, where, during the serialization process, the pointer field of any message object is processed as invalid.

[0130] Optionally, when the processor 85 generates header information for any message object, it is specifically used for: generating an empty header in a set format for any message object, the empty header at least including a sequence number field, a reference field, and a pointer field; performing information configuration on each field in the empty header to obtain the header information of any message object; where the processor 85 is specifically used for information configuration: adding the identification information of any message object to the sequence number field; adding pointer information pointing to any message object in the pointer field, and the pointer information is the address information of any message object in the local memory space; adding the identification information of other message objects pointed to by the pointer field in any message object to the reference field when the pointer field is not empty.

[0131] Further optionally, the processor 85 is further configured to: the empty packet header further includes a type field; the processor 85 is further configured to, when configuring information: add the message type to which any message object belongs to the type field; different message types correspond to different serialization methods.

[0132] Further optionally, when generating the serialized data of any message object according to the packet header information of any message object and the value field in any message object, the processor 85 is specifically configured to: determine the target serialization method according to the message type in the type field; perform serialization processing on the value field in any message object according to the target serialization method to obtain a value field serialization result; splice the packet header information of any message object, the value field serialization result, and the pointer field processed as invalid to obtain the independent serialized data of any message object.

[0133] In an alternative embodiment, before generating the serialized data of any message object according to the packet header information of any message object and the value field in any message object, the processor 85 is further configured to: set the pointer field in any message object to be empty to perform invalid processing on the pointer field; or negotiate with the peer in advance to agree that the pointer field in any message object is not processed by default to perform invalid processing on the pointer field.

[0134] In an alternative embodiment, when allocating identification information to multiple message objects respectively, the processor 85 is specifically configured to: determine an initial message object from the multiple message objects; starting from the initial message object, traverse each message object according to the reference relationship between the multiple message objects; for the currently traversed message object, determine whether identification information has been allocated to it; in the case where the determination result is negative, allocate identification information to the currently traversed message object.

[0135] Optionally, when the processor determines whether identification information has been allocated to the currently traversed message object, it is specifically configured to: calculate the hash value of the currently traversed message object according to the attribute information of the currently traversed message object; determine that identification information has not been allocated to the currently traversed message object in the case where the hash value of the currently traversed message object does not exist in the hash value list; wherein, the hash value list stores the hash values of the message objects to which identification information has been allocated; or determine whether the flag bit corresponding to the currently traversed message object is the target value; determine that identification information has not been allocated to the currently traversed message object in the case where the flag bit is not the target value; wherein, the flag bit will be set to the target value in the case where identification information is allocated to its corresponding message object.

[0136] In an alternative embodiment, when the processor 85 transfers the serialized data of multiple message objects to the peer, it is specifically configured to: during the serialization process, sequentially transfer the serialized data of the message objects obtained by serialization to the peer; or after the serialization is completed, transfer the serialized data of the message objects obtained by serialization to the peer at once.

[0137] Regarding the Figure 8 detailed implementation manners and beneficial effects of each step in the device provided in the embodiments of the present application have been described in detail in the foregoing embodiments, and will not be elaborated herein.

[0138] Furthermore, as Figure 8 shown, the electronic device further includes: other components such as a communication component 86, a display 87, a power supply component 88, an audio component 89, etc. Figure 8 Only some components are schematically shown in Figure 8 and it does not mean that the electronic device only includes Figure 8 the components shown. Additionally, Figure 8 the components within the dashed box in Figure 8 are optional components, rather than mandatory components, and specifically depend on the product form of the electronic device. The electronic device in this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or can also be a server device such as a conventional server, a cloud server, or a server array. If the electronic device in this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it may include

[0139] The embodiments of the present application further provide an electronic device on which a first application runs. The first application is developed based on a link library, and the link library includes a serializer. The implementation structure of this electronic device is the same as or similar to the Figure 8 implementation structure of the electronic device shown in Figure 8 and can be implemented with reference to the structure of the electronic device shown in Figure 8The differences between the electronic devices in the illustrated embodiments mainly lie in that the functions implemented by the processor executing the computer program stored in the memory are different. For the electronic device provided in this embodiment, when its processor executes the computer program stored in the memory, it can be used to: respond to a data transmission trigger event, generate an object graph to be transmitted, where the object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects; call the serializer in the link library, and the serializer serializes the object graph by using the object processing method provided in the embodiments of the present application to obtain the independent serialized data of each of the multiple message objects; transmit the independent serialized data of each of the multiple message objects to the peer end, and the serialized data of the multiple message objects at least includes the identification information of the multiple message objects and the serialized results of the value fields in the multiple message objects.

[0140] The detailed implementation manners and beneficial effects of the electronic device provided in the embodiments of the present application have been described in detail in the foregoing embodiments, and will not be elaborated herein.

[0141] The embodiments of the present application further provide an electronic device, and the implementation structure of this electronic device is the same as or similar to Figure 8 the implementation structure of the illustrated electronic device, and can be implemented with reference to Figure 8 the structure of the illustrated electronic device. The differences between the electronic device provided in this embodiment and Figure 8 the electronic devices in the illustrated embodiments mainly lie in that the functions implemented by the processor executing the computer program stored in the memory are different. For the electronic device provided in this embodiment, when its processor executes the computer program stored in the memory, it can be used to: receive the serialized data of multiple message objects transmitted from the peer end, there is no data dependency between the serialized data of the multiple message objects, the multiple message objects belong to the same object graph, and there is a reference relationship between the multiple message objects; perform parsing processing on the serialized data of the multiple message objects respectively in a parallel manner to obtain the identification information of the multiple message objects and the value fields of the multiple message objects; restore the pointer fields in the multiple message objects according to the identification information of the multiple message objects to obtain the object graph.

[0142] In an optional embodiment, when the processor performs parsing processing on the serialized data of multiple message objects in a parallel manner to obtain the identification information of the multiple message objects and the value fields of the multiple message objects, it is specifically used to: for the serialized data of any one message object, parse the serialized data of any one message object to obtain the packet header information, the serialized result of the value field, and the pointer field that is marked as invalid of any one message object; where the packet header information at least includes the identification information of any one message object, and the identification information of other message objects pointed to by the pointer field before it is marked as invalid when it is not empty; perform deserialization processing on the serialized result of the value field of any one message object to obtain the value field of any one message object.

[0143] Optionally, the packet header information includes a sequence number field, a reference field, and a pointer field. The sequence number field carries the identification information of any message object, and the reference field carries the identification information of other message objects pointed to by the pointer field before the invalidation process when the pointer field is non-empty. The processor is further configured to: when obtaining the value field of any message object, configure pointer information pointing to any message object in the pointer field according to the memory address of the value field of any message object. Correspondingly, when the processor restores the pointer field in multiple message objects according to the identification information of multiple message objects to obtain an object graph, specifically: when obtaining the value fields of multiple message objects, for any message object, if the identification information of other message objects it references is obtained from the reference field in its packet header information, configure the pointer information in the pointer field of the packet header information of other message objects into the invalidated pointer field of any message object according to the identification information of other message objects, so as to obtain the reference relationship between any message object and other message objects, and generate an object graph according to the value fields and pointer fields of multiple message objects.

[0144] Further optionally, the packet header information further includes a type field, and the type field carries the message type of any message object. When the processor deserializes the serialization result of the value field of any message object to obtain the value field of any message object, specifically: determine the target deserialization method according to the message type in the type field; deserialize the serialization result of the value field of any message object according to the target deserialization method to obtain the value field of any message object.

[0145] The embodiment of the present application further provides an electronic device on which a first application runs. The first application is developed based on a link library, and the link library includes a deserializer. The implementation structure of this electronic device is the same as or similar to Figure 8 the implementation structure of the electronic device shown, and can be implemented with reference to Figure 8 the structure of the electronic device shown. The difference between the electronic device provided in this embodiment and Figure 8 the electronic device in the embodiment shown is mainly that the functions implemented by the processor executing the computer program stored in the memory are different. For the electronic device provided in this embodiment, its processor executes the computer program stored in the memory and can be used to: receive the serialized data of multiple message objects transmitted by the peer end. There is no data dependency between the serialized data of multiple message objects. Multiple message objects belong to the same object graph, and there is a reference relationship between multiple message objects; call the deserializer in the link library, and the deserializer parses and processes the serialized data of multiple message objects by using the object processing method provided in the embodiment of the present application to obtain an object graph.

[0146] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which when executed can implement each step executable by an electronic device in the method embodiments shown in the above Figure 2 、 Figure 4 and Figure 6 .

[0147] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc.

[0148] The above-mentioned communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.

[0149] The above-mentioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from users. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations.

[0150] The above-mentioned power supply component provides power for various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.

[0151] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.

[0152] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, Compact Disc Read-Only Memories (CD-ROMs), optical memories, etc.) containing computer-usable program code.

[0153] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0154] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.

[0156] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), an input / output interface, a network interface, and memory.

[0157] The memory may include non-permanent memory in the form of computer-readable media, random access memory (Random Access Memory, RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.

[0158] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change random access memory (Phase-change Random Access Memory, PRAM), static random access memory (SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (Digital Video Disc, DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0159] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.

[0160] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. An object processing method, characterized in that, it includes: Obtain an object graph to be serialized, where the object graph includes multiple message objects, and the pointer fields in the multiple message objects represent the reference relationships between the multiple message objects; Allocate identification information to the multiple message objects respectively; Use the identification information of the multiple message objects to replace the pointer fields in the multiple message objects and participate in the serialization processing of the multiple message objects to obtain the serialized data of the multiple message objects; Transmit the serialized data of the multiple message objects to the peer end, and the serialized data of the multiple message objects at least includes the identification information of the multiple message objects and the serialization results of the value fields in the multiple message objects.

2. The method according to claim 1, characterized in that, using the identification information of the multiple message objects to replace the pointer fields in the multiple message objects and participate in the serialization processing of the multiple message objects to obtain the serialized data of the multiple message objects, includes: Generate header information for any one of the message objects, where the header information at least includes the identification information of any one of the message objects, and the identification information of other message objects pointed to by the pointer field of any one of the message objects when the pointer field is not empty; Generate the serialized data of any one of the message objects according to the header information of any one of the message objects and the value field in any one of the message objects, where during the serialization process, the pointer field of any one of the message objects is processed as invalid.

3. The method according to claim 2, characterized in that, generating header information for any one of the message objects includes: Generate an empty header in a set format for any one of the message objects, where the empty header at least includes a sequence number field, a reference field, and a pointer field; Configure information for each field in the empty header to obtain the header information of any one of the message objects; where the information configuration includes: Add the identification information of any one of the message objects to the sequence number field; Add pointer information pointing to any one of the message objects to the pointer field, where the pointer information is the address information of any one of the message objects in the local memory space; Add the identification information of other message objects pointed to by the pointer field in any one of the message objects when the pointer field is not empty to the reference field.

4. The method according to claim 3, characterized in that, it further includes: The empty header further includes a type field; the information configuration further includes: Add the message type to which any one of the message objects belongs to the type field; Different message types correspond to different serialization methods.

5. The method according to claim 4, characterized in that, generating the serialized data of any one of the message objects according to the header information of any one of the message objects and the value field in any one of the message objects, includes: Determine the target serialization method according to the message type in the type field; Perform serialization processing on the value field in any one of the message objects according to the target serialization method to obtain the value field serialization result; Concatenate the header information of any of the message objects with the serialization result of the value domain and the pointer domain processed as invalid to obtain the independent serialized data of any of the message objects.

6. The method according to claim 2, wherein, before generating the serialized data of any of the message objects according to the header information of any of the message objects and the value domain in any of the message objects, further comprising: Set the pointer domain in any of the message objects to be empty to perform invalid processing on the pointer domain; or Negotiate with the peer in advance to agree that the pointer domain in any of the message objects is not processed by default to perform invalid processing on the pointer domain.

7. The method according to any one of claims 1-6, wherein, Assign identification information to each of the multiple message objects, including: Determine an initial message object from the multiple message objects; Starting from the initial message object, traverse each message object according to the reference relationship between the multiple message objects; For the currently traversed message object, determine whether identification information has been assigned to it; In the case where the determination result is no, assign identification information to the currently traversed message object.

8. The method according to claim 7, wherein, For the currently traversed message object, determining whether identification information has been assigned to it includes: Calculate the hash value of the currently traversed message object according to the attribute information of the currently traversed message object; in the case where the hash value of the currently traversed message object does not exist in the hash value list, determine that identification information has not been assigned to the currently traversed message object; wherein, the hash value list stores the hash values of the message objects to which identification information has been assigned; or Determine whether the flag bit corresponding to the currently traversed message object is the target value; in the case where the flag bit is not the target value, determine that identification information has not been assigned to the currently traversed message object; wherein, the flag bit will be set to the target value in the case where identification information is assigned to the corresponding message object.

9. The method according to any one of claims 1-6, wherein, Transmit the serialized data of the multiple message objects to the peer, including: During the serialization process, sequentially transmit the serialized data of the serialized message objects to the peer; or After the serialization is completed, transmit the serialized data of the serialized message objects to the peer together.

10. An object processing method, wherein, comprising: Receive the serialized data of multiple message objects transmitted by the peer, there is no data dependency between the serialized data of the multiple message objects, the multiple message objects belong to the same object graph, and there is a reference relationship between the multiple message objects; Parse and process the serialized data of the multiple message objects respectively in a parallel manner to obtain the identification information of the multiple message objects and the value domains of the multiple message objects; Restore the pointer domain in the multiple message objects according to the identification information of the multiple message objects to obtain the object graph.

11. The method according to claim 10, wherein, Parsing the serialized data of the multiple message objects in parallel to obtain the identification information of the multiple message objects and the value ranges of the multiple message objects, including: For the serialized data of any one message object, parsing the serialized data of the any one message object to obtain the header information of the any one message object, the serialized result of the value range, and the pointer field to be invalidated; Wherein, the header information at least includes the identification information of the any one message object, and the identification information of other message objects pointed to by the pointer field before invalidation when the pointer field is non-empty; Deserializing the serialized result of the value range of the any one message object to obtain the value range of the any one message object.

12. The method according to claim 11, wherein, the header information includes a sequence number field, a reference field, and a pointer field. The sequence number field carries the identification information of the any one message object, and the reference field carries the identification information of other message objects pointed to by the pointer field before invalidation when the pointer field is non-empty; The method further includes: when obtaining the value range of the any one message object, configuring pointer information pointing to the any one message object in the pointer field according to the memory address of the value range of the any one message object; Correspondingly, restoring the pointer field in the multiple message objects according to the identification information of the multiple message objects to obtain the object graph, including: When obtaining the value ranges of the multiple message objects, for any one message object, if the identification information of other message objects it references is obtained from the reference field in its header information, according to the identification information of the other message objects, configuring the pointer information in the pointer field of the header information of the other message objects into the pointer field to be invalidated of the any one message object to obtain the reference relationship between the any one message object and the other message objects; Generating the object graph according to the value ranges and pointer fields of the multiple message objects.

13. The method according to claim 12, wherein, the header information further includes a type field, and the type field carries the message type of the any one message object; Deserializing the serialized result of the value range of the any one message object to obtain the value range of the any one message object, including: Determining a target deserialization method according to the message type in the type field; Deserializing the serialized result of the value range of the any one message object according to the target deserialization method to obtain the value range of the any one message object.

14. An electronic device, wherein, including: a memory and a processor; The memory is used for storing a computer program; the processor is coupled with the memory and is used for executing the computer program to implement the steps in the method according to any one of claims 1-9 and claims 10-13.

15. A computer-readable storage medium storing a computer program, wherein, When the computer program is executed by a processor, it causes the processor to implement the steps in the method according to any one of claims 1-9 and claims 10-13.