IP Library › Granted Patent US 11,388,220
Granted Patent B2
US 11,388,220 · App. 16/589,729 · Granted Jul 12, 2022

Image distribution method and apparatus, and image obtaining method and apparatus

Inventor: Keyang Xie (Shenzhen, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
H04L67/06G06F16/583H04L9/3236H04L9/3297H04L2209/38
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,388,220
App. No.
16/589,729
Granted
Jul 12, 2022
Kind
B2
Abstract

A method and apparatus pertaining to the field of network technologies include generating interplanetary file system (IPFS) metadata of a first image and an IPFS metadata identifier of the first image based on pieces of block data of the first image, storing the pieces of block data of the first image to storage locations corresponding to the address information in an IPFS repository of the node device, and adding the IPFS metadata identifier of the first image to a distributed hash table (DHT) of a distributed file system. A node device is configured to locally construct and store the image without depending on a central repository server, and publish the image by adding the IPFS metadata identifier corresponding to the IPFS metadata of the image to the DHT to enable another node device to obtain the image based on the DHT.

Claims (63)

1. An image distribution method, applied to a node device in a distributed file system, comprising:

generating interplanetary file system (IPFS) metadata of a first image, wherein generating the IPES metadata comprises organizing pieces of block data of the first image based on a Merkle database availability group (DAG) algorithm, and wherein the IPFS metadata comprises a first image identifier, first image version information, a name of the node device, and names and address information of the pieces of block data;

generating an IPFS metadata identifier of the first image based on a plurality of pieces of block data of the first image, and wherein generating the IPFS metadata identifier comprises performing image service-customized encoding and hash encoding on the first image identifier to obtain the IPFS metadata identifier, and wherein the IPFS metadata identifier indexes the IPFS metadata;

comparing the IPFS metadata identifier of the image with IPFS metadata identifiers in a distributed hash table (DHT), wherein the DHT comprises IPFS metadata identifiers of images published by a plurality of node devices in the distributed file system;

storing the pieces of block data in storage locations corresponding to the address information in an IPFS repository of the node device; and

adding the IPFS metadata identifier to the DHT.

2. The image distribution method of claim 1 , wherein adding the IPFS metadata identifier to the DHT comprises:

receiving a publication request for the first image, wherein the publication request carries the first image identifier;

obtaining the IPFS metadata identifier based on the first image identifier; and

adding the IPFS metadata identifier to the DHT.

3. The image distribution method of claim 1 , wherein the IPFS metadata further comprises first version information of the first image, and wherein storing the pieces of block data comprises:

determining, based on the first image identifier, whether a second image exists in the IPFS repository, wherein a second image identifier of the second image is the same as the first image identifier; and

storing the pieces of block data in the storage locations when the second image exists and second version information of the second image is different from the first version information.

4. An image obtaining method, applied to a first node device in a distributed file system, comprising:

receiving a first obtaining request for an image, wherein the first obtaining request carries an image identifier of the image;

performing image service-customized encoding and hash encoding on the image identifier-to obtain an interplanetary file system (IPFS) metadata identifier of the image;

comparing the IPFS metadata identifier of the image with IPFS metadata identifiers in a distributed hash table (DHT), wherein the DHT comprises IPFS metadata identifiers of images published by a plurality of node devices in the distributed file system, and wherein an IPFS metadata identifier indexes IPFS metadata of the image;

obtaining the IPFS metadata corresponding to the IPFS metadata identifier of the image when the IPFS metadata identifier of the image exists in the DHT, wherein the IPFS metadata comprises pieces of block data arranged based on a Merkle database availability group (DAG) algorithm; and

obtaining the image based on the IPFS metadata.

5. The image obtaining method of claim 4 , wherein obtaining the IPFS metadata comprises:

sending a second obtaining request to the DHT, wherein the second obtaining request instructs the DHT to obtain the IPFS metadata from the node devices; and

receiving a request result from the DHT, wherein the request result carries the IPFS metadata.

6. The image obtaining method of claim 4 , wherein obtaining the image comprises:

obtaining, based on a name of a second node device in which the image is located and address information of a plurality of pieces of block data of the image, the pieces of block data from the second node device, wherein the IPFS metadata comprises the name and the address information; and

obtaining the image based on the pieces of block data.

7. A node device, in a distributed file system, comprising:

a memory configured to store executable instructions; and

a processor coupled to the memory, wherein when executed by the processor, the executable instructions cause the processor to be configured to:

generate interplanetary file system (IPFS) metadata of a first image, wherein generating the IPES metadata comprises organizing pieces of block data of the first image based on a Merkle database availability group (DAG) algorithm, and wherein the IPFS metadata comprises a first image identifier, first image version information, a name of the node device, and names and address information of the pieces of block data;

generate an IPFS metadata identifier of the first image based on a plurality of pieces of block data of the first image, and wherein generating the IPFS metadata identifier comprises performing image service-customized encoding and hash encoding on the first image identifier to obtain the IPFS metadata identifier, and wherein the IPFS metadata identifier indexes the IPFS metadata;

compare the IPFS metadata identifier with IPFS metadata identifiers in a distributed hash table (DHT), wherein the DHT comprises IPFS metadata identifiers of images published by a plurality of node devices in the distributed file system;

determine whether the IPFS metadata identifier exists in the DHT;

store the pieces of block data in storage locations corresponding to the address information in an IPFS repository of the node device; and

add the IPFS metadata identifier to the DHT.

8. The node device of claim 7 , wherein the executable instructions further cause the processor to be configured to:

receive a publication request for the first image, wherein the publication request carries the first image identifier;

obtain the IPFS metadata identifier based on the first image identifier; and

add the IPFS metadata identifier to the DHT.

9. The node device of claim 7 , wherein the IPFS metadata further comprises first version information of the first image, and wherein the executable instructions further cause the processor to be configured to:

determine, based on the first image identifier, whether a second image exists in the IPFS repository, wherein a second image identifier of the second image is the same as the first image identifier; and

store the pieces of block data in the storage locations when the second image exists and second version information of the second image is different from the first version information.

10. A first node device, in a distributed file system, comprising:

a memory configured to store executable instructions; and

a processor coupled to the memory, wherein when executed, the executable instructions-cause the processor to be configured to:

receive a first obtaining request for an image, wherein the first obtaining request carries an image identifier of the image;

perform image service-customized encoding and hash encoding on the image identifier to obtain an interplanetary file system (IPFS) metadata identifier of the image;

compare the IPFS metadata identifier of the image with IPFS metadata identifiers in a distributed hash table (DHT), wherein the DHT comprises IPFS metadata identifiers of images published by a plurality of node devices in the distributed file system, and wherein the IPFS metadata identifier indexes IPFS metadata of the image;

obtain the IPFS metadata corresponding to the IPFS metadata identifier of the image when the IPFS metadata identifier of the image exists in the DHT, wherein the IPFS metadata comprises pieces of block data arranged based on a Merkle database availability group (DAG) algorithm; and

obtain the image based on the IPFS metadata.

11. The first node device of claim 10 , wherein the executable instructions further cause the processor to be configured to:

send a second obtaining request to the DHT requesting to obtain the IPFS metadata, wherein the second obtaining request enables the DHT to query and obtain the IPFS metadata from the node devices in the distributed file system; and

receive a request result from the DHT, wherein the request result carries the IPFS metadata.

12. The first node device of claim 10 , wherein the executable instructions further cause the processor to be configured to:

obtain, based on a name of a second node device in which the image is located and address information of a plurality of pieces of block data of the image, the pieces of block data from the second node device, wherein the IPFS metadata comprises the name and the address information; and

obtain the image based on the pieces of block data.

13. The first node device of claim 10 , wherein the executable instructions further cause the processor to be configured to:

determine target block data based on names of a plurality of pieces of block data of the image in the IPFS metadata;

obtain, based on a name of a second node device in which the image is located and address information of the target block data, the target block data from the second node device; and

obtain the image based on the target block data and block data of the image that exists in an IPFS repository of the first node device, wherein the target block data is in the pieces of block data and does not exist in the IPFS repository.

14. The image obtaining method of claim 4 , wherein obtaining the image comprises:

determining target block data based on names of a plurality of pieces of block data of the image in the IPFS metadata;

obtaining, based on a name of a second node device in which the image is located and address information of the target block data, the target block data from the second node device; and

obtaining the image based on the target block data and block data of the image that exists in an IPFS repository of the first node device, wherein the target block data is in the pieces of block data and does not exist in the IPFS repository.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 22, 2019
From: XIE, KEYANG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 050791/0557 →
Priority Claims (1)
CN 201710214053.7 · Apr 1, 2017 · national
Continuity (2)
Continuation PCTCN2018080944 · Mar 28, 2018
Related Publication 20200036772A1 · Jan 30, 2020
Cited By (1)
US 12,253,976