Data communication method and device, equipment, storage medium and program product

By introducing the data structure relationship between programming language and YAML language in data communication, serialization and deserialization processing is performed, the problem of low efficiency of structured languages ​​in the prior art is solved, and efficient and standardized data communication is achieved.

CN119201491APending Publication Date: 2024-12-27DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411186221.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing structured language information is large in size, resulting in low data communication efficiency, and a large amount of manual encoding is required when configuring structured languages, which reduces the efficiency of data communication.

Method used

By introducing the data structure relationship between various programming languages ​​and serialized YAML languages, serialization and deserialization are performed, bytecode based on YAML language is generated, and communication is carried out between applications, which improves data processing efficiency and communication normative.

Benefits of technology

It improves the efficiency and standardization of data communication, reduces the need for manual coding, and ensures the efficiency and accuracy of data structure relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201491A_ABST
    Figure CN119201491A_ABST
Patent Text Reader

Abstract

The invention relates to a data communication method and device, equipment, a storage medium and a program product. The method comprises the steps of obtaining first communication data under a first programming language supported by a first application under the condition that the first application has a communication requirement with a second application, and performing serialization processing on the first communication data based on a data structure relationship between the first programming language and a serialization YAML language to obtain a second communication data; and sending the first byte code to the first application to obtain a first byte code based on the YAML language, and sending the first byte code to the second application to enable the second application to perform deserialization processing on the first byte code to obtain second communication data under a second programming language supported by the second application. By adopting the method, the data communication 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 communication technology, and in particular to a data communication method, apparatus, device, storage medium and program product. Background Art

[0002] With the continuous development of the communication field, in order to ensure the efficiency of communication data transmission when message communication is carried out between multiple application processes, the communication data is generally serialized and deserialized, that is, the communication data is serialized and deserialized directly through a preset structured language.

[0003] However, the existing structured language information is large in size and requires a lot of manual coding when configuring the structured language, which reduces the efficiency of data communication. Summary of the invention

[0004] Based on this, it is necessary to provide a data communication method, device, equipment, storage medium and program product that can improve data communication efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides a data communication method, comprising:

[0006] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0007] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0008] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0009] In the embodiments of the present application, data structure relationships between various programming languages ​​and serialized YAML languages ​​are introduced. On the one hand, communication data is serialized and deserialized based on pre-configured data structure relationships, which can improve data processing efficiency. On the other hand, each application communicates using bytecode under the YAML language, which improves the standardization of data communication.

[0010] In one embodiment, the data structure relationship between the first programming language and the serialized YAML language is determined as follows:

[0011] Extract each structure information based on the YAML language from the YAML file; use the language template corresponding to the first programming language to process the extracted structure information to obtain each structure information based on the first programming language; determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as the data structure relationship between the first programming language and the serialized YAML language.

[0012] In an embodiment of the present application, by adopting a language template corresponding to the first programming language, various structure information under the YAML language is processed to obtain various structure information based on the first programming language, and then the data structure relationship between the first programming language and the serialized YAML language is determined, thereby ensuring the efficiency and accuracy of the determination of the data structure relationship.

[0013] In one embodiment, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language, including:

[0014] Based on each structure information of the first programming language, determine the first structure information in the first programming language contained in the first communication data; use the first structure information as an index to query from the data structure relationship to obtain the target structure information of the first communication data in the YAML language; generate a first bytecode according to the target structure information and the first communication data.

[0015] In the embodiment of the present application, by determining the first bytecode based on the target structure information of the first communication data in the YAML language and the first communication data, the accuracy of the first bytecode and the efficiency of bytecode generation can be guaranteed.

[0016] In one embodiment, generating a first bytecode according to the target structure information and the first communication data includes:

[0017] Based on the first communication data, the structure parameters corresponding to the target structure information are filled to obtain information to be converted; and the information to be converted is processed using a bytecode generation rule to generate a first bytecode.

[0018] In the embodiment of the present application, by adopting the bytecode generation rule, the target structure information filled with the structure parameters is processed to obtain the first bytecode, which can ensure the accuracy of the first bytecode.

[0019] In one embodiment, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language, including:

[0020] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the specified language includes at least a process-oriented programming language.

[0021] In an embodiment of the present application, by dividing each programming language into a designated language and a non-designated language, and adopting different processing methods, the communication data under the two types of programming languages ​​are processed to obtain the first bytecode under the corresponding programming language, which can effectively improve the efficiency of determining the first bytecode.

[0022] In one embodiment, the method further comprises:

[0023] A second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0024] In an embodiment of the present application, by deserializing the second bytecode based on the data structure relationship between the first programming language and the serialized YAML language, communication data that can be parsed by the first application is obtained, thereby ensuring the reliability of data communication.

[0025] In a second aspect, the present application further provides a data communication device, including:

[0026] A data acquisition module, configured to acquire first communication data in a first programming language supported by the first application when the first application has a communication requirement with the second application;

[0027] A data processing module, configured to perform serialization processing on the first communication data based on a data structure relationship between the first programming language and the serialized YAML language, to obtain a first bytecode based on the YAML language;

[0028] The data sending module is used to send the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0031] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0032] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0034] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0035] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0036] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0038] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0039] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0040] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0041] The above-mentioned data communication method, device, equipment, storage medium and program product, when the first application has a communication demand with the second application, obtains the first communication data in the first programming language supported by the first application, and serializes the first communication data based on the data structure relationship between the first programming language and the serialized YAML language to obtain the first bytecode based on the YAML language, and then sends the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain the second communication data in the second programming language supported by the second application. Compared with the related art, in which the communication data is serialized and deserialized only by a preset structured language, the above-mentioned method introduces the data structure relationship between various programming languages ​​and the serialized YAML language. On the one hand, the communication data is serialized and deserialized based on the pre-configured data structure relationship, which can improve the efficiency of data processing; on the other hand, each application uses the bytecode under the YAML language to communicate, which improves the standardization of data communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 An application environment diagram of a data communication method in an embodiment;

[0044] Figure 2 is a flow chart of a data communication method in one embodiment;

[0045] Figure 3A A schematic diagram of a process for determining a data structure relationship in one embodiment;

[0046] Figure 3B A schematic diagram of determining structure information in each programming language in one embodiment;

[0047] Figure 4 A schematic diagram of a process for determining a first byte code in one embodiment;

[0048] Figure 5 A schematic diagram of a process of receiving data in one embodiment;

[0049] Figure 6 is a flow chart of a data communication method in another embodiment;

[0050] Figure 7is a structural block diagram of a data communication device in one embodiment;

[0051] Figure 8 is a structural block diagram of a data communication device in another embodiment;

[0052] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] The data communication method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the first application 102 and the second application 104 can communicate. For example, when the first application 102 has a communication demand with the second application 104, the first application 102 obtains the first communication data in the first programming language supported by the first application 102, and based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain the first bytecode based on the YAML language, and then the first bytecode is sent to the second application 104, so that the second application 104 deserializes the first bytecode to obtain the second communication data in the second programming language supported by the second application 104. Among them, the first application 102 and the second application 104 can be applications with communication functions in the same device, or they can be applications with communication functions in different devices, which is not limited in this application.

[0055] With the continuous development of the communication field, in order to ensure the efficiency of communication data transmission when message communication is carried out between multiple application processes, the communication data is generally serialized and deserialized, that is, the communication data is serialized and deserialized directly through a preset structured language.

[0056] However, the existing structured language information is large in size and requires a lot of manual coding when configuring the structured language, which reduces the efficiency of data communication.

[0057] Based on this, in an exemplary embodiment, Figure 2 As shown, a data communication method is provided, which is described by taking the method applied to a device integrated with a first application as an example, and specifically includes the following steps:

[0058] S201, when a first application has a communication demand with a second application, obtaining first communication data in a first programming language supported by the first application.

[0059] Among them, the first application refers to an application with data sending requirements; the second application refers to the application with which the first application wants to communicate; the first programming language refers to the programming language supported by the first application, and further, the programming language supported by the first application may be the same as or different from the programming language supported by the second application; the first communication data refers to the communication data in the first programming language to be transmitted by the first application.

[0060] Optionally, when a communication event in which the first application communicates with the second application is detected, first communication data in a first programming language supported by the first application may be acquired based on the communication content in the communication event.

[0061] Exemplarily, the communication event may be generated based on the user's input in the terminal integrated with the first application, or may be generated spontaneously by the first application. For example, the terminal A integrated with the first application will display the information sharing page associated with the first application to the user, and the user can select the second application that he wants to share (i.e. communicate) in the information sharing interface; at this time, after detecting this selection operation, the terminal A determines that the first application has a communication demand with the second application, and automatically obtains the first communication data of the first application.

[0062] S202: Based on the data structure relationship between the first programming language and the serialized YAML language, serialize the first communication data to obtain a first bytecode based on the YAML language.

[0063] In this embodiment, a serialization language (YAML Ain't Markup Language, YAML) is used to express the format of data serialization in a programming language; a data structure relationship refers to the association relationship between a data structure contained in a programming language and a data structure contained in a YAML language; a serialization process refers to a process of converting state information of an object to be transmitted into a form that can be stored or transmitted; and a first bytecode refers to a bytecode of the first communication data in the YAML language.

[0064] It is understandable that when communicating between applications, there may be a problem of reduced communication efficiency due to the different programming languages ​​supported by each application. Therefore, in this embodiment, in order to improve the efficiency of communication, the YAML language can be used to serialize the communication data to be sent by each application to obtain a standard bytecode that can be parsed by each application.

[0065] Optionally, after acquiring the first communication data, the first communication data may be serialized directly based on the data structure relationship between the first programming language preconfigured in the first application and the serialized YAML language, thereby obtaining a first bytecode of the YAML language corresponding to the first communication data.

[0066] In order to improve the efficiency of serialization processing, for each application, the data structure relationship between the programming language and the YAML language can be determined according to the language characteristics of the programming language supported by the application, and the data structure relationship can be configured in the application so that the application can still support serialization processing of the communication data to be sent when it is offline.

[0067] S203: Send the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0068] Among them, the deserialization process refers to the reverse process of the serialization process; the second programming language refers to the programming language supported by the second application; and the second communication data refers to the communication data in the second programming language received by the second application.

[0069] Optionally, after sending the first bytecode to the second application, the second application can deserialize the first bytecode based on the data structure relationship between the second programming language and the serialized YAML language, and thereby obtain second communication data in the second programming language supported by the second application; subsequently, the second application can perform subsequent processing operations based on the second communication data that can be parsed.

[0070] In the above data communication method, when the first application has a communication demand with the second application, the first communication data in the first programming language supported by the first application is obtained, and based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain the first bytecode based on the YAML language, and then the first bytecode is sent to the second application, so that the second application deserializes the first bytecode to obtain the second communication data in the second programming language supported by the second application. Compared with the related art, in which the communication data is serialized and deserialized only by a preset structured language, the above method introduces the data structure relationship between various programming languages ​​and the serialized YAML language. On the one hand, the communication data is serialized and deserialized based on the pre-configured data structure relationship, which can improve the efficiency of data processing; on the other hand, each application uses the bytecode under the YAML language to communicate, which improves the standardization of data communication.

[0071] In order to ensure the accuracy of the data structure relationship, based on the above embodiment, in this embodiment, an optional method for determining the data structure relationship is provided, such as Figure 3A As shown, the specific steps include:

[0072] S301, extracting various structure information based on the YAML language from the YAML file.

[0073] In this embodiment, the YAML file is used to represent the structural definition of communication data in the YAML language, which may include but is not limited to structural information such as macros, enumerations, constants, data hierarchical structures, function definitions, and function call relationships, etc.; the structure information is used to represent the relevant information of the data structure.

[0074] Optionally, a structure parser may be used to extract each structure information in the YAML language from a pre-configured YAML file.

[0075] S302: Using a language template corresponding to the first programming language, process each extracted structure information to obtain each structure information based on the first programming language.

[0076] Among them, the language template is a template that contains programming language features. It is understandable that since the structure information under each programming language is different, in order to avoid repeated writing processes, reference Figure 3B , the structure information of the YAML language can be used as a framework to obtain the structure information of various programming languages ​​such as C language and Java language.

[0077] Optionally, after extracting each structure information of the YAML language, a structure renderer can be used to render each structure information of the YAML language based on a language template corresponding to the first programming language to obtain each structure information under the first programming language.

[0078] For example, for the card class, the definition in YAML language is as follows:

[0079] Messages:

[0080] -Name: card

[0081] Fields:

[0082] -{name: id, type: int32, desc: "Unique ID"}

[0083] -{name: name, type: string, length:10, desc: "name"}

[0084] Using the definition in YAML language as the framework, the definition of the card class in C language is as follows:

[0085] typedef struct Card {

[0086] int id; / / unique identifier

[0087] char name

[10] ; / / name

[0088] } Card_t;

[0089] S303: Determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as a data structure relationship between the first programming language and the serialized YAML language.

[0090] Optionally, since the structure information of the first programming language is obtained based on the structure information of the YAML language, the association relationship between the structure information of the first programming language and the structure information based on the YAML language can be directly determined, and then the above association relationship can be used as the data structure relationship between the first programming language and the serialized YAML language.

[0091] In an embodiment of the present application, by adopting a language template corresponding to the first programming language, various structure information under the YAML language is processed to obtain various structure information based on the first programming language, and then the data structure relationship between the first programming language and the serialized YAML language is determined, thereby ensuring the efficiency and accuracy of the determination of the data structure relationship.

[0092] In order to ensure the accuracy of the first byte code, based on the above embodiment, in this embodiment, an optional method for determining the first byte code is provided, such as Figure 4 As shown, the specific steps include:

[0093] S401 : Determine first structure information in the first programming language contained in first communication data based on each structure information in the first programming language.

[0094] The first structure information is used to represent the structure information included in the first communication data.

[0095] Optionally, for each structure information under the first programming language, the structure information can be matched with the first communication data. If the matching degree is greater than a preset threshold, it proves that the first communication data contains the structure information, and the structure information can be used as the first structure information; if the matching degree is less than the preset threshold, it proves that the first communication data does not contain the structure information, and the next structure information can be matched.

[0096] S402: Use the first structure information as an index to query from the data structure relationship to obtain target structure information of the first communication data in the YAML language.

[0097] The target structure information refers to the structure information in the YAML language corresponding to the first structure information.

[0098] Optionally, after determining the first structure information contained in the first communication data, in order to improve the efficiency of bytecode determination, the first structure information can be used as an index to query from the data structure relationship between the first programming language and the serialized YAML language, thereby obtaining the target structure information of the first communication data in the YAML language.

[0099] S403, generating a first bytecode according to the target structure information and the first communication data.

[0100] An optional way is that after determining the target structure information in the YAML language, the target structure information can be optimized using the first communication data to obtain the first bytecode.

[0101] Another optional method is to fill in the structure parameters corresponding to the target structure information based on the first communication data to obtain the information to be converted; and use the bytecode generation rule to process the information to be converted to generate the first bytecode.

[0102] Among them, the structure parameters refer to the parameters corresponding to the data structure; the information to be converted refers to the YAML data filled into the structure parameters; the bytecode generation rules are used to represent the preset rules for converting YAML data into bytecode.

[0103] Optionally, since the target structure information only includes the structure of the first communication data, the structure parameters can be extracted from the first communication data, and the structure parameters can be filled into the target structure information to obtain complete information to be converted; then, the information to be converted in the YAML language can be processed based on a preset bytecode generation rule to obtain the first bytecode. The bytecode generation rule can be splicing the information to be converted in a fixed format, etc.

[0104] In the embodiment of the present application, by determining the first bytecode based on the target structure information of the first communication data in the YAML language and the first communication data, the accuracy of the first bytecode and the efficiency of bytecode generation can be guaranteed.

[0105] It is understandable that since the structure of some specified programming languages ​​is similar to that of the YAML language, directly adopting the above method may reduce the efficiency of bytecode generation. Based on this, on the basis of the above embodiment, in this embodiment, another optional method for determining the first bytecode is provided, which specifically includes the following content.

[0106] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode.

[0107] Among them, the specified language refers to a programming language whose language structure is similar to the YAML language structure. Furthermore, the specified language at least includes a process-oriented programming language, namely, the C language; the non-specified language refers to a programming language other than the specified language, for example, the Java language.

[0108] Optionally, each programming language can be divided into a designated language and a non-designated language based on the similarity between the language structure of each programming language and the YAML language structure; then, when the first programming language is a non-designated language, the process of the above-mentioned step S202 can be referred to, and based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data can be serialized to obtain a first bytecode based on the YAML language.

[0109] When the first programming language is the designated language, the first communication data in the first programming language can be directly byte aligned based on the memory format of the YAML language to complete the data serialization process and obtain the first bytecode.

[0110] Exemplarily, when the first programming language is C language, the first byte code can be obtained by performing 1-byte alignment processing on the first communication data in C language. For example, a structure in C language consists of a member of int type and a member of char type, and after 1-byte alignment processing, 5 bytes are obtained, wherein the first 4 bytes are the first int type member and the fifth byte is the second char type member.

[0111] In an embodiment of the present application, by dividing each programming language into a designated language and a non-designated language, and adopting different processing methods, the communication data under the two types of programming languages ​​are processed to obtain the first bytecode under the corresponding programming language, which can effectively improve the efficiency of determining the first bytecode.

[0112] It can be understood that, in addition to the function of sending data externally, the first application also has the function of receiving communication data sent by other applications. Based on this, on the basis of the above embodiment, in this embodiment, an optional method of data reception is provided, such as Figure 5 As shown, the specific steps include:

[0113] S501, obtaining a second bytecode based on the YAML language sent by a third application.

[0114] The third application refers to an application that sends communication data to the first application. It is understandable that the third application can be the same application as the second application or another application; the second bytecode refers to the bytecode sent by the third application.

[0115] Optionally, the third application can serialize the communication data to be sent by the third application based on the data structure relationship between the programming language supported by the third application and the YAML language, obtain a second bytecode based on the YAML language, and send a communication request containing the second bytecode to the first application.

[0116] After detecting the communication request of the third application, security verification can be performed on the communication request of the third application first; then, after the security verification passes, the second bytecode based on the YAML language sent by the third application can be directly obtained from the communication request.

[0117] S502: Based on the data structure relationship between the first programming language and the serialized YAML language, deserialize the second bytecode to obtain communication data in the first programming language.

[0118] Optionally, after receiving the second bytecode, the structure information in the first programming language corresponding to the second bytecode can be determined based on the data structure relationship between the first programming language and the serialized YAML language; then, the communication data in the first programming language can be determined based on the structure information in the first programming language and the structure parameters in the second bytecode.

[0119] For example, when the programming language supported by the first application is C++ and the programming language supported by the third application is Java, the third application itself will generate communication data S in Java. Java; Then, the third application will convert the communication data S based on the data structure relationship between the Java language and the YAML language Java Convert to the second byte code S YAML .

[0120] Further, when the first application receives the second byte code S YAML After that, based on the data structure relationship between C++ language and YAML language, the second bytecode S YAML Converted into communication data S C++ , for the first application to parse.

[0121] In an embodiment of the present application, by deserializing the second bytecode based on the data structure relationship between the first programming language and the serialized YAML language, communication data that can be parsed by the first application is obtained, thereby ensuring the reliability of data communication.

[0122] Figure 6 FIG. 2 is a flow chart of a data communication method in another embodiment. Based on the above embodiment, this embodiment provides an optional example of a data communication method. Figure 6 The specific implementation process is as follows:

[0123] S601, extracting various structure information based on the YAML language from the YAML file.

[0124] S602: Using a language template corresponding to the first programming language, process each extracted structure information to obtain each structure information based on the first programming language.

[0125] S603: Determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as a data structure relationship between the first programming language and the serialized YAML language.

[0126] S604: When the first application has a communication demand with the second application, obtain first communication data in a first programming language supported by the first application.

[0127] S605, determining whether the first programming language is a designated language, if so, executing S610; if not, executing S606.

[0128] S606: Determine, based on each structure information of the first programming language, first structure information in the first programming language included in the first communication data.

[0129] S607: Use the first structure information as an index to query from the data structure relationship to obtain target structure information of the first communication data in the YAML language.

[0130] S608: Fill in the structure parameters corresponding to the target structure information based on the first communication data to obtain information to be converted.

[0131] S609, using a bytecode generation rule to process the information to be converted to generate a first bytecode.

[0132] S610: Perform byte alignment processing on first communication data in a first programming language to obtain a first byte code.

[0133] The specified language at least includes a process-oriented programming language.

[0134] S611: Send the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0135] Correspondingly, a second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0136] The specific process of S601-S611 can refer to the description of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0137] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0138] Based on the same inventive concept, the embodiment of the present application also provides a data communication device for implementing the data communication method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data communication device embodiments provided below can refer to the limitations on the data communication method above, and will not be repeated here.

[0139] In an exemplary embodiment, Figure 7 As shown, a data communication device 1 is provided, comprising: a data acquisition module 10, a data processing module 20 and a data sending module 30, wherein:

[0140] A data acquisition module 10 is used to acquire first communication data in a first programming language supported by the first application when the first application has a communication requirement with the second application;

[0141] A data processing module 20, configured to perform serialization processing on the first communication data based on a data structure relationship between the first programming language and the serialized YAML language, to obtain a first bytecode based on the YAML language;

[0142] The data sending module 30 is used to send the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0143] In an exemplary embodiment, the data communication device further includes a relationship determination module, wherein the relationship determination module is specifically configured to:

[0144] Extract each structure information based on the YAML language from the YAML file; use the language template corresponding to the first programming language to process the extracted structure information to obtain each structure information based on the first programming language; determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as the data structure relationship between the first programming language and the serialized YAML language.

[0145] In an exemplary embodiment, Figure 8 As shown, the data processing module 20 includes:

[0146] The first unit 21 is used to determine the first structure information in the first programming language included in the first communication data based on the structure information in the first programming language;

[0147] The second unit 22 is used to use the first structure information as an index to query from the data structure relationship to obtain the target structure information of the first communication data in the YAML language;

[0148] The third unit 23 is used to generate a first bytecode according to the target structure information and the first communication data.

[0149] In an exemplary embodiment, the third unit 23 is specifically configured to:

[0150] Based on the first communication data, the structure parameters corresponding to the target structure information are filled to obtain information to be converted; and the information to be converted is processed using a bytecode generation rule to generate a first bytecode.

[0151] In an exemplary embodiment, the data processing module 20 is further configured to:

[0152] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the specified language includes at least a process-oriented programming language.

[0153] In an exemplary embodiment, the data communication device further includes a data receiving module, wherein the data receiving module is specifically configured to:

[0154] A second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0155] Each module in the above data communication device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0156] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a data communication method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0157] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0159] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0160] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0161] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0163] Extract each structure information based on the YAML language from the YAML file; use the language template corresponding to the first programming language to process the extracted structure information to obtain each structure information based on the first programming language; determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as the data structure relationship between the first programming language and the serialized YAML language.

[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0165] Based on each structure information of the first programming language, determine the first structure information in the first programming language contained in the first communication data; use the first structure information as an index to query from the data structure relationship to obtain the target structure information of the first communication data in the YAML language; generate a first bytecode according to the target structure information and the first communication data.

[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0167] Based on the first communication data, the structure parameters corresponding to the target structure information are filled to obtain information to be converted; and the information to be converted is processed using a bytecode generation rule to generate a first bytecode.

[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0169] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the specified language includes at least a process-oriented programming language.

[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0171] A second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0172] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0173] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0174] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0175] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0177] Extract each structure information based on the YAML language from the YAML file; use the language template corresponding to the first programming language to process the extracted structure information to obtain each structure information based on the first programming language; determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as the data structure relationship between the first programming language and the serialized YAML language.

[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0179] Based on each structure information of the first programming language, determine the first structure information in the first programming language contained in the first communication data; use the first structure information as an index to query from the data structure relationship to obtain the target structure information of the first communication data in the YAML language; generate a first bytecode according to the target structure information and the first communication data.

[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0181] Based on the first communication data, the structure parameters corresponding to the target structure information are filled to obtain information to be converted; and the information to be converted is processed using a bytecode generation rule to generate a first bytecode.

[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0183] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the specified language includes at least a process-oriented programming language.

[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0185] A second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0186] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0187] When the first application has a communication requirement with the second application, obtaining first communication data in a first programming language supported by the first application;

[0188] Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language;

[0189] The first bytecode is sent to the second application, so that the second application performs deserialization processing on the first bytecode to obtain second communication data in a second programming language supported by the second application.

[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0191] Extract each structure information based on the YAML language from the YAML file; use the language template corresponding to the first programming language to process the extracted structure information to obtain each structure information based on the first programming language; determine the association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as the data structure relationship between the first programming language and the serialized YAML language.

[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0193] Based on each structure information of the first programming language, determine the first structure information in the first programming language contained in the first communication data; use the first structure information as an index to query from the data structure relationship to obtain the target structure information of the first communication data in the YAML language; generate a first bytecode according to the target structure information and the first communication data.

[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0195] Based on the first communication data, the structure parameters corresponding to the target structure information are filled to obtain information to be converted; and the information to be converted is processed using a bytecode generation rule to generate a first bytecode.

[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0197] When the first programming language is a non-specified language, based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; when the first programming language is a specified language, byte alignment is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the specified language includes at least a process-oriented programming language.

[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0199] A second bytecode based on the YAML language sent by the third application is obtained; based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

[0200] It should be noted that the data involved in this application (including but not limited to communication data, etc.) are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0201] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0202] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0203] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data communication method, characterized in that: The method comprises: When the first application has a communication demand with the second application, obtaining first communication data in a first programming language supported by the first application; Based on the data structure relationship between the first programming language and the serialized YAML language, the first communication data is serialized to obtain a first bytecode based on the YAML language; The first bytecode is sent to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

2. The method according to claim 1, characterized in that The data structure relationship between the first programming language and the serialized YAML language is determined in the following manner: Extract the structure information based on YAML language from the YAML file; Using a language template corresponding to the first programming language, the extracted structural information is processed to obtain structural information based on the first programming language; Determine an association relationship between each structure information based on the first programming language and each structure information based on the YAML language, and use the association relationship as a data structure relationship between the first programming language and the serialized YAML language.

3. The method according to claim 2, characterized in that The first communication data is serialized based on the data structure relationship between the first programming language and the serialized YAML language to obtain a first bytecode based on the YAML language, including: Based on each structure information of the first programming language, determining first structure information in the first programming language included in the first communication data; Using the first structure information as an index, querying from the data structure relationship to obtain target structure information of the first communication data in the YAML language; A first bytecode is generated according to the target structure information and the first communication data.

4. The method according to claim 3, characterized in that: The step of generating a first bytecode according to the target structure information and the first communication data includes: Based on the first communication data, filling in the structure parameters corresponding to the target structure information to obtain information to be converted; The information to be converted is processed using a bytecode generation rule to generate a first bytecode.

5. The method according to claim 1, characterized in that The first communication data is serialized based on the data structure relationship between the first programming language and the serialized YAML language to obtain a first bytecode based on the YAML language, including: When the first programming language is a non-specified language, based on a data structure relationship between the first programming language and a serialized YAML language, serializing the first communication data to obtain a first bytecode based on the YAML language; In the case where the first programming language is a designated language, byte alignment processing is performed on the first communication data in the first programming language to obtain a first bytecode; wherein the designated language at least includes a process-oriented programming language.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining a second bytecode based on the YAML language sent by a third application; Based on the data structure relationship between the first programming language and the serialized YAML language, the second bytecode is deserialized to obtain communication data in the first programming language.

7. A data communication device, characterized in that: The device comprises: A data acquisition module, configured to acquire first communication data in a first programming language supported by the first application when the first application has a communication requirement with the second application; A data processing module, configured to perform serialization processing on the first communication data based on a data structure relationship between the first programming language and the serialized YAML language, to obtain a first bytecode based on the YAML language; The data sending module is used to send the first bytecode to the second application, so that the second application deserializes the first bytecode to obtain second communication data in a second programming language supported by the second application.

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

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

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