Tüm Ürünler
Search
Belge Merkezi

Intelligent Media Management:Package file decompression

Son Güncelleme:Oct 05, 2026

Bu konu, Object Storage Service (OSS) içinde depolanan bir veya daha fazla nesneyi Intelligent Media Management (IMM) kullanarak nasıl sıkıştıracağınızı, bir paketin içindeki dosya içeriğini nasıl sorgulayacağınızı ve bir paketi nasıl açacağınızı açıklar. Sıkıştırma ve açma işlemleri; veri aktarımı, yedekleme ve arşivleme gibi birçok senaryoda faydalıdır. Bu özellikleri kullanarak bir paket içindeki verileri verimli bir şekilde yönetebilir ve işleyebilirsiniz. Örneğin, bu özelliği veri aktarım hızını artırmak, depolama kullanımını azaltmak ve veri arşivlemeyi ile paylaşımı kolaylaştırmak için kullanabilirsiniz.

Özelliklere genel bakış

IMM, bulut ortamında dosya sıkıştırma ve açma işlemlerini destekleyerek verimliliği artırır ve dosya yönetimini basitleştirir. OSS içindeki nesneleri çevrimiçi olarak sıkıştırmak ve açmak için IMM'yi kullanabilirsiniz.

Ön koşullar

  • Bir AccessKey çifti oluşturdunuz. Daha fazla bilgi için bkz. AccessKey çifti oluşturma.

  • OSS hizmetini etkinleştirdiniz, bir paket oluşturdunuz ve pakete dosyalar yüklediniz. Daha fazla bilgi için bkz. Dosya yükleme.

  • IMM hizmetini etkinleştirdiniz. Daha fazla bilgi için bkz. IMM'yi etkinleştirme.

  • IMM konsolunda bir proje oluşturdunuz. Daha fazla bilgi için bkz. Proje oluşturma.

    Not
    • Proje oluşturmak için CreateProject API işlemini de çağırabilirsiniz. Daha fazla bilgi için bkz. Proje oluşturma.

    • Belirtilen bir bölgedeki tüm projeleri listelemek için ListProjects API işlemini çağırabilirsiniz.

Desteklenen biçimler

  • Sıkıştırma özelliği yalnızca paketleme işlemlerini destekler.

  • Sıkıştırma özelliği yalnızca ZIP biçimini destekler.

  • Açma ve paket önizleme özellikleri ZIP, RAR ve 7z biçimlerini destekler.

Notlar

Sıkıştırma, paket okuma ve açma görevlerine ilişkin bilgiler, görevin başlama tarihinden itibaren 7 gün boyunca saklanır ve bu süre dolduktan sonra sorgulanamaz. Görev bilgilerini sorgulamak için aşağıdaki yöntemlerden birini kullanabilirsiniz:

Sıkıştırma

Bir OSS paketindeki birden fazla nesneyi sıkıştırmak için CreateFileCompressionTask - Dosya sıkıştırma görevi oluşturma API işlemini çağırın.

Sıkıştırma bilgileri

  • IMM projesi: test-project

  • Sıkıştırılacak nesneler:

    • oss://test-bucket/test-object1.jpg

    • oss://test-bucket/test-object2.jpg

    • oss://test-bucket/test-object3.jpg

    • oss://test-bucket/test-object4.jpg

  • Çıkış yolu: oss://test-bucket/test-target-object.zip

İstek örneği

{
    "ProjectName": "test-project",
    "CompressedFormat": "zip",
    "Sources": "[{\"URI\":\"oss://test-bucket/test-object1.jpg\"},{\"URI\":\"oss://test-bucket/test-object2.jpg\"},{\"URI\":\"oss://test-bucket/test-object3.jpg\"},{\"URI\":\"oss://test-bucket/test-object4.jpg\"}]",
    "TargetURI": "oss://test-bucket/test-target-object.zip"
}

Yanıt örneği

{
  "TaskId": "FileCompression-7e3e2b8c-81bd-495f-a338-25b3762a****",
  "RequestId": "C54C5888-9C96-5A35-AF73-ABD6EF15****",
  "EventId": "164-1S6uXTYhUU4qAFCPOTcYdcb****"
}

Örnek kod

Aşağıdaki örnek kod, birden fazla nesnenin nasıl sıkıştırılacağını göstermektedir:

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_imm20200930.client import Client as imm20200930Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_imm20200930 import models as imm_20200930_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient

class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client(
        access_key_id: str,
        access_key_secret: str,
    ) -> imm20200930Client:
        """
        Use your AccessKey ID and AccessKey secret to initialize the client.
        @param access_key_id:
        @param access_key_secret:
        @return: Client
        @throws Exception
        """
        config = open_api_models.Config(
            access_key_id=access_key_id,
            access_key_secret=access_key_secret
        )
        # Specify the IMM endpoint.
        config.endpoint = f'imm.cn-beijing.aliyuncs.com'
        return imm20200930Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        sources_0 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object1.jpg'
        )
        sources_1 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object2.jpg'
        )
        sources_2 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object3.jpg'
        )
        sources_3 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object4.jpg'
        )
        create_file_compression_task_request = imm_20200930_models.CreateFileCompressionTaskRequest(
            project_name='test-project',
            sources=[
                sources_0,
                sources_1,
                sources_2,
                sources_3
            ],
            target_uri='oss://test-bucket/test-target-object.zip',
            compressed_format='zip',
        )
        runtime = util_models.RuntimeOptions()
        try:
            # Write your code to print the response of the API operation if necessary.
            client.create_file_compression_task_with_options(create_file_compression_task_request, runtime)
        except Exception as error:
            # Print the error message if necessary.
            UtilClient.assert_as_string(error.message)

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        sources_0 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object1.jpg'
        )
        sources_1 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object2.jpg'
        )
        sources_2 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object3.jpg'
        )
        sources_3 = imm_20200930_models.CreateFileCompressionTaskRequestSources(
            uri='oss://test-bucket/test-object4.jpg'
        )
        create_file_compression_task_request = imm_20200930_models.CreateFileCompressionTaskRequest(
            project_name='test-project',
            sources=[
                sources_0,
                sources_1,
                sources_2,
                sources_3
            ],
            target_uri='oss://test-bucket/test-target-object.zip',
            compressed_format='zip',
        )
        runtime = util_models.RuntimeOptions()
        try:
            # Write your code to print the response of the API operation if necessary.
            await client.create_file_compression_task_with_options_async(create_file_compression_task_request, runtime)
        except Exception as error:
            # Print the error message if necessary.
            UtilClient.assert_as_string(error.message)

if __name__ == '__main__':
    Sample.main(sys.argv[1:])

Paket içeriğini sorgulama

OSS içindeki bir paketin içeriğini sorgulamak için CreateArchiveFileInspectionTask - Paket ayrıştırma görevi oluşturma API işlemini çağırın.

Paket bilgileri

  • Proje adı: test-project

  • Paket yolu: oss://test-bucket/test-target-object.zip

  • Çıkış yolu: oss://test-bucket/test-target-object.json

İstek örneği

{
    "ProjectName": "test-project",
    "SourceURI": "oss://test-bucket/test-target-object.zip",
    "TargetURI": "oss://test-bucket/test-target-object.json"
}

Yanıt örneği

{
    "TaskId": "ArchiveFileInspection-4a7c308a-5671-4d34-ba41-86a942d0****",
    "RequestId": "20D23855-C9E6-5193-8939-3A8797E1****",
    "EventId": "2AB-1S53L6FTdU6yMxkc1JgpwcV****"
}

Örnek kod

Aşağıdaki örnek kod, bir paketin içeriğinin nasıl sorgulanacağını göstermektedir:

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_imm20200930.client import Client as imm20200930Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_imm20200930 import models as imm_20200930_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient

class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client(
        access_key_id: str,
        access_key_secret: str,
    ) -> imm20200930Client:
        """
        Use your AccessKey ID and AccessKey secret to initialize the client.
        @param access_key_id:
        @param access_key_secret:
        @return: Client
        @throws Exception
        """
        config = open_api_models.Config(
            access_key_id=access_key_id,
            access_key_secret=access_key_secret
        )
        # Specify the IMM endpoint.
        config.endpoint = f'imm.cn-beijing.aliyuncs.com'
        return imm20200930Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        create_archive_file_inspection_task_request = imm_20200930_models.CreateArchiveFileInspectionTaskRequest(
            project_name='test-project',
            source_uri='oss://test-bucket/test-target-object.zip',
            target_uri='oss://test-bucket/test-target-object.json'
        )
        runtime = util_models.RuntimeOptions()
        try:
            # You can choose to print the response of the API operation.
            client.create_archive_file_inspection_task_with_options(create_archive_file_inspection_task_request, runtime)
        except Exception as error:
            # Print the error message if necessary.
            UtilClient.assert_as_string(error.message)

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        create_archive_file_inspection_task_request = imm_20200930_models.CreateArchiveFileInspectionTaskRequest(
            project_name='test-project',
            source_uri='oss://test-bucket/test-target-object.zip',
            target_uri='oss://test-bucket/test-target-object.json',
        )
        runtime = util_models.RuntimeOptions()
        try:
            # You can choose to print the response of the API operation.
            await client.create_archive_file_inspection_task_with_options_async(create_archive_file_inspection_task_request, runtime)
        except Exception as error:
            # Print the error message if necessary.
            UtilClient.assert_as_string(error.message)

if __name__ == '__main__':
    Sample.main(sys.argv[1:])

Açma

OSS içindeki bir paketi açmak için CreateFileUncompressionTask - Açma görevi oluşturma API işlemini çağırın.

Açma bilgileri

  • Proje adı: test-project

  • Paket yolu: oss://test-bucket/test-target-object.zip

  • Açılacak nesne: test-object1.jpg

  • Çıkış yolu: oss://test-bucket/test-target-object

İstek örneği

{
    "ProjectName": "test-project",
    "SourceURI": "oss://test-bucket/test-target-object.zip",
    "Target": "{\"URI\":\"oss://test-bucket/test-target-object\"}",
    "SelectedFiles": "[\"test-object1.jpg\"]"
}

Yanıt örneği

{
  "TaskId": "FileUncompression-f31061ab-eaeb-469d-ac8f-9af10e5d****",
  "RequestId": "20115435-9F59-58C0-8D15-E6ECC096****",
  "EventId": "3B6-1S6ywKAB2ogXJnrzmk6tFUF****"
}

Örnek kod

Aşağıdaki örnek kod, bir paketin nasıl açılacağını göstermektedir:

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_imm20200930.client import Client as imm20200930Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_imm20200930 import models as imm_20200930_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient

class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client(
            access_key_id: str,
            access_key_secret: str,
    ) -> imm20200930Client:
        """
        Use your AccessKey ID and AcecssKey secret to initialize the client.
        @param access_key_id:
        @param access_key_secret:
        @return: Client
        @throws Exception
        """
        config = open_api_models.Config(
            access_key_id=access_key_id,
            access_key_secret=access_key_secret
        )
        # The endpoint.
        config.endpoint = f'imm.cn-beijing.aliyuncs.com'
        return imm20200930Client(config)

    @staticmethod
    def main(
            args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        target = imm_20200930_models.CreateFileUncompressionTaskRequestTarget(
            uri='oss://test-bucket/test'
        )
        create_file_uncompression_task_request = imm_20200930_models.CreateFileUncompressionTaskRequest(
            project_name='test-project',
            target=target,
            source_uri='oss://test-bucket/test-target-object.zip'
        )
        runtime = util_models.RuntimeOptions()
        try:
            # Write code to print the response of the API operation based on your business requirements.
            response = client.create_file_uncompression_task_with_options(create_file_uncompression_task_request, runtime)
        except Exception as error:
            # You can choose to print the error if necessary.
            UtilClient.assert_as_string(error.message)

    @staticmethod
    async def main_async(
            args: List[str],
    ) -> None:
        # The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M.
        # We recommend that you do not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code for data security reasons.
        # In this example, the AccessKey pair is read from the environment variables to implement identity verification for API access.
        imm_access_key_id = os.getenv("AccessKeyId")
        imm_access_key_secret = os.getenv("AccessKeySecret")
        client = Sample.create_client(imm_access_key_id, imm_access_key_secret)
        target = imm_20200930_models.CreateFileUncompressionTaskRequestTarget(
            uri='oss://test-bucket/test'
        )
        create_file_uncompression_task_request = imm_20200930_models.CreateFileUncompressionTaskRequest(
            project_name='test-project',
            target=target,
            source_uri='oss://test-bucket/test-target-object.zip'
        )
        runtime = util_models.RuntimeOptions()
        try:
            # Write code to print the response of the API operation based on your business requirements.
            await client.create_file_uncompression_task_with_options_async(create_file_uncompression_task_request, runtime)
        except Exception as error:
            # You can choose to print the error if necessary.
            UtilClient.assert_as_string(error.message)

if __name__ == '__main__':
    Sample.main(sys.argv[1:])

Faturalama

Paket dosya açma işlemi sırasında OSS ve IMM tarafında aşağıdaki faturalandırma öğeleri oluşur:

  • OSS tarafı: Fiyatlandırma hakkında daha fazla bilgi için bkz. OSS Fiyatlandırması.

    API

    Faturalandırma öğesi

    Açıklama

    GetObject

    GET istekleri

    Başarılı istek sayısına göre istek ücretlerinden ücretlendirilirsiniz.

    İnternet üzerinden giden trafik

    GetObject işlemini oss-cn-hangzhou.aliyuncs.com gibi bir genel uç nokta veya oss-accelerate.aliyuncs.com gibi bir hızlandırma uç noktası aracılığıyla çağırırsanız, veri boyutuna göre İnternet üzerinden giden trafik ücretlerinden ücretlendirilirsiniz.

    IA nesnelerinin alınması

    IA nesneleri alınırsa, alınan IA nesnelerinin boyutuna göre IA veri erişim ücretlerinden ücretlendirilirsiniz.

    Arşiv Doğrudan Okumadan Veri Erişim Kapasitesi

    Gerçek zamanlı erişimin etkinleştirildiği bir paketteki Arşiv nesneleri alınırsa, alınan Arşiv nesnelerinin boyutuna göre Arşiv veri erişim ücretlerinden ücretlendirilirsiniz.

    Aktarım hızlandırma

    Aktarım hızlandırmayı etkinleştirir ve paketinize erişmek için bir hızlandırma uç noktası kullanırsanız, veri boyutuna göre aktarım hızlandırma ücretlerinden ücretlendirilirsiniz.

  • IMM tarafı: Fiyatlandırma hakkında daha fazla bilgi için bkz. IMM faturalandırma öğeleri.

    Önemli

    28 Temmuz 2025 saat 11:00'den (UTC+8) itibaren IMM dosya sıkıştırma ve açma hizmetleri ücretsiz modelden ücretli modele geçecektir. Daha fazla bilgi için bkz. IMM faturalandırma ayarlama duyurusu.

    API

    Faturalandırma öğesi

    Açıklama

    CreateFileCompressionTask

    FileProcess

    Sıkıştırılacak kaynak dosyaların boyutuna göre sıkıştırma ücretlerinden ücretlendirilirsiniz.

    CreateFileUncompressionTask

    Açılan dosyaların boyutuna göre açma ücretlerinden ücretlendirilirsiniz.

    CreateArchiveFileInspectionTask

    FilePreview

    Önizlenecek paketin boyutuna göre önizleme ücretlerinden ücretlendirilirsiniz.

SSS