Method, apparatus and device for determining cluster network card, and readable storage medium

US11979368B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11979368-B2
Application numberUS-202017779356-A
CountryUS
Kind codeB2
Filing dateJul 23, 2020
Priority dateNov 24, 2019
Publication dateMay 7, 2024
Grant dateMay 7, 2024

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A method and device for determining a cluster network card, and a computer readable storage medium. The method comprises: reading a network segment of a Cluster IP from a configuration file of a current node; determining the type of the network segment of the Cluster IP by means of an address string in the network segment of the Cluster IP; obtaining an IP and a network card corresponding to the type of the network segment of the Cluster IP on the current node; and calculating the network segment of each IP, determining the IP corresponding to the network segment with the same address string as a Cluster IP, and determining the network card where the IP is located as a cluster network card. According to the disclosure, the cluster network card can be automatically and accurately found according to the configuration file.

First claim

Opening claim text (preview).

What is claimed is: 1. A method for determining a cluster network card for a distributed storage cluster, comprising: reading a network segment of Cluster IP from a configuration file of a current node, wherein the Cluster IP is an IP used for communication between OSD modules inside the distributed storage cluster; determining a type of the network segment of Cluster IP by means of an address string in the network segment of Cluster IP; obtaining IPs and network cards corresponding to the type of the network segment of Cluster IP on the current node; and calculating a network segment of each IP of the IPs obtained on the current node, comparing the network segment of each IP with the address string, determining the IP corresponding to the same network segment as that of the address string to be the Cluster IP, and determining the network card where the Cluster IP is located to be the cluster network card for the distributed storage cluster; when the type of the network segment of Cluster IP is an IPv4 type of network segment, the step of obtaining IPs and network cards corresponding to the type of the network segment of Cluster IP on the current node comprises: obtaining IPs and network cards corresponding to the IPv4 type of network segment on the current node by means of an ioctl function; the step of calculating a network segment of each IP of the IPs obtained on the current node, comparing the network segment of each IP with the address string, and determining the IP corresponding to the same network segment as that of the address string to be the Cluster IP comprises: performing shift processing on four parts in each IP corresponding to the IPv4 type of network segment respectively to obtain four first integers by left-shifting the four parts in each IP by 24 bits, 16 bits, 8 bits, and 0 bit in sequence from left to right, and performing a bitwise AND operation on the four first integers to obtain one second integer; performing a bitwise AND operation on the second integer and a converted mask to obtain a first value, wherein the converted mask is obtained by performing left shift operation on a mask in the network segment of Cluster IP; and comparing the first value with a second value, and determining the IP corresponding to the first value to be the Cluster IP when the first value is the same as the second value, wherein the second value is obtained by performing a bitwise AND operation on a third integer and the converted mask, and the third integer is obtained by performing shift processing and a bitwise AND operation on the address string in the network segment of Cluster IP, wherein the shift processing is performed by left-shifting four parts of the address string by 24 bits, 16 bits, 8 bits, and 0 bit in sequence from left to right. 2. The method for determining a cluster network card according to claim 1 , wherein, when the type of the network segment of Cluster IP is an IPv6 type of network segment, the step of obtaining IPs and network cards corresponding to the type of the network segment of Cluster IP on the current node comprises: obtaining IPs and network cards corresponding to the IPv6 type of network segment on the current node by means of a getifaddrs function. 3. The method for determining a cluster network card according to claim 2 , wherein, when the IPs and the network cards corresponding to the IPv6 type of network segment on the current node are obtained by means of the getifaddrs function, the method further comprises: obtaining a mask of each IP, and calculating a mask length of each IP; and comparing the mask length of each IP with a length of the mask in the network segment of Cluster IP, and discarding the IP if the mask length of the IP is inconsistent with the length of the mask in the network segment of Cluster IP. 4. The method for determining a cluster network card according to claim 2 , wherein, if the mask length of the IP is consistent with the length of the mask in the network segment of Cluster IP, the step of calculating a network segment of each IP of the IPs obtained on the current node, comparing the network segment of each IP with the address string, and determining the IP corresponding to the same network segment as that of the address string to be the Cluster IP comprises: converting and storing the IP, which corresponds to the IPv6 type of network segment and has a mask length consistent with the length of the mask in the network segment of Cluster IP, into four integers so as to obtain first data; performing AND operation on the first data and second data, and placing an operation result into the first data correspondingly so as to obtain post-operation first data, wherein the second data is obtained by converting the mask in the network segment of Cluster IP, and the second data comprises four elements with a prefix in the form of successive 1; and comparing the post-operation first data with third data, and determining the IP corresponding to the post-operation first data to be the Cluster IP if respective values in the post-operation first data are correspondingly the same as respective values in the third data, wherein the third data is obtained by converting the address string in the network segment of Cluster IP into IP address data, and converting and storing the IP address data into four integers. 5. A device for determining a cluster network card, comprising: a memory, configured to store a computer program; and a processor, configured to implement steps of the method for determining a cluster network card according to of claim 1 when executing the computer program. 6. A non-transitory computer readable storage medium, wherein, the non-transitory computer readable storage medium stores a computer program; and the computer program implements the steps of the method for determining a cluster network card according to of claim 1 when executed by a processor.

Assignees

Inventors

Classifications

  • Internet protocol [IP] addresses · CPC title

  • for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection (management of faults, events, alarms or notifications in data switching networks H04L41/06) · CPC title

  • Internet protocol version 6 [IPv6] addresses · CPC title

  • using masks or ranges of addresses · CPC title

  • Departure or maintenance mechanisms · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11979368B2 cover?
A method and device for determining a cluster network card, and a computer readable storage medium. The method comprises: reading a network segment of a Cluster IP from a configuration file of a current node; determining the type of the network segment of the Cluster IP by means of an address string in the network segment of the Cluster IP; obtaining an IP and a network card corresponding to th…
Who is the assignee on this patent?
Inspur Electronic Information Industry Co Ltd
What technology area does this patent fall under?
Primary CPC classification H04L61/5007. Mapped technology areas include Electricity.
When was this patent published?
Publication date Tue May 07 2024 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 6 related publications on this page (citations in our corpus or others sharing the same primary CPC).