Data transmission method and apparatus thereof, computer-readable storage medium, and processor
By adopting the memory-level data flow method under the distributed microservice architecture, a unified data mapping interface is defined to realize data sharing and exchange between nodes, the problem of low data transmission efficiency between nodes is solved and data transmission efficiency and applicability are improved.
Patent Information
- Application Number
- CN202211183761.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Under the distributed microservice architecture, the existing data exchange method leads to low data transmission efficiency between nodes and excessive resource usage, and is not suitable for memory-level inter-node data interaction in service orchestration scenarios.
The memory-level data flow method is adopted to define a unified data mapping interface, and data access and mapping are realized through node transmission objects. The input and output mapping method of the data mapping interface is used to complete data transmission in memory, including constructing node transmission objects and switching data areas to realize data sharing and exchange.
It improves the efficiency of data sharing and exchange between nodes, is suitable for online real-time processing, and has clearer data flow, supports service orchestration across units and across data centers, and has stronger scalability.
Smart Images

Figure CN115695456B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data transmission, and in particular, to a data transmission method, an apparatus therefor, a computer-readable storage medium, and a processor. Background Art
[0002] In a distributed microservices architecture, atomic services and composite services are both independently deployed services. By service orchestration, atomic services are orchestrated and combined to build composite services with more complex business logics. How to achieve data exchange and data sharing between different nodes in service orchestration is the key to service orchestration capabilities and execution, and also the key to realizing the functions of composite services.
[0003] The existing data exchange and sharing technologies mainly include the following several types:
[0004] 1). The socket-based method, which is a typical C / S interaction mode. The client performs message interaction by connecting to the port specified by the server to achieve data exchange.
[0005] 2). The file sharing server method, which realizes data interaction by uploading files to the file server. This method is suitable for large-volume data interaction.
[0006] 3). The method of sharing data in a database, which realizes data sharing by connecting to the same database.
[0007] 4). The messaging method, which performs data exchange through a message server. In existing workflow engines, the most widely used data exchange technology is the database-based data sharing method. For example, Activiti, JBPM, flowable, etc. all realize data sharing and transfer between nodes based on a database.
[0008] However, most of the existing data exchange methods are based on the socket-based method, which is a typical C / S interaction mode and is not suitable for in-memory inter-node data interaction in the service orchestration scenario; the method of using a file sharing server is suitable for file-level large-volume data interaction and is not suitable for the service orchestration scenario of processing real-time services; the method of using a database can solve the problem of data exchange between nodes and is also the most commonly used data exchange method in existing workflow engines at present. However, introducing a database only to achieve data exchange seems too cumbersome, especially in the service orchestration scenario of a distributed microservices framework, where data flow is required to be more lightweight; the messaging method requires the support of a message middleware, and each node has to subscribe to messages, which is relatively complex to implement and requires a certain learning cost. In the case of large volumes of data, messages may accumulate, resulting in message delays, message losses, and even message middleware crashes.
[0009] For the above problems, no effective solutions have been proposed yet. Summary of the Invention
[0010] Embodiments of the present invention provide a data transmission method, its device, computer-readable storage medium, and processor, so as to at least solve the technical problem in related technologies that the data transmission between nodes occupies more resources, resulting in low data transmission efficiency.
[0011] According to one aspect of the embodiments of the present invention, a data transmission method is provided, including: obtaining request information in an input data area, where the input data area is used to store the request information; calling a first data relationship based on the request information to construct a node transmission object, where the first data relationship is an input mapping method of a data mapping interface; performing data access on target data by using the node transmission object; calling a second data relationship to map the node transmission object to an exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is data that needs to be exchanged between nodes; using the second data relationship to map the request information and the exchange data to an output data area, where the output data area is used to store data input from the input data area and the exchange data area.
[0012] Optionally, before obtaining the request information in the input data area, the method further includes: generating the input data area, the exchange data area, and the output data area in response to the request information.
[0013] Optionally, the node transmission object includes at least one of the following data information: interface field name, field type, field length, field precision, field constraint.
[0014] Optionally, after using the second data relationship to map the request information and the exchange data to the output data area, the method further includes: generating a message based on the request information and the exchange data.
[0015] According to another aspect of the embodiments of the present invention, there is also provided a data transmission device, including: an acquisition unit, configured to acquire request information in an input data area, where the input data area is used to store the request information; a first call unit, configured to call a first data relationship based on the request information to construct a node transmission object, where the first data relationship is an input mapping method of a data mapping interface; an access unit, configured to perform data access on target data by using the node transmission object; a second call unit, configured to call a second data relationship to map the node transmission object to an exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is data that needs to be exchanged between nodes; and an output unit, configured to map the request information and the exchange data to an output data area by using the second data relationship, where the output data area is used to store data input from the input data area and the exchange data area.
[0016] Optionally, the device further includes: a first generation unit, configured to generate the input data area, the exchange data area, and the output data area in response to the request information before acquiring the request information in the input data area.
[0017] Optionally, the node transmission object includes at least one of the following data information: interface field name, field type, field length, field precision, and field constraint.
[0018] Optionally, the device further includes: a second generation unit, configured to generate a message based on the request information and the exchange data after mapping the request information and the exchange data to the output data area by using the second data relationship.
[0019] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program is run by a processor, it controls a device where the computer-readable storage medium is located to execute the data transmission method described in any one of the above.
[0020] According to another aspect of the embodiments of the present invention, there is also provided a processor, where the processor is used to run a computer program, and when the computer program runs, it executes the data transmission method described in any one of the above.
[0021] In an embodiment of the present invention, request information in an input data area is obtained, where the input data area is used to store the request information; a first data relationship is called based on the request information to construct a node transmission object, where the first data relationship is an input mapping method of a data mapping interface; the target data is accessed using the node transmission object; a second data relationship is called to map the node transmission object to an exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is data that needs to be exchanged between nodes; the request information and the exchange data are mapped to an output data area using the second data relationship, where the output data area is used to store data input from the input data area and the exchange data area. Through the data transmission method provided by the embodiment of the present invention, the purpose of defining a unified data mapping structure and implementing interface definition as needed by the application to complete memory-level data transmission is achieved, thereby realizing the technical effect of improving the efficiency of data sharing and exchange between nodes, and further solving the technical problem that data transmission between nodes in related technologies occupies more resources and results in low data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 is a flowchart of the data transmission method according to an embodiment of the present invention;
[0024] Figure 2 is a process diagram of data flow between nodes according to an embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of the data transmission device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0028] For the convenience of description, some nouns or terms appearing in the embodiments of the present invention are described below.
[0029] Atomic service: An IT business capability in the enterprise steady state, and one or more components can be called to implement a certain type of reusable business process and logic processing, and can be independently deployed.
[0030] Composite service: A technology based on a specific microservice framework and composed of one or more atomic services, which realizes the ability orchestration across data objects internally and exposes the capabilities of this component to front-end applications and other back-end components externally.
[0031] Service orchestration: A method of combining one or more atomic services according to a certain logic to build a coarser-grained composite service.
[0032] DTO (Data Transfer Object): A transfer object used to clearly define the interface field name, field type, field length, field precision, and field constraints. It can be divided into input DTO, output DTO, and exchange DTO according to the source and nature of the data.
[0033] Embodiment 1
[0034] According to an embodiment of the present invention, a method embodiment of a data transmission method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0035] Figure 1 is a flowchart of the data transmission method according to an embodiment of the present invention, as Figure 1 shown, the method includes the following steps:
[0036] Step S102, obtain the request information in the input data area, where the input data area is used to store the request information.
[0037] Optionally, in the above steps, map the combined service request information (i.e., the request information) in the data input area to the data exchange area, where the combined service request information is a type of request information for the data sharing system to initiate data transmission or sharing.
[0038] Step S104, call the first data relationship based on the request information to construct a node transmission object, where the first data relationship is the input mapping method of the data mapping interface.
[0039] Optionally, after the request information is mapped, call the input mapping method (i.e., the first data relationship) of the corresponding data mapping interface based on the request information mapped to the data exchange area to construct a node transmission object DTO (i.e., the node transmission object), so as to trigger data transmission, sharing, circulation, and exchange between nodes.
[0040] Step S106, use the node transmission object to perform data access on the target data.
[0041] Optionally, in the above steps, use the previously constructed node transmission object for data access, where the node transmission object contains the interface field names, field types, field lengths, field precisions, and field constraints of the data to be transmitted, and the node transmission object DTO is divided into input DTO, output DTO, and exchange DTO according to the source and nature of the data, so as to realize data transmission, sharing, circulation, and exchange between nodes.
[0042] Step S108, call the second data relationship to map the node transmission object to the exchange data area to obtain the exchange data, where the second data relationship is the output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is the data that needs to be exchanged between each node.
[0043] Optionally, in the above steps, after the node execution is completed, call the output mapping method (i.e., the second data relationship) of the corresponding data mapping interface to map the result of the node execution (i.e., the node transmission object after data access) to the exchange area (i.e., the second data area) according to the interface definition, so as to obtain the target data mapped to the exchange data area and make it available for subsequent nodes to share.
[0044] Step S110, use the second data relationship to map the request information and the exchange data to the output data area, where the output data area is used to store the data input from the input data area and the exchange data area.
[0045] Optionally, the first data in the swap area is mapped to the data output area by using the output mapping method of the corresponding data mapping interface to obtain the target data to be transmitted. It should be noted that the data transfer methods here include, but are not limited to: transmission, sharing, and exchange.
[0046] As can be seen from the above, in the embodiment of the present invention, first, the request information in the input data area can be obtained, where the input data area is used to store the request information; based on the request information, the first data relationship is called to construct a node transmission object, where the first data relationship is the input mapping method of the data mapping interface; the target data is accessed by using the node transmission object; the second data relationship is called to map the node transmission object to the swap data area to obtain swap data, where the second data relationship is the output mapping method of the data mapping interface, and the swap data area is used to store the swap data, and the swap data is the data that needs to be exchanged between each node; the second data relationship is used to map the request information and the swap data to the output data area, where the output data area is used to store the data input from the input data area and the swap data area. Through the data transmission method provided by the embodiment of the present invention, the purpose of defining a unified data mapping structure and implementing interface definition as needed by the application to complete in-memory data transmission is achieved, thereby realizing the technical effect of improving the efficiency of data sharing and exchange between nodes, and further solving the technical problem that in the related technology, the data transmission between nodes occupies more resources and results in low data transmission efficiency.
[0047] As an optional embodiment, before obtaining the request information in the input data area, the method further includes: in response to the request information, generating the input data area, the swap data area, and the output data area.
[0048] In the above optional embodiment, before mapping the request information in the data input area to the data swap area, after the component receives the request information, the data input area, the data swap area, and the data output area are created.
[0049] As an optional embodiment, the node transmission object includes at least one of the following data information: interface field name, field type, field length, field precision, field constraint.
[0050] In the above optional embodiment, the node transmission object is a transmission object used to represent the data interaction between different data layers, which includes, but is not limited to: interface field name, field type, field length, field precision, field constraint. The advantage of this is that if certain information does not want to be exposed in data sharing, it can be disabled in the node transmission object to transmit the attributes of the data that you want to display, or in other words, it realizes the simplification and personalization of data transmission, and also improves the efficiency of data transmission.
[0051] As an alternative embodiment, after mapping the request information and the exchanged data to the output data area using the second data relationship, the method further includes: generating a message based on the request information and the exchanged data.
[0052] Figure 2 is a process diagram of data transfer between nodes according to an embodiment of the present invention, as Figure 2 shown, and the steps of this process will be described in detail below.
[0053] 1), The service orchestration process starts to execute. An input data area is created according to the composite service request information, and an exchange area is created at the same time. The information in the input data area is mapped to the exchange area with the same name.
[0054] 2), The node execution starts. According to the information in the input data area and the exchange area, the input mapping method of the corresponding data mapping interface is called to construct a node input DTO object.
[0055] 3), After the node execution is completed, the output mapping method of the corresponding data mapping interface is called to map the result of the node execution to the exchange area according to the interface definition for subsequent nodes to share.
[0056] 4), After the entire process is completed, the service orchestration calls the output mapping method of the process data mapping interface to map the data in the input data area and the exchange area to the output data area for constructing an output message.
[0057] Since the above data transfer process is all memory-level operations, the data transfer efficiency between nodes is greatly improved.
[0058] As can be seen from the above, in the embodiment of the present invention, an application scenario of service orchestration based on a distributed microservice architecture is provided, and a memory-level data transfer method based on data mapping is adopted. A unified data mapping interface is defined, and the interface definition is implemented by the application as needed. Data mapping is performed before and after the execution of each node in the service orchestration, realizing data transfer between different nodes, and data sharing and exchange are realized through the exchange area, and it has the following advantages:
[0059] 1), It can realize data exchange more lightly and flexibly, and the data that can be used for exchange is completely controlled by the user on demand. In accordance with the principles of "exchange on demand" and "minimum visibility", data security is ensured on the basis of realizing data sharing.
[0060] 2), Since it is a memory-level data transfer method, the data transfer efficiency is higher; it is more suitable for the requirements of online real-time processing.
[0061] 3), The definition of the service orchestration data area under the distributed microservice architecture is proposed, making the data transfer clearer.
[0062] 4) As a data transfer method under a distributed microservices architecture, it can support service orchestration across units and data centers, with stronger scalability.
[0063] Embodiment 2
[0064] According to another aspect of the embodiments of the present invention, there is also provided a data transmission device. Figure 3 It is a schematic diagram of the data transmission device according to the embodiments of the present invention, as Figure 3 shown. The data transmission device includes: an acquisition unit 31, a first call unit 33, an access unit 35, a second call unit 37, and an output unit 39. The data transmission device will be described below.
[0065] The acquisition unit 31 is used to acquire request information in the input data area, where the input data area is used to store request information.
[0066] The first call unit 33 is used to call a first data relationship based on the request information to construct a node transmission object, where the first data relationship is an input mapping method of a data mapping interface.
[0067] The access unit 35 is used to perform data access on target data using the node transmission object.
[0068] The second call unit 37 is used to call a second data relationship to map the node transmission object to the exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store exchange data, and the exchange data is data that needs to be exchanged between each node.
[0069] The output unit 39 is used to map the request information and the exchange data to the output data area using the second data relationship, where the output data area is used to store data input from the input data area and the exchange data area.
[0070] It should be noted here that the above acquisition unit 31, first call unit 33, access unit 35, second call unit 37, and output unit 39 correspond to steps S102 to S110 in Embodiment 1. The above modules and the corresponding steps have the same implemented instances and application scenarios, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules, as part of the device, can be executed in a computer system such as a set of computer executable instructions.
[0071] As can be seen from the above, in the embodiment of the present invention, first, the acquisition unit can be used to acquire the request information in the input data area, where the input data area is used to store the request information; then the first call unit is used to call the first data relationship based on the request information to construct a node transmission object, where the first data relationship is the input mapping method of the data mapping interface; then the access unit is used to perform data access on the target data by using the node transmission object; then the second call unit is used to call the second data relationship to map the node transmission object to the exchange data area to obtain exchange data, where the second data relationship is the output mapping method of the data mapping interface, and the exchange data area is used to store the exchange data, and the exchange data is the data that needs to be exchanged between each node; and the output unit is used to map the request information and the exchange data to the output data area by using the second data relationship, where the output data area is used to store the data input from the input data area and the exchange data area. Through the data transmission device provided by the embodiment of the present invention, the purpose of defining a unified data mapping structure and realizing interface definition as needed by the application to complete memory-level data transmission is achieved, thereby achieving the technical effect of improving the efficiency of data sharing and exchange between nodes, and further solving the technical problem that data transmission between nodes in the related technology occupies more resources and results in low data transmission efficiency.
[0072] As an optional embodiment, the device further includes: a first generation unit, configured to generate the input data area, the exchange data area, and the output data area in response to the request information before acquiring the request information in the input data area.
[0073] As an optional embodiment, the node transmission object includes at least one of the following data information: interface field name, field type, field length, field precision, and field constraint.
[0074] As an optional embodiment, the device further includes: a second generation unit, configured to generate a message based on the request information and the exchange data after mapping the request information and the exchange data to the output data area by using the second data relationship.
[0075] Embodiment 3
[0076] According to another aspect of the embodiment of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program is run by a processor, it controls the device where the computer-readable storage medium is located to execute any one of the above data transmission methods.
[0077] Embodiment 4
[0078] According to another aspect of the embodiments of the present invention, a processor is further provided, which is used to run a computer program. When the computer program runs, it executes the data transmission method described in any one of the above.
[0079] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0080] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0081] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections with each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be in electrical or other forms.
[0082] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] In addition, the functional units in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0084] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0085] The foregoing is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A data transmission method, characterized in that, including: Obtain request information in the input data area, where the input data area is used to store the request information; Based on the request information, call a first data relationship to construct a node transfer object, where the first data relationship is an input mapping method of a data mapping interface; Use the node transfer object to perform data access on target data; Call a second data relationship to map the node transfer object to an exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is data that needs to be exchanged between nodes; Use the second data relationship to map the request information and the exchange data to an output data area, where the output data area is used to store response object information, and the response object information is data input from the input data area and the exchange data area.
2. The method according to claim 1, wherein Before obtaining the request information in the input data area, the method further includes: In response to the request information, generate the input data area, the exchange data area, and the output data area.
3. The method according to claim 1, wherein The node transfer object includes at least one of the following data information: interface field name, field type, field length, field precision, field constraint.
4. The method according to any one of claims 1 to 3, characterized in that, After using the second data relationship to map the request information and the exchange data to the output data area, the method further includes: Generate a message based on the request information and the exchange data.
5. A data transmission device, characterized in that, including: An obtaining unit, configured to obtain request information in the input data area, where the input data area is used to store the request information; A first calling unit, configured to call a first data relationship based on the request information to construct a node transfer object, where the first data relationship is an input mapping method of a data mapping interface; An access unit, configured to use the node transfer object to perform data access on target data; A second calling unit, configured to call a second data relationship to map the node transfer object to an exchange data area to obtain exchange data, where the second data relationship is an output mapping method of the data mapping interface, the exchange data area is used to store the exchange data, and the exchange data is data that needs to be exchanged between nodes; An output unit, configured to use the second data relationship to map the request information and the exchange data to an output data area, where the output data area is used to store data input from the input data area and the exchange data area.
6. The device according to claim 5, wherein The apparatus further includes: A first generating unit, configured to generate the input data area, the exchange data area, and the output data area in response to the request information before obtaining the request information in the input data area.
7. The device according to claim 5, characterized in that, The node transfer object includes at least one of the following data information: interface field name, field type, field length, field precision, field constraint.
8. The device according to any one of claims 5 to 7, characterized in that, The apparatus further includes: A second generation unit, configured to generate a message based on the request information and the exchange data after mapping the request information and the exchange data to an output data area by using the second data relationship.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program is run by a processor, it controls the device where the computer-readable storage medium is located to execute the data transmission method according to any one of claims 1 to 4 above.
10. A processor, characterized in that, The processor is configured to run a computer program, wherein when the computer program runs, it executes the data transmission method according to any one of claims 1 to 4 above.
Citation Information
Patent Citations
IEC61850-based communication component and application component data interface method
CN105515819A
Partition exchange method and device of database
CN110399354A