Methods, apparatus, electronic devices, media, and products for processing batch tasks in object storage services.
By splitting and prioritizing the batch processing tasks of the bucket list in the object storage service, the problem of unfair resource allocation in the bucket list service is solved, and fair and efficient processing between storage buckets is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, the bucket list service for object storage buckets suffers from unfair resource allocation and low efficiency when handling storage buckets with different data volumes. In particular, it is difficult to guarantee timeliness and fairness for storage buckets with smaller data volumes.
By splitting and limiting the batch processing tasks corresponding to each bucket list rule, and allocating and executing batch processing subtasks according to preset data volume and execution priority, it is ensured that each bucket list batch processing task can obtain execution resources.
It enables fair task distribution and processing among storage buckets of different orders of magnitude, improving efficiency and fairness among storage buckets and ensuring that batch processing tasks for each bucket list can be executed in a timely manner.
Smart Images

Figure CN119025243B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, medium, and product for processing batch tasks of object storage services. Background Technology
[0002] The bucket list feature of object storage can process the data in a bucket according to the bucket list rules corresponding to the bucket, generate a list file and store it in the specified bucket, and help users list massive amounts of data.
[0003] However, when batch processing object data in a storage bucket, the next batch of tasks will only begin after the previous batch is completed. The amount of data to be processed in the batch processing tasks corresponding to the bucket list rules of different storage buckets varies. The bucket list service provided to storage buckets with large amounts of data will consume a lot of task execution resources, while for storage buckets with relatively small amounts of data, it is difficult to guarantee the timeliness and fairness of the bucket list service provided to them. Summary of the Invention
[0004] This disclosure provides a method, apparatus, electronic device, medium, and product for processing batch tasks of object storage services. By splitting and limiting the batch processing tasks of the bucket list corresponding to a single object storage bucket, a fair task distribution strategy is implemented for object storage buckets with different data volumes, ensuring that each bucket list batch processing task has execution resources, thereby achieving efficiency and fairness among object storage buckets.
[0005] In a first aspect, embodiments of this disclosure provide a method for processing batch tasks of object storage services, the method comprising:
[0006] The bucket list batch processing task corresponding to each bucket list rule is obtained through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data.
[0007] For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0008] Based on the bucket order of the storage buckets corresponding to each bucket list batch processing task and in accordance with the execution priority, select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence, and trigger the allocation and execution of the selected batch processing subtasks.
[0009] Secondly, embodiments of this disclosure also provide a processing apparatus for batch processing tasks of object storage services, the apparatus comprising:
[0010] The task acquisition module is used to obtain the bucket list batch processing task corresponding to each bucket list rule through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data.
[0011] The task splitting module is used to split each bucket list batch processing task according to a preset data volume, resulting in multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0012] The task allocation and processing module is used to select multiple batch processing subtasks corresponding to each batch processing task in the order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority, and to trigger the allocation and execution of the selected batch processing subtasks.
[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0014] One or more processors;
[0015] Storage device for storing one or more programs.
[0016] When one or more programs are executed by one or more processors, the one or more processors implement the object storage service batch task processing method as described in any embodiment of this disclosure.
[0017] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a processing method for an object storage service batch processing task as described in any of the embodiments of this disclosure.
[0018] Fifthly, this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements a method for processing batch tasks of object storage services as described in any of the embodiments of the present invention.
[0019] In this embodiment, a bucket list batch processing task corresponding to each bucket list rule is obtained through an object storage bucket list service. Each bucket list rule corresponds to one bucket list batch processing task, and the processing objects of each bucket list batch processing task include multiple object data. For each bucket list batch processing task, the task is split according to a preset data volume, resulting in multiple batch processing subtasks with execution priority order. Based on the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, the multiple batch processing subtasks corresponding to each bucket list batch processing task are selected sequentially, and the allocation and execution of the selected batch processing subtasks are triggered. The technical solution of this embodiment solves the problem that the bucket list service cannot simultaneously consider the fairness and efficiency among bucket list batch processing tasks corresponding to bucket list rules of different object storage buckets. By splitting and limiting the bucket list batch processing task corresponding to a single bucket list rule, a fair task distribution and processing strategy is implemented for storage buckets of different orders of magnitude, ensuring that each bucket list batch processing task has execution resources, thus achieving both efficiency and fairness among bucket list batch processing tasks corresponding to bucket list rules. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 This is a schematic flowchart of a batch processing method for an object storage service provided in this embodiment of the present disclosure;
[0022] Figure 2 This is a schematic flowchart of a batch processing method for an object storage service provided in this embodiment of the present disclosure;
[0023] Figure 3 This is a schematic flowchart of a batch processing method for an object storage service provided in this embodiment of the present disclosure;
[0024] Figure 4 This is a schematic flowchart of a batch processing method for an object storage service provided in this embodiment of the present disclosure;
[0025] Figure 5 This is a schematic diagram illustrating the implementation process of an application example of a batch processing method for an object storage service provided in this embodiment of the present disclosure. Figure 6 This is a schematic diagram of task splitting in an application example provided by an embodiment of this disclosure;
[0026] Figure 7This is a schematic diagram of multi-round task distribution in an application example provided by an embodiment of this disclosure;
[0027] Figure 8 This is a schematic diagram of the structure of a processing device for batch processing tasks of an object storage service provided in an embodiment of this disclosure;
[0028] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0035] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0036] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0038] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0039] Figure 1 This is a flowchart illustrating a batch processing method for an object storage service provided in this embodiment. This embodiment is applicable to scenarios where data processing tasks corresponding to storage buckets are scheduled and managed in object storage. The method can be executed by a batch processing device for the object storage service, which can be implemented in software and / or hardware. Optionally, the batch processing device for the object storage service can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0040] like Figure 1 As shown, the processing methods for batch tasks of object storage services include:
[0041] S110. Obtain the batch processing task of the bucket list corresponding to each bucket list rule through the bucket list service of object storage.
[0042] In this context, a bucket list batch processing task can be a task corresponding to a bucket list rule for an object data storage bucket. Each bucket list rule corresponds to one bucket list batch processing task, and each bucket list batch processing task processes multiple object data items.
[0043] In the field of object storage, file data is stored in key-value pair format, where the filename is the key and the file data is the value, and this key-value pair is called an object. A bucket is a container for storing object data, and all object data must belong to a bucket, which can be considered a namespace.
[0044] Each bucket can be configured with one or more bucket list rules by the user. Each bucket list rule corresponds to a bucket list batch processing task. Within the bucket list rules, you can define whether each batch processing task is executed daily or weekly; you can define the range of object data to be listed, such as specifying object data with a specified prefix, or listing only specific metadata information of the objects, such as object size, storage type, last update date, etc. When object data within a bucket meets the specified prefix or other conditions, this object data can be filtered out, a list can be generated, and the data can be stored in the specified bucket.
[0045] Bucket list service is a service provided by the object storage server to process object data in storage buckets based on bucket list rules. Specific services can be implemented through operation interfaces such as object uploading, deletion, and storage type conversion provided by the object storage server.
[0046] The bucket list batch processing task corresponding to each bucket list rule is obtained through the object storage bucket list service. This task can be obtained from the corresponding bucket list batch processing task queue consumption queue, or it can be obtained from a preset task information list or task retrieval interface. The obtained bucket list batch processing tasks can include multiple bucket list batch processing tasks corresponding to multiple bucket list rules for a single bucket, or multiple bucket list batch processing tasks corresponding to multiple bucket list rules for multiple buckets respectively.
[0047] S120. For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0048] Typically, during the processing of bucket list batch tasks, each bucket list rule corresponds to one bucket list batch task. Consequently, the processing time for bucket list batch tasks varies depending on the size of the buckets. Batch tasks for large-scale buckets can consume significant execution resources for extended periods, thus blocking the execution of bucket list batch tasks for other buckets. This results in an unfair allocation of execution resources among the buckets, particularly affecting small-scale buckets, where bucket list batch tasks may remain unexecuted for extended periods.
[0049] In this embodiment, after obtaining the bucket list batch processing task, the task can be split into corresponding batch processing subtasks. That is, each bucket list batch processing task is split into multiple batch processing subtasks to reduce the data volume of a single allocated bucket list batch processing task and ensure the timeliness of the bucket list batch processing task.
[0050] When splitting tasks, tasks can be split according to a preset data volume, resulting in multiple batch processing subtasks with execution priority for each bucket list batch processing task. That is, the data volume corresponding to each batch processing subtask is the same.
[0051] The execution priority order of batch processing subtasks can be determined based on the data order in the storage bucket, or it can be a random order or a batch processing subtask split according to certain rules.
[0052] For example, the execution priority order of batch processing subtasks in the corresponding bucket list batch processing task can be determined based on the data order of the batch processing subtasks in the corresponding bucket list batch processing task.
[0053] The order in which batch processing subtasks are split within the corresponding bucket list batch processing task determines the execution order of the subtasks when the bucket list batch processing task is split. It can be understood that the data order depends on the data sequence of the object data in the corresponding bucket. For example, if a bucket contains 10 million data entries, the task can be split in units of 1 million data entries, splitting the 10 million data entries according to the default data sorting, with each 1 million data entry resulting in a corresponding batch processing subtask. Alternatively, the task can be split based on the creation time of the object data in the bucket, splitting object data from every three consecutive hours into a corresponding batch processing subtask. The order in which the batch processing subtasks are split determines their execution priority. Subtasks split earlier have higher execution priority.
[0054] S130. According to the bucket order of the storage buckets corresponding to each bucket list batch processing task and the execution priority order, select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence, and trigger the allocation and execution of the selected batch processing subtasks.
[0055] The bucket order can be either lexicographical or randomly generated.
[0056] Specifically, according to the bucket order of the storage buckets corresponding to each bucket list batch processing task, the batch processing subtasks with higher execution priority can be selected from the multiple batch processing subtasks corresponding to each bucket list batch processing task, until the number of selected batch processing subtasks reaches the preset maximum task distribution number.
[0057] The preset maximum number of tasks to be distributed can be the maximum number of tasks to be distributed in a single task distribution, which can be greater than or equal to the number of task execution resources. The task execution resources can be preset worker threads. That is, only a fixed number of batch processing subtasks are distributed each time, and after the batch processing subtasks distributed in one distribution are processed, other batch processing subtasks will be re-selected and distributed.
[0058] Specifically, within a task distribution round, each bucket list batch processing task is treated equally. The order of task processing and its timeliness are not affected by differences in bucket list rules or the number of objects. Within each bucket list batch processing task, the highest priority subtasks are distributed to the corresponding worker threads based on their execution priority. Multiple bucket list batch processing tasks with the same highest priority subtasks can be processed within the same batch. If the number of bucket list batch processing tasks is less than the maximum number of tasks, additional subtasks can be selected from each bucket list batch task based on their execution priority and distributed and processed together.
[0059] The fair distribution strategy implemented in this step ensures that buckets with different object counts can execute pending tasks in parallel. When the service system expands, the expansion amount can also be evenly distributed to the bucket list batch processing tasks of each bucket, without resource skew limitations. Moreover, the number of tasks per batch can effectively control the execution time of each batch task, giving the bucket list batch processing tasks corresponding to the new bucket list rules more opportunities to participate in the distribution, which can effectively improve the user experience of using object storage services.
[0060] In this embodiment, the bucket list batch processing task corresponding to each bucket list rule is obtained through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task includes multiple object data. For each bucket list batch processing task, the task is split according to a preset data volume, resulting in multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task. According to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, the multiple batch processing subtasks corresponding to each bucket list batch processing task are selected sequentially, and the allocation and execution of the selected batch processing subtasks are triggered. The technical solution of this embodiment solves the problem that the bucket list service cannot simultaneously consider the fairness and efficiency among the bucket list batch processing tasks corresponding to bucket list rules of different object storage buckets. By splitting and limiting the bucket list batch processing task corresponding to a single bucket list rule, a fair task distribution and processing strategy is implemented for object storage buckets of different orders of magnitude, ensuring that each bucket list batch processing task has execution resources, thus achieving both efficiency and fairness among the bucket list batch processing tasks corresponding to bucket list rules.
[0061] Figure 2 This is a flowchart illustrating a method for processing batch tasks of an object storage service provided in this embodiment. Based on the above embodiment, it further explains the task distribution process during the implementation of the object storage service batch task processing method. This method can be executed by a processing device for object storage service batch tasks. This device can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server.
[0062] like Figure 2 As shown, the processing methods for batch tasks of object storage services include:
[0063] S210. Obtain the batch processing task of the bucket list corresponding to each bucket list rule through the bucket list service of object storage.
[0064] Each bucket list rule corresponds to a bucket list batch processing task, and each bucket list batch processing task contains multiple object data.
[0065] S220. For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0066] In this embodiment, the data volume corresponding to each batch processing subtask is less than or equal to a preset data volume. That is, the bucket list batch processing task is split according to a fixed data volume. After task splitting, the data volume corresponding to each batch processing subtask will not exceed the preset data volume.
[0067] The current bucket list service does not control the task processing time after a task distribution round, i.e., the working time of a task execution resource. During a batch task processing execution, newly created bucket list batch processing tasks can only participate in the next task distribution round after the current batch processing task has finished executing. The waiting time is uncontrollable, which seriously affects the timeliness of the bucket list service.
[0068] In this embodiment, since a maximum data volume for each batch processing subtask is defined, meaning there is an upper limit to the data volume of each batch processing subtask, the task processing time is also controlled, further ensuring the timeliness of the bucket list batch processing tasks. Based on the relationship between the number of tasks in the bucket list batch processing tasks and the preset maximum task distribution number, S230 or S240 can be executed.
[0069] S230. When the number of tasks in the bucket list batch processing task is greater than or equal to the preset maximum number of tasks to be distributed, the batch processing subtask corresponding to the highest priority in the execution priority order is selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task.
[0070] The preset maximum number of tasks to be distributed corresponds to the amount of execution resources required for supporting bucket list batch processing tasks. For example, if the required execution resources for supporting bucket list batch processing tasks are 10 worker threads, then the preset maximum number of tasks to be distributed is 10. In a single task distribution, 10 batch processing subtasks can be selected and distributed.
[0071] Each bucket list rule corresponds to a fair batch processing task. When selecting batch processing subtasks, the highest priority subtask is selected from the batch processing subtasks corresponding to each bucket list batch processing task, according to the bucket order of the storage buckets. Consequently, the number of selected batch processing subtasks is greater than or equal to the preset maximum number of tasks to be distributed.
[0072] S240. When the number of tasks in the bucket list batch processing task is less than the preset maximum task distribution quantity, the batch processing subtask corresponding to the highest priority in the execution priority order is repeatedly selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, until the number of tasks corresponding to the selected batch processing subtask is greater than or equal to the preset maximum task distribution quantity.
[0073] Based on the fairness principle of batch processing tasks corresponding to each bucket list rule, when selecting batch processing subtasks, the highest priority subtask is selected from the batch processing subtasks corresponding to each bucket list batch processing task according to the bucket order of the storage buckets. When the number of tasks in a bucket list batch processing task is less than the preset maximum task distribution number, the number of selected batch processing subtasks will also be less than the preset maximum task distribution number. This indicates that if batch processing subtasks are selected only once, the execution resources of some bucket list batch processing tasks will be idle. To improve the utilization of task execution resources, the highest priority batch processing subtask can be repeatedly selected from each bucket list batch processing task until the number of tasks corresponding to the selected batch processing subtasks is greater than or equal to the preset maximum task distribution number.
[0074] For example, given 3 bucket list batch processing tasks and 10 corresponding worker threads, the first step involves selecting the highest-priority subtask from the batch processing subtasks corresponding to each bucket list batch processing task, following the bucket order of the storage buckets. This process selects the highest-priority subtask from each of the 3 bucket list batch processing tasks. If there are still idle execution resources, a second, third, and fourth task selection can be performed to select batch processing subtasks with a number greater than or equal to the preset maximum task distribution number.
[0075] S250. Based on the preset maximum number of tasks to be distributed, the selected batch processing subtasks are assigned to the task execution worker thread and executed.
[0076] Specifically, the number of batch processing subtasks selected through S230 or S240 is greater than or equal to the preset maximum task distribution number. Based on the execution priority order and bucket order of each selected batch processing subtask, the batch processing subtasks corresponding to the preset maximum task distribution number are assigned to task execution worker threads for execution. If there are remaining unassigned batch processing subtasks, these unassigned batch processing subtasks from the selected batch processing subtasks are used as the allocation targets for the next round of task allocation, until all selected batch processing subtasks have been allocated and executed.
[0077] When the number of selected batch processing subtasks is the same as the preset maximum number of tasks to be distributed, it can be determined that a task allocation has been completed. Then, each batch processing subtask can be distributed to the corresponding worker thread for bucket list batch processing.
[0078] S260. After each assigned batch processing subtask is completed, the bucket list batch processing task corresponding to each bucket list rule is retrieved again through the bucket list service to update the bucket list batch processing task that needs to be processed.
[0079] Once all selected batch processing subtasks in the current task distribution round have been distributed and processed, the next round of task distribution can begin. During the next round of task distribution, new bucket list batch processing tasks will be obtained through the bucket list service. New bucket list batch processing tasks that need to be processed can be added to the next round of task distribution without waiting for the old tasks to finish before starting the new tasks.
[0080] For example, there are 3 bucket list batch processing tasks (A, B, and C) and 5 corresponding worker threads. The 3 bucket list batch processing tasks are respectively split into batch processing subtasks A1, A2, A3, B1, B2, C1, C2, C3, and C4. The first batch processing subtask selects A1, B1, and C1. The second batch processing subtask selects A2, B2, and C2. The number of selected batch processing subtasks is 6, which is greater than the number of worker threads. This can trigger the task allocation and execution process. According to the bucket order and execution priority, the first task allocation assigns A1, B1, C1, A2, and B2 to the corresponding worker threads for execution.
[0081] Then, the batch processing tasks corresponding to each bucket list rule are retrieved again through the bucket list service to update the batch processing tasks that need to be processed, resulting in bucket list batch processing task D. D is split into D1 and D2. Subtasks A3, C2, D1, C3, and D2 can then be selected. Based on the bucket order and execution priority, the second task distribution assigns D1, C2, D2, A3, and C3 to their corresponding worker threads for execution.
[0082] The technical solution of this disclosure embodiment obtains the batch processing task corresponding to each bucket list rule through the bucket list service of object storage; for each bucket list batch processing task, the task is split according to a preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task; when the number of tasks in the bucket list batch processing task is greater than or equal to the preset maximum task distribution number, the batch processing subtask corresponding to the highest priority in the execution priority order is selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task; when the number of tasks in the bucket list batch processing task is less than the preset maximum task distribution number, the batch processing subtask corresponding to the highest priority in the execution priority order is repeatedly selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, until the number of tasks corresponding to the selected batch processing subtasks is greater than or equal to the preset maximum task distribution number; according to the preset maximum task distribution number, the selected batch processing subtasks are assigned to task execution worker threads and executed. The technical solution of this disclosure addresses the problem that the bucket list service cannot simultaneously consider the fairness and efficiency of bucket list batch processing tasks corresponding to bucket list rules for each object storage bucket. By splitting the bucket list batch processing task corresponding to a single storage bucket and limiting the data volume of a single subtask, a fair task distribution strategy is implemented for storage buckets of different orders of magnitude. This ensures that the bucket list batch processing tasks corresponding to newly created bucket list rules can all have execution resources, further improving the efficiency and fairness of the bucket list service among storage buckets.
[0083] Figure 3 This is a flowchart illustrating a batch processing method for an object storage service task according to an embodiment of this disclosure. Based on the above embodiment, the process of managing batch processing tasks for new and old bucket lists under the same bucket list rule is further explained during the implementation of the batch processing method for the object storage service task. This method can be executed by a processing device for the object storage service batch processing task. This device can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server.
[0084] like Figure 3 As shown, the processing methods for batch tasks of object storage services include:
[0085] S310. Obtain the batch processing task of the bucket list corresponding to each bucket list rule through the bucket list service of object storage.
[0086] S320. Based on the bucket list rule information associated with the bucket list batch processing task, determine whether there are multiple bucket list batch processing tasks corresponding to the same bucket list rule in the bucket list batch processing task.
[0087] In a typical bucket list service, bucket list rules for each bucket are considered to have equal priority, with one bucket list rule corresponding to one bucket list batch task. However, when tasks span multiple days (meaning a bucket list batch task hasn't finished processing by 00:00), a bucket list rule for a bucket will simultaneously correspond to yesterday's (old) bucket list batch task and today's (new) bucket list batch task, meaning one bucket corresponds to two bucket list batch tasks. From a bucket perspective, this means the bucket is occupying two sets of execution resources, which is unfair to other buckets. This unfairness is further amplified when this phenomenon occurs with a large number of buckets, impacting a smaller number of buckets.
[0088] In this embodiment, after obtaining the bucket list batch processing task, the system first determines whether there are more than one bucket list batch processing task associated with the same bucket list rule based on the bucket list rule information corresponding to the bucket list batch processing task. That is, it checks whether a storage bucket corresponds to two or more bucket list batch processing tasks (old and new) for a single bucket list rule. When two or more bucket list batch processing tasks are found to be associated with a single bucket list rule identifier, it can be determined that there are associated pending list tasks within the bucket list batch processing tasks that correspond to the same bucket list rule.
[0089] S330. In the case of multiple bucket list batch processing tasks corresponding to the same bucket list rule, select the bucket list batch processing task with the earliest task time from the multiple bucket list batch processing tasks and execute it first, according to the single bucket old rule priority strategy.
[0090] When multiple bucket list batch processing tasks correspond to the same bucket list rule, to ensure that each bucket list rule corresponds to one bucket list batch processing task, the bucket list batch processing task with the earliest task time will be selected and executed first according to the single-bucket old rule priority strategy. That is, in scenarios with bucket list batch processing tasks spanning multiple days, to ensure that all bucket list batch processing tasks are scheduled fairly, the splitting and task distribution management operations for multiple bucket list batch processing tasks corresponding to the same bucket list rule will be suspended. In other words, when a bucket list rule has corresponding incomplete old tasks, only the incomplete old tasks can participate in task distribution scheduling and are processed first; the corresponding new bucket list batch processing tasks do not participate in task splitting and distribution.
[0091] For example, the bucket list batch processing task corresponding to bucket list rule A generates a cross-day task. Rule A corresponds to 3 bucket list batch processing tasks, of which 2 are old tasks, one of which is incomplete and the other has not yet started processing; there is 1 new task remaining. In this case, the task participating in task over-splitting and distribution corresponding to rule A is only the 1 incomplete old task, and the old task that has not yet started processing and the new task are paused.
[0092] S340. For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0093] S350. According to the bucket order of the storage buckets corresponding to each bucket list batch processing task and the execution priority order, select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence, and trigger the allocation and execution of the selected batch processing subtasks.
[0094] The technical solution of this disclosure embodiment obtains the batch processing tasks corresponding to each bucket list rule through the bucket list service of object storage; based on the bucket list rule information associated with the batch processing tasks, it determines whether there are multiple batch processing tasks corresponding to the same bucket list rule; if multiple batch processing tasks corresponding to the same bucket list rule exist, the bucket list batch processing task with the earliest task time is selected from the multiple batch processing tasks according to the single bucket old rule priority strategy and executed first; for each bucket list batch processing task, the task is split according to a preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task; according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, the multiple batch processing subtasks corresponding to each bucket list batch processing task are selected sequentially, and the allocation and execution of the selected batch processing subtasks are triggered. The technical solution of this disclosure embodiment solves the problem of unfairness caused by one storage bucket occupying multiple task execution resources when a bucket list rule has cross-day tasks in the bucket list service, and can further improve the efficiency and fairness of the bucket list service between storage buckets through the single storage bucket old task priority strategy.
[0095] Figure 4This is a flowchart illustrating a batch processing method for an object storage service task according to an embodiment of this disclosure. Based on the above embodiment, the process of managing batch processing tasks for new and old bucket lists under the same bucket list rule is further explained during the implementation of the batch processing method for the object storage service task. This method can be executed by a processing device for the object storage service batch processing task. This device can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server.
[0096] like Figure 4 As shown, the processing methods for batch tasks of object storage services include:
[0097] S410. Determine the preset execution time threshold and the preset concurrency threshold for a single bucket list batch processing task, and determine the amount of resources required to support the execution of bucket list batch processing tasks.
[0098] In the bucket list service, service managers can pre-configure the execution time threshold, concurrency threshold, and resource quantity supporting the execution of individual bucket list batch processing tasks to manage the processing of bucket list batch processing tasks.
[0099] The execution time threshold for a single bucket list batch processing task limits the duration for a worker thread to execute a task. If a task fails to complete within the execution time threshold, the thread will terminate its lifecycle to prevent prolonged thread occupation. Correspondingly, the execution time threshold also limits the preset data volume used to guide task splitting during subsequent bucket list batch processing task splitting, ensuring that each batch processing subtask can complete within the execution time threshold under normal operating conditions.
[0100] The concurrency threshold for bucket list batch processing tasks is the number of bucket list batch processing tasks that can be processed simultaneously, which is also the number of bucket list rules that can be processed simultaneously.
[0101] The amount of resources required to execute bucket list batch processing tasks can correspond to the preset maximum number of tasks to be distributed.
[0102] S420. Based on the execution time threshold of a single bucket list batch processing task, the concurrency threshold of the bucket list batch processing task, and the execution resource amount of the bucket list batch processing task, determine the filtering period of the bucket list batch processing task. The filtering period is used to control the execution period of the bucket list batch processing task.
[0103] In each task distribution round, the number of tasks in the target distribution task corresponds to the amount of execution resources for the bucket list batch processing task. The execution time of each task when the execution resources are processed is limited by an execution time threshold, and the processing time of each round of tasks is also controlled accordingly.
[0104] Assuming each batch processing subtask takes m minutes to execute, and n batch processing subtasks are distributed each time, with t execution resources available, the maximum execution time for all batch processing subtasks in this task distribution round is m*n / t minutes. That is, with m*n / t minutes as the maximum execution period, every m*n / t minutes, the batch processing subtasks for the next task distribution round will be re-selected and distributed. Newly created bucket list batch processing tasks will be executed after a maximum of m*n / t minutes. This time can be shortened by increasing the value of t. The timeliness of bucket list batch processing tasks can be controlled at the hourly level, significantly improving the user experience of the bucket list service.
[0105] Once the task flow management parameters of the bucket list service are determined, the bucket list batch processing tasks that need to be processed can be executed according to the filtering cycle of the corresponding bucket list batch processing tasks.
[0106] S430. Obtain the batch processing task of each bucket list rule through the bucket list service of object storage.
[0107] S440. Based on the bucket list rule information associated with the bucket list batch processing task, determine whether there are multiple bucket list batch processing tasks corresponding to the same bucket list rule in the bucket list batch processing task.
[0108] S450. In the case of multiple bucket list batch processing tasks corresponding to the same bucket list rule, select the bucket list batch processing task with the earliest task time from the multiple bucket list batch processing tasks according to the single bucket old rule priority strategy and execute it first.
[0109] S460. For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0110] S470. According to the bucket order of the storage buckets corresponding to each bucket list batch processing task and the execution priority order, select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence, and trigger the allocation and execution of the selected batch processing subtasks.
[0111] S480. After each assigned batch processing subtask is completed, the bucket list batch processing task corresponding to each bucket list rule is retrieved again through the bucket list service to update the bucket list batch processing task that needs to be processed.
[0112] S490. Based on the filtering cycle, select multiple batch processing subtasks from the batch processing subtasks corresponding to the updated batch processing tasks of the bucket list that need to be processed, according to the bucket order of the storage buckets corresponding to each batch processing task of the bucket list and the execution priority order, and trigger the allocation and execution of the selected batch processing subtasks.
[0113] This embodiment provides a pre-configuration scheme for execution time thresholds, concurrency thresholds for bucket list batch processing tasks, and execution resource quantities. Based on the configuration results, the pre-set execution time threshold and concurrency threshold for a single bucket list batch processing task are determined, along with the required execution resource quantity for each task. Furthermore, based on these factors, the filtering period for the bucket list batch processing tasks is determined. This filtering period controls the execution period of the bucket list batch processing tasks, thus managing the bucket list service process. This achieves both fairness and efficiency for bucket list batch processing tasks corresponding to the bucket list rules of each object storage bucket.
[0114] In a specific application example of object storage service batch task processing methods, the processing procedure for object storage service batch tasks can be referenced. Figure 5 The content shown. Specifically, it includes the following process:
[0115] First, after the batch processing of the object storage service begins, the bucket list rules of the buckets will be obtained periodically or according to the processing progress of each batch task. That is, the bucket list batch processing task corresponding to the bucket list rules of the storage buckets will be obtained.
[0116] Then, the single bucket list rule task is split into multiple batch processing tasks (corresponding to the batch processing subtasks in the above embodiments), and priority is set in sequence.
[0117] Before distributing tasks (batch subtasks), confirm whether there are any unfinished old tasks. Specifically, confirm whether there is a bucket with a bucket list rule that spans multiple days. If so, the old tasks within the spanning-day task list participate in task allocation; otherwise, the new tasks directly participate in task allocation.
[0118] During task allocation, tasks for the current task allocation round are selected from the batch processing task list corresponding to each bucket rule in order of priority.
[0119] Determine if the number of tasks participating in the allocation of a single batch has reached the batch distribution limit. If so, distribute the tasks and then execute them. Otherwise, return to the batch processing task list corresponding to each bucket rule and select tasks in order of priority.
[0120] Once a batch of tasks has been completed, the bucket list rules can be retrieved.
[0121] Furthermore, when splitting a single bucket list rule task into multiple batch processing tasks, the splitting process can refer to... Figure 6 The process diagram shown is shown below.
[0122] exist Figure 6 When retrieving bucket list rules, two bucket list rules, Rule A and Rule B, are obtained. Batch processing tasks are split according to the data processing volume. Rule A corresponds to bucket a with 2 million data entries, and Rule B corresponds to bucket b with 3 million data entries. If the batch processing tasks are split according to 1 million data entries, Rule A corresponds to two batch processing tasks with priorities 1 and 2, which can be represented as Ap1 and Ap2 respectively; Rule B corresponds to three batch processing tasks with priorities 1, 2, and 3, which can be represented as Bp1, Bp2, and Bp3 respectively. Furthermore, tasks can be distributed according to priority, selecting priorities 1, 2, 3... in sequence. The distributed batch processing execution order is Ap1, Bp1, Ap2, Bp2, Bp3.
[0123] exist Figure 7 The example demonstrates setting the maximum number of tasks to be distributed in a single batch to 4. Tasks can be distributed until the maximum number is reached. If no tasks need to be distributed before reaching this maximum, all tasks will be distributed. For example, if rule A and rule B exist simultaneously, with rule A corresponding to 3 tasks and rule B corresponding to 3 tasks, then based on priority, the first distribution can select 2 tasks from rule A and 2 tasks from rule B to distribute, with the remaining tasks waiting for the next distribution. After all tasks from the first distribution have finished executing, all bucket list rules are retrieved again. If any newly created bucket list rules are present, they can be retrieved at this step. For example, if a new rule C corresponds to 1 task, then the tasks to be distributed will include 1 task from rule A, 1 task from rule B, and 1 task from rule C. The second distribution can then select tasks from the remaining tasks to distribute, until all tasks have been distributed. From the second distribution onwards, tasks corresponding to the new rule (rule C) will participate in the task allocation process, without waiting for all tasks corresponding to all rules to be processed, thus ensuring timeliness.
[0124] Figure 8 This disclosure provides an object storage service batch processing task processing apparatus. The apparatus is suitable for scenarios involving scheduling and managing data processing tasks in object storage buckets within object storage. The object storage service batch processing task processing apparatus can be implemented in software and / or hardware and can be configured on an electronic device, such as a mobile terminal, a PC, or a server.
[0125] like Figure 8 As shown, the processing device for batch processing tasks of object storage service includes: a task acquisition module 510, a task splitting module 520, and a task allocation and processing module 530.
[0126] The task acquisition module 510 is used to acquire the bucket list batch processing task corresponding to each bucket list rule through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data. The task splitting module 520 is used to split each bucket list batch processing task according to a preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task. The task allocation and processing module 530 is used to select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, and trigger the allocation and execution of the selected batch processing subtasks.
[0127] The technical solution of this disclosure embodiment obtains the batch processing tasks corresponding to each bucket list rule through the bucket list service of object storage. Each bucket list rule corresponds to one batch processing task, and the processing objects of each batch processing task include multiple object data. For each batch processing task, the task is split according to a preset data volume, resulting in multiple batch processing subtasks with execution priority order. According to the bucket order of the storage buckets corresponding to each batch processing task and according to the execution priority order, the multiple batch processing subtasks corresponding to each batch processing task are selected sequentially, and the allocation and execution of the selected batch processing subtasks are triggered. The technical solution of this disclosure embodiment solves the problem that the bucket list service cannot simultaneously consider the fairness and efficiency among the batch processing tasks corresponding to bucket list rules of different object storage buckets. By splitting and limiting the batch processing tasks corresponding to a single bucket list rule, a fair task distribution and processing strategy is implemented for object storage buckets of different orders of magnitude, ensuring that each batch processing task has execution resources, thus achieving both efficiency and fairness among the batch processing tasks corresponding to bucket list rules.
[0128] In one optional implementation, the task allocation and processing module 530 may be specifically used for:
[0129] When the number of tasks in a bucket list batch processing task is greater than or equal to the preset maximum number of tasks to be distributed, the batch processing subtask corresponding to the highest priority in the execution priority order is selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task.
[0130] Based on the preset maximum number of tasks to be distributed, the selected batch processing subtasks are assigned to task execution worker threads and executed.
[0131] In an optional implementation, the task allocation and processing module 530 may be further specifically used for:
[0132] Based on the execution priority order and bucket order of each selected batch processing subtask, the batch processing subtasks corresponding to the preset maximum number of task distributions are assigned to the task execution worker thread and executed.
[0133] Unassigned batch processing subtasks among the selected batch processing subtasks will be used as the allocation targets for the next round of task allocation, until all selected batch processing subtasks have been allocated and executed.
[0134] In an optional implementation, the task allocation and processing module 530 may also be specifically used for:
[0135] When the number of tasks in a bucket list batch processing task is less than the preset maximum number of tasks to be distributed, the batch processing subtask corresponding to the highest priority in the execution priority order is repeatedly selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, until the number of tasks corresponding to the selected batch processing subtask is greater than or equal to the preset maximum number of tasks to be distributed.
[0136] In an alternative implementation, the task acquisition module 510 can also be used for:
[0137] After obtaining the bucket list batch processing task corresponding to each bucket list rule, determine whether there are multiple bucket list batch processing tasks corresponding to the same bucket list rule based on the bucket list rule information associated with the bucket list batch processing task.
[0138] If there are multiple bucket list batch processing tasks corresponding to the same bucket list rule, the bucket list batch processing task with the earliest task time is selected from the multiple bucket list batch processing tasks and executed first, according to the single bucket old rule priority strategy.
[0139] In an alternative implementation, the task acquisition module 510 can also be used for:
[0140] After each assigned batch processing subtask is completed, the bucket list service is used to retrieve the corresponding bucket list batch processing task for each bucket list rule to update the bucket list batch processing task that needs to be processed.
[0141] In one optional implementation, the processing apparatus for object storage service batch tasks further includes a task execution management module, used for:
[0142] Determine the preset execution time threshold and the preset concurrency threshold for a single bucket list batch processing task, and determine the amount of resources required to support the execution of bucket list batch processing tasks.
[0143] The filtering period for bucket list batch processing tasks is determined based on the execution time threshold, concurrency threshold, and execution resource requirements of each task. This filtering period is used to control the execution cycle of the bucket list batch processing tasks.
[0144] The object storage service batch processing device provided in this disclosure can execute the object storage service batch processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0145] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0146] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 9 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 9 The diagram below shows the structure of the terminal device or server 600. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0147] like Figure 9 As shown, electronic device 600 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Edit / output (I / O) interface 605 is also connected to bus 605.
[0148] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0149] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0150] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0151] The electronic device provided in this embodiment and the batch processing method for object storage services provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0152] This disclosure also provides a computer storage medium storing a computer program that, when executed by a processor, implements the batch processing method for object storage services provided in the above embodiments.
[0153] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0154] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0155] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0156] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:
[0157] The bucket list batch processing task corresponding to each bucket list rule is obtained through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data.
[0158] For each bucket list batch processing task, the task is split according to the preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task.
[0159] Based on the bucket order of the storage buckets corresponding to each bucket list batch processing task and in accordance with the execution priority, select multiple batch processing subtasks corresponding to each bucket list batch processing task in sequence, and trigger the allocation and execution of the selected batch processing subtasks.
[0160] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0162] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0163] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0164] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0165] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements a batch processing method for object storage services as provided in any embodiment of this disclosure.
[0166] In implementing a computer program product, computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0167] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0168] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0169] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for processing batch tasks of an object storage service, characterized in that, include: The bucket list batch processing task corresponding to each bucket list rule is obtained through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data. For each bucket list batch processing task, the task is split according to a preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task. According to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, multiple batch processing subtasks corresponding to each bucket list batch processing task are selected in sequence, and the allocation and execution of the selected batch processing subtasks are triggered; wherein, the bucket order of the storage buckets is the lexicographical order corresponding to the storage bucket identifier, or a randomly generated order; The processing method further includes, after obtaining the batch processing task for the bucket list corresponding to each bucket list rule: Based on the bucket list rule information associated with the bucket list batch processing task, determine whether there are multiple bucket list batch processing tasks corresponding to the same bucket list rule in the bucket list batch processing task. The multiple bucket list batch processing tasks include unprocessed old bucket list batch processing tasks in the current task distribution round and new bucket list batch processing tasks in the next task distribution round. If multiple bucket list batch processing tasks exist that correspond to the same bucket list rule, the task distribution and scheduling of the multiple bucket list batch processing tasks are suspended according to the single bucket old rule priority strategy, and the old bucket list batch processing task with the earliest task time is selected from the multiple bucket list batch processing tasks for priority execution.
2. The method according to claim 1, characterized in that, The step of sequentially selecting multiple batch processing subtasks corresponding to each batch processing task of the bucket list according to the bucket order of the storage buckets corresponding to each batch processing task of the bucket list and according to the execution priority order, and triggering the allocation and execution of the selected batch processing subtasks, includes: When the number of tasks in the bucket list batch processing task is greater than or equal to the preset maximum number of tasks to be distributed, the batch processing subtask corresponding to the highest priority in the execution priority order is selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task. Based on the preset maximum number of tasks to be distributed, the selected batch processing subtasks are assigned to task execution worker threads and executed.
3. The method according to claim 2, characterized in that, The step of allocating the selected batch processing subtasks to task execution worker threads and executing them according to the preset maximum task distribution number includes: Based on the execution priority order and bucket order corresponding to each batch processing subtask in the selected batch processing subtasks, the batch processing subtasks in the selected batch processing subtasks that correspond to the preset maximum number of task distributions are assigned to the task execution worker thread and executed. The unassigned batch processing subtasks among the selected batch processing subtasks will be used as the allocation targets for the next round of task allocation until all the selected batch processing subtasks have been allocated and executed.
4. The method according to claim 2, characterized in that, The step of sequentially selecting multiple batch processing subtasks corresponding to each batch processing task according to the bucket order of the storage buckets corresponding to each batch processing task in the bucket list and according to the execution priority order, and triggering the allocation and execution of the selected batch processing subtasks, further includes: When the number of tasks in the bucket list batch processing task is less than the preset maximum task distribution number, the batch processing subtask corresponding to the highest priority in the execution priority order is repeatedly selected in each bucket list batch processing task according to the bucket order of the storage buckets corresponding to each bucket list batch processing task and according to the execution priority order, until the number of tasks corresponding to the selected batch processing subtask is greater than or equal to the preset maximum task distribution number.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: After each assigned batch processing subtask is completed, the bucket list service is used to retrieve the corresponding bucket list batch processing task for each bucket list rule to update the bucket list batch processing task that needs to be processed.
6. The method according to any one of claims 1-4, characterized in that, The method further includes: Determine the preset execution time threshold and the preset concurrency threshold for a single bucket list batch processing task, and determine the amount of resources required to support the execution of bucket list batch processing tasks. The filtering period for the bucket list batch processing task is determined based on the execution time threshold of the single bucket list batch processing task, the concurrency threshold of the bucket list batch processing task, and the execution resource amount of the bucket list batch processing task. The filtering period is used to control the execution period of the bucket list batch processing task.
7. A processing apparatus for batch processing tasks of an object storage service, characterized in that, include: The task acquisition module is used to acquire the bucket list batch processing task corresponding to each bucket list rule through the bucket list service of object storage. Each bucket list rule corresponds to one bucket list batch processing task, and the processing object of each bucket list batch processing task contains multiple object data. The task splitting module is used to split each bucket list batch processing task according to a preset data volume to obtain multiple batch processing subtasks with execution priority order corresponding to each bucket list batch processing task. The task allocation and processing module is used to select multiple batch processing subtasks corresponding to each batch processing task in the bucket list according to the bucket order of the storage buckets corresponding to each batch processing task in the bucket list and according to the execution priority order, and trigger the allocation and execution of the selected batch processing subtasks; wherein, the bucket order of the storage buckets is the lexicographical order corresponding to the storage bucket identifier, or a randomly generated order. The task acquisition module is further configured to determine, based on the bucket list rule information associated with the bucket list batch processing task, whether there are multiple bucket list batch processing tasks corresponding to the same bucket list rule within the bucket list batch processing task. These multiple bucket list batch processing tasks include unprocessed old bucket list batch processing tasks from the current task distribution round and new bucket list batch processing tasks from the next task distribution round; and... If multiple bucket list batch processing tasks exist that correspond to the same bucket list rule, the task distribution and scheduling of the multiple bucket list batch processing tasks are suspended according to the single bucket old rule priority strategy, and the old bucket list batch processing task with the earliest task time is selected from the multiple bucket list batch processing tasks for priority execution.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the object storage service batch task processing method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, this program implements the batch processing method for object storage services as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the processing method for batch processing tasks of object storage services as described in any one of claims 1-6.
Citation Information
Patent Citations
Job distribution method, scheduling system, electronic equipment and computer storage medium
CN116991586A
Task processing method and device, storage medium and computer equipment
CN118295790A