Patent Description:
Simple Storage Service (simple storage service, S3) is an online storage service system that is provided by Amazon. This resolves problems such as high construction and maintenance costs and low storage reliability that users face when building their own storage systems. The users can temporarily or permanently store any type of files on an S3 server by using a service interface provided by Amazon.

The S3 system uses three basic concepts: a bucket (bucket), an object (object), and a key (key). A bucket works like a folder and is used to store an object. An object is a basic storage unit of the S3 system, and includes data and metadata (metadata). The metadata is a special type of data used to describe the data included in the object. For ease of understanding, in the following, all "data" described in this application does not include the metadata in the object unless otherwise specified. Metadata stores additional description information of data. The information may be system metadata (system metadata) defined by a system by default, or may be customized user metadata (user metadata). The metadata usually coexists with data associated with the metadata, and does not exist alone. A key is an identifier (identifier, ID) of an object, and each object has only one key. A bucket, a key, and a version ID can uniquely identify one object.

Currently, a procedure of uploading data to the S3 server by the users is as follows.

A client establishes a connection with the S3 server, namely, an S3 connection;.

Because a connection between the client and the S3 server can only serially process files, the connection is in an idle state most of time. How to improve data uploading efficiency in the S3 system is a problem that urgently needs to be resolved currently.

United States patent application <CIT> discloses a file uploading method, a client, and an application server in cloud storage, and a cloud storage system. The methods includes extracting an eigenvalue of a target file to be uploaded; submitting an upload request including the eigenvalue to an application server, so that the application server determines, according to the upload request, whether a client needs to upload the target file; receiving an execution instruction that is sent, according to a determining result, by the application server; and if the execution instruction is an upload instruction, uploading the target file to a file server according to the upload instruction. International patent application <CIT> discloses a data packet sending method, a data packet receiving method, a data packet sending device and a data packet receiving device. The data packet sending method comprises: determining a first data packet to be sent to a server; when there arc two or more first data packets, aggregating the two or more first data packets into one second data packet; and sending the second data packet to the server.

<CIT> further discloses a distributed storage system for storing data objects uploaded from client applications at different geographical locations.

This application provides a data sending method and apparatus. First, a plurality of to-be-uploaded objects with a comparatively small amount of data are encapsulated to generate an object with a comparatively large amount of data, namely, a large object, and then the large object is sent to an S3 server by using a connection between a client and the S3 server. Because the plurality of small objects are uploaded as a whole (namely, the large object), in a process of uploading the plurality of small objects, there is no need to repeatedly send an S3 request. This improves data uploading efficiency in an S3 system.

According to a first aspect, a data sending method applied to an object storage system is provided, where the method includes: obtaining a plurality of to-be-uploaded small objects, where each of the small objects is an object whose amount of data is less than or equal to a first data amount threshold; encapsulating the plurality of small objects to generate a large object, where the large object includes the plurality of small objects; sending an S3 request to a server, where the S3 request is used to request to upload the large object: receiving a response message for the S3 request from the server, where the response message is used to indicate to start to upload the large object; and sending the large object to the server.

The first aspect may be executed by a client. Because the plurality of small objects are uploaded as a whole (namely, the large object), in a process of uploading the plurality of small objects, the client does not need to repeatedly send the S3 request This improves data uploading efficiency in an S3 system. In addition, because the client encapsulates the plurality of small objects for aggregation, and does not further process data in the small objects (for example, extract the data in the plurality of small objects for fusion processing), the first aspect further improves the uploading efficiency,.

Optionally, the encapsulating the plurality of small objects to generate a large object includes: when generation time points of the plurality of small objects fall within a preset time range, encapsulating the plurality of small objects to generate the large object.

The preset time range is, for example, <NUM> hours corresponding to one natural day. The plurality of small objects generated in the preset time range are encapsulated together and sent to the server, and this facilitates the server to manage the plurality of small objects, and improves efficiency of the server.

Optionally, the encapsulating the plurality of small objects to generate a large object includes: when a total amount of data of the plurality of small objects after being encapsulated is less than or equal to a second data amount threshold, encapsulating the plurality of small objects to generate the large object.

In the first aspect, a case in which uploading fails because an amount of data of the large object is excessively large can be avoided.

Optionally, the large object further includes an object header, and the object header includes at least one piece of information of each small object in the plurality of small objects, including an object name, a generation time point, a message digest algorithm <NUM> value, a length, and an offset in the large object.

The foregoing information facilitates the server to manage the plurality of small objects by category, thereby improving the efficiency of the server.

Optionally, before the sending an S3 request to a server, the method further includes: establishing an HTTP connection to the server, where the HTTP connection is used to transmit the large object, and the HTTP connection is a persistent connection.

The persistent connection is a connection that is not immediately disconnected after an object is uploaded. After the large object has been uploaded, if there is a to-be-uploaded object subsequently, the client may directly send the S3 request, and there is no need to re-establish the HTTP connection. This reduces overheads for data uploading and improves the data uploading efficiency.

According to a second aspect, a data receiving method applied to an object storage system is provided, where the method includes: receiving an S3 request from a client, where the S3 request is used to request to upload a large object, and the large object are encapsulated with a plurality of small objects, and each of the small objects is an object whose amount of data is less than or equal to a data amount threshold; sending a response message for the S3 request to the client, where the response message is used to indicate to start to upload the large object; and receiving the large object from the client.

The second aspect may be executed by a server. Because the plurality of small objects are uploaded as a whole (namely, the large object), in a process of receiving the plurality of small objects, the server does not need to repeatedly send the response message for the S3 request. This improves data uploading efficiency in an S3 system. In addition, because the client encapsulates the plurality of small objects for aggregation, and does not further process data in the small objects (for example, extract the data in the plurality of small objects for fusion processing), the second aspect further improves the uploading efficiency.

Optionally, the method further includes: storing the plurality of small objects to a persistence layer of the object storage system, where storage spaces of the plurality of small objects are consecutive storage spaces; and storing metadata corresponding to each small object in the plurality of small objects to an index layer of the object storage system.

After receiving the plurality of small objects, the server stores the plurality of small objects in the consecutive storage spaces, and this facilitates management of the plurality of small objects.

Optionally, the storing the plurality of small objects to a persistence layer of the object storage system includes: storing, to the consecutive storage space at the persistence layer, a small object whose generation time point or upload time point falls within a preset time range in the plurality of small objects.

The preset time range is, for example, <NUM> hours corresponding to one natural day. The plurality of small objects generated in the preset time range are stored in the consecutive storage spaces, and this facilitates the server to manage the plurality of small objects, and improves efficiency of the server.

Optionally, the metadata is used to indicate the generation time point or the upload time point of the small object, and the method further includes: scanning metadata of the plurality of small objects, and determining generation time points or upload time points of the plurality of small objects; and deleting a first small object when a generation time point or an upload time point of the first small object in the plurality of small objects falls within an expiration time range.

The first small object is any expired small object in the foregoing plurality of small objects, and the server may determine a generation time point or an upload time point of the small object by scanning metadata of the small object. When some small objects in the plurality of small objects are expired objects, the expired objects are deleted, so that storage space utilization of the server can be improved.

Optionally, the deleting a first small object when a generation time point or an upload time point of the first small object in the plurality of small objects falls within an expiration time range includes: deleting the first small object when space utilization of the persistence layer is less than or equal to a space utilization threshold, and when the generation time point or the upload time point of the first small object in the plurality of small objects falls within the expiration time range.

The server may first add an expiration tag to the expired small object, and when the space utilization of the persistence layer is less than or equal to the space utilization threshold, delete the expired small object, so as to provide better services for users when the storage space utilization of the server is improved.

The server may manage the plurality of small objects by category based on the foregoing information, so that the efficiency of the server is improved.

Optionally, before the receiving an S3 request from a client, the method further includes: establishing an HTTP connection to the server, where the HTTP connection is used to transmit the large object, and the HTTP connection is a persistent connection.

According to a third aspect, a data sending apparatus is provided, where the apparatus may implement functions corresponding to the steps in the method involved in the foregoing first aspect, and the functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more units or modules corresponding to the foregoing functions.

In a possible design, the apparatus includes a processor, where the processor is configured to support the apparatus in executing the corresponding functions in the method involved in the foregoing first aspect. The apparatus may further include a memory, where the memory is configured to couple to the processor, and the memory stores a program instruction and data that are necessary to the apparatus. The apparatus further includes a communications interface, where the communications interface is configured to support communication between the apparatus and another network element.

According to a fourth aspect, a data receiving apparatus is provided, where the apparatus may implement functions corresponding to the steps in the method involved in the foregoing second aspect, and the functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more units or modules corresponding to the foregoing functions.

In a possible design, the apparatus includes a processor, where the processor is configured to support the apparatus in executing the corresponding functions in the method involved in the foregoing second aspect. The apparatus may further include a memory, where the memory is configured to couple to the processor, and the memory stores a program instruction and data that are necessary to the apparatus. The apparatus further includes a communications interface, where the communications interface is configured to support communication between the apparatus and another network element.

According to a fifth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores computer program code, and when the computer program code is executed by a processing unit or a processor, a data sending apparatus is enabled to perform the method in the first aspect.

According to a sixth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores computer program code, and when the computer program code is executed by a processing unit or a processor, a data receiving apparatus is enabled to perform the method in the second aspect.

According to a seventh aspect, a chip is provided, and the chip stores an instruction, where when the instruction runs on a data sending apparatus, the chip is enabled to perform the method in the foregoing first aspect.

According to an eighth aspect, a chip is provided, and the chip stores an instruction, where when the instruction runs on a data receiving apparatus, the chip is enabled to perform the method in the foregoing second aspect.

According to a ninth aspect, a computer program product is provided, where the computer program product includes computer program code, and when the computer program code is executed by a processor or a processing unit of a data uploading apparatus, a data sending apparatus is enabled to perform the method in the foregoing first aspect.

According to a tenth aspect, a computer program product is provided, where the computer program product includes computer program code, and when the computer program code is executed by a processor or a processing unit of a data uploading apparatus, a data receiving apparatus is enabled to perform the method in the foregoing second aspect.

<FIG> is a schematic diagram of an object storage system (object storage system) applicable to this application.

The object storage system includes a client (client) <NUM> and a server. The server includes a load balancing layer (load balancing layer) <NUM>, an object service layer (object service layer) <NUM>, a persistence layer (persistence layer) <NUM>, and an index layer (index layer) <NUM>. The foregoing each layer includes one or more servers. For example, the load balancing layer <NUM> includes a load balancing server (load balancing server) <NUM>, and the object service layer includes an object service server (object service server) <NUM>, an object service server <NUM>, and an object service server <NUM>.

The persistence layer <NUM> is a clustered storage pool including a plurality of servers, and a plurality of hard disks are configured for each server to provide data persistence and redundancy protection capabilities. Hard disks on different servers at the persistence layer <NUM> are combined into a logically consecutive resource pool (plog), and both the object service layer <NUM> and the index layer <NUM> may read and write the plog.

The index layer <NUM> is configured to store metadata and provide an index capability.

When the client <NUM> needs to upload data, the client <NUM> sends an S3 request to the load balancing server <NUM> over an internal network or a public network. The S3 request indicates that the client <NUM> needs to write an object (that is, an object needs to be uploaded), or the S3 request indicates that the client <NUM> needs to read an object.

The load balancing server <NUM> may allocate the S3 request to one or more servers based on a load status of each server at the object service layer <NUM>. For example, load of the object server <NUM> is currently comparatively light, and the load balancing server <NUM> allocates the S3 request to the object server <NUM>.

If the S3 request indicates that the client <NUM> needs to write the object, after receiving the object, the object server <NUM> stores a part of data of the object to the persistence layer <NUM>, and then stores metadata of the object to the index layer <NUM>.

If the S3 request indicates that the client <NUM> needs to read the object, the object server <NUM> first searches the index layer <NUM> for metadata indicated by the S3 request, and then reads, from the persistence layer <NUM> based on a data layout recorded in the metadata, object data corresponding to the metadata.

A data sending method and a data receiving method that are based on the foregoing object storage system and that are provided in this application are described in detail below.

As shown in <FIG>, a procedure executed by the client <NUM> is as follows.

C1: Establish an HTTP connection to the server shown in <FIG>. The HTTP connection is used to upload an object, and optionally, to reduce overheads for establishing a connection, the HTTP connection is a persistent connection. That is, after one object has been uploaded, the client <NUM> does not disconnect the HTTP connection, and continuously uses the HTTP connection to send an S3 request to request to upload another object.

In this application, the small object is an object whose amount of data is less than or equal to a first data amount threshold, and the first data amount threshold is, for example, <NUM> KB. If an obtained object is less than <NUM> KB, the client <NUM> determines that the object is the small object, and step C4 is performed: encapsulate the plurality of small objects into a large object and send the S3 request. If an obtained object is greater than <NUM> KB, the client <NUM> may directly send the S3 request to request to upload the object.

C3: Calculate a message digest algorithm (message digest algorithm, MD) <NUM> value of each small object, where the MD5 value is used by the server to check whether information included in the received small object is complete.

C4: Encapsulate, in the memory, the plurality of small objects into the large object. Optionally, the large object includes an object header (header), and the object header records an object name, a generation time point, an MD5 value, a length (length), and an offset (offset) that is of each small object in the large object.

As an optional example, before encapsulating N (N is a positive integer greater than <NUM>) small objects, the client <NUM> first calculates an amount of data of the encapsulated large object. If the amount of data of the encapsulated large object exceeds a second data amount threshold, the client <NUM> may decrease a value of N. If the amount of data of the encapsulated large object does not exceed the second data amount threshold, the client <NUM> may continue to encapsulate the N small objects. The second data amount threshold may be a value set based on a bearer capability based on a connection.

<FIG> is a schematic structural diagram of a large object generated by a client according to this application.

The client <NUM> obtains three small objects that are respectively obj1, obj2, and obj3, and encapsulates the three small objects into one large object. An encapsulation format of the large object meets a transmission requirement of an HTTP connection. In addition to obj1, obj2, and obj3, the large object further includes an object header, and the object header includes description information of each small object, that is, obj1. desc, obj2. desc, and obj3. For example, the description information of obj1 includes a path name (obj1. name) of obj1, an MD5 value (obj1. md5) of obj1, a generation date (obj1. date) of obj1, a length of obj1 (obj1. length), and an offset of obj <NUM> (obj1. offset) relative to the object header in the large object.

The schematic structural diagram of the large object is merely an example for description. The encapsulation format of the large object may alternatively be another format that meets a transmission requirement of a connection between the client <NUM> and a server, and the object header may further include more types of information or fewer types of information.

In this application, the client <NUM> encapsulates, in a memory, a plurality of small objects without changing data structures of the plurality of small objects or performing encryption processing or another processing on the plurality of small objects, and only encapsulates the plurality of small objects into a data packet that meets the transmission requirement of the connection between the client <NUM> and the server. This not only improves uploading efficiency of the client <NUM>, but also facilitates the server to obtain the plurality of small objects from the large object.

C5: Send the S3 request to the server to request to upload the large object.

C6: Receive a response message for the S3 request from the server, where the response message indicates that the client <NUM> starts to upload the large object.

C7: Send the large object to the server based on the response message.

C8: After the large object has been uploaded, if the client <NUM> still has a to-be-uploaded object, the client <NUM> continues to perform the step C2; and if the client <NUM> does not have the to-be-uploaded object, the client <NUM> performs step C9.

C9: Disconnect the HTTP connection. The procedure ends.

It can be learned from the foregoing procedure that the client <NUM> aggregates the plurality of small objects into one large object, and then sends the large object to the server. The client <NUM> can upload the plurality of small objects to the server by sending the S3 request for only once. Compared with a prior-art method in which a client needs to send an S3 request every time when sending a small object, the foregoing procedure provided in this application reduces information overheads, and improves data uploading efficiency in an object storage system.

A procedure executed by the server is as follows.

S1: Establish an HTTP connection to the client <NUM>. The HTTP connection is used to upload an object, and optionally, to reduce overheads for establishing a connection, the HTTP connection is a persistent connection. That is, after one object has been uploaded, the server does not disconnect the HTTP connection, and continuously uses the HTTP connection to receive an S3 request, and receive another object uploaded by the client <NUM>.

S2: Receive the S3 request, where the S3 request is used to request to upload a large object.

S3: Send a response message to the client <NUM>, where the response message indicates that the client <NUM> starts to upload the large object.

S4: Receive the large object from the client <NUM>.

S5: Check data integrity of a small object. For example, a location of each small object in the large object is determined based on description information in an object header, and an MD5 value of each small object is calculated. If a check of the MD5 value succeeds, it indicates that data of the small object is complete, and if the check of the MD5 value fails, the data of the small object is incomplete.

S6: Write a plurality of small objects into a persistence layer. Optionally, the plurality of small objects are written into the plog of the persistence layer <NUM>, that is, data of the plurality of small objects is written into consecutive storage spaces.

A plurality of small objects belonging to one large object are usually associated to some extent, for example, the plurality of small objects have a same generation time point. The plurality of small objects belonging to one large object are written into the consecutive storage spaces to facilitate management of the server.

Optionally, the server reads metadata of each small object, determines a generation time point or an upload time point of each small object, and stores, in the consecutive storage spaces, small objects whose generation time point or upload time point falls within a same time range, where the time range may be a preset range.

The foregoing example is merely an example for description. The server may also classify the received plurality of small objects in another manner, and store a same type of small objects in the consecutive storage spaces.

S7: Parse the object header of the large object to obtain the metadata of the small object, and store the metadata to the index layer <NUM>.

<FIG> is a schematic structural diagram of metadata stored at a server according to this application.

obj <NUM> is used as an example. After obtaining metadata of obj1 by parsing a received large object, the server writes layout information (obj1. layout) of obj <NUM> at the server into the metadata, and deletes some useless information, for example, obj <NUM>. offset and obj1.

layout includes an identifier (plogid) of a plog storing obj <NUM>, an offset (offset) of obj <NUM> relative to a start position of the plog, and a data length (length) of obj <NUM>. The data length of obj <NUM> is used to indicate a quantity of bits occupied by obj <NUM>.

The schematic structural diagram of the metadata shown in <FIG> is merely an example for description. The server may further add more description information to metadata of a small object.

S8: After the large object has been uploaded, if the client <NUM> still has a to-be-uploaded object, the server continues to perform the step S2; and if the client <NUM> does not have the to-be-uploaded object, the server performs step S9.

S9: Disconnect the HTTP connection. The procedure ends.

It can be learned from the foregoing procedure that the server receives, by receiving the large object including the plurality of small objects, the plurality of small objects by receiving the S3 request for only once. Compared with a prior-art method in which the server needs to receive the S3 request for once every time when receiving one small object, the foregoing procedure provided in this application reduces information overheads, and improves data uploading efficiency in an object storage system.

To improve requirements of input/output (input/output, I/O) performance, the server needs to align data when storing the data. For example, a minimum storage unit at the server is <NUM> KB. If the server receives only one <NUM> KB small object, the small object occupies a <NUM> KB storage space. This leads to a waste of storage resources. In addition, to improve a requirement of reliability, the server usually needs to back up one piece of data to obtain a plurality of copies and store copies in different disks. For example, if one <NUM> KB small object is backed up to obtain three copies, the foregoing storage resources are wasted by three times more.

According to the method shown in <FIG>, the large object received by the server is a set of the plurality of small objects. For example, if the server receives three <NUM> KB small objects, the three <NUM> KB small objects need only two <NUM> KB storage spaces, however, in the prior art, three <NUM> KB storage spaces are required to store three <NUM> KB small objects. Therefore, according to the data uploading method provided in this application, storage resource utilization at the server can be improved.

In a process of storing a small object, the server may regularly or irregularly scan metadata of the small object to obtain a generation time point or an upload time point of the small object. If the generation time point or the upload time point of the small object falls within an expiration time range, the server may directly delete the expired small object to improve space utilization of the plog, or may add an expired label to the metadata of the expired small object. When the space utilization of the plog is less than a preset utilization threshold, a space reclamation process is started, that is, the small object corresponding to the metadata that carries the expired label is deleted. In this way, space utilization can be improved, while a better service can be provided for users.

Because the server stores, in the consecutive storage spaces according to the method shown in <FIG>, the small objects whose generation time points or upload time points fall within a same time range, when a time range becomes the expiration time range, the server may delete all small objects corresponding to the time range, and obtain the consecutive storage spaces. Therefore, space fragments are avoided, the storage resource utilization at the server is improved, and lifecycle management overheads for a small object are reduced.

This application further provides a data downloading method.

S501: When a client <NUM> needs to download a small object, the client <NUM> establishes an HTTP connection to a server.

S502: The client <NUM> sends an S3 request to the server, where the S3 request is used to request to obtain the small object, and the small object is, for example, obj1.

S503: After receiving the S3 request, the server reads metadata of obj1 based on information (for example, a name of a bucket, a name of obj1, and path information of obj1) carried in the S3 request, and obtains layout information (obj1. layout) of obj1 to obtain a storage location of obj1.

S504: The server reads, based on the storage location indicated by obj1. layout, obj1 from a plog corresponding to obj <NUM>.

S505: The server sends obj1 to the client <NUM>, so as to complete a data downloading process.

An example of the data sending method and an example of the data receiving method that are provided in this application are described in detail above. It may be understood that to implement the foregoing functions, a data sending apparatus and a data receiving apparatus include corresponding hardware structures and/or software modules for executing the functions. A person of ordinary skill in the art should easily be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithms steps may be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or hardware driven by computer software depends on particular applications and design constraints of the technical solutions.

In this application, the data sending apparatus and the data receiving apparatus may be divided into functional units based on the foregoing method examples. For example, each function may be divided into each functional unit, or two or more functions may be integrated into one processing unit. It should be noted that, in this application, unit division is an example, and is merely a logical function division. In an actual implementation, another division manner may be used.

When an integrated unit is used, <FIG> is a possible schematic structural diagram of a data sending apparatus according to this application. The apparatus <NUM> includes a processing unit <NUM>, a sending unit <NUM>, and a receiving unit <NUM>. The processing unit <NUM> is configured to control the apparatus <NUM> to perform the steps of the client shown in <FIG>. The processing unit <NUM> may be further configured to perform another process of the technology described in this specification. The apparatus <NUM> may further include a storage unit <NUM> that is configured to store program code and data of the apparatus <NUM>.

For example, the processing unit <NUM> is configured to: obtain a plurality of to-be-uploaded small objects, where each of the small objects is an object whose amount of data is less than or equal to a first data amount threshold; and encapsulate the plurality of small objects to generate a large object, where the large object includes the plurality of small objects.

The sending unit <NUM> is configured to send an S3 request to a server, where the S3 request is used to request to upload the large object.

The receiving unit <NUM> is configured to receive a response message for the S3 request from the server, where the response message is used to indicate to start to upload the large object.

The sending unit <NUM> is further configured to send the large object to the server.

The processing unit <NUM> may be a processor or a controller, such as a central processing unit (central processing unit, CPU), a general purpose processor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA), or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in this application. The processor may also be a combination of processors implementing a computing function, for example, a combination of one or more microprocessors, or a combination of the DSP and the microprocessor. The sending unit <NUM> and the receiving unit <NUM> may be communications interfaces. The storage unit <NUM> may be a memory.

When the processing unit <NUM> is the processor, the sending unit <NUM> and the receiving unit <NUM> are the communications interfaces, and the storage unit <NUM> is the memory, the data sending apparatus involved in this application may be an apparatus shown in <FIG>.

Referring to <FIG>, the apparatus <NUM> includes a processor <NUM>, a communications interface <NUM>, and a memory <NUM>. The processor <NUM>, the communications interface <NUM>, and the memory <NUM> may communicate with each other by using an internal connection path, to transfer a control signal and/or a data signal.

It may be clearly understood by a person of skill in the art that, for ease and brief description, for a detailed working process of the foregoing apparatus and units, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.

The data sending apparatus provided in this application first encapsulates the plurality of to-be-uploaded objects with a comparatively small amount of data to generate an object with a comparatively large amount of data, namely, the large object, and then, sends the large object to the S3 server by using a connection between a client and the S3 server. Because the plurality of small objects are uploaded as a whole (namely, the large object), in a process of uploading the plurality of small objects, there is no need to repeatedly send the S3 request. This improves data uploading efficiency in an S3 system.

When an integrated unit is used, <FIG> is a possible schematic structural diagram of a data receiving apparatus according to this application. The apparatus <NUM> includes a processing unit <NUM>, a sending unit <NUM>, and a receiving unit <NUM>. The processing unit <NUM> is configured to control the apparatus <NUM> to perform the steps of the server shown in <FIG>. The processing unit <NUM> may be further configured to perform another process of the technology described in this specification. The apparatus <NUM> may further include a storage unit <NUM> that is configured to store program code and data of the apparatus <NUM>.

For example, the processing unit <NUM> is configured to control the receiving unit <NUM> to receive an S3 request from a client, where the S3 request is used to request to upload a large object, and the large object includes a plurality of small objects, and each of the small objects is an object whose amount of data is less than or equal to a data amount threshold.

The processing unit <NUM> is configured to control the sending unit <NUM> to send a response message for the S3 request to the client, where the response message is used to indicate to start to upload the large object.

The processing unit <NUM> is further configured to control the receiving unit <NUM> to receive the large object from the client.

The processing unit <NUM> may be a processor or a controller, for example, may be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA, or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in this application. The processor may also be a combination of processors implementing a computing function, for example, a combination of one or more microprocessors, or a combination of the DSP and the microprocessor. The sending unit <NUM> and the receiving unit <NUM> may be communications interfaces. The storage unit <NUM> may be a memory.

When the processing unit <NUM> is the processor, the sending unit <NUM> and the receiving unit <NUM> are the communications interfaces, and the storage unit <NUM> is the memory, the data receiving apparatus involved in this application may be an apparatus shown in <FIG>.

The data receiving apparatus provided in this application, by receiving the large object including the plurality of small objects, receives the plurality of small objects by receiving the S3 request for only once. Compared with a prior-art method in which the server needs to receive the S3 request for once every time when receiving one small object, the foregoing procedure provided in this application reduces information overheads, and improves data uploading efficiency in an object storage system.

An apparatus embodiment completely corresponds to a method embodiment, and a corresponding module performs a corresponding step. For example, a sending unit performs a sending step in the method embodiment, a receiving unit performs a receiving step in the method embodiment, and another step other than the sending step and the receiving step may be performed by a processing unit or a processor. For a function of a specific unit, refer to a corresponding method embodiment.

The execution sequences of the processes should be determined based on functions and internal logic of the processes, and should not be construed as any limitation on the implementation processes of this application.

In addition, the term "and/or" in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist.

Claim 1:
A data receiving method, applied to an object storage system, wherein the method comprises:
receiving a simple storage service S3 request from a client, wherein the S3 request is used to request to upload a large object, and the large object comprises a plurality of small objects, and each of the small objects is an object whose amount of data is less than or equal to a data amount threshold,
sending a response message for the S3 request to the client, wherein the response message is used to indicate to start to upload the large object; and
receiving the large object from the client;
storing the plurality of small objects to a persistence layer of the object storage system, wherein storage spaces of the plurality of small objects are consecutive storage spaces; and
storing metadata corresponding to each small object in the plurality of small objects to an index layer of the object storage system, wherein the metadata is used to indicate a generation time point or an upload time point of the small object,
scanning metadata of the plurality of small objects, and determining generation time points or upload time points of the plurality of small objects, and
deleting a first small object when a generation time point or an upload time point of the first small object in the plurality of small objects falls within an expiration time range.