Otu esi ewepu metadata na Google Drive

Mmelite ikpeazụ: 18/08/2025

  • Ghọta ihe metadata mbanye na-ejikwa (aha, mkpado, indexableText, na thumbnails) yana ihe metadata bụ nke ọrụ Google Cloud ndị ọzọ.
  • Jiri API mbanye iji jụọ ajụjụ wee mezie metadata; hichaa EXIF ​​​​na data agbakwunyere tupu ebugo faịlụ.
  • Oke oke na iwu (thumbnails, ederede indexable, ndọtị) wee jiri gcloud gosipụta maka nnwale REST mpaghara.
hichapụ metadata na Google Drive

Ịchọrọ ijikwa metadata nke faịlụ gị n'ime Google mbanye ma ị maghị ebe ịmalite? N'ebe a, anyị na-akọwa, n'ụzọ zuru ezu, Otu esi ewepu metadata na Google Drive nke ọma yana n'enweghị nsogbu (metadata nke faịlụ ebugoro). Anyị na-agwakwa gị oke nke Google na-amanye na aha faịlụ, nha na ikike.

Ntuziaka a ga-enye gị nghọta zuru oke na ezi uche nke ihe nwere ike "na enweghị ike ihichapụ" ma a bịa na metadata na Google Drive.

Kedu ihe enwere ike ịgbanwe ma ọ bụ "ehichapụ" na Drive

Ndị a bụ metadata enwere ike wepu ya na faịlụ ebugoro na Google Drive:

Aha na ndọtị: Mgbe ị na-eke faịlụ site na API, ọ dị mma ịkọwapụta ndọtị n'ime aha aha, dịka ọmụmaatụ, "cat.jpg." Draịvụ nwere ike wepụta ndọtị site na ụdị MIME ma ọ bụrụ na i kọwaghị ya, mana ọ ka mma ịkọwa ya n'onwe gị. Na nzaghachi ndị na-esote, faịlụ na-agụ naanị nwere ike ịpụta yana ndọtị bilitere site na aha. Ọ bụrụ na onye ọrụ budata faịlụ ahụ, Drive na-achịkọta aha ikpeazụ site na aha (yana ndọtị ya).

  • Ederede nwere ike ịkọwapụta (contentHints.indexableText): Dezie akwụkwọ na ụdị ndị a na-ahụkarị (PDF, onyonyo enyere OCR, wdg) na ndabara. Ọ bụrụ na ngwa gị na-echekwa usoro ndị ọzọ (eserese, vidiyo, ụzọ mkpirisi), ị nwere ike ịnye ederede index nwere ike imeziwanye ọchụchọ. A na-ahazi ederede a ka HTML: ọ bụrụ na ị gafere eriri nwere mkpado, a na-edepụta ọdịnaya ederede, ọ bụghị njirimara mkpado. Enwere oke nha 128KB maka ọdịnayaHints.indexableText, a na-atụ aro ka imelite ya na nchekwa ọ bụla wee debe ya ka ọ dabara na faịlụ ahụ.
  • thumbnails (contentHints.thumbnail): Draịvụ na-ewepụta thumbnails maka ọtụtụ ụdị, mana maka usoro na-anaghị ewepụta ya na-akpaghị aka, ị nwere ike bulite nke gị mgbe ị mepụtara ma ọ bụ melite faịlụ. Ị ga-edozi ihe onyonyo a ka ọ bụrụ URL-safe base64 yana mimeType kwekọrọ. Iwu isi: Ụdị akwadoro bụ PNG, GIF, ma ọ bụ JPG; Ogologo akwadoro bụ 1600px (opekempe 220px), na oke kachasị bụ 2MB. A na-emebi thumbnails mgbe ọdịnaya faịlụ gbanwere; metadata mgbanwe adịghị.
  • Ịnweta thumbnails: Ogige ThumbnailLink na-eweghachi URL dị nkenke, enwere ike ịnweta naanị ma ọ bụrụ na ngwa ahụ nwere ikike ịgụ faịlụ ahụ (ọ bụrụ na ọ bụghị ọha, ị ga-achọrịrị ịrịọ ya na nzere). Ị nwere ike jụọ ya maka otu faịlụ ma ọ bụ maka ndepụta ejiri ụdị edozichara.
  • Akara: Drive na-enye gị ohere ijikọ akara na faịlụ. Iji chọta ha, ị nwere ike iji faịlụ.listLabels, na iji gbanwee ha, ị ga-ederịrị akara akara kwekọrọ na fileId. Usoro a bara uru maka ịhazi na, ọ bụrụ na ọ dị mkpa, "ihichapụ" nhazi ọkwa na-achọghị na-emetụghị ọdịnaya ahụ aka.
Ọdịnaya pụrụiche - Pịa ebe a  Gemini 2.5 Pro bụ n'efu ugbu a: Nke a bụ ka Google kacha nwee ụdị AI AI si arụ ọrụ.
hichapụ metadata na Google Drive
Hichapụ metadata na Google Drive

Hichapụ metadata na Google Drive: metadata zoro ezo na faịlụ n'onwe ya

Enweghị bọtịnụ anwansi iji wepu metadata na Google Drive (dị ka EXIF ​​​​na foto ma ọ bụ data agbakwunyere na PDF). Draịvụ na-ejikwa metadata nke ya, mana metadata dị n'ime faịlụ ahụ dabere na ngwa ọrụ mepụtara ya.

Omume akwadoro bụ hichaa faịlụ ahụ tupu ebugo ya na Drive, Iji ngwaọrụ sistemụ ma ọ bụ ngwa pụrụ iche na-ewepụ data EXIF ​​​​na onyonyo ma ọ bụ akụrụngwa akwụkwọ. N'ụzọ dị otú a, ọdịnaya ị na-echekwara na Drive na-abịa "edobere ya."

Ọ bụrụ na ịnweelarị faịlụ ebugoro nwere metadata agbakwunyere, kama iwepu metadata na Google Drive, ọ ka adabara. budata, hichaa ma bulitegharịa, dochie nke mbụ ma ọ bụrụ na ọdabara. Site na PDF ma ọ bụ onyonyo, nke a na-adịkarị mgbe ịchọrọ ichekwa odee, ọnọdụ, ma ọ bụ akụkọ ndezi.

Maka akụkụ ụfọdụ nke Drive, lekwasịrị anya n'ịgbanwe aha, akara na ọdịnaya Ntụle (indexableText/thumbnail), ndị dị n'okpuru gị. Ọ bụrụ na ị jikwaa ikike ịnweta, ị na-ebelatakwa mkpughe nke metadata a na-ahụ anya (dịka ọmụmaatụ, njikọ thumbnail nwere ike ịnweta ndị nwere ikike ịgụ akwụkwọ).

Echefula na Ịgbanwe naanị metadata mbanye anaghị ewepụ EXIF ​​​​ma ọ bụ ihe dị n'ime. Ya mere, atụmatụ gị kwesịrị ijikọta tupu ihichapụ faịlụ na njikwa metadata mara mma nke Drive na-enye gị ohere imetụ aka.

metadata mgbagwoju anya na Google Cloud: VMs, gcloud, na oke

Ọ bụrụ na ị na-arụ ọrụ na Google Cloud, ị ga-ahụ ọtụtụ ntuziaka maka “metadata” nke na-ezo aka na Compute Engine ma ọ bụ nchekwa igwe ojii, ọ bụghị mbanye. Agbanyeghị, ị ga-achọ ịma isi ihe ndị a ka ị ghara ịgwakọta ha mgbe ị na-eme nyocha.

Nhazi gcloud CLI bụ isi

Mgbe ị wụnyechara Google Cloud CLI, jiri:

gcloud init

Ọ dị mkpa ijide n'aka na ị nwere ụdị kachasị ọhụrụ nwere:

gcloud components update

Ọ bụrụ na ị na-eji ihe na-eweta njirimara mpụga, Banye na njirimara gị jikọtara ọnụ tupu ị rụọ ọrụ na gcloud, karịsịa ma ọ bụrụ na ị ga-achọpụta iji mee oku REST site na gburugburu mpaghara gị. Ihe nlele API REST nwere ike iji nzere ị haziri na gcloud.

VM

Ikikere na ọrụ (Njin Kọmputa): Ka ịgbakwunye, melite, ma ọ bụ hichapụ metadata omenala na VM, ịchọrọ ikikere IAM kwesịrị ekwesị. Ihe atụ ndị a na-ahụkarị gụnyere:

  • Ọ bụrụ na VM gị na-eji akaụntụ ọrụ: ikike iam.serviceAccounts.actAs na akaụntụ ọrụ ma ọ bụ ọrụ.
  • metadata oru ngo: compute.projects.get y compute.projects.setCommonInstanceMetadata.
  • metadata mpaghara: compute.instanceSettings.get y compute.instanceSettings.update maka mpaghara dị mkpa.
  • Ihe atụ metadata: compute.instances.get y compute.instances.setMetadata.

Nkwụsị

Ndị a bụ oke oke anyị zutere mgbe anyị na-agbalị iwepụ metadata na Google Drive:

  • Oke oke (Njin Kọmputa): Ngụkọta ndenye metadata jikọtara ọnụ na 512 KB. Igodo ọ bụla nwere oke na 128 bytes, uru ọ bụla nwere oke na 256 KB. Dịka ọmụmaatụ, ọ bụrụ na ị na-eji igodo ssh-igodo wee gafere oke 256 KB, ị gaghị enwe ike itinyekwu igodo ruo mgbe ị sachara.
  • Akpa dị elu na nke nta: Igodo na-enwe mmetụta; ụkpụrụ dịkwa, ewezuga Booleans. Na zonal, ị nweghị ike ịmepụta igodo abụọ dị iche naanị ma ọ bụrụ na (zonal-metadata-key vs. ZONAL-METADATA-KEY).
  • metadata mpaghara: edobere ma ọ bụ wepu ya site na iji gcloud ma ọ bụ REST. Ị nweghị ike ịkọwa ụkpụrụ zonal maka igodo SSH (ssh-igodo). N'ime ọrụ / ndekọ ndekọ ezi uche, ọ bụrụ na enwere ọkwa-ọkwa na mpaghara mpaghara maka otu igodo ahụ, uru zonal na-ebute ụzọ na mpaghara ya.
  • Ụkpụrụ boolean akwadoro: Na mgbakwunye na EZI / Ụgha, ị nwere ike iji Y / Ee / 1 na N / Mba / 0 (ikpe enweghị mmetụta).
  • Oke nhazi (Njin Kọmputa):
    • Draftụ: metadata jikọrọ VM niile na oru ngo a.
    • Mpaghara: ndenye na-emetụta VM niile n'otu mpaghara ma nwee ike ịkagbu uru ọrụ ahụ.
    • Ihe atụ: metadata maka otu VM (emepụtara ma ọ bụ dị adị).
Ọdịnaya pụrụiche - Pịa ebe a  Otu esi esi wepu aha na klas Google

Metadata na Google Cloud

Mkpịsị aka, indexing, na metadata eweghachite na Drive (REST na omume kacha mma)

Ka anyị lelee ọrụ nke thumbnails mgbe ị na-ewepụ metadata na Google Drive. Nakwa ụzọ kacha mma iji nwetaghachi ha:

  • Nyocha maka REST na ụlọ: Ọ bụrụ na ị na-anwale ọmụmaatụ REST site na igwe gị, jiri nzere ahazibere na gcloud. N'ụzọ dị otú a, oku API mbanye gị ga-asọpụrụ njirimara na ikike ị deberelarị.
  • Bulite thumbnail omenala: tọọ ọdịnayaHants.thumbnail nwere mpaghara abụọ: URL-ọdịdị nchekwa base64 na mimeType ziri ezi. Ọ bụrụ na draịva nwere ike wepụta thumbnail na-akpaghị aka, ọ ga-eji nke ya wee maa nke gị. Ma ọ bụghị ya, ọ ga-eji nke ị nyere.

Iwu ndị dị mkpa maka obere mkpịsị aka na mbanye:

  • Ụdị: PNG, GIF ma ọ bụ JPG.
  • Obosara akwadoro: 1600 px (opekempe 220 px).
  • Oke kachasị: 2MB.
  • Melite thumbnail na nchekwa ọ bụla ma ọ bụrụ na ọ ka dị mkpa.

Ihe dị mkpa gbasara mmebi iwu: A na-emebi thumbnails mgbe agbanwere ọdịnaya nke faịlụ; metadata mgbanwe adịghị. Ọ bụrụ na ị na-agbanwe naanị mkpado ma ọ bụ aha, atụla anya obere mkpịsị aka ọhụrụ ọ gwụla ma ị gbanwee faịlụ ahụ.

Ederede nwere ike ịkọwapụta

Anwala iji okwu buzz mee "na-aghọ aghụghọ" ọchụchọ ahụ. Weghara echiche na okwu ndị onye ọrụ ga-eji ezi uche chọọ faịlụ ahụ, yana lelee oke 128KB. Melite ya mgbe ọ bụla ọdịnaya gbanwere nke ukwuu.

Tinye aha na mgbakwunye na-agbanwe agbanweMgbe ọ bụla enwere ike, tinye ndọtị n'aha mgbe ị na-ebugo; Ọ bụrụ na ọ na-efu, Drive ga-anwa iji MIME wepụta ya. Idobe aha n'ụzọ doro anya ga-ezere enweghị mgbagha ma nye ohere maka ọchụchọ ndọtị dị mfe.

Mkpado na mbanye

Iji gbanwee akara, rịba ama ndị dị mkpa. Ị ga-achọ akara labelId na faịlụ faịlụ. Ị nwere ike ibu ụzọ depụta ha na faịlụ.listLabels wee tinye mgbanwe ndị kwekọrọ na faịlụ ebumnuche.

// Al modificar etiquetas de un archivo en Drive:
// - labelId: identificador de la etiqueta a cambiar
// - fileId: identificador del archivo al que aplicas la etiqueta
// Usa files.listLabels para localizarlas antes de actualizar.

Cheta na, Ọ bụ ezie na mbanye bụ ihe a na-elekwasị anya, ọtụtụ mmepe na-ejikọta Drive na Nchekwa igwe ojii ma ọ bụ ọrụ ndị ọzọ, N'ihi ya, ị ga-ahụ ihe atụ nke Nchekwa iji nyochaa njirimara ihe.

// Ejemplo en Go para obtener atributos de un objeto en Cloud Storage (no Drive)
// e imprimir metadatos como ContentType, CacheControl, MD5, etc.
// Útil si tu flujo sube primero a Storage y luego a Drive.
import (
  "context"
  "fmt"
  "io"
  "time"
  "cloud.google.com/go/storage"
)

func getMetadata(w io.Writer, bucket, object string) (*storage.ObjectAttrs, error) {
  ctx := context.Background()
  client, err := storage.NewClient(ctx)
  if err != nil { return nil, fmt.Errorf("storage.NewClient: %w", err) }
  defer client.Close()

  ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
  defer cancel()

  o := client.Bucket(bucket).Object(object)
  attrs, err := o.Attrs(ctx)
  if err != nil { return nil, fmt.Errorf("Object(%q).Attrs: %w", object, err) }

  fmt.Fprintf(w, "Bucket: %v\n", attrs.Bucket)
  fmt.Fprintf(w, "CacheControl: %v\n", attrs.CacheControl)
  fmt.Fprintf(w, "ContentDisposition: %v\n", attrs.ContentDisposition)
  fmt.Fprintf(w, "ContentEncoding: %v\n", attrs.ContentEncoding)
  fmt.Fprintf(w, "ContentLanguage: %v\n", attrs.ContentLanguage)
  fmt.Fprintf(w, "ContentType: %v\n", attrs.ContentType)
  fmt.Fprintf(w, "Crc32c: %v\n", attrs.CRC32C)
  fmt.Fprintf(w, "Generation: %v\n", attrs.Generation)
  fmt.Fprintf(w, "KmsKeyName: %v\n", attrs.KMSKeyName)
  fmt.Fprintf(w, "Md5Hash: %v\n", attrs.MD5)
  fmt.Fprintf(w, "MediaLink: %v\n", attrs.MediaLink)
  fmt.Fprintf(w, "Metageneration: %v\n", attrs.Metageneration)
  fmt.Fprintf(w, "Name: %v\n", attrs.Name)
  fmt.Fprintf(w, "Size: %v\n", attrs.Size)
  fmt.Fprintf(w, "StorageClass: %v\n", attrs.StorageClass)
  fmt.Fprintf(w, "TimeCreated: %v\n", attrs.Created)
  fmt.Fprintf(w, "Updated: %v\n", attrs.Updated)
  fmt.Fprintf(w, "Event-based hold enabled? %t\n", attrs.EventBasedHold)
  fmt.Fprintf(w, "Temporary hold enabled? %t\n", attrs.TemporaryHold)
  fmt.Fprintf(w, "Retention expiration time %v\n", attrs.RetentionExpirationTime)
  fmt.Fprintf(w, "Custom time %v\n", attrs.CustomTime)
  fmt.Fprintf(w, "Retention: %+v\n", attrs.Retention)
  fmt.Fprintf(w, "\n\nMetadata\n")
  for key, value := range attrs.Metadata {
    fmt.Fprintf(w, "\t%v = %v\n", key, value)
  }
  return attrs, nil
}

Ihichapụ faịlụ vs. ihichapụ metadata na Google mbanye

Ọ bụrụ na ihe ị chọrọ bụ hichapụ faịlụ na DriveDịka onye nwe ya, ịnwere ike ibuga ya na ahịhịa site na webụ site na ịpị aka nri wee họrọ Bugharịa na ahịhịa. Ọ bụrụ na onye nwe ya bụ onye ọzọ, ị nwere ike "wepụ" faịlụ site na anya gị; ndị ọzọ ka ga-enwe ike ịhụ ya.

Ọdịnaya pụrụiche - Pịa ebe a  Otu esi enweta foto Google site na Instagram

para Ka ihichapụ faịlụ na-adịgide adịgide, ị ga-ewepụrịrị ahịhịa ma ọ bụ jiri nhọrọ ihichapụ na-adịgide adịgide, N'okwu a, ị gaghị enwe ike iweghachi ya. Nke a, n'onwe ya, anaghị "ewepụ metadata" na faịlụ ndị ọzọ - ọ na-emetụta naanị ihe ahụ.

Ị nweghị ike ihichapụ metadata na Google Drive na faịlụ ndị ị na-enweghị, n'ihi na njikwa ha bụ nke onye kere ha ma ọ bụ nke onye nwere ikike dị elu n'ime nzukọ ahụ. N'okwu ndị a, naanị ị na-ewepụ ohere ma ọ bụ visibiliti gị.

Ejikọtara ya na metadata: Ihichapụ faịlụ na-ehichapụ metadata ya na Drive yana ya, mana ọ naghị emetụta metadata na mbipụta ndị ọzọ ma ọ bụ metadata agbakwunyere na akwụkwọ ndị ọzọ fọdụrụ na sistemụ.

Na ihe niile dị n'elu, ị nwere ike ugbu a dị iche iche nke ọma Kedu ihe njikwa draịva metadata (aha, mkpado, nrịbama ọchụchọ na obere mkpirisi), Otu esi ajuju ha site na REST, usoro kacha mma ị ga-agbaso maka ihicha data agbakwunyere tupu ebugo, yana oke na ikike na-abata mgbe ị nwetara akwụkwọ Google Cloud nke na-ekwu maka "metadata" na ọnọdụ ndị ọzọ.