Link keep-alive state determination method and device, equipment and storage medium

By utilizing the keep-alive mechanisms of user-state and kernel-state in the RoCE link, combined with the read operation of preset memory, the problem that RoCE link is difficult to quickly perceive exceptions is solved, and higher device availability and reliability are achieved.

CN119996490AActive Publication Date: 2025-05-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510386486.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-05-13
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

It is difficult to quickly perceive link abnormalities after problems occur in RoCE links, resulting in a decrease in device availability and reliability.

Method used

By establishing a link between the user state in the first device and the user state in the second device, the link keep-alive mechanism is determined based on the keep-alive information of the first target network card and the second target network card. When the link keep-alive mechanism is a kernel state keep-alive mechanism, the kernel state control first target network card reads memory values ​​from preset memory to quickly determine the link keep-alive state.

Benefits of technology

It realizes the rapid perception of the link keep-alive state between user states, improves the availability and reliability of the equipment, reduces the interaction process in the link keep-alive mechanism, and thus improves the accuracy of the link keep-alive mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996490A_ABST
    Figure CN119996490A_ABST
Patent Text Reader

Abstract

The invention provides a link keep-alive state determination method and device, equipment and a storage medium, and can be applied to the technical field of communication connection. The method comprises the following steps: determining a link keep-alive mechanism between a user mode in a first device and a user mode in a second device according to keep-alive information of a first target network card in the first device and keep-alive information of a second target network card in the second device; under the condition that the link keep-alive mechanism is a kernel mode keep-alive mechanism, based on a kernel mode in the first equipment, controlling a first target network card to read a memory value of the first target network card from a preset memory according to a keep-alive parameter of the first target network card and address information of the preset memory, and according to the read memory value, determining that the memory value of the first target network card is equal to the memory value of the first target network card; and determining a link keep-alive state between the user mode in the first device and the user mode in the second device, the memory value of the first target network card in the preset memory being set by the second target network card according to the first atomic operation request from the first target network card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication connection technology, and in particular to a method, device, equipment and storage medium for determining a link keep-alive status. Background Art

[0002] With the development of technologies such as the Internet, cloud computing, the Internet of Things, and mobile Internet, data has shown explosive growth, which has posed new challenges to the transmission efficiency of traditional data transmission networks. In the traditional network communication mode, a large amount of central processing unit (CPU) resources will be occupied during the data transmission process, resulting in high data transmission delay. To solve this problem, Remote Direct Memory Access (RDMA) technology came into being, which can significantly reduce the delay of data transmission and improve data processing efficiency.

[0003] As an Ethernet-based RDMA technology standard, RDMA over Converged Ethernet (RcCE) enables RDMA to run not only on InfiniBand networks but also on Ethernet. However, the Ethernet protocol is vulnerable to damage and loss, which makes it difficult to quickly detect RoCE link abnormalities after a problem occurs. Summary of the invention

[0004] In view of the above problems, the present application provides a link keep-alive status determination method, apparatus, device and storage medium.

[0005] According to a first aspect of the present application, a method for determining a link keep-alive state is provided, comprising: determining a link keep-alive mechanism between a user state in the first device and a user state in the second device according to keep-alive information of a first target network card in a first device and keep-alive information of a second target network card in a second device; in a case where the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device: controlling the first target network card to read a memory value of the first target network card from the preset memory according to a keep-alive parameter of the first target network card and address information of a preset memory, and determining a link keep-alive state between the user state in the first device and the user state in the second device according to the read memory value, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to a first atomic operation request from the first target network card.

[0006] A second aspect of the present application provides a link keep-alive status determination device, comprising: a determination module, used to determine the link keep-alive mechanism between the user state in the first device and the user state in the second device according to the keep-alive information of the first target network card in the first device and the keep-alive information of the second target network card in the second device; a control module, used to, when the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device: control the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory, and determine the link keep-alive status between the user state in the first device and the user state in the second device according to the read memory value, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic request from the first target network card.

[0007] The third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0008] The fourth aspect of the present application also provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0009] The fifth aspect of the present application also provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.

[0010] According to the link keep-alive state determination method, device, equipment and storage medium provided by the present application, when a link is established between the user state in the first device and the user state in the second device, the link keep-alive mechanism between the user states is determined according to the keep-alive information of the first target network card and the second target network card, so as to realize the selection of different link keep-alive mechanisms; when the link keep-alive mechanism is the kernel state keep-alive mechanism, the kernel state information in the first device controls the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory. Since the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic operation request from the first target network card, the link keep-alive state between the user state in the first device and the user state in the second device can be determined based on the memory value of the first target network card read from the preset memory. In addition, since the first target network card reads the memory value of the first target network card from the preset memory, the interaction process in the link keep-alive mechanism is reduced, and the accuracy of the link keep-alive mechanism is further improved. The kernel state controls the first target network card to read the memory value in the preset memory, so that the link keep-alive state between user states can be quickly perceived, so as to achieve the purpose of improving the availability and reliability of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above contents and other purposes, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:

[0012] Figure 1 A diagram schematically illustrates an application scenario of a method for determining a link keep-alive state according to an embodiment of the present application;

[0013] Figure 2 A flowchart of a method for determining a link keep-alive state according to an embodiment of the present application is schematically shown;

[0014] Figure 3 A flowchart for generating a network card configuration file according to an embodiment of the present application is schematically shown;

[0015] Figure 4 A schematic diagram of a keep-alive process for executing a user-mode keep-alive mechanism according to an embodiment of the present application is shown schematically;

[0016] Figure 5 A structural block diagram of a link keep-alive status determination device according to an embodiment of the present application is schematically shown; and

[0017] Figure 6 A block diagram of an electronic device suitable for implementing a link keep-alive status determination method according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0018] Below, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present application.

[0019] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0020] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0021] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0022] In the technical solution of the present application, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, application and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0023] RDMA is an innovative network communication technology that enables computers to directly access the memory of remote computers without the need for tedious data copying between local and remote computers, thereby significantly reducing data transmission latency and improving data processing efficiency. Therefore, RDMA occupies a vital position in network communications, especially in areas with extremely high requirements for network performance, such as high-performance computing, data centers, and cloud computing.

[0024] RoCE is an Ethernet-based RDMA technology standard that allows RDMA to run on Ethernet. However, the Ethernet protocol is vulnerable to damage and loss, which makes it difficult to quickly detect RoCE link abnormalities when problems occur.

[0025] To this end, an embodiment of the present application provides a link keep-alive status determination method to quickly sense the keep-alive status of a link.

[0026] Figure 1 The application scenario diagram of the link keep-alive status determination method according to an embodiment of the present application is schematically shown.

[0027] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first device 101, a second device 102, and a network 103. The network 103 is used to provide a medium for a communication link between the first device 101 and the second device 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0028] The first device 101 interacts with the second device 102 through the network 103 to receive or send messages, etc. The first device 101 and the second device 102 may be servers that provide various services.

[0029] For example, the link keep-alive mechanism between the user state in the first device 101 and the user state in the second device 102 can be determined based on the keep-alive information of the first target network card in the first device 101 and the keep-alive information of the second target network card in the second device 102, and when the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device 101, the first target network card is controlled to read the memory value of the first target network card from the preset memory according to the keep-alive parameters of the first target network card and the address information of the preset memory, so that the link keep-alive state between the user state in the first device 101 and the user state in the second device 102 can be determined based on the read memory value, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic operation request from the first target network card.

[0030] It should be noted that the link keep alive state determination method provided in the embodiment of the present application can generally be executed by the first device 101. Accordingly, the link keep alive state determination apparatus provided in the embodiment of the present application can generally be set in the first device 101.

[0031] It should be understood that Figure 1 The number of the first device, the second device, and the network in the embodiment is only for illustration. According to the implementation requirements, there may be any number of the first device, the second device, and the network.

[0032] The following will be based on Figure 1 The scene described by Figure 2~Figure 4 The link keep-alive status determination method of the embodiment of the present application is described in detail.

[0033] Figure 2 The flowchart of the link keep-alive status determination method according to an embodiment of the present application is schematically shown.

[0034] like Figure 2 As shown, the method 200 includes operation S210 and operation S220.

[0035] After the user state in the first device establishes a link with the user state in the second device, in order to quickly and accurately perceive the link keep-alive status between the user states, the first device is used to perform operations S210 and S220. Similarly, the second device also performs steps similar to the first device to perceive the link keep-alive status between the user states from the second device end.

[0036] The first device and the second device may be servers.

[0037] In operation S210, a link keepalive mechanism between a user state in the first device and a user state in the second device is determined according to keepalive information of a first target network card in the first device and keepalive information of a second target network card in the second device.

[0038] According to an embodiment of the present application, after the first target network card in the first device establishes a connection with the second target network card in the second device, keep-alive information will be transmitted between the first target network card and the second target network card, that is, the first target network card can send the keep-alive information of the first target network card to the second target network card, and similarly, the second target network card will also send the keep-alive information of the second target network card to the first target network card.

[0039] According to an embodiment of the present application, in the first device, the link keep-alive mechanism between the user state in the first device and the user state in the second device can be determined based on the keep-alive information of the first target network card and the keep-alive information received from the second target network card, so as to subsequently execute the corresponding link keep-alive mechanism.

[0040] The first target network card and the second target network card may be RoCE network cards.

[0041] According to an embodiment of the present application, the keep-alive information of the first target network card in the first device can be stored in a network card configuration file preconfigured in the first device. The keep-alive information of the second target network card in the second device can also be stored in a network card configuration file preconfigured in the second device.

[0042] Therefore, after the first target network card establishes a connection with the second target network card, the keep-alive information in the configuration files of the respective network cards is read, and the read keep-alive information is sent to the corresponding network card, that is, the first target network card sends the keep-alive information of the first target network card to the second target network card, and the second target network card sends the keep-alive information of the second target network card to the first target network card.

[0043] Figure 3 The flowchart of generating a network card configuration file according to an embodiment of the present application is schematically shown.

[0044] like Figure 3 As shown, the method 300 includes operations S310 to S350.

[0045] The first device and the second device may respectively perform operations S310 to S350 to generate respective network card configuration files, and read network card keep-alive information from the network card configuration files to determine a link keep-alive mechanism between a user state in the first device and a user state in the second device.

[0046] In operation S310, a configuration file is acquired.

[0047] In operation S320, it is detected whether there is a target network card in the target slot recorded in the configuration file.

[0048] According to an embodiment of the present application, when there is a target network card in the target slot, operation S330 is performed; when there is no target network card in the target slot, operation S340 is performed.

[0049] In operation S330, device information of the target network card in the target slot is recorded in a configuration file.

[0050] In operation S340, device information of the remaining network cards in the target slot is recorded in the configuration file, and device information of the network cards in the remaining slots is recorded in the configuration file.

[0051] In operation S350, a network card configuration file is generated.

[0052] According to an embodiment of the present application, different hardware platforms have different slots marked as supporting high-precision keep-alive, so a configuration file for precision keep-alive in the hardware platform is obtained. The configuration file records which slots are marked as supporting high-precision keep-alive and which slots are marked as not supporting high-precision keep-alive.

[0053] The hardware platform may include any one of the first device and the second device in the above operation S210; and the slot may refer to a peripheral component interconnect express (PCIE) address in the hardware platform.

[0054] According to an embodiment of the present application, the target slot is a slot marked as supporting high-precision keep-alive recorded in the configuration file, the remaining slots are slots marked as not supporting high-precision keep-alive recorded in the configuration file, the target network card is a RoCE network card, and the remaining network cards may be network cards other than the RoCE network card.

[0055] Based on the configuration file, it is detected whether there is a target network card in the target slot recorded in the configuration file, for example, whether there is a target network card inserted in the target slot.

[0056] If there is a target NIC in the target slot, the target NIC supports high-precision keep-alive, that is, supports accurate keep-alive; if there is a target NIC in other slots, the target NIC does not support high-precision keep-alive; if there are other NICs in the target slot, high-precision keep-alive is not supported either. Therefore, only when the target NIC is in the target slot can the target NIC support high-precision keep-alive.

[0057] According to an embodiment of the present application, the device information may include a slot number and keep-alive information, and the keep-alive information may indicate whether the network card supports high-precision keep-alive. The device information of the network cards in the target slot and other slots are recorded in a configuration file to generate a network card configuration file.

[0058] When a link is established between the user state in the first device and the user state in the second device, the network card configuration files are read respectively to identify whether the network cards loaded by the first device and the second device are target network cards, and when the network cards loaded by the first device and the second device are both target network cards, the keep-alive information of the first target network card and the second target network card is determined from the network card configuration files. The keep-alive parameters for the network cards in the network card configuration files can be set as needed.

[0059] In operation S220, when the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device: control the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory, and determine the link keep-alive state between the user state in the first device and the user state in the second device according to the read memory value.

[0060] The memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic operation request from the first target network card.

[0061] According to an embodiment of the present application, when the link keep-alive mechanism is determined to be a kernel-mode keep-alive mechanism based on the keep-alive information of the first target network card and the second target network card, the kernel-mode driver in the first device obtains the address information of the preset memory and the keep-alive parameters of the first target network card. The kernel-mode in the first device controls the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameters of the first target network card and the address information of the preset memory, so that the link keep-alive status between the user state in the first device and the user state in the second device can be determined according to the read memory value.

[0062] According to an embodiment of the present application, when a link is established between a user state in a first device and a user state in a second device, a link keep-alive mechanism between user states is determined according to the keep-alive information of each of the first target network card and the second target network card, so as to realize the selection of different link keep-alive mechanisms; when the link keep-alive mechanism is a kernel state keep-alive mechanism, the kernel state information in the first device controls the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory. Since the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic operation request from the first target network card, the link keep-alive state between the user state in the first device and the user state in the second device can be determined based on the memory value of the first target network card read from the preset memory. In addition, since the first target network card reads the memory value of the first target network card from the preset memory, the interaction process in the link keep-alive mechanism is reduced, and the accuracy of the link keep-alive mechanism is further improved. The kernel state controls the first target network card to execute the reading of the memory value in the preset memory, so that the link keep-alive state between the user states can be quickly perceived, so as to achieve the purpose of improving the availability and reliability of the device.

[0063] According to an embodiment of the present application, the first target network card is controlled to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory, and the link keep-alive state between the user state in the first device and the user state in the second device is determined according to the read memory value, including: controlling the first target network card to repeatedly read the memory value of the first target network card at a first time interval until the number of repeated readings is equal to the number of retries or the read memory value is consistent with the expected value; when the read memory value is consistent with the expected value and the number of repeated readings is less than or equal to the number of retries, determining that the link keep-alive state is that the link connection between the user state in the first device and the user state in the second device is normal.

[0064] The keep-alive parameters may include a first time interval and a number of retries.

[0065] According to an embodiment of the present application, the kernel state in the first device controls the first target network card to periodically read the memory value of the first target network card in the preset memory at a first time interval.

[0066] When the link connection between the user state in the first device and the user state in the second device is normal, the memory value of the first target network card read from the preset memory at the first time interval by the first target network card should be consistent with the expected value. When the memory value read by the first target network card is inconsistent with the expected value, the kernel state controls the first target network card to repeatedly read the memory value of the first target network card in the preset memory at the first time interval.

[0067] When the read memory value is consistent with the expected value and the number of repeated reads is less than or equal to the number of retries, the link keep-alive status is determined to be that the link connection between the user state in the first device and the user state in the second device is normal, that is, within the number of retries, the repeatedly read memory value is consistent with the expected value, then it can be determined that the link connection between the user state in the first device and the user state in the second device is normal.

[0068] According to an embodiment of the present application, it is possible to quickly determine that the link connection between user states is normal by only reading the memory value of the first target network card in the preset memory, and when the number of repeated reads is less than or equal to the number of retries, the read memory value is consistent with the expected value.

[0069] According to an embodiment of the present application, the above-mentioned link keep-alive status determination method also includes: when the read memory value is inconsistent with the expected value and the number of repeated readings is equal to the number of retries, determining that the link keep-alive status is an abnormal link connection between the user state in the first device and the user state in the second device.

[0070] According to an embodiment of the present application, when the number of repeated reads is equal to the number of retries, if the read memory value is still inconsistent with the expected value, the link connection between the user state in the first device and the user state in the second device is abnormal, so that the link between the user state in the first device and the user state in the second device can be controlled to be disconnected.

[0071] According to an embodiment of the present application, if the memory value is still inconsistent with the expected value within the number of retries, the link keep-alive status between user states can be quickly perceived, and the link connection abnormality between user states can be specifically determined.

[0072] According to an embodiment of the present application, the above-mentioned link keep-alive status determination method also includes: in response to a second atomic operation request from the second target network card, controlling the first target network card to compare the memory value of the second target network card read from a preset area of ​​the second target network card with the first comparison value in the second atomic operation request; when the memory value of the second target network card read is consistent with the first comparison value, controlling the first target network card to update the memory value of the second target network card using the first update value in the second atomic operation request.

[0073] According to an embodiment of the present application, when a link is established between a user state in a first device and a user state in a second device, the first target network card and the second target network card interact with each other in address information of a preset memory, that is, the first target network card sends the address information of the preset memory of the first target network card to the second target network card, and the second target network card sends the address information of the preset memory of the second target network card to the first target network card.

[0074] According to an embodiment of the present application, the second target network card periodically sends a second atomic operation request to the first target network card at a first time interval. When the first target network card receives the second atomic operation request from the second target network card, the kernel state in the first device controls the first target network card to read the memory value of the second target network card from the preset memory of the second target network card according to the address information of the preset memory of the second target network card. The read memory value of the second target network card is compared with the first comparison value carried in the second atomic operation request to determine whether the last atomic operation of the first target network card was successfully executed. Among them, the first comparison value represents the updated memory value of the second target network card in the preset memory of the second target network card when the first target network card successfully executed the atomic operation last time.

[0075] According to an embodiment of the present application, when the read memory value of the second target network card is consistent with the first comparison value, the first target network card is controlled to update the memory value of the second target network card using the first update value carried in the second atomic operation request.

[0076] For example, when the first target network card successfully performed an atomic operation last time, the memory value of the second target network card in the preset memory of the second target network card was updated to 3. During the process of the first target network card performing the atomic operation this time, the first comparison value carried in the second atomic operation request is 3. If the memory value of the second target network card read by the first target network card from the preset memory of the second target network card is 3, that is, the memory value of the second target network card read is consistent with the first comparison value carried in the second atomic operation request, then the memory value of the second target network card can be updated using the first update value carried in the second atomic operation request.

[0077] According to an embodiment of the present application, when a second atomic operation request is received from a second target network card, the first target network card is controlled to compare the read memory value of the second target network card with the first comparison value in the second atomic operation request to see whether they are consistent with the first comparison value, so that when the read memory value of the second target network card is consistent with the first comparison value, the memory value of the second target network card in the preset memory of the second target network card is updated using the first update value. This is beneficial for the subsequent second target network card to read the memory value in the preset memory and judge the link keep-alive status between the user state in the first device and the user state in the second device based on whether the read memory value is consistent with the expected value.

[0078] According to an embodiment of the present application, the above-mentioned link keep-alive status determination method also includes: controlling the first target network card to periodically send a first atomic operation request to the second target network card at a first time interval, so that the second target network card updates the memory value of the first target network card according to the second update value and the second comparison value in the first atomic operation request.

[0079] According to an embodiment of the present application, the first target network card can also periodically send a first atomic operation request to the second target network card at a first time interval, so that at the second device end, the memory value in the preset memory of the first target network card is updated according to the second update value and the second comparison value carried in the first atomic operation request.

[0080] According to an embodiment of the present application, the first target network card may also periodically send a first atomic operation request to the second target network card at a first time interval, so that the second target network card updates the memory value in the preset memory of the first target network card, so that the first target network card can subsequently determine whether the link connection between the user state in the first device and the user state in the second device is abnormal based on whether the read memory value is consistent with the expected value.

[0081] The expected value used for comparison with the read memory value of the first target network card may represent the memory value of the first target network card after the second target network card last executed an atomic operation and updated the memory in the preset memory.

[0082] For example, when the link connection between the user state in the first device and the user state in the second device is normal, the memory value of the first target network card after the second target network card executes an atomic operation and updates the preset memory is 2. On this basis, the expected value is 2, and if the memory value in the preset memory read by the first target network card is 2, the read memory value is consistent with the expected value, indicating that the link connection between the user state in the first device and the user state in the second device is normal.

[0083] Since kernel state control performs atomic operations, the accuracy of the first time interval in kernel state can be controlled in milliseconds, microseconds, and nanoseconds. To avoid additional CPU overhead, the first time interval can be controlled in milliseconds.

[0084] According to an embodiment of the present application, a link keep-alive mechanism between a user state in the first device and a user state in the second device is determined based on keep-alive information of a first target network card in a first device and keep-alive information of a second target network card in a second device, including: when the keep-alive information of the first target network card indicates that the first target network card supports precise keep-alive and the keep-alive information of the second target network card indicates that the second target network card supports precise keep-alive, determining that the link keep-alive mechanism between the user state in the first device and the user state in the second device is a kernel state keep-alive mechanism; when the keep-alive information of the first target network card indicates that the first target network card does not support precise keep-alive and / or the keep-alive information of the second target network card indicates that the second target network card does not support precise keep-alive, determining that the link keep-alive mechanism between the user state in the first device and the user state in the second device is a user state keep-alive mechanism.

[0085] The link keep-alive mechanism may include a kernel-mode keep-alive mechanism and a user-mode keep-alive mechanism.

[0086] According to an embodiment of the present application, when a connection is established between a first target network card and a second target network card, and when the keep-alive information of the first target network card indicates that the first target network card supports precise keep-alive and the keep-alive information of the second target network card indicates that the second target network card supports precise keep-alive, it can be determined that the link keep-alive mechanism between the user state in the first device and the user state in the second device is a kernel state keep-alive mechanism.

[0087] According to an embodiment of the present application, when the keep-alive information of the first target network card indicates that the first target network card does not support precise keep-alive and / or the keep-alive information of the second target network card indicates that the second target network card does not support precise keep-alive, that is, there is at least one keep-alive information in the keep-alive information of the first target network card and the keep-alive information of the second target network card indicating that precise keep-alive is not supported, it can be determined that the link keep-alive mechanism between the user state in the first device and the user state in the second device is a user state keep-alive mechanism.

[0088] According to an embodiment of the present application, based on the respective keep-alive information of the first target network card and the second target network card, it can be determined whether to execute the kernel state keep-alive mechanism or the user state keep-alive mechanism subsequently, thereby achieving compatibility of the two link keep-alive mechanisms and realizing the reuse of network cards.

[0089] According to an embodiment of the present application, when the link keep-alive mechanism is a user-state keep-alive mechanism, the above-mentioned link keep-alive status determination method also includes: controlling the first target network card to periodically send a keep-alive request to the second target network card at a second time interval; when the first target network card does not receive a keep-alive response from the second target network card within a preset time period, controlling the link between the user state in the first device and the user state in the second device to be disconnected.

[0090] According to an embodiment of the present application, when the link keep-alive mechanism is a user-state keep-alive mechanism, the first target network card is controlled to periodically send a keep-alive request to the second target network card at a second time interval, and when the connection between the user state in the first device and the user state in the second device is normal, the first target network card should receive a keep-alive response from the second target network card within a preset time period. The preset time period is a preset multiple of the second time interval.

[0091] According to an embodiment of the present application, when the first target network card does not receive a keep-alive response from the second target network card within a preset time period, it can be determined that the second target network card has timed out, that is, the link connection between the user state in the first device and the user state in the second device is abnormal, and the link between the user state in the first device and the user state in the second device can be controlled to be disconnected.

[0092] Figure 4 A schematic diagram of a keep-alive process for executing a user-mode keep-alive mechanism according to an embodiment of the present application is schematically shown.

[0093] like Figure 4 As shown, for the user state keep-alive mechanism, the Remote Direct Memory Access Connection Manager (RDMA CM) protocol is used, the first device (initiator end) 401 initiates a link request to the second device (target end) 402, and the second device 402 returns a link response to create a RoCE link between the user state in the first device and the user state in the second device.

[0094] After the link is established, when the connection between the user state in the first device and the user state in the second device is normal, the first target network card in the first device periodically sends a keepalive request (keepalive command) to the second target network card at a second time interval, and the second target network card in the second device responds according to the received keepalive request and sends a keepalive response to the first target network card.

[0095] Similarly, the second device may also execute a user state keep-alive mechanism, that is, execute operations similar to those of the first device, to determine whether the link connection between the user state in the first device and the user state in the second device is abnormal at the second device end.

[0096] According to an embodiment of the present application, when the link keepalive mechanism is a user state keepalive mechanism, the first target network card promptly determines whether the connection between the user state in the first device and the user state in the second device is abnormal by sending a keepalive request and receiving a keepalive response.

[0097] Based on the above content, the link keep-alive status determination method of the present application pre-scans the RoCE network card at a specific location through the PCIE protocol to generate a network card configuration file that records the keep-alive information of the network card, so as to be used to determine the link keep-alive mechanism based on the keep-alive information of the network card, that is, to determine whether to use the user-state keep-alive mechanism or the kernel-state keep-alive mechanism, and improve the second-level keep-alive mechanism, so that the link keep-alive status of both ends can be quickly perceived, so as to achieve the purpose of improving the availability and reliability of the equipment.

[0098] Based on the above-mentioned link keep-alive status determination method, the present application also provides a link keep-alive status determination device. Figure 5 The device is described in detail.

[0099] Figure 5 The structural block diagram of a link keep-alive status determination device according to an embodiment of the present application is schematically shown.

[0100] like Figure 5 As shown, the link keep-alive status determining device 500 of this embodiment includes a determining module 510 and a first control module 520 .

[0101] The determination module 510 is used to determine the link keepalive mechanism between the user state in the first device and the user state in the second device according to the keepalive information of the first target network card in the first device and the keepalive information of the second target network card in the second device. In one embodiment, the determination module 510 can be used to perform the operation S210 described above, which will not be repeated here.

[0102] The first control module 520 is used to control the first target network card to read the memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory, and determine the link keep-alive state between the user state in the first device and the user state in the second device according to the read memory value, when the link keep-alive mechanism is the kernel state keep-alive mechanism, based on the kernel state in the first device, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic request from the first target network card. In one embodiment, the first control module 520 can be used to perform the operation S220 described above, which will not be repeated here.

[0103] According to an embodiment of the present application, the keep-alive parameters include a first time interval and a number of retries; the first control module 520 includes a control unit and a first determination unit.

[0104] The control unit is used to control the first target network card to repeatedly read the memory value of the first target network card at a first time interval until the number of repeated readings is equal to the number of retries or the read memory value is consistent with the expected value.

[0105] The first determination unit is used to determine that the link keep-alive state is that the link connection between the user state in the first device and the user state in the second device is normal when the read memory value is consistent with the expected value and the number of repeated readings is less than or equal to the number of retries.

[0106] According to an embodiment of the present application, the first control module 520 further includes a second determining unit.

[0107] The second determination unit is used to determine that the link keep-alive state is an abnormal link connection between the user state in the first device and the user state in the second device when the read memory value is inconsistent with the expected value and the number of repeated readings is equal to the number of retries.

[0108] According to an embodiment of the present application, the link keep-alive status determining device 500 further includes a second control module and an updating module.

[0109] The second control module is used for controlling the first target network card to compare the memory value of the second target network card read from the preset area of ​​the second target network card with the first comparison value in the second atomic operation request in response to the second atomic operation request from the second target network card.

[0110] The update module is used to control the first target network card to update the memory value of the second target network card using the first update value in the second atomic operation request when the read memory value of the second target network card is consistent with the first comparison value.

[0111] According to an embodiment of the present application, the link keep-alive status determining device 500 further includes a third control module.

[0112] The third control module is used to control the first target network card to periodically send a first atomic operation request to the second target network card at a first time interval, so that the second target network card updates the memory value of the first target network card according to the second update value and the second comparison value in the first atomic operation request.

[0113] According to an embodiment of the present application, the link keep-alive mechanism includes a kernel-mode keep-alive mechanism and a user-mode keep-alive mechanism; the determination module 510 includes a third determination unit and a fourth determination unit.

[0114] The third determination unit is used to determine that the link keepalive mechanism between the user state in the first device and the user state in the second device is a kernel state keepalive mechanism when the keepalive information of the first target network card indicates that the first target network card supports precise keepalive and the keepalive information of the second target network card indicates that the second target network card supports precise keepalive.

[0115] The fourth determination unit is used to determine that the link keep-alive mechanism between the user state in the first device and the user state in the second device is a user state keep-alive mechanism when the keep-alive information of the first target network card indicates that the first target network card does not support precise keep-alive and / or the keep-alive information of the second target network card indicates that the second target network card does not support precise keep-alive.

[0116] According to an embodiment of the present application, the link keep-alive status determining device 500 further includes a fourth control module and a fifth control module.

[0117] The fourth control module is configured to control the first target network card to periodically send a keep-alive request to the second target network card at a second time interval when the link keep-alive mechanism is a user mode keep-alive mechanism.

[0118] The fifth control module is used to control the link between the user state in the first device and the user state in the second device to be disconnected when the first target network card does not receive a keep-alive response from the second target network card within a preset time period.

[0119] According to an embodiment of the present application, any multiple modules in the determination module 510 and the first control module 520 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present application, at least one of the determination module 510 and the first control module 520 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the determination module 510 and the first control module 520 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0120] Figure 6 A block diagram of an electronic device suitable for implementing a link keep-alive status determination method according to an embodiment of the present application is schematically shown.

[0121] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0122] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present application by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present application by executing the program stored in the one or more memories.

[0123] According to an embodiment of the present application, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0124] The present application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present application is implemented.

[0125] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present application, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0126] The embodiment of the present application also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the link keep-alive state determination method provided in the embodiment of the present application.

[0127] The above functions defined in the system / device of the embodiment of the present application are performed when the computer program is executed by the processor 601. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0128] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0129] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.

[0130] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages, and specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present application may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present application.

[0133] The embodiments of the present application are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present application. Although each embodiment is described above, this does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present application, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present application.

Claims

1. A method for determining a link keep-alive state, characterized in that: The method comprises: Determine a link keepalive mechanism between a user state in the first device and a user state in the second device according to keepalive information of a first target network card in the first device and keepalive information of a second target network card in the second device; When the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device: Control the first target network card to read a memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and the address information of the preset memory, and determine the keep-alive state of the link between the user state in the first device and the user state in the second device according to the read memory value, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic operation request from the first target network card.

2. The method according to claim 1, characterized in that The keep-alive parameter includes a first time interval and a number of retries; the controlling the first target network card to read a memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and address information of the preset memory, and determining a link keep-alive state between a user state in the first device and a user state in the second device according to the read memory value, includes: Controlling the first target network card to repeatedly read the memory value of the first target network card at a first time interval until the number of repeated readings is equal to the number of retries or the read memory value is consistent with an expected value; When the read memory value is consistent with the expected value and the number of repeated reads is less than or equal to the number of retries, the link keep-alive state is determined to be that the link connection between the user state in the first device and the user state in the second device is normal.

3. The method according to claim 2, characterized in that The method further comprises: When the read memory value is inconsistent with the expected value and the number of repeated reads is equal to the number of retries, the link keep-alive state is determined as an abnormal link connection between the user state in the first device and the user state in the second device.

4. The method according to claim 2, characterized in that: The method further comprises: In response to a second atomic operation request from the second target network card, controlling the first target network card to compare a memory value of the second target network card read from a preset area of ​​the second target network card with a first comparison value in the second atomic operation request; When the read memory value of the second target network card is consistent with the first comparison value, the first target network card is controlled to update the memory value of the second target network card using the first update value in the second atomic operation request.

5. The method according to claim 4, characterized in that The method further comprises: The first target network card is controlled to periodically send a first atomic operation request to the second target network card at the first time interval, so that the second target network card updates the memory value of the first target network card according to the second update value and the second comparison value in the first atomic operation request.

6. The method according to claim 1, characterized in that The link keep-alive mechanism includes the kernel state keep-alive mechanism and the user state keep-alive mechanism; the determining the link keep-alive mechanism between the user state in the first device and the user state in the second device according to the keep-alive information of the first target network card in the first device and the keep-alive information of the second target network card in the second device includes: When the keep-alive information of the first target network card indicates that the first target network card supports precise keep-alive and the keep-alive information of the second target network card indicates that the second target network card supports precise keep-alive, determining that the link keep-alive mechanism between the user state in the first device and the user state in the second device is the kernel state keep-alive mechanism; When the keep-alive information of the first target network card indicates that the first target network card does not support precise keep-alive and / or the keep-alive information of the second target network card indicates that the second target network card does not support precise keep-alive, determine that the link keep-alive mechanism between the user state in the first device and the user state in the second device is the user state keep-alive mechanism.

7. The method according to claim 6, characterized in that In the case where the link keep-alive mechanism is the user state keep-alive mechanism, the method further includes: Controlling the first target network card to periodically send a keep-alive request to the second target network card at a second time interval; When the first target network card does not receive a keep-alive response from the second target network card within a preset time period, the link between the user state in the first device and the user state in the second device is controlled to be disconnected.

8. A link keep-alive status determination device, characterized in that: The device comprises: A determination module, configured to determine a link keepalive mechanism between a user state in the first device and a user state in the second device according to keepalive information of a first target network card in the first device and keepalive information of a second target network card in the second device; A control module, configured to, when the link keep-alive mechanism is a kernel state keep-alive mechanism, based on the kernel state in the first device: Control the first target network card to read a memory value of the first target network card from the preset memory according to the keep-alive parameter of the first target network card and address information of the preset memory, and determine the keep-alive state of the link between the user state in the first device and the user state in the second device according to the read memory value, wherein the memory value of the first target network card in the preset memory is set by the second target network card according to the first atomic request from the first target network card.

9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Link state determination method and device of physical layer equipment, equipment and storage medium

    CN116366520A

  • Method and device for acquiring network throughput data in real time

    CN117155827A

  • Multi-petascale highly efficient parallel supercomputer

    US20110219208A1