CN116567111A - Interaction method of database and related device - Google Patents

Interaction method of database and related device Download PDF

Info

Publication number
CN116567111A
CN116567111A CN202310572427.8A CN202310572427A CN116567111A CN 116567111 A CN116567111 A CN 116567111A CN 202310572427 A CN202310572427 A CN 202310572427A CN 116567111 A CN116567111 A CN 116567111A
Authority
CN
China
Prior art keywords
message
database
received
sent
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310572427.8A
Other languages
Chinese (zh)
Inventor
张志刚
罗向征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN202310572427.8A priority Critical patent/CN116567111A/en
Publication of CN116567111A publication Critical patent/CN116567111A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of communication, and provides an interaction method and a related device of a database. The method comprises the steps that a database node server is communicated with other database node servers in a database cluster through a UDP user datagram protocol, an intelligent network card in the database node server identifies a message to be sent when the message is sent, and the message to be sent is sent according to a preset reliability sending mechanism under the condition that the message to be sent is a database interaction type message; the intelligent network card identifies the message to be received when receiving the message, and receives the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is a database interaction type message. The high-efficiency communication among the nodes of the database cluster is realized through UDP, and the database interaction message is sent and received through the intelligent network card according to a set sending mechanism and a set receiving mechanism. The interaction reliability of the database is guaranteed, and meanwhile interaction efficiency and performance of the database cluster are improved.

Description

Interaction method of database and related device
Technical Field
The invention relates to the technical field of communication, in particular to an interaction method of a database and a related device.
Background
Databases are becoming more and more popular for use in data centers and other businesses. In order to solve the problems of high concurrency of databases, guaranteed availability of services and the like, a database scheme is often realized by adopting a mode of constructing a database cluster by two or more database node servers. The database cluster nodes can perform interactive operations such as synchronization, keep-alive and backup, and because the interaction of the databases requires high reliability, TCP (Transmission Control Protocol ) is generally adopted for communication between the database cluster nodes at present. However, in a scenario shared by the database cluster node network and the customer service network, or in a scenario of communication between database nodes crossing the data center machine room, a large amount of messages are retransmitted due to the influence of other interference traffic or communication line loss, so that the interaction efficiency of the database is reduced, and the performance of the database cluster is affected.
Disclosure of Invention
Accordingly, the present invention is directed to a database interaction method and related device.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for interaction of a database, applied to an intelligent network card of a database node server, where the database node server communicates with other database node servers in a database cluster through a UDP user datagram protocol, the method including:
when a message is sent, identifying the message to be sent, and sending the message to be sent according to a preset reliability sending mechanism under the condition that the message to be sent is a database interaction type message;
and when receiving the message, identifying the message to be received, and receiving the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is the database interaction type message.
In an optional implementation manner, the intelligent network card is provided with a cache space for caching the database interaction type message;
the step of sending the message to be sent according to a preset reliability sending mechanism comprises the following steps:
after caching the message to be sent to the cache space, copying the message to be sent to obtain a copied message;
marking the copied message to obtain a marked message and sending the marked message;
if a response message corresponding to the marked message is received within a preset time, clearing the message to be sent in the cache space;
and if the response message corresponding to the marked message is not received within the preset time length, repeating the steps of copying the message to be sent to obtain the copied message and marking the copied message to obtain the marked message and sending the marked message until the response message corresponding to the marked message is received.
In an alternative embodiment, the step of marking the copied message to obtain a marked message includes:
setting a specific mark in the copied message to obtain the marked message, or packaging the copied message into a specific format to obtain the marked message.
In an optional implementation manner, the step of sending the message to be sent according to a preset reliability sending mechanism further includes:
and when the buffer space has no residual space, sending a flow control message to a processor of the database node server where the intelligent network card is located, so as to inform the processor of the database node server to stop sending the database interaction type message until the buffer space has the residual space, and stopping sending the flow control message to the processor of the database node server where the intelligent network card is located, so that the processor of the database node server continues sending the database interaction type message.
In an optional embodiment, the step of receiving the message to be received according to a preset reliability receiving mechanism includes:
generating a response message corresponding to the message to be received, and sending the response message corresponding to the message to be received;
and acquiring an original message from the message to be received, so that a processor of the database node server performs database interaction operation according to the original message.
In an optional embodiment, the step of generating a response message corresponding to the message to be received includes:
when the message to be received is one, generating a response message corresponding to the message to be received according to the sequence number in the message to be received and a preset response mark;
when the number of the messages to be received is multiple, generating a message according to the serial number in each message to be received and a preset response mark, and taking the message as a response message corresponding to each message to be received.
In an optional embodiment, the step of obtaining the original message from the message to be received includes:
removing a specific mark in the message to be received to obtain the original message, wherein the message to be received is obtained after the specific mark is set in the original message;
or analyzing the specific format of the message to be received to obtain the original message, wherein the message to be received is obtained after the original message is packaged into the specific format.
In a second aspect, the present invention provides an interaction device of a database, applied to an intelligent network card of a database node server, where the database node server communicates with other database node servers in a database cluster through a UDP user datagram protocol, and the interaction device of the database includes:
the sending module is used for identifying the message to be sent when the message is sent, and sending the message to be sent according to a preset reliability sending mechanism under the condition that the message to be sent is a database interaction type message;
and the receiving module is used for identifying the message to be received when the message is received, and receiving the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is the database interaction type message.
In a third aspect, the present invention provides a database node server in communication with other database node servers in a database cluster via UDP user datagram protocol, the database node server comprising an intelligent network card for implementing the method of any of the previous embodiments.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed, implements a method according to any of the preceding embodiments.
According to the interaction method and the related device of the database, the database node server is communicated with other database node servers in the database cluster through the UDP user datagram protocol, the intelligent network card in the database node server identifies the message to be sent when sending the message, and sends the message to be sent according to a preset reliability sending mechanism under the condition that the message to be sent is the database interaction type message; the intelligent network card identifies the message to be received when receiving the message, and receives the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is a database interaction type message. Compared with the prior art adopting a TCP mode, the invention adopts UDP to realize high-efficiency communication among all database node servers in the database cluster, and identifies the message through the intelligent network card to send and receive the database interaction type message according to the set sending mechanism and receiving mechanism, thereby improving the interaction efficiency while ensuring the data interaction reliability and improving the performance of the database cluster.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a database cluster according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a database node server according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of an interaction method of a database according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of another method of interaction of databases according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of another method for interacting with a database according to an embodiment of the present invention;
fig. 6 shows a functional block diagram of an interaction device of a database according to an embodiment of the present invention.
Icon: 110-a processor; 120-memory; 130-an intelligent network card; 300-interaction means of the database; 310-a transmitting module; 330-receiving module.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Please refer to fig. 1, which is a schematic diagram of a database cluster according to an embodiment of the present invention. The database cluster comprises a plurality of database node servers, one database node server is a node in the database cluster, and the database node server can be understood as a physical server provided with a database and an intelligent network card, wherein the database is used for providing data service, and the intelligent network card is used for realizing communication interaction.
It can be understood that, in order to realize that two nodes in the database cluster can communicate as a distributed database cluster, a switch can be adopted to perform communication connection with an intelligent network card in each database node server so as to realize communication interaction between all nodes in the database cluster.
It should be noted that, in the database cluster provided by the embodiment of the present invention, each database node server communicates by means of UDP (User Datagram Protocol ). Compared with the mode of adopting TCP in the prior art, the method and the device have the advantages that the communication time delay is lower, the efficiency is higher, and a large number of message retransmission caused by adopting TCP can be effectively avoided.
Please refer to fig. 2, which is a schematic diagram of a database node server according to an embodiment of the present invention. The database node server comprises a processor 110, a memory 120 and an intelligent network card 130, and the components are directly or indirectly electrically connected with each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The processor 110 is used to read/write data or programs stored in the memory 120 and perform corresponding functions, and may be a general-purpose processor including a CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but may also be a DSP digital signal processor, ASIC application specific integrated circuit, FPGA off-the-shelf programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The memory 120 is used to store programs or data. The Memory 120 may be RAM (Random Access Memory ), ROM (Read Only Memory), PROM (Programmable Read-Only Memory, programmable Read Only Memory), EPROM (Erasable Programmable Read-Only Memory, erasable Read Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory, electrically erasable Read Only Memory), or the like.
The intelligent network card 130 is used for signaling or data communication with other devices.
It will be appreciated that the architecture shown in fig. 2 is merely a schematic diagram of a database node server, which may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
For each database node server in the database cluster, the process of implementing the interaction method of the database provided by the embodiment of the invention is similar, and for brevity, any one database node server will be taken as an example.
Referring to fig. 3, fig. 3 is a flowchart illustrating an interaction method of a database according to an embodiment of the invention.
Step S202, when a message is sent, the message to be sent is identified, and when the message to be sent is a database interaction type message, the message to be sent is sent according to a preset reliability sending mechanism;
step S204, when receiving the message, identifying the message to be received, and receiving the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is a database interaction type message.
It will be appreciated that the intelligent network card in the database node server can act as both a transmitting side and a receiving side, and can also act as both a transmitting side and a receiving side. The above step S202 is used in a scenario where the intelligent network card is used as the transmitting side, and the step S204 is used in a scenario where the intelligent network card is used as the receiving side, so the execution sequence of the above step S202 and step S204 is not limited in the embodiment of the present invention.
The database interaction message may be understood as a message that is internally communicated with other database node servers in the database cluster when the database node servers perform interactive operations such as synchronization, keep-alive, backup and the like on the database.
In this embodiment, the processor in the database node server encapsulates the relevant content of the database into a UDP packet according to the UDP protocol, and sends the UDP packet to the intelligent network card through the network interface provided by the intelligent network card, so that the intelligent network card sends the packet, and at this time, the intelligent network card serves as a sending side.
The intelligent network card can identify the message to be sent when sending the message, namely, identify whether the message to be sent is a database interaction type message. For example, the identification may be performed according to the five-tuple characteristics in the message to be sent, or may be performed according to other characteristics, which is not limited by the embodiment of the present invention. If the intelligent network card recognizes that the message to be sent is the database interaction type message, the message to be sent is sent according to a preset reliability sending mechanism so as to ensure the reliability of database interaction.
And the intelligent network card in the database node server is used as a receiving side when receiving messages sent by other devices. The intelligent network card can identify the message to be received when receiving the message, namely, identify whether the message to be received is a database interaction type message carrying a corresponding mark. For example, the identification may be performed according to a specific flag or a specific encapsulation format in the message to be received, or may be performed according to other features, which is not limited by the embodiment of the present invention. If the intelligent network card recognizes that the message to be received is the database interaction type message carrying the corresponding mark, the message to be received is received according to a preset reliability receiving mechanism so as to ensure the reliability of database interaction.
Based on the steps, the database node server communicates with other database node servers in the database cluster through the UDP user datagram protocol, the intelligent network card in the database node server identifies the message to be sent when sending the message, and sends the message to be sent according to a preset reliability sending mechanism when the message to be sent is a database interaction type message; the intelligent network card identifies the message to be received when receiving the message, and receives the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is the database interaction type message carrying the corresponding mark. Compared with the prior art adopting a TCP mode, the invention adopts UDP to realize high-efficiency communication among all database node servers in the database cluster, and identifies the message through the intelligent network card to send and receive the database interaction type message according to the set sending mechanism and receiving mechanism, thereby improving the interaction efficiency while ensuring the data interaction reliability and improving the performance of the database cluster.
Optionally, for the process of sending the message to be sent according to the preset reliability sending mechanism in step S202, a possible implementation manner is provided in the embodiment of the present invention, please refer to fig. 4.
Step S202-1, after caching the message to be sent to a cache space, copying the message to be sent to obtain a copied message;
in this embodiment, the intelligent network card has a buffer space for buffering the database interaction class messages. Buffer space is understood to be a reliable send queue, i.e. messages that enter this queue are sent according to a reliable send mechanism. The Buffer space can be implemented by using a Ring Buffer TX Ring Buffer technology, or can be implemented by using other Buffer methods, which is not limited by the embodiment of the present invention.
If the intelligent network card recognizes that the message to be sent is the database interaction type message, the message to be sent is cached to a cache space, and then the message to be sent is copied to obtain the copied message. It can be understood that for the database interaction message, the intelligent network card backs up the database interaction message so as to ensure the reliability of database interaction.
Step S202-3, marking the copied message to obtain a marked message and transmitting the marked message;
in this embodiment, the intelligent network card performs marking processing on the copied message, that is, marks the copied message as a database interaction type message requiring reliability guarantee, and then sends the marked message out through an ethernet interface of the intelligent network card and external communication, so that when the intelligent network card in other database node servers receives the message, the intelligent network card can be identified as the database interaction type message based on the mark.
Optionally, the process of marking the copied message provides two implementation manners, which are described below respectively.
First marking mode: setting a specific mark in the copied message to obtain a marked message. For example, the VFI logical interface attribute value of the VLAN (Virtual Local Area Network ) field in the replicated message may be set to 1. It should be understood that the specific mark and the specific manner of setting the mark may be set according to practical applications, and the embodiments of the present invention are not limited.
The second marking mode is as follows: and packaging the copied message into a message with a specific format to obtain a marked message. For example, the ethernet header of the copied message is encapsulated into a specific format, such as under the premise of complying with the IEEE 802 (local area network/metropolitan area network standard) or the like specification, and the ethernet type field is set to a specified value (e.g., 0x 1010). It should be understood that the format of the package may be set according to practical applications, and embodiments of the present invention are not limited.
Step S202-5A, if a response message corresponding to the marked message is received within a preset time period, clearing the message to be sent in a cache space;
step S202-5B, if a response message corresponding to the marked message is not received within a preset time period, repeating the steps of copying the message to be sent to obtain the copied message and marking the copied message to obtain the marked message and sending the marked message until the response message corresponding to the marked message is received;
in this embodiment, a timer is provided on the intelligent network card, and when the marked message is sent out, the timer is activated to record the duration of the response message corresponding to the received marked message.
If the response message corresponding to the marked message is received within a preset period of time, the message to be sent is cleared in a cache space such as a ring buffer. It will be appreciated that in this case, indicating that the intelligent network card in the other database node server successfully received the marked message, the "original" of the marked message may be cleared to free up buffer space.
If the response message corresponding to the marked message is not received within a preset period of time, i.e. after the timer waits for timeout, then a message to be sent is duplicated again and sent again after marking, i.e. the duplication of the message to be sent in the step S202-1 is repeatedly executed to obtain the duplicated message, and the step S202-3 is to mark the duplicated message to obtain the marked message and send the marked message until the response message corresponding to the marked message is received. It will be appreciated that in this case, if no corresponding response message is received, the transmission is repeated until the message transmission is successful, so as to ensure the reliability of the database interaction.
Optionally, if a large number of sent messages do not receive corresponding response messages all the time, original messages of the messages stay in the buffer space all the time, and then the buffer space is full, so that the embodiment of the invention provides an implementation manner, which further includes the following steps:
and when the buffer space has no residual space, sending a flow control message to a processor of the database node server where the intelligent network card is positioned so as to inform the processor of the database node server to stop sending the database interaction class message, and when the buffer space has the residual space, stopping sending the flow control message to the processor of the database node server where the intelligent network card is positioned so as to enable the processor of the database node server to continuously send the database interaction class message.
In this embodiment, when the buffer space is full, i.e. there is no remaining space, the intelligent network card will send a flow control message to the processor of the database node server where the intelligent network card is located, i.e. the processor is informed through the flow control message that the current buffer space cannot store a new database interaction class message, and after the processor receives the flow control message, the intelligent network card will stop sending the database interaction class message to the intelligent network card.
When the message is successfully sent, the original message of the message is cleared in the cache space, the cache space is left again, and then the intelligent network card stops sending the flow control message to the processor of the database node server where the intelligent network card is located, so that the processor can send the database interaction type message to the intelligent network card again.
Optionally, for the process of receiving the message to be received according to the preset reliability receiving mechanism in step S204, a possible implementation manner is provided in the embodiment of the present invention, please refer to fig. 5.
Step S204-1, generating a response message corresponding to the message to be received, and sending the response message corresponding to the message to be received;
step S204-3, obtaining the original message from the message to be received, so that the processor of the database node server performs the database interaction operation according to the original message.
In this embodiment, when the intelligent network card in the database node server receives a message through the ethernet interface in communication with the outside, the intelligent network card is used as the receiving side. The process of sending the message based on the reliability transmitter system marks the database interaction type message, so that the message to be received can be identified based on the mark under the condition that the intelligent network card is taken as the receiving side.
For example, taking the two marking modes provided above as examples, if a specific mark exists in the message to be received or the message to be received is in a specific format, the message to be received is a database interaction type message, and then the intelligent network card receives the message to be received according to a preset reliability receiving mechanism.
The intelligent network card generates a response message corresponding to the message to be received, and sends the response message out through an Ethernet interface for communication between the intelligent network card and the outside so as to inform the intelligent network card in a database node server for sending the message to be received of successfully receiving the message; and then, carrying out de-marking processing on the message to be received to obtain an original message, and sending the original message to the processor through a communication interface with the processor so that the processor carries out database interaction operation according to the original message.
Optionally, for the process of generating the response message corresponding to the message to be received in the step S204-1, the following two response manners are provided in the embodiment of the present invention.
First response mode: when the message to be received is one, generating a response message corresponding to the message to be received according to the sequence number in the message to be received and a preset response mark.
In this embodiment, the intelligent network card may respond to only one message to be received, that is, obtain a sequence number from the received message, and then generate a response message corresponding to the message to be received according to the sequence number and a preset response flag, that is, a Replay flag.
The second response mode: when a plurality of messages to be received are provided, a message is generated according to the serial number and the preset response mark in each message to be received, and the message is used as the response message corresponding to each message to be received.
In this embodiment, the intelligent network card may also perform batch response on multiple received messages at one time, that is, obtain its own sequence number from each message to be received, and generate a response message according to the sequence number in each message to be received and a preset response flag, that is, a Replay flag, where the response message is a response message corresponding to each message to be received.
Optionally, based on the two marking manners provided above, two corresponding marking manners are provided in the embodiment of the present invention, so as to obtain the original message from the message to be received in the step S204-3.
The first marking mode corresponds to the de-marking mode: and removing the specific mark in the message to be received to obtain an original message, wherein the message to be received is obtained after the specific mark is set in the original message.
In this embodiment, if a specific flag exists in the message to be received, that is, the message to be received is obtained after the specific flag is set in the original message, the intelligent network card will strip the specific flag from the message to be received by removing the specific flag, so as to obtain the original message.
The second marking mode corresponds to the de-marking mode: analyzing the specific format of the message to be received to obtain an original message, wherein the message to be received is obtained after the original message is packaged into the specific format.
In this embodiment, if the message to be received is in a specific format, that is, the message to be received is obtained after the original message is encapsulated into the specific format, the intelligent network card will adopt a format parsing method, for example, the ethernet header in the message to be received is decapsulated to obtain the original message.
In order to perform the above embodiments and corresponding steps in each possible way, an implementation of an interaction means of a database is presented below. Referring to fig. 6, fig. 6 is a functional block diagram of an interaction device 300 of a database according to an embodiment of the invention. It should be noted that, the basic principle and the technical effects of the interaction device 300 for a database provided in this embodiment are the same as those of the foregoing embodiments, and for brevity, reference may be made to the corresponding contents of the foregoing embodiments. The interaction means 300 of the database comprises:
the sending module 310 is configured to identify a message to be sent when the message is sent, and send the message to be sent according to a preset reliability sending mechanism when the message to be sent is a database interaction type message;
the receiving module 330 is configured to identify a message to be received when receiving the message, and receive the message to be received according to a preset reliability receiving mechanism when the message to be received is a database interaction type message.
Optionally, the sending module 310 is further configured to: after caching the message to be sent into a cache space, copying the message to be sent to obtain a copied message; marking the copied message to obtain a marked message and transmitting the marked message; if a response message corresponding to the marked message is received within a preset time period, clearing the message to be sent in a cache space; if the response message corresponding to the marked message is not received within the preset time length, repeating the steps of copying the message to be sent to obtain the copied message and marking the copied message to obtain the marked message and sending the marked message until the response message corresponding to the marked message is received.
Optionally, the sending module 310 is further configured to: setting a specific mark in the copied message to obtain a marked message, or packaging the copied message into a specific format to obtain the marked message.
Optionally, the sending module 310 is further configured to: and when the buffer space has no residual space, sending a flow control message to a processor of the database node server where the intelligent network card is positioned so as to inform the processor of the database node server to stop sending the database interaction class message, and when the buffer space has the residual space, stopping sending the flow control message to the processor of the database node server where the intelligent network card is positioned so as to enable the processor of the database node server to continuously send the database interaction class message.
Optionally, the receiving module 330 is further configured to: generating a response message corresponding to the message to be received, and sending the response message corresponding to the message to be received; and acquiring an original message from the message to be received, so that a processor of the database node server performs database interaction operation according to the original message.
Optionally, the receiving module 330 is further configured to: when the message to be received is one, generating a response message corresponding to the message to be received according to the serial number in the message to be received and a preset response mark; when a plurality of messages to be received are provided, a message is generated according to the serial number and the preset response mark in each message to be received, and the message is used as the response message corresponding to each message to be received.
Optionally, the receiving module 330 is further configured to: removing a specific mark in a message to be received to obtain an original message, wherein the message to be received is obtained after the specific mark is set in the original message; or analyzing the specific format of the message to be received to obtain the original message, wherein the message to be received is obtained after the original message is packaged into the specific format.
The embodiment of the invention also provides a database node server which is communicated with other database node servers in the database cluster through the UDP user datagram protocol, and comprises an intelligent network card, wherein the intelligent network card is used for realizing the interaction method of the database disclosed by the embodiment of the invention.
The embodiment of the invention also provides a database cluster, which comprises the database node server provided by the embodiment of the invention.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed, implements the interaction method of the database disclosed by the embodiment of the invention.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An interaction method of a database, which is characterized by being applied to an intelligent network card of a database node server, wherein the database node server communicates with other database node servers in a database cluster through a UDP user datagram protocol, and the method comprises the following steps:
when a message is sent, identifying the message to be sent, and sending the message to be sent according to a preset reliability sending mechanism under the condition that the message to be sent is a database interaction type message;
and when receiving the message, identifying the message to be received, and receiving the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is the database interaction type message.
2. The method of claim 1, wherein the intelligent network card has a buffer space for buffering the database interaction class messages;
the step of sending the message to be sent according to a preset reliability sending mechanism comprises the following steps:
after caching the message to be sent to the cache space, copying the message to be sent to obtain a copied message;
marking the copied message to obtain a marked message and sending the marked message;
if a response message corresponding to the marked message is received within a preset time, clearing the message to be sent in the cache space;
and if the response message corresponding to the marked message is not received within the preset time length, repeating the steps of copying the message to be sent to obtain the copied message and marking the copied message to obtain the marked message and sending the marked message until the response message corresponding to the marked message is received.
3. The method according to claim 2, wherein the step of marking the copied message to obtain a marked message comprises:
setting a specific mark in the copied message to obtain the marked message, or packaging the copied message into a specific format to obtain the marked message.
4. The method of claim 2, wherein the step of transmitting the message to be transmitted according to a preset reliability transmission mechanism further comprises:
and when the buffer space has no residual space, sending a flow control message to a processor of the database node server where the intelligent network card is located, so as to inform the processor of the database node server to stop sending the database interaction type message until the buffer space has the residual space, and stopping sending the flow control message to the processor of the database node server where the intelligent network card is located, so that the processor of the database node server continues sending the database interaction type message.
5. The method of claim 1, wherein the step of receiving the message to be received according to a predetermined reliability receiving mechanism comprises:
generating a response message corresponding to the message to be received, and sending the response message corresponding to the message to be received;
and acquiring an original message from the message to be received, so that a processor of the database node server performs database interaction operation according to the original message.
6. The method according to claim 1, wherein the step of generating a response message corresponding to the message to be received comprises:
when the message to be received is one, generating a response message corresponding to the message to be received according to the sequence number in the message to be received and a preset response mark;
when the number of the messages to be received is multiple, generating a message according to the serial number in each message to be received and a preset response mark, and taking the message as a response message corresponding to each message to be received.
7. The method of claim 5, wherein the step of obtaining the original message from the message to be received comprises:
removing a specific mark in the message to be received to obtain the original message, wherein the message to be received is obtained after the specific mark is set in the original message;
or analyzing the specific format of the message to be received to obtain the original message, wherein the message to be received is obtained after the original message is packaged into the specific format.
8. An interaction device of a database, wherein the interaction device is applied to an intelligent network card of a database node server, the database node server communicates with other database node servers in a database cluster through a UDP user datagram protocol, and the interaction device of the database comprises:
the sending module is used for identifying the message to be sent when the message is sent, and sending the message to be sent according to a preset reliability sending mechanism under the condition that the message to be sent is a database interaction type message;
and the receiving module is used for identifying the message to be received when the message is received, and receiving the message to be received according to a preset reliability receiving mechanism under the condition that the message to be received is the database interaction type message.
9. A database node server, characterized in that it communicates with other database node servers in a database cluster via UDP user datagram protocol, the database node server comprising an intelligent network card for implementing the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed, implements the method of any of claims 1 to 7.
CN202310572427.8A 2023-05-19 2023-05-19 Interaction method of database and related device Pending CN116567111A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310572427.8A CN116567111A (en) 2023-05-19 2023-05-19 Interaction method of database and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310572427.8A CN116567111A (en) 2023-05-19 2023-05-19 Interaction method of database and related device

Publications (1)

Publication Number Publication Date
CN116567111A true CN116567111A (en) 2023-08-08

Family

ID=87485862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310572427.8A Pending CN116567111A (en) 2023-05-19 2023-05-19 Interaction method of database and related device

Country Status (1)

Country Link
CN (1) CN116567111A (en)

Similar Documents

Publication Publication Date Title
US7797565B1 (en) System and method for maintaining communication protocol connections during failover
CN109245955B (en) Data processing method and device and server
WO2021128927A1 (en) Message processing method and apparatus, storage medium, and electronic apparatus
CN112214441B (en) Communication switching method, equipment and system based on serial bus polling protocol
CN108521371B (en) Message forwarding method and device
CN108306852B (en) Message middleware system and method based on simple binary coding
US6741566B1 (en) Remote management ethernet network and device
CN113300816A (en) Node positioning method, network transmission method, device and equipment
WO2021088813A1 (en) Packet encapsulating method and apparatus, and packet decapsulating method and apparatus
CN113472719A (en) Method, device and storage medium for protocol analysis of gatekeeper based on data ferry
CN112769939A (en) Big data reliable transmission method for real-time communication
EP3672189B1 (en) Data transmission method, device and system
CN108460044B (en) Data processing method and device
WO2016196486A1 (en) Systems and methods for improved trivial file transfer protocol
CN112039835B (en) Adaptive polling time estimation method, device, equipment and storage medium
CN113973091A (en) Message processing method, network equipment and related equipment
CN116567111A (en) Interaction method of database and related device
KR20150057347A (en) Method and apparatus for communication
CN108390828B (en) Message forwarding method and device
CN110798366B (en) Task logic processing method, device and equipment
CN111130941B (en) Network error detection method and device and computer readable storage medium
CN115883466B (en) Switch control method and device, storage medium and electronic device
CN112260923B (en) Bridge network information notification method and device
JP3217397B2 (en) Data transmission method of communication control device
CN117061072B (en) Message transmission method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination