Communication method, device and system and storage medium

By including the first metadata on both the sending end and the receiving end of the communication system, the problem of excessive data volume in the prior art is solved, and the effect of improving the efficiency of sending data is achieved.

CN119906712APending Publication Date: 2025-04-29HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311405956.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, when sending data, the data amount of data in the data block increases, which reduces the efficiency of sending data.

Method used

By including first metadata on both the transmitting end and the receiving end, the transmitting end acquires the data block based on the first metadata, and the data block does not contain the first metadata, thereby reducing the data amount of the data block and improving the transmission efficiency.

Benefits of technology

The amount of data in the data block is reduced, the time and bandwidth resources for sending data are reduced, and the efficiency of sending data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906712A_ABST
    Figure CN119906712A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method, device and system and a storage medium, and belongs to the field of communication. The method is applied to a first device in the communication system, the communication system further comprises a second device, each of the first device and the second device comprises first metadata, the first metadata is used for describing at least one data category, and the at least one data category is a data category to which a data value which can be sent to the second device by the first device belongs. The method comprises the steps that a first device obtains a first data block based on first metadata, wherein the first data block comprises data values belonging to the at least one data category; the first device sends the first data block to the second device; and the second equipment is used for analyzing the first data block based on the first metadata to obtain the data value. According to the invention, the data sending efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a communication method, device, system and storage medium. Background Art

[0002] Serialization is the process of converting the data to be sent into a format that can be transmitted. For example, for the original data to be sent included in the sender, the sender serializes the original data to obtain metadata and target data, and the metadata is used to describe the arrangement structure of the target data. A data block is sent to the receiving end, and the data block includes a block header of the data block, the metadata, and the target data. The block header includes the offset of the target data in the data block, and the target data includes the offset of the metadata in the data block and the original data.

[0003] The receiving end receives the data block, obtains the target data in the data block based on the offset of the target data in the block header of the data block, obtains the metadata in the data block based on the offset of the metadata included in the target data, and deserializes the target data based on the metadata to obtain the original data. The time required for the sending end from obtaining the original data to sending the data block is relatively long, which reduces the efficiency of sending data. Summary of the invention

[0004] The present application provides a communication method, device, system and storage medium, which can improve the efficiency of sending data. The technical solution is as follows:

[0005] In a first aspect, the present application provides a communication system, the communication system comprising a first device and a second device, the first device and the second device both comprising first metadata, the first metadata being used to describe at least one data category, the at least one data category being a data category to which a data value that the first device can send to the second device belongs. The first device is configured to obtain a first data block based on the first metadata, the first data block comprising a data value belonging to the at least one data category. The first device is further configured to send the first data block to the second device. The second device is configured to parse the first data block based on the first metadata to obtain the data value.

[0006] Since both the first device and the second device include the first metadata, and the first metadata includes at least one data category, the first device obtains the first data block based on the first metadata, and the first data block includes a data value belonging to the at least one data category, and sends the first data block to the second device. In this way, since the first data block includes the data value and does not need to include the first metadata, the amount of data in the first data block can be reduced, thereby improving the efficiency of sending the first data block. In addition, since the first data block includes the data value and does not need to include the first metadata, the data value does not need to be serialized, thereby reducing the time to obtain the first data block and improving the efficiency of sending the first data block.

[0007] In a possible implementation, the first metadata is also used to describe the data value arrangement mode that the first device can send to the second device, and the data value arrangement mode included in the first data block is the data value arrangement mode, so as to ensure that the second device can successfully parse the data value.

[0008] In another possible implementation, the first metadata is metadata of the first device, and the first device is further configured to send the first metadata to the second device. The second device is further configured to receive the first metadata, thereby ensuring that both the first device and the second device include the first metadata.

[0009] In another possible implementation, the first metadata is metadata of the second device, and the second device is further configured to send the first metadata to the first device. The first device is further configured to receive the first metadata, thereby ensuring that both the first device and the second device include the first metadata.

[0010] In another possible implementation, the number of the at least one data category is M, M is an integer greater than or equal to 1, the first device further includes second metadata, the second metadata is metadata of the first device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M. The first device is further used to obtain N data values ​​belonging to the N data categories based on the second metadata. The first device is further used to select Q data values ​​belonging to the Q data category from the N data values ​​based on the first metadata, the first data block includes MQ default values ​​belonging to MQ data categories and the Q data values, and the MQ data categories are data categories other than the Q data categories in the M data categories. In this way, it is ensured that the first data block includes M data values, so that the format of the first data block is the same as the format indicated by the first metadata, thereby ensuring that the second device can successfully parse the first data block based on the first metadata.

[0011] In a second aspect, the present application provides a communication method, the method is applied to a first device in a communication system, the communication system further includes a second device, the first device and the second device both include first metadata, the first metadata is used to describe at least one data category, the at least one data category is a data category to which a data value that the first device can send to the second device belongs. In the method, the first device obtains a first data block based on the first metadata, the first data block includes a data value belonging to the at least one data category. The first device sends the first data block to the second device, and the second device is used to parse the first data block based on the first metadata to obtain the data value.

[0012] Since both the first device and the second device include the first metadata, and the first metadata includes at least one data category, the first device obtains the first data block based on the first metadata, and the first data block includes a data value belonging to the at least one data category, and sends the first data block to the second device. In this way, since the first data block includes the data value and does not need to include the first metadata, the amount of data in the first data block can be reduced, thereby improving the efficiency of sending the first data block. In addition, since the first data block includes the data value and does not need to include the first metadata, the data value does not need to be serialized, thereby reducing the time to obtain the first data block and improving the efficiency of sending the first data block.

[0013] In a possible implementation, the first metadata is also used to describe the data value arrangement mode that the first device can send to the second device, and the data value arrangement mode included in the first data block is the data value arrangement mode, so as to ensure that the second device can successfully parse the data value.

[0014] In another possible implementation, the first metadata is metadata of the first device, and the first device sends the first metadata to the second device, thereby ensuring that both the first device and the second device include the first metadata.

[0015] In another possible implementation, the first metadata is metadata of the second device, and the first device receives the first metadata from the second device, thereby ensuring that both the first device and the second device include the first metadata.

[0016] In another possible implementation, the number of the at least one data category is M, M is an integer greater than or equal to 1, the first device further includes second metadata, the second metadata is metadata of the first device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M. The first device obtains N data values ​​belonging to the N data categories based on the second metadata. The first device selects Q data values ​​belonging to the Q data category from the N data values ​​based on the first metadata, the first data block includes MQ default values ​​belonging to MQ data categories and the Q data values, and the MQ data categories are data categories other than the Q data categories in the M data categories. In this way, it is ensured that the first data block includes M data values, so that the format of the first data block is the same as the format indicated by the first metadata, thereby ensuring that the second device can successfully parse the first data block based on the first metadata.

[0017] In a third aspect, the present application provides a communication method, the method is applied to a second device in a communication system, the communication system further includes a first device, the first device and the second device both include first metadata, the first metadata is used to describe at least one data category, the at least one data category is a data category to which a data value that the first device can send to the second device belongs. In the method, the second device receives a first data block, the first data block includes a data value belonging to the at least one data category. The second device parses the first data block based on the first metadata to obtain the data value.

[0018] Since both the first device and the second device include the first metadata, the first metadata includes at least one data category, and the first data block sent by the first device includes a data value belonging to the at least one data category. In this way, the first data block includes the data value and does not need to include the first metadata, so the amount of data in the first data block can be reduced, thereby improving the efficiency of the first device sending the first data block. In addition, since the first data block includes the data value and does not need to include the first metadata, the first device does not need to serialize the data value, and the second device does not need to deserialize the first data block, thereby reducing the time for the first device to obtain the first data block, improving the efficiency of the first device sending the first data block, and improving the efficiency of the second device parsing the first data block.

[0019] In one possible implementation, the first metadata is also used to describe an arrangement of data values ​​that the first device can send to the second device, and the arrangement of data values ​​included in the first data block is this data value arrangement, thereby ensuring that the second device can successfully parse the data value in the first data block.

[0020] In another possible implementation, the first metadata is metadata of the first device. The second device receives the first metadata from the first device, thereby ensuring that both the first device and the second device include the first metadata.

[0021] In another possible implementation, the first metadata is metadata of the second device. The second device sends the first metadata to the first device, thereby ensuring that both the first device and the second device include the first metadata.

[0022] In another possible implementation, the number of the at least one data category is M, M is an integer greater than or equal to 1, the first device further includes second metadata, the second metadata is metadata of the first device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the N data categories and the M data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N and Q is less than or equal to M, the first data block includes MQ default values ​​belonging to MQ data categories and Q data values ​​belonging to the Q data categories, the MQ data categories are data categories other than the Q data categories in the M data categories. In this way, it is ensured that the first data block includes M data values, so that the format of the first data block is the same as the format indicated by the first metadata, thereby ensuring that the second device can successfully parse the first data block based on the first metadata.

[0023] In a fourth aspect, the present application provides a communication method, the method is applied to a first device, the first device includes an object tree, in the method, a first node is obtained, the first node is a non-leaf node included in the object tree, the object tree also includes a second node, the second node is a child node of the first node. First target data is added to a first data block, the first target data includes location information of the second node, metadata of the first node and the first node, the metadata of the first node is used to indicate the location of the first node in the first data block, the location information is used to indicate the location of the second target data in the second data block, the second target data includes metadata of the second node and the child node, and the second data block is the data block where the second target data is located. When the data volume of the first data block exceeds the data volume threshold, the first data block is sent.

[0024] Since the first target data includes the location information of the second node (the child node of the first node), the location information is used to indicate the location of the second target data of the second node in the second data block, so that the second target data can be obtained from the second data block based on the location information, and the second node can be obtained based on the second target data, so that multiple data blocks can be used to send the object tree. In this way, when the data volume of the first data block exceeds the data volume threshold, the first data block can be sent, and after the first data block is sent, the next data block can be obtained, and then the next data block can be sent. Compared with obtaining a data block including the entire object tree and then sending a data block including the entire object tree, since the time required to obtain the data block including the entire object tree is much longer than the time to obtain the first data block, when the data volume of the first data block exceeds the data volume threshold, the first data block is sent, thereby improving the efficiency of sending data.

[0025] In a possible implementation, when the data volume of the first data block does not exceed the data volume threshold, a third node is obtained, and the third node is a brother node or a parent node of the first node. Third target data is added to the first data block, and the third target data includes metadata of the third node and the third node. When the data volume of the first data block exceeds the data volume threshold, the first data block is sent. In this way, when the data volume of the first data block does not exceed the data volume threshold, nodes in the object tree continue to be added to the first data block, so that the first data block is sent only when the data volume exceeds the data volume threshold, thereby avoiding frequent sending of data blocks.

[0026] In another possible implementation, the metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block, so as to ensure that the first node can be parsed from the first data block based on the metadata.

[0027] In another possible implementation, the location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block, so as to ensure that the second node (child node of the first node) can be parsed from the second data block based on the location information.

[0028] In another possible implementation manner, the first data block includes a block header and a payload part, the block header includes the data amount of the first data block, and the payload part includes the first target data.

[0029] In another possible implementation, the first node is a root node of the object tree, and the block header further includes an offset of the first target data in the first data block, thereby ensuring that the root node of the object tree can be obtained based on the offset.

[0030] In another possible implementation, the fourth node is obtained, and the third node is a node in the object tree that has not been sent. A third data block is created, and the data amount of the payload part of the third data block is zero. Fourth target data is added to the payload part of the third data block, and the fourth target data includes metadata of the fourth node and the fourth node. When the data amount of the third data block exceeds the data amount threshold, the third data block is sent. In this way, the object tree is sent in multiple data blocks, and there is no need to wait for the data block including the entire object tree, thereby improving the efficiency of sending data.

[0031] In a fifth aspect, the present application provides a communication method, the method is applied to a second device included in a communication system, the communication system also includes a first device, the first device includes an object tree, the object tree includes a first node and a second node, and the second node is a child node of the first node. In the method, at least one data block sent by the first device is received, the at least one data block includes a first data block, the first data block includes first target data, the first target data includes location information of the second node, metadata of the first node and the first node, the metadata of the first node is used to indicate the location of the first node in the first data block, the location information is used to indicate the location of the second target data in the second data block, the second target data includes metadata of the second node and the second node, the second data block is the data block where the second target data is located, the first data block is the second data block, or the at least one data block also includes a second data block, the second data block is a data block sent by the first device before sending the first data block. The object tree is obtained based on the at least one data block.

[0032] Since the first target data includes the location information of the second node (the child node of the first node), the location information is used to indicate the location of the second target data of the second node in the second data block, so that the second device can obtain the second node from the second data block based on the location information, so that the first device can use multiple data blocks to send the object tree. In this way, the first device can send the first data block when the data volume of the first data block exceeds the data volume threshold, and after sending the first data block, it can obtain the next data block and then send the next data block. Compared with obtaining a data block including the entire object tree and then sending a data block including the entire object tree, since the time required to obtain the data block including the entire object tree is much longer than the time to obtain the first data block, the first device sends the first data block when the data volume of the first data block exceeds the data volume threshold, thereby improving the efficiency of the first device in sending data.

[0033] In a possible implementation, the metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block, so as to ensure that the first node can be parsed from the first data block based on the metadata.

[0034] In another possible implementation manner, the location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

[0035] In another possible implementation, the first node is the root node of the object tree, the first data block includes a block header and a payload part, the payload part includes the first target data, and the block header also includes the offset of the first target data in the first data block. Based on the offset included in the block header, the first target data is obtained from the first data block. Based on the first target data, the first node and the position information are obtained. Based on the position information, the second target data is obtained from the second data block. The second node is obtained based on the second target data. In this way, the first device can send the object tree in multiple data blocks without waiting for the data block including the entire object tree, thereby improving the efficiency of the first device in sending data.

[0036] In a sixth aspect, the present application provides a communication device, configured to execute the method in the second aspect or any possible implementation of the second aspect. Specifically, the device includes a unit configured to execute the method in the second aspect or any possible implementation of the second aspect.

[0037] In a seventh aspect, the present application provides a communication device for executing the method in the third aspect or any possible implementation of the third aspect. Specifically, the device includes a unit for executing the method in the third aspect or any possible implementation of the third aspect.

[0038] In an eighth aspect, the present application provides a communication device for executing the method in the fourth aspect or any possible implementation of the fourth aspect. Specifically, the device includes a unit for executing the method in the fourth aspect or any possible implementation of the fourth aspect.

[0039] In a ninth aspect, the present application provides a communication device for executing the method in the fifth aspect or any possible implementation of the fifth aspect. Specifically, the device includes a unit for executing the method in the fifth aspect or any possible implementation of the fifth aspect.

[0040] In the tenth aspect, the present application provides a communication device comprising at least one processor and a memory, wherein the at least one processor is used to couple with the memory, read and execute instructions in the memory to implement the method in the second aspect or any possible implementation manner of the second aspect.

[0041] In the eleventh aspect, the present application provides a communication device comprising at least one processor and a memory, wherein the at least one processor is used to couple with the memory, read and execute instructions in the memory to implement the method in the third aspect or any possible implementation manner of the third aspect.

[0042] In the twelfth aspect, the present application provides a communication device comprising at least one processor and a memory, wherein the at least one processor is used to couple with the memory, read and execute instructions in the memory to implement the method in the fourth aspect or any possible implementation manner of the fourth aspect.

[0043] In the thirteenth aspect, the present application provides a communication device comprising at least one processor and a memory, wherein the at least one processor is used to couple with the memory, read and execute instructions in the memory to implement the method in the fifth aspect or any possible implementation manner of the fifth aspect.

[0044] In the fourteenth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the above-mentioned second aspect, third aspect, fourth aspect, fifth aspect, any possible implementation of the second aspect, any possible implementation of the third aspect, any possible implementation of the fourth aspect, or any possible implementation of the fifth aspect.

[0045] In the fifteenth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program is loaded by a processor to execute the method of the above-mentioned second aspect, third aspect, fourth aspect, fifth aspect, any possible implementation of the second aspect, any possible implementation of the third aspect, any possible implementation of the fourth aspect, or any possible implementation of the fifth aspect.

[0046] In the sixteenth aspect, the present application provides a chip comprising a memory and a processor, the memory being used to store computer instructions, and the processor being used to call and run the computer instructions from the memory to execute the method of the above-mentioned second aspect, third aspect, fourth aspect, fifth aspect, any possible implementation of the second aspect, any possible implementation of the third aspect, any possible implementation of the fourth aspect, or any possible implementation of the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a structural diagram of a communication system provided in an embodiment of the present application;

[0048] Figure 2 It is a schematic diagram of the structure of an object tree provided in an embodiment of the present application;

[0049] Figure 3 It is a flow chart of a communication method provided by an embodiment of the present application;

[0050] Figure 4 is a schematic diagram of metadata of a first device provided in an embodiment of the present application;

[0051] Figure 5 is a schematic diagram of metadata of a second device provided in an embodiment of the present application;

[0052] Figure 6 is a schematic diagram of the structure of a first data block provided in an embodiment of the present application;

[0053] Figure 7 is a schematic diagram of the structure of another first data block provided in an embodiment of the present application;

[0054] Figure 8 is a flow chart of another communication method provided in an embodiment of the present application;

[0055] Fig. 9 It is a schematic diagram of the structure of a data block provided in an embodiment of the present application;

[0056] Fig.10 is a schematic diagram of the structure of another data block provided in an embodiment of the present application;

[0057] Fig.11 is a schematic diagram of the structure of another data block provided in an embodiment of the present application;

[0058] Fig.12 It is a schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0059] Fig.13 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;

[0060] Fig.14 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;

[0061] Fig.15 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;

[0062] Fig.16 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;

[0063] Fig.17 It is a schematic diagram of the structure of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0065] See also Figure 1 An embodiment of the present application provides a communication system 100, which includes a first device 101 and a second device 102, and the first device 101 can communicate with the second device 102.

[0066] Next, examples 1 and 2 of communication between the first device 101 and the second device 102 are listed. Of course, there may be other examples of communication between the first device 101 and the second device 102 besides the following examples 1 and 2, which are not listed in detail here.

[0067] Example 1: The first device 101 may obtain at least one data value, and send a data block to the second device 102, where the data block includes the at least one data value or a portion of the at least one data value.

[0068] In some embodiments, the first device 101 has a need to synchronize the at least one data value or a portion of the at least one data value obtained by the first device 101 to the second device 102, so when the first device 101 obtains the at least one data value, the first device 101 can send a data block to the second device 102, which includes the at least one data value or a portion of the at least one data value.

[0069] For example, the communication system 100 is applied to an online game scenario, the first device 101 is a terminal device, and the second device 102 is a server, that is, the terminal device may obtain at least one data value and send a data block to the server, and the data block includes the at least one data value or a part of the at least one data value. Alternatively, the first device 101 is a server, and the second device 102 is a terminal device, that is, the server may obtain at least one data value and send a data block to the terminal device, and the data block includes the at least one data value or a part of the at least one data value.

[0070] In some embodiments, for at least one data value acquired by the first device 101, at least one data category to which the at least one data value belongs may be a data category supported by the second device 102, and the data block sent by the first device 101 to the second device 102 includes the at least one data value. Alternatively, some data categories in the at least one data category to which the at least one data value belongs may be data categories supported by the second device 102, and the data block sent by the first device 101 to the second device 102 includes some data values ​​in the at least one data value.

[0071] In some embodiments, the first device 101 may have metadata, and the metadata of the first device 101 includes at least one data category supported by the first device 101. The first device 101 may synchronize the metadata of the first device 101 to the second device 102, and the second device 102 saves the metadata of the first device 101. In this way, the data value included in the data block sent by the first device 101 to the second device 102 belongs to a data category supported by the first device 101, and the second device 102 parses the data block based on the metadata of the first device 101 to obtain the data included in the data block.

[0072] In some embodiments, the second device 102 may have metadata, and the metadata of the second device 102 includes at least one data category supported by the second device 102. The second device 102 may synchronize the metadata of the second device 102 to the first device 101, and the first device 101 saves the metadata of the second device 102. In this way, the data value included in the data block sent by the first device 101 to the second device 102 belongs to a data category supported by the second device 102, and the second device 102 parses the data block based on the metadata of the second device 102 to obtain the data value included in the data block.

[0073] Example 2: The first device 101 may obtain an object tree to be sent, the object tree including multiple nodes, each node including data to be sent. The first device 101 may start traversing from the leaf nodes of the object tree, and serialize each node to obtain target data, and add the target data to the data block to be sent. When the amount of data in the data block does not exceed the data amount threshold, the first device 101 continues to traverse the nodes in the object tree, and serializes each node to obtain target data, and continues to add the target data to the data block. Or,

[0074] When the data volume of the data block does not exceed the data volume threshold, the first device 101 sends the data block to the second device 102. Then, the first device 101 creates a new data block, and the data volume of the payload part of the data block is zero. The first device 101 continues to traverse the nodes in the object tree, and for a traversed node, serializes the node to obtain the target data, and adds the target data to the data block. When the data volume of the data block does not exceed the data volume threshold, the first device 101 continues to traverse the nodes in the object tree, and for a traversed node, serializes the node to obtain the target data, and adds the target data to the data block; or, when the data volume of the data block does not exceed the data volume threshold, the data block is sent to the second device 102. Repeat the above process until each node in the object tree is sent.

[0075] The second device 102 may receive at least one data block sent by the first device 101, and may obtain the object based on the at least one data block.

[0076] For example, see Figure 2 As shown in the object tree, the first device 101 starts traversing from the leaf node 5 of the object tree, serializes the node 5 to obtain the target data 1, and adds the target data 1 to the data block 1. The first device 101 traverses the leaf node 6 of the object tree, serializes the node 6 to obtain the target data 2, and adds the target data 2 to the data block 1. The first device 101 traverses the node 2 of the object tree, serializes the node 2 to obtain the target data 3, and adds the target data 3 to the data block 1. At this time, the data volume of the data block 1 exceeds the data volume threshold, and the data block 1 is sent to the second device 102.

[0077] Create data block 2, traverse leaf node 7 of the object tree, serialize node 7 to obtain target data 4, and add target data 4 to data block 2. Traverse node 8 of the object tree, serialize node 8 to obtain target data 5, and add target data 5 to data block 2. Traverse node 9 of the object tree, serialize node 9 to obtain target data 6, and add target data 6 to data block 2. At this time, the data volume of data block 2 exceeds the data volume threshold, and the first device 101 sends data block 2 to the second device 102.

[0078] Create data block 3, traverse node 3 of the object tree, serialize node 3 to obtain target data 7, and add target data 7 to data block 3. Traverse node 4 of the object tree, serialize node 4 to obtain target data 8, and add target data 8 to data block 3. Traverse node 1 of the object tree, serialize node 1 to obtain target data 9, and add target data 9 to data block 3. The first device 101 sends data block 3 to the second device 102.

[0079] The second device 102 receives data block 1, data block 2 and data block 3, and obtains the following based on data block 1, data block 2 and data block 3: Figure 2 The object tree is shown.

[0080] See also Figure 3 The present application embodiment provides a communication method 300, the method 300 is applied to Figure 1 In the communication system 100 shown, the method 300 includes the following process.

[0081] Step 301: The first device synchronizes first metadata with the second device, where the first metadata is used to describe M data categories that the first device can send to the second device, where M is an integer greater than or equal to 1.

[0082] The first metadata is metadata of the first device, or the first metadata is metadata of the second device. The first metadata includes the M data categories.

[0083] In some embodiments, the first metadata is metadata of the first device, the first device sends the first metadata to the second device, the second device receives the first metadata, and saves the first metadata, so that both the first device and the second device include the first metadata.

[0084] For example, see Figure 4 The metadata of the first device shown, that is, the first metadata is Figure 4 The metadata shown in FIG. 10 shows a first metadata indicating five data categories supported by the first device, the five data categories being timestamps (eg Figure 4 timestamp, and the type is uint64_t), the task number (such as Figure 4 The task is represented by task and its type is uint32_t), task description (such as Figure 4 t_desc is used in the table, and the type is string), the deadline (such as Figure 4 The deadline is extended (such as Figure 4 The first device sends the first metadata to the second device, and the second device receives the first metadata and saves the first metadata. In this way, both the first device and the second device include the following: Figure 4 The first metadata is shown.

[0085] In some embodiments, the first metadata is metadata of the second device, the first device receives the first metadata sent by the second device, the first device receives the first metadata, and saves the first metadata, so that both the first device and the second device include the first metadata.

[0086] For example, see Figure 5 The metadata of the second device shown, that is, the first metadata is Figure 5 The metadata shown in FIG. 10 , the first metadata indicates six data categories supported by the second device, and the six data categories are respectively timestamp (such as Figure 5 timestamp, and the type is uint6_t), the task number (such as Figure 5 The task is represented by task and its type is uint32_t), task description (such as Figure 5 t_desc is used in the table, and the type is string), the deadline (such as Figure 5 It is represented by ddl, and the type is uint32_t, and the unit is hours), limited-time special rewards (such as Figure 5 The bonus is expressed in the form of uint32_t), and the description of the limited-time special reward (such as Figure 5 b_desc is used in the representation, and the type is string). The second device sends the first metadata to the first device, and the first device receives the first metadata and saves the first metadata, so that the first device and the second device both include Figure 5 The first metadata is shown.

[0087] Since both the first device and the second device include the first metadata, the first device and the second device can identify the M data values ​​belonging to the M data categories based on the first metadata. For any data category, a data value corresponding to the data category may include one sub-data value or multiple sub-data values. For example, for the data category "timestamp", the data value corresponding to the data category may include a certain moment, or the data value corresponding to the data category may include multiple different moments.

[0088] Step 302: The first device obtains N data values ​​to be sent, where N is an integer greater than or equal to 1, and the M data categories include the N data categories to which the N data values ​​belong or some of the N data categories.

[0089] The N data categories to which the N data values ​​acquired by the first device belong are the N data categories included in the metadata of the first device.

[0090] In step 302, the first device generates N data values ​​based on the metadata of the first device, and the N data values ​​are data values ​​to be sent. Since the second device includes the first metadata, if the M data categories include the N data categories to which the N data values ​​belong, it means that the second device can identify the N data values ​​based on the first metadata. If the M data categories include some data categories among the N data categories, it means that the second device can identify some data values ​​among the N data values ​​that belong to the some data categories based on the first metadata.

[0091] For example, N=5, the first device obtains 5 data values, assuming that the 5 data values ​​include "123456", "001", "kill ten monsters", "2", and "3". Among them, timestamp="123456", task="001", t_desc="kill ten monsters", ddl="2" hours, ext_ddl2="3" hours. The 5 data values ​​belong to 5 data categories including timestamp, task number, task description, deadline, and deadline extension. The 5 data categories are as follows: Figure 4 The metadata of the first device shown includes 5 data categories.

[0092] In some embodiments, the intersection between the M data categories and the N data categories includes Q data categories, where Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M.

[0093] In some embodiments, the first metadata is metadata of the first device, M=N=Q, the M data categories are the same as the N data categories, so the Q data categories included in the intersection are the N data categories. For example, the first metadata is as follows Figure 4 The metadata of the first device shown is M=N=Q=5, and the M data categories, the N data categories, and the Q data categories are all first metadata including 5 data categories.

[0094] In some embodiments, the first metadata is metadata of the second device. The M data categories may include the N data categories, so the Q data categories included in the intersection are the N data categories, N=Q. Or,

[0095] In some embodiments, the M data categories may include some of the N data categories, so the Q data categories included in the intersection are the some of the data categories, and Q is less than N. The M data categories are the same as the some of the data categories, and Q=M; or, in addition to including the some of the data categories, the M data categories also include other data categories, and Q is less than M. For example, the first metadata is as follows Figure 5 The metadata of the second device shown, the M data categories are Figure 5 The 6 data categories shown are as follows: Figure 4 There are 5 data categories in the metadata of the first device, and the intersection between the M data categories and the N data categories includes 4 data categories, Q=4, and the Q data categories include timestamp, task number, task description and deadline.

[0096] Step 303: The first device obtains a first data block based on the first metadata, where the first data block includes M data values ​​belonging to M data categories, and the M data values ​​include the N data values ​​or some of the N data values.

[0097] In some embodiments, the arrangement of the M data values ​​in the first data block is the same as the arrangement indicated by the first metadata, and the arrangement indicated by the first metadata is the arrangement of data values ​​that the first device can send to the second device. Optionally, the arrangement is the order in which the M data values ​​are arranged in the first data block.

[0098] The arrangement order of the M data categories in the first metadata is the same as the arrangement order of the M data values ​​in the first data block. That is, the first device arranges the M data values ​​belonging to the M data types in the first data block based on the arrangement order of the M data categories in the first metadata.

[0099] In step 303, for the i-th data category in the first metadata, i=1, 2, 3, ..., M, if the N data values ​​include the i-th data value belonging to the i-th data category, the i-th data value is obtained. If the N data values ​​do not include the data value belonging to the i-th data category, the default value corresponding to the i-th data category is used as the i-th data value. If the data amount of the i-th data value does not exceed the specified threshold, the first device inserts the i-th data value into the i-th field of the first data block; if the data amount of the i-th data value exceeds the specified threshold, the first device inserts the i-th data value into the field after the M-th field of the first data block, and inserts the i-th data value at the offset of the first data block at the i-th field of the first data block.

[0100] In some embodiments, the first metadata is metadata of the first device, M=N, and the first data block acquired by the first device based on the first metadata includes the N data values.

[0101] For example, the first metadata is Figure 4 The metadata of the first device shown is based on Figure 4 The first metadata shown in the first data block obtained is as follows Figure 6 As shown, the first data block includes the above five data values, which include "123456", "001", "kill ten monsters", "2", and "3". In implementation:

[0102] For the first data category "timestamp" in the first metadata, the timestamp "123456" belonging to "timestamp" is inserted into the first field of the first data block. For the second data category "task" in the first metadata, the task number "001" belonging to "task" is inserted into the second field of the first data block. For the third data category "t_desc" in the first metadata, the data volume of the task description "kill ten monsters" belonging to "t_desc" exceeds the specified threshold, the task description "kill ten monsters" is inserted into the sixth field of the first data block, and the offset "offset" of the task description "kill ten monsters" in the first data block is inserted into the third field of the first data block. For the fourth data category "ddl" in the first metadata, the deadline "2" belonging to "ddl" is inserted into the fourth field of the first data block. For the fifth data category "ext_ddl2" in the first metadata, the deadline extension "3" belonging to "ext_ddl2" is inserted into the fifth field of the first data block.

[0103] In some embodiments, the first metadata is metadata of the second device, and the first data block obtained by the first device based on the first metadata includes MQ default values ​​belonging to MQ data categories and the Q data values. The MQ data categories are data categories other than the Q data categories among the M data categories, and the Q data values ​​are data values ​​belonging to the Q data categories among the N data values.

[0104] For example, the first metadata is Figure 5 The metadata of the second device shown in FIG. Figure 5 The first metadata shown in the first data block obtained is as follows Figure 7 As shown, the first data block includes 6 data values, including "123456", "001", "kill ten monsters", "2", "10", and "10 coins". In implementation:

[0105] For the first data category "timestamp" in the first metadata, the timestamp "123456" belonging to "timestamp" is inserted into the first field of the first data block. For the second data category "task" in the first metadata, the task number "001" belonging to "task" is inserted into the second field of the first data block. For the third data category "t_desc" in the first metadata, the data volume of the task description "kill ten monsters" belonging to "t_desc" exceeds the specified threshold, the task description "kill ten monsters" is inserted into the sixth field of the first data block, and the offset "offset1" of the task description "kill ten monsters" in the first data block is inserted into the third field of the first data block. For the fourth data category "ddl" in the first metadata, the deadline "2" belonging to "ddl" is inserted into the fourth field of the first data block.

[0106] For the 5th data category "bonus" in the first metadata, the 5 data values ​​do not include the data value belonging to the 5th data category "bonus", obtain the default value corresponding to the 5th data category "bonus" as the limited-time special reward "10", and insert the limited-time special reward "10" belonging to the 5th data category "bonus" into the 5th field of the first data block. For the 6th data category "b_desc" in the first metadata, the 5 data values ​​do not include the data value belonging to the 6th data category "b_desc", obtain the default value belonging to the 6th data category "b_desc" as the limited-time special reward description "10coins", the data amount of the limited-time special reward description "10coins" exceeds the specified threshold, insert the limited-time special reward description "10coins" belonging to the 6th data category "b_desc" into the 7th field of the first data block, and insert the offset "offset2" of the limited-time special reward description "10coins" in the first data block into the 6th field of the first data block.

[0107] Step 304: The first device sends a first data block to the second device.

[0108] Step 305: The second device receives the first data block, and parses the first data block based on the M data categories included in the first metadata to obtain the M data values.

[0109] In some embodiments, the first metadata is further used to describe the arrangement of the M data values ​​included in the first data block, and the second device parses the first data block to obtain the M data values ​​based on the M data categories and the arrangement.

[0110] In step 304, for the jth data category in the first metadata, j=1, 2, 3, ..., M, if the jth field of the first data block includes a data value belonging to the jth data category, the second device reads the data value belonging to the jth data category from the jth field of the first data block. If the jth field of the first data block includes an offset of the data value belonging to the jth data category in the first data block, the second device reads the data value belonging to the jth data category from the first data block based on the offset.

[0111] In some embodiments, for the M data values, the second device also selects at least one data value from the M data values ​​based on the metadata of the second device, and at least one data category to which the at least one data value belongs is a data category in the metadata of the second device, and processes the at least one data value.

[0112] For example, the first metadata is Figure 4 As shown, the second device receives Figure 6 In the first data block shown, for the first data category "timestamp" in the first metadata, the second device reads the timestamp "123456" belonging to "timestamp" from the first field of the first data block. For the second data category "task" in the first metadata, the second device reads the task number "001" belonging to "task" from the second field of the first data block.

[0113] For the third data category "t_desc" in the first metadata, the third field of the first data block includes the offset "offset" of the data value belonging to the data category "t_desc" in the first data block, and the second device reads the offset "offset" from the third field of the first data block, and reads the task description "kill ten monsters" belonging to "t_desc" from the first data block based on the offset "offset".

[0114] For the 4th data category "ddl" in the first metadata, the second device reads the deadline "2" belonging to "ddl" from the 4th field of the first data block. For the 5th data category "ext_ddl2" in the first metadata, the second device reads the deadline extension "3" belonging to "ext_ddl2" from the 5th field of the first data block.

[0115] Thus, the second device parses and obtains five data values, including "123456", "001", "killten monsters", "2", and "3". The metadata of the second device is as follows: Figure 5As shown, the second device selects "123456", "001", "kill ten monsters", and "2" from the five data values ​​based on the metadata of the second device, and processes "123456", "001", "kill ten monsters", and "2".

[0116] For example, the first metadata is Figure 5 As shown, the second device receives Figure 7 In the first data block shown, for the first data category "timestamp" in the first metadata, the second device reads the timestamp "123456" belonging to "timestamp" from the first field of the first data block. For the second data category "task" in the first metadata, the second device reads the task number "001" belonging to "task" from the second field of the first data block.

[0117] For the third data category "t_desc" in the first metadata, the third field of the first data block includes the offset "offset1" of the data value belonging to the data category "t_desc" in the first data block, and the second device reads the offset "offset1" from the third field of the first data block, and reads the task description "kill ten monsters" belonging to "t_desc" from the first data block based on the offset "offset1".

[0118] For the 4th data category "ddl" in the first metadata, the second device reads the deadline "2" belonging to "ddl" from the 4th field of the first data block. For the 5th data category "bonus" in the first metadata, the second device reads the limited-time special reward "10" belonging to "bonus" from the 5th field of the first data block.

[0119] For the 6th data category "b_desc" in the first metadata, the 6th field of the first data block includes the offset "offset2" of the data value belonging to the data category "b_desc" in the first data block, and the second device reads the offset "offset2" from the 6th field of the first data block, and based on the offset "offset2", reads the limited-time special reward description "10 coins" belonging to "t_desc" from the first data block.

[0120] Thus, the second device parses and obtains 6 data values, including "123456", "001", "killten monsters", "2", "10", and "10 coins". The metadata of the second device is as follows: Figure 5As shown, the second device selects "123456", "001", "kill ten monsters", "2", "10", "10 coins" from the 6 data values ​​based on the metadata of the second device, and processes "123456", "001", "kill ten monsters", "2", "10", "10 coins".

[0121] In an embodiment of the present application, since the first device and the second device first synchronize the first metadata, the first metadata includes M data categories, so that when the first device obtains N data values, it obtains the first data block based on the first metadata, and the first data block includes M data values ​​belonging to the M data categories, and the M data values ​​include the N data values ​​or some of the N data values, and sends the first data block to the second device. Since the first data block includes the M data values ​​and does not need to include the first metadata, the amount of data in the first data block can be reduced, thereby improving the efficiency of sending the first data block and reducing the bandwidth resources occupied by sending the first data block. Since the first data block includes the M data values ​​and does not need to include the first metadata, it does not need to be serialized, thereby reducing the time to obtain the first data block and improving the efficiency of sending the first data block.

[0122] See also Figure 8 , the present application embodiment provides a communication method 800, the method 800 is applied to Figure 1 In the communication system 100 shown, the first device in the communication system 100 includes an object tree to be sent. The method 800 includes the following process.

[0123] Step 801: The first device obtains a first node, where the first node is a non-leaf node included in an object tree. The object tree also includes a second node, which is a child node of the first node.

[0124] Non-leaf nodes are nodes in the object tree other than leaf nodes.

[0125] In an embodiment of the present application, the first device traverses the object tree from the lower nodes to the upper nodes, and each time a node is traversed, the target data of the node is obtained and the target data is added to the current data block.

[0126] That is, the first device starts traversing from the leaf node of the object tree, and each time it traverses to a node, it serializes the node to obtain the target data of the node, and adds the target data of the node to the data block, and the target data of the node includes the metadata of the node and the node, and the metadata of the node is used to indicate the position of the node in the data block. Repeat the above process until the data volume of the data block exceeds the data volume threshold, and then send the data block to the second device.

[0127] Continue to traverse the nodes, and whenever a node is traversed, serialize the node to obtain the target data of the node, add the target data of the node to the new data block, the target data of the node includes the metadata of the node and the node, and the metadata of the node is used to indicate the position of the node in the new data block. Repeat the above process until the data volume of the new data block exceeds the data volume threshold, and send the new data block to the second device.

[0128] The above process is repeated, and multiple data blocks may be used to send the target data of each node in the object tree, until the data block containing the target data of the last node (the root node of the object tree) in the object tree is sent.

[0129] The first device includes a cache space. For any of the above data blocks, the data block is data stored in the cache space. Sending the data block is actually sending the data block in the cache space. After each data block in the cache space is sent, the data newly stored in the cache space is called a new data block.

[0130] For any node in the data block, the target data of the node includes metadata of the node and the node, and the metadata of the node is used to indicate the position of the node in the data block. Optionally, the metadata of the node includes one or more of the following data: the data volume of the target data of the node, or the offset of the target data of the node in the data block, etc.

[0131] In some embodiments, when the node is the parent node of at least one child node, the target data of the node also includes the location information of the at least one child node. For each child node, for ease of explanation, the child node is referred to as a second node, and the location information of the second node is used to indicate the data block where the target data of the second node is located and the location of the target data of the second node in the data block.

[0132] The location information of the second node includes one or more of the following information: identification information of the data block where the target data of the second node is located, or the offset of the target data of the second node in the data block, etc.

[0133] In some embodiments, an example of the first device traversing the object tree is listed below. Of course, there are other examples of the first device traversing the object tree, which are not listed here one by one. The process of this example is:

[0134] 1. The first device traverses at least one leaf node in the object tree, and the at least one leaf node is a child node of the same parent node.

[0135] Each time the first device traverses a leaf node, it adds the target data of the leaf node to the current data block.

[0136] The target data includes metadata of the leaf node and the leaf node, where the metadata of the leaf node is used to indicate the position of the leaf node in the data block.

[0137] In some embodiments, when the first device starts traversing, it can first create a data block, the payload of which is empty, the current data block is the created data block, the traversed leaf nodes are serialized to obtain the target data of the leaf nodes, and the target data of the leaf nodes are added to the data block. When the data volume of the data block exceeds the data volume threshold, the data block is sent to the second device. Then, a new data block is created, and the target data of other traversed leaf nodes are added to the new data block. When the data volume of the data block does not exceed the data volume threshold, the target data of other traversed leaf nodes are added to the data block.

[0138] Optionally, the first device includes a cache space, the data stored in the cache space is a data block, the so-called creation of a data block refers to storing a block header of the data block in the cache space, and the payload of the data block is empty. The so-called adding the target data of the leaf node to the data block refers to adding the target data of the leaf node to the cache space.

[0139] For example, see Figure 2 In the object tree shown in the figure, traversing nodes 5 and 6, both nodes 5 and 6 are leaf nodes, and the parent nodes of both nodes 5 and 6 are node 2. Fig. 9 When traversing to node 5, the first device serializes node 5 to obtain the target data of node 5, and adds the target data of node 5 to the current data block. The target data includes the metadata of node 5 and node 5, the data volume size1 of the target data of node 5 and the offset offset1 of the target data in the data block. Assume that a field with a length of 4 bytes is required in the data block to include the data volume size1 of the target data of node 5, and another field with a length of 4 bytes is used to include the offset offset1 of the target data in the data block. It is also assumed that size1 = 16 bytes, offset1 = 16 bytes, and the data volume of node 5 is 8 bytes.

[0140] See also Fig. 9 , the data block is the data stored in the cache space of the first device, and the data block includes a block header and a payload part. Assume that the block header includes four fields, each field is 4 bytes long, the first field includes the current data amount of the data block (32 bytes), and the other three fields are reserved fields. The payload part includes the target data of node 5.

[0141] When traversing to node 6, the first device serializes node 6 to obtain the target data of node 6, and adds the target data of node 6 to the current data block. The target data includes the metadata of node 6 and node 6. The metadata of node 6 includes the data volume size2 of the target data of node 6 and the offset offset2 of the target data in the data block, offset2 = 32 bytes, assuming size2 = 24 bytes, the data volume of node 6 is 16 bytes. At this time, the data volume of the data block is 56 bytes, and the first device also updates the data volume (32 bytes) of the data block included in the block header of the data block to 56 bytes.

[0142] 2. The first device traverses the parent node of the at least one leaf node, where the first node is the parent node, thereby obtaining the first node.

[0143] Step 802: The first device adds first target data to the first data block, where the first target data includes location information of the second node, metadata of the first node, and the first node.

[0144] Among them, the metadata of the first node is used to indicate the position of the first node in the first data block, the position information of the second node is used to indicate the position of the second target data in the second data block, the second target data includes the metadata of the second node and the second node, and the second data block is the data block where the second target data is located.

[0145] The first data block is data stored in the cache space of the first device, that is, the first data block is a data block that has not been sent yet. The first data block may be the same data block as the second data block, or the second data block is the data block sent last time, and the first data block and the second data block are different data blocks.

[0146] The location information of the second node includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

[0147] For example, the first node is node 2, and the first data block is Fig. 9 For operation 2 in the process shown in the above traversal example, when traversing to the parent node 2 of the at least one leaf node (node ​​5 and node 6), the first device adds the first target data to the data block. The first target data is the target data of node 2, and the first target data includes the location information of the two child nodes of node 2, the metadata of node 2, and node 2.

[0148] The data block where the target data of node 2 is located is the same as the data block where the target data of the two child nodes of node 2 are located. The location information of the two child nodes of node 2 includes location information 1 of node 5 and location information 2 of node 6. Assuming that a field with a length of 4 bytes is required to include the location information 1 of node 5, and another field with a length of 4 bytes is required to include the data amount of location information 2 of node 6, the location information 1 of node 5 includes the identification information "ID1" of the data block where the target data of node 5 is located and the offset of the target data of node 5 in the data block is 16, and the location information 2 of node 6 includes the identification information "ID1" of the data block where the target data of node 6 is located and the offset of the target data of node 6 in the data block is 32.

[0149] The metadata of node 2 includes the data size3 of the target data of node 2 and the offset offset3 of the target data in the data block, offset3=56 bytes, assuming size3=48 bytes, the data size of node 2 is 32 bytes. At this time, the data size of the data block is 104 bytes, and the first device also updates the data size of the data block (56 bytes) included in the block header of the first data block to 104 bytes.

[0150] Step 803: When the data amount of the first data block exceeds a data amount threshold, the first device sends the first data block to the second device.

[0151] For example, for Fig. 9 The data block shown, assuming the data volume threshold is 100 bytes, Fig. 9 The data block shown has a data volume of 104 bytes, which exceeds the data volume threshold, so the first device sends a data block to the second device. Fig. 9 The data block shown.

[0152] In some embodiments, when the data volume of the first data block does not exceed the data volume threshold, the first device obtains a second node, which is a sibling node or a parent node of the first node; adds third target data to the first data block, and the third target data includes metadata of the second node and the second node; and sends the first data block when the data volume of the first data block exceeds the data volume threshold.

[0153] In some embodiments, the first node is a root node of the object tree, and the header of the first data block further includes an offset of the first target data in the first data block. At this time, the first device has sent all nodes in the object tree and ends.

[0154] In some embodiments, the first node is not the root node of the object tree. After sending the first data block to the second device, if there are still unsent nodes in the object tree, the first device obtains a fourth node, which is an unsent node in the object tree; creates a third data block, the data volume of the payload part of the third data block is zero; adds fourth target data to the payload part of the third data block, the fourth target data includes metadata of the fourth node and the fourth node; when the data volume of the third data block exceeds the data volume threshold, sends the third data block. Repeat the above process until all nodes of the object tree are sent.

[0155] For example, for the above-mentioned example of traversing the object tree, the example also includes the following operations.

[0156] 3. The first device determines whether the first node is the root node of the object tree. If the first node is not the root node of the object tree, perform operation 4. If the first node is the root node of the object tree, end the traversal.

[0157] If the first node is the root node of the object tree, in addition to adding the target data of the first node to the current data block, the offset of the target data of the first node in the data block is also added to the block header of the data block.

[0158] 4. The first device obtains a third node, which is a sibling node of the first node and a non-leaf node, and traverses at least one leaf node, which is a leaf node attached to the third node.

[0159] Each time the first device traverses to a leaf node, it adds the target data of the node to the current data block. Then it determines whether the data volume of the data block exceeds the data volume threshold. If the data volume of the data block exceeds the data volume threshold, it sends the data block and then creates a new data block with an empty payload. Then it adds the target data of other leaf nodes traversed to the new data block. If the data volume of the data block does not exceed the data volume threshold, it adds the target data of other leaf nodes traversed to the data block.

[0160] For example, Figure 2 In the object tree shown, the first node is node 2, and the sibling nodes of node 2 include node 3 and node 4. That is, the third node may be node 3, and the leaf nodes under node 3 include node 7, node 8, and node 9. The first device traverses node 7, creates a new data block, and adds the target data of node 7 to the new data block. Fig.10, the target data includes the metadata of node 7 and node 7, the data size size4 of the target data of node 7 and the offset offset4 of the target data in the data block. Assuming size4 = 24 bytes, offset4 = 16 bytes, the data size of node 7 is 16 bytes. At this time, the block header of the data block includes the data size of the data block, which is 40 bytes.

[0161] When traversing to node 8, the first device serializes node 8 to obtain the target data of node 8, and adds the target data of node 8 to the current data block. The target data includes the metadata of node 8 and node 8. The metadata of node 8 includes the data volume size5 of the target data of node 8 and the offset offset5 of the target data in the data block, offset5 = 40 bytes, assuming size5 = 32 bytes, the data volume of node 8 is 24 bytes. At this time, the data volume of the data block is 72 bytes, and the first device also updates the data volume (40 bytes) of the data block included in the block header of the data block to 72 bytes.

[0162] When traversing to node 9, the first device serializes node 9 to obtain the target data of node 9, and adds the target data of node 9 to the current data block. The target data includes the metadata of node 9 and node 9. The metadata of node 9 includes the data volume size6 of the target data of node 9 and the offset offset6 of the target data in the data block. Offset6 = 72 bytes. Assuming size6 = 40 bytes, the data volume of node 9 is 32 bytes. At this time, the data volume of the data block is 112 bytes, and the first device also updates the data volume (72 bytes) of the data block included in the block header of the data block to 112 bytes. At this time, the data volume of the data block of 112 bytes exceeds the data volume threshold of 100 bytes, so the first device also sends the data block to the second device to create a new data block.

[0163] 5. The first device traverses the parent node of the at least one leaf node, and the third node is the parent node.

[0164] When the first device traverses to the parent node, that is, traverses to the third node, the first device adds the target data of the third node to the current data block.

[0165] For example, the parent node of nodes 7, 8, and 9 is node 3. The first device traverses node 3 and adds the target data of node 3 to the new data block. Fig.11 , the target data includes the location information of the three child nodes of node 3, the metadata of node 3 and node 3.

[0166] The location information of the three child nodes of node 3 includes location information 3 of node 7, location information 4 of node 8, and location information 5 of node 9. Location information 3 of node 7 includes the data block where the target data of node 7 is located ( Fig.10 The location information 4 of node 8 includes the data block ( Fig.10 The location information 9 of node 9 includes the data block ( Fig.10 The identification information "ID2" of the data block shown in the figure and the offset of the target data of node 9 in the data block is 72.

[0167] The metadata of node 3 includes the data size7 of the target data of node 3 and the offset offset7 of the target data in the data block, where offset7=16 bytes. Assuming size7=24 bytes, the data size of node 3 is 4 bytes. At this time, the data size of the data block is 40 bytes, that is, the block header of the data block includes the data size of 40 bytes of the data block.

[0168] After traversing node 3, the first device also traverses another sibling node of node 2, which is node 4. Since node 4 has no child nodes, the first device serializes node 4 to obtain the target data of node 4, and adds the target data of node 4 to the current data block. The target data includes the metadata of node 4 and node 4. The metadata of node 4 includes the data volume size8 of the target data of node 4 and the offset offset8 of the target data in the data block. Offset8 = 40 bytes. Assuming size8 = 16 bytes, the data volume of node 8 is 8 bytes. At this time, the data volume of the data block is 56 bytes, and the first device also updates the data volume (40 bytes) of the data block included in the block header of the data block to 56 bytes.

[0169] 6. The first device traverses the parent nodes of the first node and the third node, calls the parent node the first node, and returns to execute operation 3.

[0170] For example, the parent node of node 2, node 3, and node 4 is node 1, and node 1 is the root node. Fig.11 The target data of node 1 is added to the data block shown. The target data of node 1 includes the location information of the three child nodes of node 1, the metadata of node 1 and node 1, as well as the offset of the target data of node 1 in the data block in a reserved field in the data block, and the offset is 56.

[0171] The location information of the three child nodes of node 1 includes location information 6 of node 2, location information 7 of node 3, and location information 8 of node 4. Location information 6 of node 2 includes the data block where the target data of node 7 is located ( Fig. 9 The location information 7 of node 3 includes the data block ( Fig.11 The location information 9 of node 4 includes the data block ( Fig.11 The identification information “ID3” of the data block shown in the figure and the offset of the target data of node 4 in the data block is 40.

[0172] The metadata of node 1 includes the data size9 of the target data of node 1 and the offset offset9 of the target data in the data block. Offset9 = 56 bytes. Assuming size9 = 32 bytes, the data size of node 1 is 12 bytes. At this time, the data size of the data block is 88 bytes, that is, the block header of the data block including the data size of the data block 56 bytes is updated to 88 bytes. Then the first device sends to the second device Fig.11 The data block shown.

[0173] Step 804: The second device receives at least one data block sent by the first device, and obtains an object tree based on the at least one data block.

[0174] In step 804 , it can be implemented through the following operations 8041 to 8045 .

[0175] 8041: The second device identifies a data block including a root node from the multiple data blocks, and obtains the target data of the root node from the data block based on an offset of the target data of the root node included in a block header of the data block.

[0176] The block header of the data block including the root node includes the offset of the target data of the root node, so the data block whose block header includes the offset is identified as the data block including the root node.

[0177] For example, the second device receives Fig.12 , Fig.10 and Fig.11 The three data blocks shown in FIG. 1 include the root node 1. Fig.11 The data block shown. Fig.11 The block header of the data block shown includes an offset 56 based on which the target data of the root node 1 is obtained.

[0178] 8042: The second device obtains location information of the root node and child nodes of the root node based on the target data of the root node.

[0179] In some embodiments, the target data of the root node includes the location information of the child nodes of the root node, the metadata of the root node, and the root node, and the metadata of the root node includes the data volume of the target data of the root node and the offset of the target data of the root node. If the offset in the metadata is the same as the offset in the block header, the location information of the root node and the child nodes of the root node are obtained from the target data of the root node based on the data volume of the target data of the root node.

[0180] For example, Fig.11 The data block shown includes the location information of the three child nodes of the root node 1, the metadata of the root node 1 and the root node 1. The metadata of the root node 1 includes the data volume size9=24 of the target data of the root node and the offset offset9=56 of the target data of the root node. The offset in the metadata is the same as the offset in the block header. Based on the data volume size9 of the target data of the root node, the location information of the root node and the three child nodes of the root node is obtained from the target data of the root node. The location information of the three child nodes includes the location information 6 of node 2, the location information 7 of node 3 and the location information 8 of node 4.

[0181] 8043: The second device calls the child node the fifth node, and based on the location information of the fifth node, obtains the target data of the fifth node from the data block where the fifth node is located.

[0182] 8044: The second device obtains the fifth node based on the target data of the fifth node.

[0183] For example, for the location information 6 of node 2, based on the location information 6 of node 2 Fig. 9 The identification information "ID1" of the data block and the target data of node 2 are shown in Fig. 9 The offset 56 in the data block shown. Based on the offset 56, from Fig. 9 The target data of node 2 is obtained from the data block shown. The target data of node 2 includes the location information of the three child nodes of node 2, the metadata of node 2 and node 2. The metadata of node 2 includes the data volume size3=48 and offset offset3=56 of the target data of node 2. The offset in the location information 6 is the same as the offset offset3 in the target data. Based on the data volume size3 of the target data of node 2, the location information of node 2 and the two child nodes of node 2 are obtained from the target data of node 2. The location information of the two child nodes includes the location information 1 of node 5 and the location information 2 of node 6.

[0184] For the location information 7 of node 3, based on the location information 7 of node 3 including Fig.11 The identification information "ID3" of the data block shown and the target data of node 3 are in Fig.11 The offset 16 in the data block shown. Based on this offset 16, from Fig.11 The target data of node 3 is obtained from the data block shown. The target data of node 3 includes the location information of the three child nodes of node 3, the metadata of node 3 and node 3. The metadata of node 3 includes the data volume size7=24 and offset offset7=16 of the target data of node 3. The offset in the location information 7 is the same as the offset offset7 in the target data. Based on the data volume size7 of the target data of node 3, the location information of node 3 and the three child nodes of node 3 are obtained from the target data of node 3. The location information of the three child nodes includes location information 3 of node 7, location information 4 of node 8 and location information 5 of node 9.

[0185] For the location information 8 of node 4, based on the location information 8 of node 4 including Fig.11 The identification information "ID3" of the data block shown and the target data of node 4 are in Fig.11 The offset 40 in the data block shown. Based on this offset 40, from Fig.11 The target data of node 4 is obtained from the data block shown. The target data of node 4 includes the metadata of node 4 and node 4. The metadata of node 4 includes the data volume size8=16 and offset offset8=40 of the target data of node 4. The offset in the location information 8 is the same as the offset offset8 in the target data. Based on the data volume size8 of the target data of node 4, node 4 is obtained from the target data of node 4.

[0186] 8045: If the target data of the fifth node also includes the location information of the child node of the fifth node, the child node is called the fifth node, and the process returns to execute 8043.

[0187] For example, for the location information 1 of node 5, based on the location information 1 of node 5 Fig. 9 The identification information "ID1" of the data block and the target data of node 5 are shown in Fig. 9 The offset 16 in the data block shown. Based on this offset 16, from Fig. 9 The target data of node 5 is obtained from the data block shown. The target data of node 5 includes the metadata of node 5 and node 2. The metadata of node 5 includes the data volume size1=16 and offset offset1=16 of the target data of node 5. The offset in the location information 1 is the same as the offset offset1 in the target data. Based on the data volume size1 of the target data of node 5, node 2 is obtained from the target data of node 5.

[0188] For the location information 2 of node 6, based on the location information 2 of node 6 including Fig. 9 The identification information "ID1" of the data block and the target data of node 6 are shown in Fig. 9 Based on the offset 32, from Fig. 9 The target data of node 6 is obtained from the data block shown. The target data of node 6 includes the metadata of node 6 and node 6. The metadata of node 6 includes the data volume size2=24 and offset offset2=32 of the target data of node 6. The offset in the location information 2 is the same as the offset offset2 in the target data. Based on the data volume size2 of the target data of node 6, node 6 is obtained from the target data of node 6.

[0189] For the location information 3 of node 7, based on the location information 3 of node 7 including Fig.10 The identification information "ID2" of the data block shown and the target data of node 7 are in Fig.10 The offset 16 in the data block shown. Based on this offset 16, from Fig.10 The target data of node 7 is obtained from the data block shown. The target data of node 7 includes the metadata of node 7 and node 7. The metadata of node 7 includes the data volume size4=24 and offset offset4=16 of the target data of node 7. The offset in the location information 3 is the same as the offset offset4 in the target data. Based on the data volume size4 of the target data of node 7, node 7 is obtained from the target data of node 7.

[0190] For the location information 4 of the node 8, based on the location information 4 of the node 8 including Fig.10 The identification information "ID2" of the data block shown and the target data of node 8 are in Fig.10 The offset 40 in the data block shown. Based on this offset 40, from Fig.10 The target data of node 8 is obtained from the data block shown. The target data of node 8 includes the metadata of node 8 and node 8. The metadata of node 8 includes the data volume size5=32 and offset offset5=40 of the target data of node 8. The offset in the location information 4 is the same as the offset offset5 in the target data. Based on the data volume size5 of the target data of node 8, node 8 is obtained from the target data of node 8.

[0191] For the location information 5 of the node 9, based on the location information 5 of the node 9 including Fig.10 The identification information "ID2" of the data block shown and the target data of node 9 are in Fig.10 Based on the offset 72, from Fig.10The target data of node 9 is obtained from the data block shown. The target data of node 9 includes the metadata of node 9 and node 9. The metadata of node 9 includes the data volume size6=40 and offset offset6=72 of the target data of node 9. The offset in the location information 5 is the same as the offset offset6 in the target data. Based on the data volume size6 of the target data of node 9, node 6 is obtained from the target data of node 6.

[0192] In this way, node 1, node 2, node 3, node 4, node 5, node 6, node 7, node 8 and node 9 of the object tree are obtained, and the 9 nodes form an object tree.

[0193] In an embodiment of the present application, a first node is obtained, the first node is a non-leaf node included in the object tree, and the target data of the first node is added to the first data block, the target data includes the position information of the second node (the child node of the first node), the metadata of the first node and the first node, the metadata of the first node is used to indicate the position of the first node in the data block, and the position information is used to indicate the second data block where the target data of the second node is located and the position of the target data in the second data block; when the data volume of the first data block exceeds the data volume threshold, the first data block is sent. Since the target data includes the position information of the child node of the first node, the metadata of the first node and the first node, even if multiple data blocks are used to send the nodes in the object tree, the object tree can be restored based on the multiple data blocks. Therefore, when the data volume of the data block exceeds the data volume threshold, the data block can be sent, which improves the efficiency of sending the data block.

[0194] See also Fig.12 , the present application embodiment provides a communication device 1200, the device 1200 is Figure 1 The communication system 100 shown includes an apparatus, the communication system 100 also includes a second device, the apparatus 1200 and the second device both include first metadata, the first metadata is used to describe at least one data category, the at least one data category is a data category to which a data value that the apparatus 1200 can send to the second device belongs, and the apparatus 1200 includes:

[0195] The processing unit 1201 is further configured to obtain a first data block based on the first metadata, where the first data block includes data values ​​belonging to the at least one data category;

[0196] The sending unit 1202 is used to send the first data block to the second device, and the second device is used to parse the first data block based on the first metadata to obtain the data value.

[0197] Optionally, the detailed implementation process of the processing unit 1201 obtaining the first data block can be found in Figure 3The relevant contents in step 303 of the method 300 are not described in detail here.

[0198] Optionally, the detailed implementation process of the sending unit 1202 sending the first data block is shown in Figure 3 The relevant contents in step 304 of the method 300 are not described in detail here.

[0199] Optionally, the first metadata is also used to describe an arrangement of data values ​​that the apparatus 1200 can send to the second device, and the arrangement of data values ​​included in the first data block is the data value arrangement.

[0200] Optionally, the first metadata is metadata of the apparatus 1200, and the sending unit 1202 is further configured to send the first metadata to the second device.

[0201] Optionally, the detailed implementation process of the sending unit 1202 sending the first metadata is shown in Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0202] Optionally, the first metadata is metadata of the second device, and the apparatus 1200 further includes:

[0203] The receiving unit 1203 is configured to receive first metadata from a second device.

[0204] Optionally, the detailed implementation process of the receiving unit 1203 receiving the first metadata is shown in Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0205] Optionally, the number of the at least one data category is M, M is an integer greater than or equal to 1, the apparatus 1200 further includes second metadata, the second metadata is metadata of the apparatus 1200, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M;

[0206] The processing unit 1201 is configured to:

[0207] Acquire N data values ​​belonging to the N data categories based on the second metadata;

[0208] Based on the first metadata, Q data values ​​belonging to the Q data category are selected from the N data values, and the first data block includes MQ default values ​​belonging to the MQ data categories and the Q data.

[0209] Optionally, the detailed implementation process of the processing unit 1201 obtaining the N data values ​​belonging to the N data categories based on the second metadata is shown in Figure 3 The relevant contents in step 302 of the method 300 are not described in detail here.

[0210] Optionally, the processing unit 1201 selects Q data values ​​belonging to the Q data category from the N data values ​​based on the first metadata. Figure 3 The relevant contents in step 303 of the method 300 are not described in detail here.

[0211] In the embodiment of the present application, since the apparatus and the second device both include the first metadata, and the first metadata includes at least one data category, the processing unit obtains the first data block based on the first metadata, and the first data block includes at least one data value belonging to the at least one data category, and the sending unit sends the first data block to the second device. In this way, since the first data block includes the at least one data value and does not need to include the first metadata, the amount of data in the first data block can be reduced, thereby improving the efficiency of sending the first data block. In addition, since the first data block includes the at least one data value and does not need to include the first metadata, the at least one data value does not need to be serialized, thereby reducing the time to obtain the first data block and improving the efficiency of sending the first data block.

[0212] See also Fig.13 The present application embodiment provides a communication device 1300, which may be Figure 1 The communication system 100 shown includes an apparatus, the communication system 100 also includes a first device, the first device and the apparatus 1300 both include first metadata, the first metadata is used to describe at least one data category, the at least one data category is a data category to which a data value that the first device can send to the apparatus 1300 belongs, M is an integer greater than or equal to 1, and the apparatus 1300 includes:

[0213] The receiving unit 1301 is configured to receive a first data block, where the first data block includes a data value belonging to the at least one data category;

[0214] The processing unit 1302 is configured to parse the first data block based on the first metadata to obtain the data value.

[0215] Optionally, the detailed implementation process of the receiving unit 1301 receiving the first data block is shown in Figure 3 The relevant contents in step 305 of the method 300 are not described in detail here.

[0216] Optionally, the detailed implementation process of the processing unit 1301 parsing the first data block based on the first metadata to obtain the at least one data value is shown in Figure 3 The relevant contents in step 305 of the method 300 are not described in detail here.

[0217] Optionally, the first metadata is also used to describe a data value arrangement mode that the first device can send to the apparatus 1300, and the data value arrangement mode included in the first data block is the data value arrangement mode.

[0218] Optionally, the first metadata is metadata of the first device, and the receiving unit 1301 is further configured to receive the first metadata from the first device.

[0219] Optionally, the detailed implementation process of the receiving unit 1301 receiving the first metadata sent by the first device is shown in Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0220] Optionally, the first metadata is metadata of the device 1300, and the device 1300 further includes:

[0221] The sending unit 1303 is configured to send first metadata to the first device.

[0222] Optionally, the detailed implementation process of the sending unit 1303 sending the first metadata to the first device is shown in Figure 3 The relevant contents in step 301 of the method 300 are not described in detail here.

[0223] Optionally, the number of the at least one data category is M, M is an integer greater than or equal to 1, the first device also includes second metadata, the second metadata is metadata of the first device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N and Q is less than or equal to M, the first data block includes default values ​​belonging to MQ data categories and the Q data values, the MQ data categories are data categories among the M data categories except the Q data categories.

[0224] In an embodiment of the present application, since both the first device and the apparatus include the first metadata, the first metadata includes at least one data category, and the first data block sent by the first device includes at least one data value belonging to the at least one data category. In this way, the first data block includes the at least one data value and does not need to include the first metadata, so the amount of data in the first data block can be reduced, thereby improving the efficiency of the first device sending the first data block. In addition, since the first data block includes the at least one data value and does not need to include the first metadata, the first device does not need to serialize the at least one data value, and the apparatus does not need to deserialize the first data block, thereby reducing the time for the first device to obtain the first data block, improving the efficiency of the first device sending the first data block, and improving the efficiency of the processing unit parsing the first data block.

[0225] See also Fig.14 The embodiment of the present application provides a communication device 1400, the device 1400 includes an object tree, and the device 1400 can be deployed in Figure 1 The first device in the communication system 100 includes:

[0226] The processing unit 1401 is configured to obtain a first node, where the first node is a non-leaf node included in the object tree, and the object tree further includes a second node, where the second node is a child node of the first node;

[0227] The processing unit 1401 is further configured to add first target data to the first data block, the first target data including position information of the second node, metadata of the first node, and the first node, the metadata of the first node is used to indicate the position of the first node in the first data block, the position information is used to indicate the position of the second target data in the second data block, the second target data includes the metadata of the second node and the second node, and the second data block is the data block where the second target data is located;

[0228] The sending unit 1402 is configured to send the first data block when the data amount of the first data block exceeds a data amount threshold.

[0229] Optionally, the detailed implementation process of the processing unit 1401 obtaining the first node can be found in Figure 8 The relevant contents in step 801 of the method 800 are not described in detail here.

[0230] Optionally, the detailed implementation process of the processing unit 1401 adding the first target data to the first data block is shown in Figure 8 The relevant contents in step 802 of the method 800 are not described in detail here.

[0231] Optionally, the detailed implementation process of the sending unit 1402 sending the first data block is shown in Figure 8The relevant contents in step 803 of the method 800 are not described in detail here.

[0232] Optionally, the processing unit 1401 is further configured to, when the data volume of the first data block does not exceed the data volume threshold, obtain a third node, where the third node is a sibling node or a parent node of the first node; add third target data to the first data block, where the third target data includes metadata of the third node and the third node;

[0233] The sending unit 1402 is configured to send the first data block when the data amount of the first data block exceeds a data amount threshold.

[0234] Optionally, the detailed implementation process of the processing unit 1401 obtaining the third node can be found in Figure 8 The relevant contents in step 803 of the method 800 are not described in detail here.

[0235] Optionally, the detailed implementation process of the sending unit 1402 sending the first data block is shown in Figure 8 The relevant contents in step 803 of the method 800 are not described in detail here.

[0236] Optionally, the metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block.

[0237] Optionally, the location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

[0238] Optionally, the first data block includes a block header and a payload part, the block header includes the data amount of the first data block, and the payload part includes the first target data.

[0239] Optionally, the first node is a root node of the object tree, and the block header further includes an offset of the first target data in the first data block.

[0240] Optionally, the processing unit 1401 is further configured to obtain a fourth node, where the fourth node is a node in the object tree that has not been sent;

[0241] The processing unit 1401 is further configured to create a third data block, wherein the data amount of the payload portion of the third data block is zero;

[0242] The processing unit 1401 is further configured to add fourth target data to the payload portion of the third data block, where the fourth target data includes metadata of a fourth node and the fourth node;

[0243] The sending unit 1402 is further configured to send the third data block when the data amount of the third data block exceeds a data amount threshold.

[0244] Optionally, the detailed implementation process of the processing unit 1401 acquiring the fourth node, creating the third data block, and adding the fourth target data to the payload part of the third data block can be found in Figure 8 The relevant contents in step 803 of the method 800 are not described in detail here.

[0245] Optionally, the detailed implementation process of the sending unit 1402 sending the third data block is shown in Figure 8 The relevant contents in step 803 of the method 800 are not described in detail here.

[0246] In an embodiment of the present application, since the first target data includes the location information of the second node, the location information is used to indicate the location of the second target data of the second node in the second data block, so that the second device can obtain the second node from the second data block based on the location information, so that the sending unit can use multiple data blocks to send the object tree. In this way, when the data volume of the first data block exceeds the data volume threshold, the sending unit sends the first data block, and after sending the first data block, the next data block can be obtained, and then the next data block is sent. Compared with obtaining a data block including the entire object tree and then sending a data block including the entire object tree, since the time required to obtain the data block including the entire object tree is much longer than the time to obtain the first data block, when the data volume of the first data block exceeds the data volume threshold, the first data block is sent, thereby improving the efficiency of sending data.

[0247] See also Fig.15 , the present application embodiment provides a communication device 1500, the device 1500 is as follows Figure 1 The communication system 100 shown includes an apparatus, the communication system 100 also includes a first device, the first device includes an object tree, the object tree includes a first node and a second node, the second node is a child node of the first node, and the apparatus 1500 includes:

[0248] A receiving unit 1501 is configured to receive at least one data block sent by a first device, the at least one data block including a first data block, the first data block including first target data, the first target data including location information of a second node, metadata of the first node, and the first node, the metadata of the first node is used to indicate a location of the first node in the first data block, the location information is used to indicate a location of second target data in a second data block, the second target data includes metadata of the second node and the second node, the second data block is a data block where the second target data is located, and the first data block is the second data block, or the at least one data block also includes a second data block, and the second data block is a data block sent by the first device before sending the first data block;

[0249] The processing unit 1502 is configured to obtain an object tree based on the at least one data block.

[0250] Optionally, the detailed implementation process of the receiving unit 1501 receiving at least one data block sent by the first device is shown in Figure 8 The relevant contents in step 804 of the method 800 are not described in detail here.

[0251] Optionally, the detailed implementation process of the processing unit 1502 obtaining the object tree based on the at least one data block is shown in Figure 8 The relevant contents in step 804 of the method 800 are not described in detail here.

[0252] Optionally, the metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block.

[0253] Optionally, the location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

[0254] Optionally, the first node is a root node of the object tree, the first data block includes a block header and a payload portion, the payload portion includes the first target data, and the block header also includes an offset of the first target data in the first data block;

[0255] The processing unit 1502 is configured to:

[0256] Based on the offset included in the block header, obtaining first target data from the first data block;

[0257] Based on the first target data, obtaining the first node and the location information;

[0258] Based on the position information, obtaining second target data from the second data block;

[0259] A second node is acquired based on the second target data.

[0260] Optionally, the detailed implementation process of the processing unit 1502 obtaining the first target data from the first data block is shown in Figure 8 The relevant contents in step 804 of the method 800 are not described in detail here.

[0261] Optionally, the detailed implementation process of the processing unit 1502 obtaining the first node and the location information is as follows: Figure 8 The relevant contents in step 804 of the method 800 are not described in detail here.

[0262] Optionally, the detailed implementation process of the processing unit 1502 obtaining the second target data from the second data block is shown in Figure 8The relevant contents in step 804 of the method 800 are not described in detail here.

[0263] Optionally, the detailed implementation process of the processing unit 1502 acquiring the second node based on the second target data can be found in Figure 8 The relevant contents in step 804 of the method 800 are not described in detail here.

[0264] In an embodiment of the present application, since the first target data includes the location information of the second node, the location information is used to indicate the location of the second target data of the second node in the second data block, so that the processing unit can obtain the second node from the second data block based on the location information, so that the first device can use multiple data blocks to send the object tree. In this way, the first device can send the first data block when the data volume of the first data block exceeds the data volume threshold, and after sending the first data block, it can obtain the next data block and then send the next data block. Compared with obtaining a data block including the entire object tree and then sending a data block including the entire object tree, since the time required to obtain the data block including the entire object tree is much longer than the time to obtain the first data block, the first device sends the first data block when the data volume of the first data block exceeds the data volume threshold, thereby improving the efficiency of the first device in sending data.

[0265] See also Fig.16 , an embodiment of the present application provides a schematic diagram of a communication device 1600. The device 1600 may be the first device provided by any of the above embodiments, for example, Figure 1 A first device in the communication network 100 shown, Figure 3 The first device or Figure 8 The first device in the method 800 is shown. The apparatus 1600 comprises at least one processor 1601 , an internal connection 1602 , a memory 1603 and at least one transceiver 1604 .

[0266] The device 1600 is a hardware structure device that can be used to implement Fig.12 The functional modules in the device 1200 may be used to implement Fig.14 The functional modules in the device 1400 are described.

[0267] For example, a person skilled in the art would think of Fig.12 The processing unit 1201 in the device 1200 shown can be implemented by the at least one processor 1601 calling the code in the memory 1603. Fig.12 The sending unit 1202 and the receiving unit 1203 in the device 1200 shown may be implemented by the at least one transceiver 1604 .

[0268] For another example, a person skilled in the art may think of Fig.14 The processing unit 1401 in the device 1400 shown can be implemented by the at least one processor 1601 calling the code in the memory 1603. Fig.14 The sending unit 1402 in the illustrated device 1400 may be implemented by the at least one transceiver 1604 .

[0269] The apparatus 1600 may also be used to implement the function of the first device in any of the above embodiments.

[0270] The processor 1601 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0271] The internal connection 1602 may include a path to transmit information between the components. The internal connection 1602 may be a single board or a bus.

[0272] The at least one transceiver 1604 is used to communicate with other devices or communication networks.

[0273] The memory 1603 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0274] The memory 1603 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 1601. The processor 1601 is used to execute the application code stored in the memory 1603, and cooperate with at least one transceiver 1604, so that the device 1600 implements the functions of the method of the present patent.

[0275] In a specific implementation, as an embodiment, the processor 1601 may include one or more CPUs, such as Fig.16 CPU0 and CPU1 in.

[0276] In a specific implementation, as an embodiment, the device 1600 may include multiple processors, such as Fig.16 1601 and processor 1607 in the embodiment. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0277] See also Fig.17 , an embodiment of the present application provides a schematic diagram of a communication device 1700. The device 1700 may be the first device provided by any of the above embodiments, for example, Figure 1 The second device in the communication network 100 shown, Figure 3 The second device or Figure 8 The second device in the method 800 is shown. The apparatus 1700 includes at least one processor 1701 , an internal connection 1702 , a memory 1703 and at least one transceiver 1704 .

[0278] The device 1700 is a hardware structure device that can be used to implement Fig.13 The functional modules in the device 1300 may be used to implement Fig.15 Functional modules in the device 1500.

[0279] For example, a person skilled in the art would think of Fig.13 The processing unit 1302 in the device 1300 shown can be implemented by the at least one processor 1701 calling the code in the memory 1703. Fig.13 The receiving unit 1301 and the sending unit 1303 in the device 1300 shown may be implemented by the at least one transceiver 1704 .

[0280] For another example, a person skilled in the art may think of Fig.15The processing unit 1502 in the device 1500 shown can be implemented by the at least one processor 1701 calling the code in the memory 1703. Fig.15 The receiving unit 1501 in the illustrated device 1500 may be implemented by the at least one transceiver 1704 .

[0281] The apparatus 1700 may also be used to implement the function of the second device in any of the above embodiments.

[0282] The processor 1701 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0283] The internal connection 1702 may include a path to transmit information between the components. The internal connection 1702 may be a single board or a bus.

[0284] The at least one transceiver 1704 is used to communicate with other devices or communication networks.

[0285] The memory 1703 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0286] The memory 1703 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 1701. The processor 1701 is used to execute the application code stored in the memory 1703, and cooperate with at least one transceiver 1704, so that the device 1700 implements the functions of the method of the present patent.

[0287] In a specific implementation, as an embodiment, the processor 1701 may include one or more CPUs, such as Fig.17 CPU0 and CPU1 in.

[0288] In a specific implementation, as an embodiment, the device 1700 may include multiple processors, such as Fig.17 1701 and processor 1707 in the embodiment. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0289] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0290] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A communication system, characterized in that: The communication system comprises a first device and a second device, wherein the first device and the second device each comprise first metadata, wherein the first metadata is used to describe at least one data category, and the at least one data category is a data category to which a data value that the first device can send to the second device belongs; the first device being configured to obtain a first data block based on the first metadata, the first data block comprising data values ​​belonging to the at least one data category; The first device is further configured to send the first data block to the second device; The second device is used to parse the first data block based on the first metadata to obtain the data value.

2. The system according to claim 1, characterized in that The first metadata is further used to describe an arrangement of data values ​​that the first device can send to the second device, and the arrangement of data blocks included in the first data block is the data value arrangement.

3. The system according to claim 1 or 2, characterized in that: The first metadata is metadata of the first device, and the first device is further used to send the first metadata to the second device; The second device is further configured to receive the first metadata.

4. The system according to claim 1 or 2, characterized in that: The first metadata is metadata of the second device, and the second device is further configured to send the first metadata to the first device; The first device is further configured to receive the first metadata.

5. The system according to claim 4, characterized in that The number of the at least one data category is M, M is an integer greater than or equal to 1, the first device further includes second metadata, the second metadata is metadata of the first device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M; The first device is further configured to obtain N data values ​​belonging to the N data categories based on the second metadata; The first device is also used to select Q data values ​​belonging to the Q data category from the N data values ​​based on the first metadata, the first data block includes MQ default values ​​belonging to MQ data categories and the Q data values, and the MQ data categories are data categories among the M data categories except the Q data categories.

6. A communication method, characterized in that: The method is applied to a first device in a communication system, the communication system further comprising a second device, the first device and the second device both comprising first metadata, the first metadata being used to describe at least one data category, the at least one data category being a data category to which a data value that can be sent by the first device to the second device belongs, the method comprising: The first device obtains a first data block based on the first metadata, the first data block including a data value belonging to the at least one data category; The first device sends the first data block to the second device, and the second device is used to parse the first data block based on the first metadata to obtain the data value.

7. The method according to claim 6, characterized in that The first metadata is metadata of the first device. Before the first device obtains the first data block based on the first metadata, the method further includes: The first device sends the first metadata to the second device.

8. The method according to claim 6, characterized in that The first metadata is metadata of the second device. Before the first device obtains the first data block based on the first metadata, the method further includes: The first device receives the first metadata from the second device.

9. The method according to claim 8, characterized in that The number of the at least one data category is M, where M is an integer greater than or equal to 1, the first device further includes second metadata, where the second metadata is metadata of the first device, where the second metadata is used to describe N data categories, where N is an integer greater than or equal to 1, where the intersection of the M data categories described by the first metadata and the N data categories includes Q data categories, where Q is an integer greater than or equal to 1, where Q is less than or equal to N, and where Q is less than or equal to M, and the method further includes: The first device obtains N data values ​​belonging to the N data categories based on the second metadata; The acquiring the first data block based on the first metadata includes: The first device selects Q data values ​​belonging to the Q data category from the N data values ​​based on the first metadata, and the first data block includes MQ default values ​​belonging to MQ data categories and the Q data values, and the MQ data categories are data categories among the M data categories except the Q data categories.

10. A communication method, characterized in that: The method is applied to a second device in a communication system, the communication system further comprising a first device, the first device and the second device both comprising first metadata, the first metadata being used to describe at least one data category, the at least one data category being a data category to which a data value that can be sent by the first device to the second device belongs, the method comprising: The second device receives a first data block, the first data block including a data value belonging to the at least one data category; The second device parses the first data block based on the first metadata to obtain the data value.

11. The method according to claim 10, characterized in that The first metadata is metadata of the first device, and before the second device receives the first data block, the method further includes: The second device receives the first metadata from the first device.

12. The method according to claim 10, characterized in that The first metadata is metadata of the second device, and before the second device receives the first data block, the method further includes: The second device sends the first metadata to the first device.

13. The method according to claim 12, characterized in that The number of the at least one data category is M, where M is an integer greater than or equal to 1. The first device also includes second metadata, where the second metadata is metadata of the first device. The second metadata is used to describe N data categories, where N is an integer greater than or equal to 1. The intersection between the N data categories and the M data categories includes Q data categories, where Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M. The first data block includes MQ default values ​​belonging to MQ data categories and Q data values ​​belonging to the Q data categories. The MQ data categories are data categories among the M data categories except the Q data categories.

14. A communication method, characterized in that: The method is applied to a first device, wherein the first device includes an object tree, including: Acquire a first node, where the first node is a non-leaf node included in the object tree, and the object tree also includes a second node, where the second node is a child node of the first node; Adding first target data to a first data block, the first target data including location information of the second node, metadata of the first node, and the first node, the metadata of the first node being used to indicate a location of the first node in the first data block, the location information being used to indicate a location of second target data in a second data block, the second target data including metadata of the second node and the second node, and the second data block being a data block where the second target data is located; When the data amount of the first data block exceeds a data amount threshold, the first data block is sent.

15. The method according to claim 14, characterized in that The method further comprises: When the data amount of the first data block does not exceed the data amount threshold, acquiring a third node, where the third node is a sibling node or a parent node of the first node; Adding third target data to the first data block, the third target data including metadata of the third node and the third node; When the data amount of the first data block exceeds the data amount threshold, the first data block is sent.

16. The method according to claim 14 or 15, characterized in that The metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block.

17. The method according to any one of claims 14 to 16, characterized in that: The location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

18. The method according to any one of claims 14 to 17, characterized in that: The first data block includes a block header and a payload part, the block header includes the data amount of the first data block, and the payload part includes the first target data.

19. The method according to claim 18, characterized in that The first node is a root node of the object tree, and the block header further includes an offset of the first target data in the first data block.

20. The method according to any one of claims 14 to 18, characterized in that After sending the first data block, the method further includes: Acquire a fourth node, where the fourth node is a node in the object tree that has not been sent; Creating a third data block, wherein the data amount of the payload portion of the third data block is zero; Adding fourth target data to the payload portion of the third data block, the fourth target data including metadata of the fourth node and the fourth node; When the data amount of the third data block exceeds the data amount threshold, the third data block is sent.

21. A communication device, characterized in that: The apparatus is an apparatus in a communication system, the communication system further comprising a second device, the apparatus and the second device both comprising first metadata, the first metadata being used to describe at least one data category, the at least one data category being a data category to which a data value that the apparatus can send to the second device belongs, the apparatus comprising: The processing unit is further configured to obtain a first data block based on the first metadata, wherein the first data block includes data values ​​belonging to the at least one data category; A sending unit is used to send the first data block to the second device, and the second device is used to parse the first data block based on the first metadata to obtain the data value.

22. The device according to claim 21, characterized in that The first metadata is metadata of the apparatus, and the sending unit is further configured to send the first metadata to the second device.

23. The device according to claim 21, characterized in that The first metadata is metadata of the second device, and the apparatus further includes: A receiving unit is configured to receive the first metadata from the second device.

24. The device according to claim 23, characterized in that The number of the at least one data category is M, M is an integer greater than or equal to 1, the device further includes second metadata, the second metadata is metadata of the device, the second metadata is used to describe N data categories, N is an integer greater than or equal to 1, the intersection between the M data categories described by the first metadata and the N data categories includes Q data categories, Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M; The processing unit is used for: Acquire N data values ​​belonging to the N data categories based on the second metadata; Based on the first metadata, Q data values ​​belonging to the Q data category are selected from the N data values, the first data block includes MQ default values ​​belonging to MQ data categories and the Q data values, and the MQ data categories are data categories among the M data categories except the Q data categories.

25. A communication device, characterized in that: The apparatus is an apparatus included in a communication system, the communication system further includes a first device, the first device and the apparatus both include first metadata, the first metadata is used to describe at least one data category, the at least one data category is a data category to which a data value that can be sent by the first device to the apparatus belongs, and the apparatus includes: a receiving unit, configured to receive a first data block, wherein the first data block includes data values ​​belonging to the at least one data category; A processing unit is configured to parse the first data block based on the first metadata to obtain the data value.

26. The device according to claim 25, characterized in that The first metadata is metadata of the first device, and the receiving unit is further configured to receive the first metadata from the first device.

27. The device according to claim 25, characterized in that The first metadata is metadata of the device, and the device further includes: A sending unit, configured to send the first metadata to the first device.

28. The device according to claim 27, characterized in that The number of the at least one data category is M, where M is an integer greater than or equal to 1. The first device also includes second metadata, where the second metadata is metadata of the first device. The second metadata is used to describe N data categories, where N is an integer greater than or equal to 1. The intersection between the N data categories and the M data categories described by the first metadata includes Q data categories, where Q is an integer greater than or equal to 1, Q is less than or equal to N, and Q is less than or equal to M. The first data block includes MQ default values ​​belonging to MQ data categories and Q data values ​​belonging to the Q data categories. The MQ data categories are data categories among the M data categories except the Q data categories.

29. A communication device, characterized in that: The apparatus comprises an object tree, including: A processing unit, configured to obtain a first node, where the first node is a non-leaf node included in the object tree, and the object tree further includes a second node, where the second node is a child node of the first node; The processing unit is further used to add first target data to the first data block, the first target data including position information of the second node, metadata of the first node and the first node, the metadata of the first node is used to indicate the position of the first node in the first data block, the position information is used to indicate the position of second target data in the second data block, the second target data includes metadata of the second node and the second node, and the second data block is the data block where the second target data is located; A sending unit is used to send the first data block when the data amount of the first data block exceeds a data amount threshold.

30. The device according to claim 29, characterized in that The processing unit is further configured to, when the data volume of the first data block does not exceed the data volume threshold, obtain a third node, the third node being a sibling node or a parent node of the first node; and add third target data to the first data block, the third target data including metadata of the third node and the third node; The sending unit is configured to send the first data block when the data amount of the first data block exceeds the data amount threshold.

31. The device according to claim 29 or 30, characterized in that The metadata of the first node includes one or more of the following information: the data volume of the first target data, or the offset of the first target data in the first data block.

32. The device according to any one of claims 29 to 31, characterized in that The location information includes one or more of the following information: identification information of the second data block, or an offset of the second target data in the second data block.

33. The device according to any one of claims 29 to 32, characterized in that The first data block includes a block header and a payload part, the block header includes the data amount of the first data block, and the payload part includes the first target data.

34. The device according to claim 33, characterized in that The first node is a root node of the object tree, and the block header further includes an offset of the first target data in the first data block.

35. The device according to any one of claims 29 to 33, characterized in that The processing unit is further used to obtain a fourth node, where the fourth node is a node in the object tree that has not been sent; The processing unit is further used to create a third data block, wherein the data amount of the payload part of the third data block is zero; The processing unit is further configured to add fourth target data to the payload portion of the third data block, wherein the fourth target data includes metadata of the fourth node and the fourth node; The sending unit is further configured to send the third data block when the data amount of the third data block exceeds the data amount threshold.

36. A communication device, characterized in that: The device comprises at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the device executes the method according to any one of claims 6 to 20.

37. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 6 to 20 is implemented.

38. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 6 to 20 is implemented.

Citation Information

Cited By

  • Communication method and apparatus, system, and storage medium

    EP4783553A1

  • Communication method and apparatus, system, and storage medium

    WO2025086689A1