Data packet transmission methods, devices, equipment and media in databases

By directly transmitting data query results from data nodes to the query party in a distributed database, the problem of excessive load on computing nodes is solved, network pressure is reduced, and the security and efficiency of data transmission are improved.

CN115941786BActive Publication Date: 2024-08-23JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211471488.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2024-08-23
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

In the distributed database architecture, the load pressure on the computing nodes is too high, and some data that does not require secondary aggregation or sorting operations need to be transmitted to the computing nodes through the data nodes and then to the query side, resulting in increased pressure on the network and computing nodes.

Method used

By receiving the data query request from the query party, a data query task is generated and sent to the associated data node. The data node executes and directly transmits the results to the query party. The computing node only sends data transmission parameters after receiving the data query completion information to avoid data passing through. The compute node transmits again.

Benefits of technology

It reduces the pressure on computing nodes and networks, improves the efficiency and security of data transmission, avoids network connection and authentication problems when the query party is directly connected to the data node, and enhances the applicability and security of the solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115941786B
    Figure CN115941786B
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for transmitting data packets in a database. The method comprises: receiving a data query request from a querying party and generating a data query task; sending the data query task to a data node associated with the data query task so that the associated data node obtains data corresponding to the data query request; receiving data query completion information sent by the associated data node, and sending data transmission parameters to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the querying party according to the data transmission parameters. The embodiment of the present invention reduces the pressure on computing nodes and networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database data transmission, and in particular to a method, device, equipment and medium for transmitting data packets in a database. Background Art

[0002] As information technology continues to integrate into our lives, the amount of data in various information systems is growing rapidly. In order to meet the demand for database software in big data scenarios, distributed databases have come into being.

[0003] In the prior art, in a distributed database architecture with separated computing and storage, all data received by the Client (query party) comes from the CN (Compute Node). The load pressure on the CN node is relatively high, and some data that does not require secondary aggregation or sorting operations also needs to be transmitted from the DN (Date Node) node to the CN node first, and then transmitted to the query party via the CN node. Summary of the invention

[0004] The present invention provides a method, device, equipment and medium for transmitting data packets in a database, so as to reduce the pressure of computing nodes.

[0005] According to one aspect of the present invention, there is provided a method for transmitting data packets in a database, comprising:

[0006] Receive a data query request from the query party and generate a data query task;

[0007] Sending the data query task to a data node associated with the data query task, so that the associated data node obtains data corresponding to the data query request;

[0008] The data query completion information sent by the associated data node is received, and data transmission parameters are sent to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters.

[0009] According to another aspect of the present invention, there is provided a data packet transmission device in a database, comprising:

[0010] A data query task generation module is used to receive a data query request from a query party and generate a data query task;

[0011] A data acquisition module, used for sending the data query task to the data node associated with the data query task, so that the associated data node acquires the data corresponding to the data query request;

[0012] The data transmission module is used to receive the data query completion information sent by the associated data node and send data transmission parameters to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data packet transmission method in the database described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for transmitting data packets in a database described in any embodiment of the present invention when executed.

[0018] The embodiment of the present invention provides a data packet transmission scheme in a database, which receives a data query request from a query party and generates a data query task; sends the data query task to a data node associated with the data query task so that the associated data node obtains the data corresponding to the data query request; receives the data query completion information sent by the associated data node, and sends the data transmission parameters to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters. In the above scheme, a data query task is generated by a computing node, and the associated data node executes the data query task, and the data node directly feeds back the execution result to the query party, and the execution result is not transmitted through the computing node, which reduces the pressure on the computing node and the network. At the same time, after receiving the data query completion information sent by the associated data node, the computing node will send the data transmission parameters to the associated data node, and the associated data node can transmit data to the query party according to the data transmission parameters, without the query party obtaining the information of the associated data node from the computing node, and does not involve network connection and authentication when the query party is directly connected to the data node, thereby improving the applicability and security of the scheme.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a method for transmitting data packets in a database provided by Embodiment 1 of the present invention;

[0022] Figure 2 is a flow chart of a method for transmitting data packets in a database provided by Embodiment 2 of the present invention;

[0023] Figure 3A This is a system structure diagram of data packet transmission in a database provided by Embodiment 3 of the present invention;

[0024] Figure 3B is a schematic diagram of a connection relationship between a computing node and a data node provided in a third embodiment of the present invention;

[0025] Figure 3C is a flow chart of a method for transmitting data packets in a database provided by Embodiment 3 of the present invention;

[0026] Figure 4 It is a structural schematic diagram of a data packet transmission device in a database provided by a fourth embodiment of the present invention;

[0027] Figure 5 It is a structural schematic diagram of an electronic device for implementing a method for transmitting data packets in a database provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of the data involved are all in compliance with the provisions of relevant laws and regulations, and do not violate public order and good morals.

[0030] Embodiment 1

[0031] Figure 1 It is a flowchart of a method for transmitting data packets in a database provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of transmitting data packets in a database. The method can be executed by a data packet transmission device in the database. The data packet transmission device in the database can be implemented in the form of hardware and / or software. The device can be configured in an electronic device that carries the data packet transmission function in the database, such as a server.

[0032] See also Figure 1 The data packet transmission method in the database shown includes:

[0033] S110: receiving a data query request from a querying party and generating a data query task.

[0034] The query party may be understood as a device that initiates a data query request. A data query request refers to an instruction that can be used to query relevant data according to the needs of the query party.

[0035] Among them, the data query task refers to an executable task generated in response to the data query request of the query party. Specifically, the computing node can verify the received data query request, and perform logical optimization and physical optimization on the verified compliant data query request through the database optimizer to obtain a query plan. If the query plan does not require the computing node to perform secondary calculations, a data query task is generated. Exemplarily, the computing node can perform at least one of semantic verification, grammatical verification, and compliance verification on the data query request. The benefit of performing logical optimization and physical optimization on the data query request in the embodiment of the present invention is to reduce the amount of calculation and reduce costs.

[0036] In an embodiment of the present invention, a data query request can be parsed to obtain a query plan; when the query plan satisfies a non-quadratic calculation condition, a data query task is generated. The non-quadratic calculation condition refers to detecting whether the data pointed to by the query plan has been calculated multiple times, for example, a query plan that does not need to be calculated, or does not need to be calculated again after the first calculation, etc. satisfies the non-quadratic calculation condition.

[0037] The embodiment of the present invention does not specifically limit the content of the secondary calculation. Exemplarily, the secondary calculation may include at least one of secondary aggregation, sorting, and grouping.

[0038] It can be understood that by introducing non-quadratic calculation conditions, the generation of data query tasks is limited, the generation of invalid data query tasks is avoided, the waste of resources is avoided, and the executability of data query tasks is improved.

[0039] Specifically, the query party initiates a data query request according to actual needs, and correspondingly, the computing node generates a data query task in response to the data query request of the query party.

[0040] S120: Send the data query task to the data node associated with the data query task, so that the associated data node obtains data corresponding to the data query request.

[0041] Specifically, the computing node sends the data query task to the data node associated with the data query task. Correspondingly, the associated data node receives and executes the data query task and obtains the data corresponding to the data query request. In fact, data is distributed and stored in multiple data nodes. The data involved in the data query task may be distributed in at least one data node. These data nodes are obtained and determined as the data nodes associated with the data query task.

[0042] The embodiment of the present invention does not specifically limit the manner of executing the data query task. In an optional embodiment, the data query task can be split into at least one subtask, and at least one subtask is executed separately. Specifically, the data query task includes at least one subtask; the associated data node includes at least one candidate data node; the number of subtasks is the same as the number of candidate data nodes; sending the data query task to the data node associated with the data query task includes: sending each subtask to the corresponding candidate data node.

[0043] Among them, a subtask can be understood as a task that contains at least part of the content of a data query task. A candidate data node refers to a data node that can execute at least part of the data query task. Usually, one subtask is executed by one candidate data node. In fact, the data query task can be split into at least one subtask according to the distribution location of the data associated with the data query task, and the subtask associated with the data distributed on the candidate data node is assigned to the candidate data node.

[0044] Specifically, the computing node is connected to each data node in communication. The computing node stores the identification information of each data node and the data identification of the data stored in the data node. The computing node can split the data query task into at least one subtask based on the identification information and the data identification, and determine the candidate data node, and send at least one subtask to the corresponding candidate data node. Among them, the identification information refers to information that can be used to uniquely characterize the identity of the data node. The data identification refers to information that can be used to uniquely characterize the identity of the data.

[0045] The embodiment of the present invention does not impose any limitation on the method of determining the subtask, which can be determined by a technician based on experience. It only needs to ensure that the subtask corresponds to the candidate data node one by one, that is, one candidate data node can only execute one subtask.

[0046] It can be understood that by splitting the data query task into at least one subtask, determining the alternative data nodes corresponding to each subtask respectively, and having the alternative data nodes execute the corresponding subtask, the execution efficiency of the data query task is improved, and execution errors due to excessive data volume when executing the data query task as a whole are avoided, thereby improving the accuracy of executing the data query task.

[0047] S130: Receive data query completion information sent by the associated data node, and send data transmission parameters to the associated data node to control the associated data node to transmit data corresponding to the data query request to the query party according to the data transmission parameters.

[0048] The data query completion information refers to the information that the associated data node has completed the data query task. The data transmission parameter is used to instruct the associated data node to send the data corresponding to the data query request to the corresponding query party. Specifically, the data transmission parameter may include at least one of the query party address, the starting packet sequence, and the routing mode.

[0049] Among them, the query party address can be used to uniquely represent the information of the query party's identity, such as an ip (Internet Protocol) address. The starting packet sequence refers to the starting sequence number corresponding to the data sent to the query party for any associated data node. The routing mode refers to the encapsulation processing of the data packet sent by the associated data node to the query party. Optionally, the routing mode can be DR (Director Routing) mode or TUNNEL (tunnel) mode. Among them, the DR mode is used to modify the MAC address (Media Access Control Address, LAN address) of the data packet header. The TUNNEL mode is used to encapsulate another data packet header outside the data packet header. The advantage of using the routing mode is that the security of the data packet is improved. It should be noted that the DR mode is used for the query party, the computing node and the associated data node are in the same LAN; the TUNNEL mode is used for the query party, the computing node and the associated data node are in the same LAN; the TUNNEL mode is used for the scenario where the query party, the computing node and the associated data node are across computer rooms.

[0050] It can be understood that the data transmission parameters include at least one of the query party address, the starting packet sequence and the routing mode, etc., which improves the diversity of the data transmission parameters, avoids the data transmission parameters determined based on a single data, and avoids the occurrence of transmission errors during data transmission, thereby improving the accuracy of the associated data nodes when transmitting data to the query party; and, when the data query request corresponds to a large amount of data, there is no need to re-initiate the data query request, thereby improving the scalability of the data transmission parameters.

[0051] Specifically, after the associated data node completes the data query task, it will send data query completion information to the computing node; accordingly, the computing node sends data transmission parameters to the corresponding data node based on the received data query completion information; the data node determines how to send data to which device based on the received data transmission parameters, thereby sending the data corresponding to the data query request to the querying party.

[0052] It should be noted that when the associated data node transmits the data corresponding to the data query request to the query party according to the data transmission parameters, there is no need to forward it through other nodes. The associated data node directly transmits the data corresponding to the data query request to the query party, and the intermediate transmission process does not pass through other nodes to reduce the pressure on the computing nodes and the network.

[0053] In addition, in order to reduce the pressure on computing nodes, in the existing technology, in the scenario of simply exporting data and the query party and the data node are in the same network, the query party can interact directly with the data node to achieve partial data diversion. The above solution has great limitations and low security because the query party needs to obtain data information from the data node and there are network connection and authentication issues when the query party directly connects to the data node.

[0054] The embodiment of the present invention provides a data packet transmission scheme in a database, which receives a data query request from a query party and generates a data query task; sends the data query task to a data node associated with the data query task so that the associated data node obtains the data corresponding to the data query request; receives the data query completion information sent by the associated data node, and sends the data transmission parameters to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters. In the above scheme, a data query task is generated by a computing node, and the associated data node executes the data query task, and the data node directly feeds back the execution result to the query party, and the execution result is not transmitted through the computing node, which reduces the pressure on the computing node and the network. At the same time, after receiving the data query completion information sent by the associated data node, the computing node will send the data transmission parameters to the associated data node, and the associated data node can transmit data to the query party according to the data transmission parameters, without the query party obtaining the information of the associated data node from the computing node, and does not involve network connection and authentication when the query party is directly connected to the data node, thereby improving the applicability of the scheme.

[0055] On the basis of the above-mentioned embodiments, a connection link can be pre-established between the computing node and the data node and stored in a connection pool. When sending a data query task, the connection link can be directly queried from the connection pool, and the data query task can be transmitted using the connection link. Specifically, sending the data query task to the data node associated with the data query task includes: obtaining the associated connection link in the connection pool corresponding to the data node associated with the data query task; sending the data query task to the associated data node through the associated connection link; further, receiving the data query completion information sent by the associated data node, and sending the data transmission parameters to the associated data node, including: receiving the data query completion information sent by the associated data node through the associated connection link, and sending the data transmission parameters to the associated data node.

[0056] The connection pool is used to store at least one associated connection link. The associated connection link refers to a link for data transmission between a computing node and a data node associated with a data query task.

[0057] Specifically, the computing node can determine the connection pool where the associated data node is located according to the data query task, and find the associated connection link corresponding to the associated data node in the connection pool. The computing node sends the data query task to the associated data node through the associated connection link; after completing the data query task, the associated data node can send data query completion information to the computing node through the associated connection link; the computing node sends data transmission parameters to the associated data node through the associated connection link based on the received data query completion information.

[0058] It can be understood that by introducing a connection pool and associated connection links, data transmission between computing nodes and data nodes is achieved, which avoids frequent creation of data transmission links, reduces system overhead, and reduces communication delay time.

[0059] Embodiment 2

[0060] Figure 2 It is a flow chart of a method for transmitting data packets in a database provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment further refines the operation of "receiving data query completion information sent by the associated data node, and sending data transmission parameters to the associated data node" into "receiving data query completion information sent by the associated data node; obtaining the historical packet sequence of the data packet of the previous return packet; determining a new starting packet sequence according to the historical packet sequence, and adding it to the data transmission parameters; sending data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the querying party" to improve the data transmission parameter sending mechanism. It should be noted that for the parts not described in detail in the embodiments of the present invention, please refer to the description of other embodiments.

[0061] See also Figure 2 The data packet transmission method in the database shown includes:

[0062] S210: receiving a data query request from a querying party and generating a data query task.

[0063] S220: Send the data query task to the data node associated with the data query task, so that the associated data node obtains data corresponding to the data query request.

[0064] S230: Receive data query completion information sent by the associated data node.

[0065] Specifically, after completing the data query task, the associated data node will send data query completion information to the computing node; correspondingly, the computing node will receive the data query completion information sent by the associated data node.

[0066] S240, obtaining the historical packet sequence of the data packet of the previous return packet.

[0067] Packet return refers to the process of a data node sending a data packet to the querying party. The data packet of the previous packet return refers to the data packet of the previous transmission among the adjacent transmitted data packets. The packet sequence is used to identify the data packet. The data associated with the data query task is sent in multiple data packets. The packet sequence of different data packets is different. The historical packet sequence can refer to the packet sequence of the historically transmitted data packets.

[0068] Specifically, the computing node can obtain the historical packet sequence of the data packet of the previous round.

[0069] S250: Determine a starting packet sequence according to a historical packet sequence, and add the sequence to a data transmission parameter.

[0070] The starting packet sequence refers to the packet sequence of the data packet currently to be transmitted. The starting packet sequence is used to determine the packet sequence of the first data packet in the data packet that the data node is about to start transmitting. For example, if the data node sends multiple data packets, the packet sequence of the first data packet is the starting packet sequence, and starting from the starting packet sequence in the transmission order, the preset value is accumulated to obtain a new packet sequence as the packet sequence of the next transmitted data packet.

[0071] S260. Send data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the querying party.

[0072] In an embodiment of the present invention, in order to enable the computing node to understand the execution progress of the data query task in real time, after sending the data transmission parameters to the associated data node, it also includes: obtaining the data packet transmission status information sent by the associated data node, the data packet transmission status information includes the packet sequence of the currently transmitted data packet; when the associated data node completes the packet return, receiving the packet sequence of the last transmitted data packet sent by the associated data node, and updating the historical packet sequence of the data packet of the previous return packet.

[0073] The data packet transmission status information can be understood as the progress information of the associated data node transmitting the data packet. Optionally, the data packet transmission status information can include at least one of the packet sequence, timestamp and number of data packets of the currently transmitted data packet. The associated data node can be the associated data node that currently sends the data packet transmission status information. The associated data node packet return completion means that the associated data node has completed sending all the data associated with the subtask.

[0074] Exemplarily, the computing node obtains the packet sequence of the currently transmitted data packet sent by the associated data node as 6. When the associated data node completes the packet return, the packet sequence of the last transmitted data packet sent by the target data node is received as 9, then the historical packet sequence of the previous returned data packet is determined to be 9.

[0075] It can be understood that by introducing the data packet transmission status information, the computing node can understand the execution progress of the data query task in real time, which is beneficial for the computing node to promptly determine whether the data query task is completed based on the execution progress; and, in the event that the associated data node fails, the alternative node can re-execute the data query task from the interrupted data packet based on the data packet transmission status information, thereby avoiding repeated execution of the data query task.

[0076] The embodiment of the present invention provides a data packet transmission scheme in a database, which receives data query completion information sent by an associated data node; obtains the historical packet sequence of the data packet of the previous packet; determines the starting packet sequence according to the historical packet sequence and adds it to the data transmission parameters; sends the data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the querying party, thereby improving the data transmission parameter sending mechanism. The above scheme improves the reliability of the starting packet sequence determination result by introducing the historical packet sequence and determining the starting packet sequence, avoids the occurrence of starting packet sequence errors, and improves the accuracy of the starting packet sequence.

[0077] In the embodiment of the present invention, in order to ensure that there is a connection between the computing node and each data node, the data node will send a heartbeat packet to the computing node according to a preset duration, and the computing node determines the connection status with each data node based on the received heartbeat packet. Among them, the heartbeat packet is used to characterize the normal connection between the data node and the computing node. The embodiment of the present invention does not impose any restrictions on the size of the preset duration, which can be set by a technician based on experience, or can be repeatedly determined through a large number of experiments.

[0078] Embodiment 3

[0079] The data packet transmission scheme in the database provided by the embodiment of the present invention can also be explained from the perspective of the associated data node. Specifically, the associated data node receives the data query task sent by the computing node, and queries the corresponding data in the database according to the data query task. When the query is completed, the data query completion information is fed back to the computing node, and the corresponding data is transmitted to the querying party according to the data transmission parameters sent by the computing node.

[0080] Specifically, the computing node splits the data query task into at least one subtask, and sends at least one subtask to the associated data node. After the associated data node receives the subtask sent by the computing node, it queries the corresponding data in the database according to the subtask; after the associated data node completes the query, it sends data query completion information to the computing node; the computing node sends data transmission parameters to the associated data node in response to the data query completion information; the associated data node encapsulates the corresponding queried data according to the data transmission parameters, forms a data packet, and sends it to the querying party.

[0081] Optionally, the data transmission parameters may include the address of the querying party, the starting packet sequence and the routing mode. Accordingly, the associated data node may determine the identity of the querying party receiving the data packet according to the address of the querying party; the associated data node may determine the packet sequence of the first data packet to be transmitted according to the starting packet sequence; the associated data node may determine the encapsulation form of the data packet according to the routing mode. Further, the associated data node encapsulates the corresponding data queried according to the data transmission parameters to form a data packet and sends it to the querying party, including: the associated data node determines to encapsulate the current data to be transmitted according to the determined identity of the querying party, the packet sequence and encapsulation form of the first data packet, and sends the encapsulated data packet to the router, and the router processes the data packet according to the identity and encapsulation form of the querying party in the packet header of the received data packet, and forwards it to the querying party.

[0082] It should be noted that, since the associated data node may fail, in order to reduce the impact on the execution of the data query task, the associated data node may send node failure information to the computing node when the failure occurs. The computing node may actively or passively receive the node failure information and respond to determine the execution progress of the failed associated node, generate a new data query task, and send the new data query task to the candidate node of the failed associated data node, which executes the new data query task. Among them, the node failure information refers to the information that the associated data node fails when executing the data query task. Exemplarily, the node failure information may include at least one of the identification information of the failed associated data node, the execution progress of the failed associated data node, and the identification information of the candidate node. The execution progress refers to the degree of completion of the data query task of the failed associated data node, which can be specifically represented by the packet sequence of the transmitted data packet. It should be noted that when the candidate node executes the new data query task, due to the time difference in obtaining the packet sequence, it may repeat the execution of at least part of the data query task. At this time, the query party will automatically ignore the data packet corresponding to the repeated part of the data query task.

[0083] It should be noted that, since the associated data node may fail, in order to reduce the impact on the transmission of data packets, the associated data node may send data packet transmission error information to the computing node when the failure occurs. The computing node determines the transmission progress of the failed associated node in response to the data packet transmission error information, generates new data transmission parameters, and sends the new data transmission parameters to the candidate node of the failed associated data node. The candidate node continues to complete the transmission of the data packet according to the new data transmission parameters. The data packet transmission error information refers to the information that the associated data node has a problem in the process of transmitting the data packet. Exemplarily, the data packet transmission error information may include at least one of the identification information of the failed associated data node, the transmission progress of the failed associated data node, and the identification information of the candidate node. The transmission progress refers to the packet sequence of the data packet currently transmitted by the failed associated data node.

[0084] For a better understanding of the interaction between compute nodes and associated data nodes, see Figure 3C The data packet transmission method in the database shown in FIG. Figure 3C Before we get started, see Figure 3A Provide detailed description of various nodes in the system that transmit data packets.

[0085] Figure 3A In this example, the querying party is a business system, which is connected to the computing nodes of the distributed database through interfaces such as JDBC (Java DataBase Connectivity) and ODBC (Open Database Connectivity). The user operates on the operation interface, and the querying party generates data query requests based on the operations.

[0086] The Compute Node (CN) can be responsible for authentication, parsing SQL (Structured Query Language), obtaining a query plan, scheduling multiple associated data nodes to execute data query tasks, and then returning data to the querying party.

[0087] Data nodes (DN) are storage nodes of distributed databases, which are used to store the business data of all users provided services by the querying party. At the same time, data nodes support partial computing push-down operations, and can perform pre-computation and data filtering on data nodes to avoid all computing pressure being concentrated on computing nodes.

[0088] For more information about the connections between compute nodes and data nodes, see Figure 3B Schematic diagram shown.

[0089] The packet return coordinator in the computing node includes a network detector, a control link manager and a state processor. The network detector is used to determine the routing mode of the data node, that is, whether to use the DR mode or the TUNNEL mode. The control link manager is used to determine whether to maintain a control link (such as an associated connection link) between the computing node and the data node. When a connection pool mechanism is used between the computing node and the data node, the control link manager can control at least one of the initialization of the connection pool, the application of the connection, the recovery and the packet activity, etc. The state processor can be used to send data transmission parameters to the data node, and receive and process at least one of the data packet transmission status information, data query completion information and data packet transmission error information fed back by the data node.

[0090] Among them, the packet return processor in the data node includes a state receiver, a state transmitter and a packet sending processor. The state receiver is used to receive the data query task and data transmission parameters sent by the packet return coordinator on the computing node. The state transmitter is used to send at least one of data query completion information, data packet transmission status information and data packet transmission error information to the computing node. Specifically, during the packet return process, the data packet transmission status information is fed back to the computing node at a regular interval (such as a 200ms cycle); when the packet return error occurs, the data packet transmission error information is fed back to the computing node; when the packet return is completed, the data query completion information is fed back to the computing node. The packet sending processor is used to transmit the data corresponding to the data query request to the querying party according to the data transmission parameters.

[0091] For further information, see Figure 3C The data packet transmission method in the database shown includes:

[0092] S301, sending a data query request to a computing node in the query direction.

[0093] S302: The computing node responds to the data query request, parses the data query request, and obtains a query plan.

[0094] S303: The computing node determines whether the query plan satisfies the non-secondary computing condition.

[0095] S304: If the query plan meets the non-secondary calculation condition, a data query task is generated.

[0096] S305. The computing node determines a connection pool associated with the data query task.

[0097] S306: The computing node splits the data query task into subtask A and subtask B, and obtains the corresponding associated connection link a and associated connection link b from the connection pool.

[0098] S307. The computing node sends subtask A to the candidate data node aa via the associated connection link a.

[0099] S308. The computing node sends subtask B to the candidate data node bb via the associated connection link b.

[0100] S309. The candidate data node aa executes subtask A and obtains subtask query result AA.

[0101] The subtask query result refers to the data found by the candidate data node in the database according to the corresponding subtask.

[0102] S310. The candidate data node bb executes subtask B and obtains subtask query result BB.

[0103] S311. After completing subtask A, candidate data node aa sends data query completion information AAA to the computing node.

[0104] S312. After completing subtask B, candidate data node bb sends data query completion information BBB to the computing node.

[0105] S313. The computing node first receives the data query completion information AAA, and then receives the data query completion information BBB.

[0106] S314. The computing node first sends a data transmission parameter Aa to the candidate data node aa.

[0107] S315. The candidate data node aa transmits the subtask query result AA to the querying party according to the received data transmission parameter Aa.

[0108] S316. During the process of transmitting the subtask query result AA, the candidate data node aa sends data packet transmission status information Aa1 to the computing node.

[0109] S317. The computing node determines the transmission progress of the candidate data node aa according to the received data packet transmission status information Aa1.

[0110] S318. When the candidate data node aa completes the packet return, the computing node sends the data transmission parameter Bb to the candidate data node bb.

[0111] S319. The candidate data node bb transmits the subtask query result BB to the querying party according to the received data transmission parameter Bb.

[0112] S320 . During the process of transmitting the subtask query result BB, the candidate data node bb sends data packet transmission status information Bb1 to the computing node.

[0113] S321. The computing node determines the transmission progress of the candidate data node bb according to the received data packet transmission status information Bb1.

[0114] S322. When the candidate data node bb completes the packet return, the computing node sends a response packet to the querying party.

[0115] S323: The querying party determines, based on the received response packet, that the querying party's data query request has been responded to.

[0116] It should be noted that S307 and S308 are performed simultaneously, that is, the computing node sends subtask A to the candidate data node aa while also sending subtask B to the candidate data node bb.

[0117] It should be noted that before the computing node sends the data transmission parameter Aa to the candidate data node aa, it may send at least one response packet to the querying party to inform the querying party that it is ready to receive the subtask query result AA and the subtask query result BB.

[0118] In an embodiment of the present invention, a computing node is connected to an alternative data node through a control link. The control link is used for information exchange between the computing node and the alternative data node. Exemplarily, the control link can be implemented through an associated connection link. The alternative data node is connected to the query party through a data link. The data link is used for the alternative data node to send a data packet to the query party. The embodiment of the present invention does not impose any restrictions on the implementation of the data link, which can be set by a technician based on experience.

[0119] According to the data packet transmission scheme in the database of the embodiment of the present invention, when the optimizer of the computing node determines that the data query request satisfies the non-secondary computing condition, it coordinates the various associated data nodes and provides data transmission parameters to the associated data nodes. The associated data nodes directly return packets to the querying party, and the control link and the data link are separated, so as to avoid the computing node receiving the data packet from the associated data node and then encoding and decoding it to return it to the querying party, thereby saving the network data packet traffic and the encoding and decoding CPU (Central Processing Unit) overhead of the computing node. At the same time, the computing node and the associated data node maintain the control link during the transmission of the data link, so as to coordinate multiple associated data nodes to return packets to the querying party.

[0120] It should be noted that for the parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0121] Embodiment 4

[0122] Figure 4It is a structural schematic diagram of a data packet transmission device in a database provided in Embodiment 4 of the present invention. This embodiment is applicable to the situation of transmitting data packets in a database. The method can be executed by the data packet transmission device in the database. The data packet transmission device in the database can be implemented in the form of hardware and / or software. The device can be configured in an electronic device that carries the data packet transmission function in the database.

[0123] like Figure 4 As shown, the device includes: a data query task generation module 410, a data acquisition module 420 and a data transmission module 430. Among them,

[0124] The data query task generating module 410 is used to receive the data query request from the query party and generate a data query task;

[0125] The data acquisition module 420 is used to send the data query task to the data node associated with the data query task, so that the associated data node obtains the data corresponding to the data query request;

[0126] The data transmission module 430 is used to receive data query completion information sent by the associated data node, and send data transmission parameters to the associated data node to control the associated data node to transmit data corresponding to the data query request to the query party according to the data transmission parameters.

[0127] The embodiment of the present invention provides a data packet transmission scheme in a database, which receives a data query request from a query party through a data query task generation module and generates a data query task; sends the data query task to a data node associated with the data query task through a data acquisition module, so that the associated data node obtains the data corresponding to the data query request; receives the data query completion information sent by the associated data node through a data transmission module, and sends data transmission parameters to the associated data node to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters. In the above scheme, a data query task is generated by a computing node, and the associated data node executes the data query task, and the data node directly feeds back the execution result to the query party, and the execution result is not transmitted through the computing node, which reduces the pressure on the computing node and the network. At the same time, after receiving the data query completion information sent by the associated data node, the computing node will send the data transmission parameter to the associated data node, and the associated data node can transmit data to the query party according to the data transmission parameter, without the query party obtaining the information of the associated data node from the computing node, and does not involve network connection and authentication when the query party is directly connected to the data node, thereby improving the applicability of the scheme.

[0128] Optionally, the data transmission parameters include: the address of the querying party, the starting packet sequence and the routing mode.

[0129] Optionally, the data transmission module 430 includes:

[0130] An information receiving unit, used for receiving data query completion information sent by an associated data node;

[0131] A historical packet sequence acquisition unit, used to acquire the historical packet sequence of the data packet of the previous return packet;

[0132] A starting packet sequence determining unit, used to determine a starting packet sequence according to a historical packet sequence and add the sequence to a data transmission parameter;

[0133] The data packet sending unit is used to send data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the query party.

[0134] Optionally, the device further includes:

[0135] A transmission status information acquisition unit, configured to acquire data packet transmission status information sent by the associated data node after sending data transmission parameters to the associated data node, wherein the data packet transmission status information includes a packet sequence of a currently transmitted data packet;

[0136] The historical packet sequence determining unit is used to receive the packet sequence of the last transmitted data packet sent by the associated data node when the associated data node completes the packet return, and update the historical packet sequence of the data packet of the previous packet return.

[0137] Optionally, the data query task includes at least one subtask; the associated data node includes at least one candidate data node; the number of subtasks is the same as the number of candidate data nodes;

[0138] The data acquisition module 420 includes:

[0139] The subtask sending unit is used to send each subtask to the corresponding candidate data node.

[0140] Optionally, the data query task generating module 410 includes:

[0141] A query plan acquisition unit, used to parse the data query request and obtain a query plan;

[0142] The data query task generating unit is used to generate a data query task when the query plan meets the non-secondary calculation condition.

[0143] Optionally, the data acquisition module 420 includes:

[0144] An associated connection link acquisition unit, used to acquire an associated connection link in a connection pool corresponding to a data node associated with a data query task;

[0145] A data query task sending unit, used to send the data query task to the associated data node through the associated connection link;

[0146] The data transmission module 430 includes:

[0147] The data transmission parameter sending unit is used to receive data query completion information sent by the associated data node through the associated connection link, and send data transmission parameters to the associated data node.

[0148] The data packet transmission device in the database provided by the embodiment of the present invention can execute the data packet transmission method in the database provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the data packet transmission method in each database.

[0149] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of data query requests, data query tasks, data query completion information, data transmission parameters, etc. are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0150] Embodiment 5

[0151] Figure 5 It is a structural diagram of an electronic device 10 for implementing a data packet transmission method in a database provided by Embodiment 5 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0152] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0153] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0154] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a data packet transmission method in a database.

[0155] In some embodiments, the data packet transmission method in the database may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data packet transmission method in the database described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the data packet transmission method in the database in any other appropriate manner (e.g., by means of firmware).

[0156] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0157] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0158] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0159] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0160] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0161] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0162] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0163] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for transmitting data packets in a database, characterized in that: include: Receive a data query request from the query party and generate a data query task; Sending the data query task to a data node associated with the data query task, so that the associated data node obtains data corresponding to the data query request; receiving data query completion information sent by the associated data node, and sending data transmission parameters to the associated data node, so as to control the associated data node to transmit the data corresponding to the data query request to the querying party according to the data transmission parameters; wherein the data transmission parameters include: the address of the querying party, the starting packet sequence and the routing mode; accordingly, the associated data node determines the identity of the querying party receiving the data packet according to the address of the querying party; the associated data node determines the packet sequence of the first data packet to be transmitted according to the starting packet sequence; the associated data node determines the encapsulation form of the data packet according to the routing mode; The receiving of data query completion information sent by the associated data node and sending data transmission parameters to the associated data node includes: Receiving data query completion information sent by the associated data node; Get the historical packet sequence of the previous packet; Determine a starting packet sequence according to the historical packet sequence, and add the sequence to the data transmission parameter; Sending the data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the querying party; After sending the data transmission parameter to the associated data node, the method further includes: Acquire data packet transmission status information sent by the associated data node, wherein the data packet transmission status information includes a packet sequence of a currently transmitted data packet; When the associated data node completes packet return, the packet sequence of the last transmitted data packet sent by the associated data node is received, and the historical packet sequence of the data packet of the previous return packet is updated.

2. The method according to claim 1, characterized in that: The data query task includes at least one subtask; the associated data node includes at least one candidate data node; the number of the subtasks is the same as the number of the candidate data nodes; The sending the data query task to the data node associated with the data query task includes: Each of the subtasks is sent to a corresponding candidate data node.

3. The method according to claim 1, characterized in that The generating of the data query task includes: Parsing the data query request to obtain a query plan; When the query plan satisfies the non-secondary calculation condition, a data query task is generated.

4. The method according to claim 1, characterized in that: The sending the data query task to the data node associated with the data query task includes: Obtaining an associated connection link in a connection pool corresponding to a data node associated with the data query task; Sending the data query task to the associated data node via the associated connection link; The receiving the data query completion information sent by the associated data node and sending the data transmission parameters to the associated data node includes: The data query completion information sent by the associated data node is received through the associated connection link, and data transmission parameters are sent to the associated data node.

5. A data packet transmission device in a database, characterized in that: include: A data query task generation module is used to receive a data query request from a query party and generate a data query task; A data acquisition module, used for sending the data query task to the data node associated with the data query task, so that the associated data node acquires the data corresponding to the data query request; A data transmission module, used for receiving the data query completion information sent by the associated data node, and sending data transmission parameters to the associated data node, so as to control the associated data node to transmit the data corresponding to the data query request to the query party according to the data transmission parameters; wherein the data transmission parameters include: the address of the query party, the starting packet sequence and the routing mode; accordingly, the associated data node determines the identity of the query party receiving the data packet according to the address of the query party; the associated data node determines the packet sequence of the first data packet to be transmitted according to the starting packet sequence; the associated data node determines the encapsulation form of the data packet according to the routing mode; Wherein, the data transmission module includes: An information receiving unit, used for receiving data query completion information sent by an associated data node; A historical packet sequence acquisition unit, used to acquire the historical packet sequence of the data packet of the previous return packet; A starting packet sequence determining unit, used to determine a starting packet sequence according to a historical packet sequence and add the sequence to a data transmission parameter; A data packet sending unit, used to send data transmission parameters to the associated data node, so that the associated data node encapsulates the data corresponding to the data query request according to the data transmission parameters to form a data packet, and sends the formed data packet to the query party; Wherein, the device further includes: A transmission status information acquisition unit, configured to acquire data packet transmission status information sent by the associated data node after sending data transmission parameters to the associated data node, wherein the data packet transmission status information includes a packet sequence of a currently transmitted data packet; The historical packet sequence determining unit is used to receive the packet sequence of the last transmitted data packet sent by the associated data node when the associated data node completes the packet return, and update the historical packet sequence of the data packet of the previous packet return.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data packet transmission method in the database according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data packet transmission method in the database of any one of claims 1-4 when executed.