Automatic distributed packaging method and system

Through automated distributed packaging methods and systems, packaging requests are decomposed into multiple tasks and assigned to multiple services for execution, dynamic expansion and load balancing solve the problem of low channel package generation efficiency in the existing technology and achieve efficient Multi-channel package generation and system stability.

CN118779110APending Publication Date: 2024-10-15XIAMEN YOULI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410999304.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing application channel package generation tools are inefficient and cannot be put on multiple application markets at the same time, resulting in limited operation and distribution efficiency.

Method used

Using automated distributed packaging methods and systems, packaging requests are decomposed into multiple tasks and assigned to multiple packaging services for execution, and packaging services are dynamically expanded. Weighted polling scheduling algorithms and task monitoring mechanisms are used to ensure load balancing and efficiency.

Benefits of technology

It realizes the parallel generation of multi-channel packages, improves packaging efficiency, dynamically expands capacity to match resource needs, and ensures system stability and channel package quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779110A_ABST
    Figure CN118779110A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of mobile internet, and provides an automatic distributed packaging method and system. The automatic distributed packaging method comprises the steps that a packaging center service of the automatic distributed packaging system responds to a packaging request, and an application mother package corresponding to the packaging request and channel resources corresponding to at least two channels are obtained; creating a packaging task corresponding to each channel based on the application mother package and the channel resources; carrying out dynamic capacity expansion on the packaging service based on the number of the packaging tasks; and distributing the packaging task to each packaging service to generate a channel package corresponding to each channel. According to the method, the packaging request can be disassembled into different packaging tasks according to channels, and the different packaging tasks are allocated to different packaging services for execution, so that the different packaging services can execute respective packaging tasks at the same time, the packaging tasks can be executed in parallel, multiple channel packages can be obtained at the same time through packaging, and then the packaging efficiency of the channel packages can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of mobile Internet technology, and in particular to an automated distributed packaging method and system. Background Art

[0002] There are application channel package generation tools on the market that can generate channel APKs for different application markets from an application parent package APK. This tool is generally deployed on a single computer device and uses a serial packaging solution, that is, outputting channel APKs one after another.

[0003] However, since there are so many application channels at present and the same application often needs to be listed on different channels at the same time, the traditional solution of outputting channel packages is inefficient and requires a long wait, which is not conducive to the operation and distribution of the application. Summary of the invention

[0004] In order to help improve the efficiency of channel package generation, the present application provides an automated distributed packaging method and system.

[0005] In a first aspect, the present application provides an automated distributed packaging method, which adopts the following technical solution: An automated distributed packaging method is used in a packaging center service of an automated distributed packaging system, wherein the automated distributed packaging system further includes at least two packaging services, and the method includes: In response to the packaging request, obtaining an application parent package corresponding to the packaging request and channel resources corresponding to at least two channels; Creating packaging tasks corresponding to each channel based on the application master package and the channel resources; Dynamically expand the packaging service based on the number of packaging tasks; The packaging tasks are distributed to each of the packaging services to generate channel packages corresponding to each channel.

[0006] By adopting the above technical solution, the packaging request can be decomposed into different packaging tasks according to the channel and assigned to different packaging services for execution. In this way, different packaging services can execute their own packaging tasks at the same time, so that the packaging tasks can be executed in parallel, and multiple channel packages can be packaged at the same time, thereby improving the packaging efficiency of the channel packages.

[0007] Optionally, dynamically expanding the packaging service based on the number of packaging tasks includes: Determining a reference processing time based on a task processing time corresponding to a historical packaging task, wherein the historical packaging task is a packaging task that has been executed; determining an expected resource consumption amount based on the reference processing time and the number of packaging tasks; The packaged service is dynamically expanded based on the expected resource consumption.

[0008] By adopting the above technical solution, the reference processing time can be determined in combination with the processing time corresponding to the historical packaging tasks, and the packaging service can be dynamically expanded in combination with the expected resource consumption calculated based on the reference time. This can help to reasonably configure the packaging service in combination with the execution speed of historical packaging tasks and the number of packaging tasks, thereby helping to further improve the efficiency of packaging.

[0009] Optionally, the allocating the packaging tasks to each of the packaging services includes: For each of the packaged services, determining a weight corresponding to the packaged service based on a performance parameter of the packaged service; A weighted round-robin scheduling algorithm is used to allocate the packaging tasks to the corresponding packaging services.

[0010] By adopting the above technical solution, the packaging tasks can be reasonably allocated to the packaging services based on the actual conditions of each packaging service, which can help achieve load balancing between packaging services and further help improve the overall packaging efficiency.

[0011] Optionally, determining a weight corresponding to the packaged service based on the performance parameter of the packaged service includes: The weight corresponding to the packaging service is determined based on the number of tasks corresponding to the packaging service and the performance parameter.

[0012] In the above technical solution, the server load is determined comprehensively by packaging the number of tasks and performance parameters corresponding to the service, which can improve the accuracy of the determined load, and further improve the accuracy of the weight determined based on the load.

[0013] Optionally, determining a weight corresponding to the packaged service based on the performance parameter of the packaged service includes: The weight of the packaging service is determined based on the task characteristics of the packaging task corresponding to the packaging service and the performance parameter.

[0014] By adopting the above technical solution, the weight of the packaging service can be determined in combination with the task characteristics and performance parameters of the packaging task corresponding to the packaging service. In this way, in the process of weight determination, not only the current state of the packaging service can be taken into account, but also the state of the packaging service in the future can be taken into account, which can help improve the accuracy of the determined weight.

[0015] Optionally, the method further includes: Monitoring the execution of tasks in each of the packaging services; In the case of an abnormal packaging service in which the task execution speed is lower than the reference execution speed, determining the abnormal cause corresponding to the abnormal packaging service; When the cause of the exception is insufficient computing resources, reduce the number of tasks corresponding to the exception packaging service; When the abnormal reason is that the packaging process is abnormal, the packaging service is restarted or the packaging task with the abnormality is reallocated.

[0016] By adopting the above technical solution, it can help determine the execution speed of the packaging task, thereby helping to avoid the impact of the abnormality of a single packaging task on the overall packaging efficiency of the system, which can further help improve the overall packaging efficiency of the system.

[0017] Optionally, the method further includes: Monitor the status of packaging services; In the case of detecting a fault packaging service that has a fault, stopping allocating packaging tasks to the fault packaging service; For the interruption packing task that has started to be executed but has not been completed, determining whether there is a backup task for the interruption packing task; If the backup task exists, directly start the backup task; In the case that the backup task does not exist, the interrupted task is reallocated to a packaging service other than the fault packaging service for execution.

[0018] By adopting the above technical solution, when a packaging service anomaly is detected and a backup task exists for the interrupted packaging task, the backup task can be directly enabled without reallocating the interrupted packaging task. This can help reduce the impact of the packaging service anomaly on the overall execution efficiency of the packaging task, and thus help ensure the overall execution efficiency of the packaging task.

[0019] Optionally, the method further includes: After generating the channel package, performing hash value calculation on the files in the channel package, and determining whether the calculated hash value is different from the expected hash value; If there is a difference between the calculated hash value and the expected hash value, analyzing the cause of the error; In the case where the error cause indicates that the environment variable is set incorrectly, determining whether a necessary environment variable is missing; In the case where it is determined that the necessary environment variables are not missing, determining whether the values ​​of the necessary environment variables are correct; When it is determined that the value of the necessary environment variable is incorrect, the value of the necessary environment variable is modified.

[0020] By adopting the above technical solution, it is possible to determine whether there are errors or omissions in the packaging process based on whether there is a difference between the hash value of the file in the channel package and the expected hash value. In this way, the accuracy of the generated channel package can be checked, which can help improve the quality of the channel package.

[0021] Optionally, after allocating the packaging tasks to the respective packaging services, the method further includes: Based on the distribution of the packaging tasks, share resource operation permissions are allocated to each packaging service, and a corresponding operation task queue is generated; In conjunction with the operation task queue, the write permission of the shared file is opened to the packaging service.

[0022] By adopting the above technical solution, the operation order of each packaging service on the shared files can be planned by operating the task queue, which can help reduce the impact of modification time conflicts on packaging efficiency, and further help to further improve packaging efficiency.

[0023] In a second aspect, the present application provides an automated distributed packaging system, which adopts the following technical solutions: An automated distributed packaging system, the system comprising: a packaging center server, at least two packaging servers and a cloud storage platform, wherein the packaging center server runs a packaging center service, the packaging server runs a packaging service, the packaging center server is in communication connection with the packaging server, and the cloud storage platform stores application master packages and channel resources; The packaging center server is used to, in response to a packaging request, obtain the application master package and channel resources corresponding to the packaging request from the cloud storage platform, wherein the channel resources include resources corresponding to at least two channels; create packaging tasks corresponding to each channel based on the application master package and the channel resources; dynamically expand the number of packaging services based on the number of packaging tasks; and distribute the packaging tasks to each packaging server; The packaging server is used to execute the packaging task issued by the packaging center server to generate a channel package corresponding to the channel.

[0024] In summary, the present application includes at least one of the following beneficial technical effects: 1. Since the packaging request can be split into different packaging tasks according to the channel and assigned to different packaging services for execution, different packaging services can execute their own packaging tasks at the same time, so that packaging tasks can be executed in parallel, and multiple channel packages can be packaged at the same time, thereby improving the packaging efficiency of channel packages; 2. Since the packaging service can be dynamically expanded based on the number of packaging tasks, this can help match the number of packaging services with the number of packaging tasks to meet the resource consumption required by the packaging tasks, and can also flexibly allocate and manage packaging resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a flow chart of an automated distributed packaging method provided in an embodiment of the present application; Figure 2 It is a flowchart of a dynamic expansion method of a packaged service provided in an embodiment of the present application; Figure 3 It is a flowchart of a packaging task allocation method provided in an embodiment of the present application; Figure 4 It is a flowchart of a packaging task status monitoring method provided in an embodiment of the present application; Figure 5 It is a flowchart of a packaging service status monitoring method provided in an embodiment of the present application; Figure 6 It is a flow chart of a channel package verification method provided in an embodiment of the present application; Figure 7 It is a flowchart of an example of an automated distributed packaging method provided in an embodiment of the present application; Figure 8 It is a structural diagram of an automated distributed packaging system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-8 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] The embodiment of the present application provides an automated distributed packaging system, which includes a packaging center service and at least two packaging services, and the packaging center server can control the work of the packaging service. Optionally, the packaging center service can be implemented as a master, and the packaging service can be implemented as a worker.

[0028] The present application embodiment discloses an automated distributed packaging method, which is used in the packaging center server of the above-mentioned distributed packaging system. Figure 1 , the packaging method includes the following steps: Step 101, in response to a packaging request, obtain an application parent package corresponding to the packaging request and channel resources corresponding to at least two channels.

[0029] The application master package stores the core content files of the application. Through the application master package, we can parse the core content of the application, and then package the resources parsed from the application master package through channel resources to obtain channel packages suitable for different channels. This can simplify the generation process of channel packages.

[0030] Channel resources store data that differs between channels, for example, they are used to store login methods for different channels.

[0031] In one example, the channel resources to be obtained are pre-set in the packaging request. For example, the packaging request includes a target channel, and the channel resources corresponding to the target channel are obtained.

[0032] In actual implementation, the channel resources that need to be obtained may also be pre-set in the system.

[0033] Optionally, the application master package and channel resources are pre-stored in the cloud storage platform (OSS), and the packaging center service can obtain the required application master package and channel resources from the cloud storage platform according to the packaging request. In this solution, by uploading the game master package and each channel resource to the cloud file storage platform (OSS), centralized management and unified scheduling of resources are achieved, avoiding the problem of manually modifying different channel configurations. At the same time, security protection measures can be taken for uploaded files through the cloud storage platform to ensure the security of the files.

[0034] Step 102: Create packaging tasks corresponding to each channel based on the application master package and channel resources.

[0035] Specifically, creating packaging tasks corresponding to each channel based on the application master package and the channel resources includes: for each channel, creating a packaging task corresponding to the channel based on the application master package and the channel resources corresponding to the channel.

[0036] In one example, before creating the packaging tasks corresponding to each channel based on the application master package and the channel resources, the process further includes: performing unpacking and file checking operations.

[0037] Specifically, unpacking refers to decompiling the application parent package to obtain the unpacked resources, so that the channel package can be directly generated based on the unpacked resources. Correspondingly, the packaging service can directly use the unpacked resources during the channel package packaging process, which can help improve the packaging efficiency.

[0038] File checking refers to checking the format and / or variables of a file. This allows for centralized management and monitoring of the packaging service process, thereby ensuring the correctness and integrity of the generated packaging tasks, while also protecting the reliability and stability of the packaging center service.

[0039] Step 103: dynamically expand the packaging service based on the number of packaging tasks.

[0040] Dynamically expanding the capacity of packaging services refers to dynamically adjusting the number of packaging services. For example, increasing the number of packaging services. Since the number of packaging tasks may change dynamically during actual use, dynamically expanding the capacity of packaging services based on the number of packaging tasks can achieve dynamic adjustment of the number of packaging services, so that the packaging services can meet the execution requirements of packaging tasks, which can help improve the execution efficiency of packaging tasks.

[0041] In actual implementation, the expansion conditions of the packaged service can be determined according to actual needs. For example, the expansion conditions can be determined based on the required packaging speed. The higher the required packaging speed, the lower the expansion conditions of the packaged service, that is, the packaged service is easier to expand.

[0042] Optionally, in the process of expanding the capacity of the packaging service, in addition to the number of packaging tasks, other factors may be considered to improve the accuracy of dynamic expansion.

[0043] In one example, when dynamically expanding the capacity of a packaged service, the performance parameters of each existing packaged service (such as CPU usage, memory usage, network bandwidth, etc.) can also be comprehensively considered. In this way, the packaged service can be dynamically expanded based on the actual situation of each packaged service, which can help improve the accuracy of dynamic expansion.

[0044] In another example, when dynamically expanding the packaging service, the characteristics of the packaging task (such as file size, complexity, etc.) can also be comprehensively considered. In this way, the packaging service can be dynamically expanded according to the actual situation of the packaging task, which can help improve the accuracy of dynamic expansion.

[0045] In actual implementation, you can also use automated scripts and monitoring programs to adaptively adjust the number of packaging services according to the real-time needs of packaging tasks. Specifically, the system will automatically trigger the increase or decrease of packaging services through advanced load balancing algorithms. For example, when the number of packaging tasks to be executed exceeds the set threshold (such as 100), the system will automatically start new packaging services and evenly distribute the newly added tasks to these services. Conversely, when the number of packaging tasks to be executed is lower than the set threshold (such as 20), the system will automatically select a part of the packaging services to be closed according to certain rules, such as the task processing capacity (such as processing speed, success rate) and utilization rate within a historical period of time (such as the past 7 days), thereby saving resources. In this way, while meeting the execution requirements of packaging tasks, the number of packaging services can be reasonably controlled, thereby achieving a balance between efficiency and cost.

[0046] Step 104, allocating the packaging tasks to each packaging service to generate a channel package corresponding to each channel.

[0047] Specifically, different packaging services can work in parallel, so that different packaging services can execute their respective packaging tasks at the same time, thereby realizing the parallel generation of channel packages and greatly reducing the generation time of channel packages.

[0048] Optionally, the method of allocating packaging tasks to each packaging service needs to be determined in combination with the actual situation of the packaging tasks and the actual situation of the packaging services. In a single task allocation process, a packaging service may be allocated one or more packaging tasks, or may not be allocated any packaging tasks.

[0049] In an example, the packaging workload of packaging tasks corresponding to different channels can be predicted through historical data, and when allocating tasks, a combination of packaging tasks with similar workloads can be selected and allocated to the same packaging task. This can ensure both the balance of the number of tasks between each packaging service and the balance of the workload between each packaging service, thereby avoiding the problem of single-point resource bottlenecks.

[0050] Optionally, after generating the channel package, the packaging service will upload the channel package to OSS and provide an online download link, which can help ensure the security and controllability of the channel package. Furthermore, the storage and transmission of the channel package can be encrypted and permission controlled to prevent unauthorized access and tampering.

[0051] In one example, after uploading the channel package to OSS, the packaging service destroys the channel package, which can help reduce the cost of using packaging resources.

[0052] The implementation principle of an automated distributed packaging method in an embodiment of the present application is as follows: the packaging center service of the automated distributed packaging system responds to a packaging request, obtains the application master package corresponding to the packaging request and the channel resources corresponding to at least two channels; creates packaging tasks corresponding to each channel based on the application master package and the channel resources; dynamically expands the packaging service based on the number of packaging tasks; and distributes packaging tasks to each packaging service to generate channel packages corresponding to each channel. The packaging request can be disassembled into different packaging tasks according to the channel, and distributed to different packaging services for execution, so that different packaging services can execute their respective packaging tasks at the same time, so that packaging tasks can be executed in parallel, and multiple channel packages can be packaged at the same time, thereby improving the packaging efficiency of channel packages.

[0053] At the same time, since the packaging service can be dynamically expanded based on the number of packaging tasks, this can help match the number of packaging services with the number of packaging tasks to meet the resource consumption required by the packaging tasks, and can also flexibly allocate and manage packaging resources.

[0054] In some embodiments, reference Figure 2 The above step 103, dynamically expanding the packaging service based on the number of packaging tasks, includes the following steps: Step 201 : determining a reference processing time based on the task processing time corresponding to the historical packaging task.

[0055] Among them, historical packaging tasks are packaging tasks that have been completed.

[0056] Optionally, the reference processing time is the average processing time of historical packaging tasks. In one example, the average processing time is calculated using an exponentially weighted moving average method, so that the reference processing time calculated in this way can better adapt to the latest processing time changes, thereby helping to improve the accuracy of the average processing time. In another example, the average processing time is calculated using a sliding window average method, which can reduce the impact of short-term fluctuations in processing time on the reference processing time, thereby improving the accuracy of the average processing time.

[0057] Step 202 : determining the expected resource consumption based on the reference processing time and the number of packaging tasks.

[0058] In one example, the expected resource consumption is represented by the number of required packaged services. Accordingly, the expected resource consumption is determined based on the reference processing time and the number of packaged tasks, including: determining the expected total processing time based on the reference processing time and the number of packaged tasks; and determining the number of packaged services required based on the expected total processing time and the time requirement. For example, the ratio of the expected total processing time to the time requirement is determined as the required number of packaged services. The time requirement may be specified in the package request or may be preset.

[0059] In actual implementation, the expected resource consumption can also be directly expressed using the expected total processing time.

[0060] Step 203: dynamically expand the capacity of the packaged service based on the expected resource consumption.

[0061] In one example, the expected resource consumption includes the required number of packaged services. At this time, the packaged services are dynamically expanded based on the expected resource consumption, including: determining whether the current number of packaged services is less than the required number of packaged services; if so, expanding the number of packaged services to the required number of packaged services.

[0062] In another example, the expected resource consumption includes the expected total processing time. In this case, the packaged service is dynamically expanded based on the expected resource consumption, including: determining whether the available time of each packaged service within the required time is less than the expected total processing time; if so, expanding the packaged service so that the available time of the packaged service within the required time is greater than or equal to the expected total processing time.

[0063] In the above implementation, since the reference processing time can be determined in combination with the processing time corresponding to the historical packaging tasks, and the packaging service can be dynamically expanded in combination with the expected resource consumption calculated based on the reference time, this can help to reasonably configure the packaging service in combination with the execution speed of the historical packaging tasks and the number of packaging tasks, thereby helping to further improve the efficiency of packaging.

[0064] In some embodiments, reference Figure 3 The above step 104, allocating the packaging tasks to each packaging service, includes the following steps: Step 301: for each packaged service, determine a weight corresponding to the packaged service based on performance parameters of the packaged service.

[0065] Specifically, the performance parameters include at least one of the parameters that may affect the performance of the packaging service, such as CPU usage, memory usage, network bandwidth, etc. Generally speaking, servers with better performance parameters can be assigned higher weights because they have greater processing capabilities.

[0066] Optionally, the weight corresponding to the packaged service is calculated by the following formula: The weight of the packaged service = CPU usage weight × (1-CPU usage) + memory usage weight × (1-memory usage) + network bandwidth weight × (1-network bandwidth usage).

[0067] Before calculating the weight of the packaged service, the performance parameters and task characteristics need to be normalized so that they are in the same range (for example, 0-1). Accordingly, the CPU usage, memory usage, and network bandwidth usage in the above formula are all normalized data.

[0068] To help you understand the calculation process of the packaged service weight, let's take an example as an example: Assume that we have three packaged services, A, B, and C, and their performance parameters are as follows: Packaging service A: CPU usage 30%, memory usage 40%, network bandwidth usage 10%; Packaging service B: CPU usage 60%, memory usage 60%, network bandwidth usage 20%; Packaging service C: CPU usage 50%, memory usage 50%, network bandwidth usage 15%.

[0069] Assume that we set the weight of CPU usage to 0.4, the weight of memory usage to 0.4, and the weight of network bandwidth to 0.2. Then we can calculate the score according to the following formula: The weight of packaged service A = (0.4 * (1-0.3) + 0.4 * (1-0.4) + 0.2 * (1-0.1)) = 0.7.

[0070] The weight of packaged service B = (0.4 * (1-0.6) + 0.4 * (1-0.6) + 0.2 * (1-0.2)) = 0.48.

[0071] The weight of packaged service C = (0.4 * (1-0.5) + 0.4 * (1-0.5) + 0.2 * (1-0.15)) = 0.57.

[0072] In one example, the weight of the packaging service can also be determined in combination with the amount of tasks corresponding to the packaging service. Among them, the amount of tasks corresponding to the packaging service refers to the number of packaging tasks that have been assigned to the packaging service but have not yet been executed by the packaging service. In this example, the load of the server is determined by comprehensively determining the number of tasks and performance parameters corresponding to the packaging service, which can improve the accuracy of the determined load, and then improve the accuracy of the weight determined based on the load. Generally speaking, if a server has a low load, that is, it has surplus capacity to process tasks, its weight can be increased to make it more likely to be selected to process tasks. On the contrary, if a server has a high load, that is, its ability to process tasks has reached or is close to the limit, its weight can be reduced to reduce the probability of it being selected.

[0073] In another example, the weight of the packaging service may also be determined in combination with the task characteristics of the packaging task corresponding to the packaging service.

[0074] The packaging task corresponding to the packaging service refers to the packaging task that has been assigned to the packaging service but has not yet been executed by the packaging service.

[0075] Task characteristics include factors that may affect packaging efficiency, such as file size and complexity. Task characteristics may be determined during the packaging task generation process, or may be determined based on the historical packaging workload corresponding to different channels. For example, some channels may have a large packaging workload, while other channels may have a relatively small packaging workload. This allows for automatic prediction of packaging workload.

[0076] Accordingly, determining the weight corresponding to the packaging service based on the performance parameters of the packaging service includes: determining the weight of the packaging service based on the task characteristics of the packaging task corresponding to the packaging service and the performance parameters. Through the task characteristics of the packaging task corresponding to the packaging service, we can predict the state of the packaging service in the future, which can help improve the accuracy of the determined weight.

[0077] In this example, since the weight of the packaging service can be determined in combination with the actual situation of the packaging task, this can help match the determined weight with the packaging task, and thus can help improve the accuracy of packaging task allocation.

[0078] It should be noted that in the actual execution process, performance parameters, the number of tasks being processed, and task characteristics are all changing dynamically. Therefore, the weight of the packaging service can also change dynamically based on the changes in these influencing factors. This can help improve the accuracy of the weight and thus improve the accuracy of task allocation.

[0079] In an example, the weight corresponding to the packaged service is calculated by the following formula: The weight of the packaging service = CPU usage weight × (1-CPU usage) + memory usage weight × (1-memory usage) + network bandwidth weight × (1-network bandwidth usage) - file size weight × file size parameter - complexity score weight × complexity score.

[0080] The file size parameter is determined based on the file size of the packaging task corresponding to the packaging service, and the complexity score is determined based on the complexity of the packaging task corresponding to the packaging service.

[0081] Step 302: Use a weighted round-robin scheduling algorithm to assign packaging tasks to corresponding packaging services.

[0082] Since the weighted polling scheduling algorithm is used to allocate packaging tasks to corresponding packaging services, not only the processing capacity differences of packaging services are taken into account in the process of packaging task allocation, but also the real-time performance changes of packaging services can be responded to by dynamically adjusting the weights. The packaging tasks can be dynamically and evenly allocated among the various packaging services, which can help ensure load balancing between packaging services and the overall stability of the system.

[0083] In some implementations, before each packaging task is assigned, step 301 is executed, and the packaging task can be directly assigned to the packaging service with the largest weight, so as to ensure that the packaging task is always assigned to the most appropriate packaging service for execution.

[0084] In the above implementation, since the weight corresponding to the packaging service can be determined based on the performance parameters of the packaging service, and the packaging tasks can be allocated to the corresponding packaging services using a weighted round-robin scheduling algorithm, the packaging tasks can be reasonably allocated to the packaging services based on the actual conditions of each packaging service. This can help achieve load balancing between packaging services, and further help improve the overall packaging efficiency.

[0085] In some embodiments, reference Figure 4 The automated distributed packaging method provided by the present application also includes the following steps: Step 401, monitoring the execution status of tasks in each packaging service.

[0086] In one example, monitoring the execution status of tasks in each packaging service includes: monitoring the execution progress of the currently executed packaging tasks of each packaging service in real time, and calculating the task execution speed.

[0087] In actual implementation, the number of completed tasks, the number of remaining tasks, and the task processing time in each packaging service are monitored.

[0088] Step 402 , in the case of monitoring an abnormal packaging service in which the task execution speed is lower than the reference execution speed, determining an abnormal cause corresponding to the abnormal packaging service.

[0089] Specifically, the reference execution speed can be pre-set, or it can be determined based on the average packaging speed of associated tasks of the currently executed task (for example, tasks with the same application parent package or the same channel), or it can be determined based on the average packaging speed of each packaging service.

[0090] In one example, determining the exception cause corresponding to the packaging service includes: determining whether the load of the packaging service exceeds a preset load limit; if so, determining that the exception cause is insufficient computing resources; if not, directly determining that the exception cause is an abnormal packaging process, or further determining the exception cause based on other methods.

[0091] In another example, determining the exception cause corresponding to the packaging service includes: determining whether the execution progress of the packaging task has changed within a preset time period; if not, determining that the exception cause is an abnormal packaging process; if so, the exception cause can be directly determined to be insufficient computing resources, or the exception cause can be further determined based on other methods.

[0092] Step 403, when the cause of the exception is insufficient computing resources, reduce the number of tasks corresponding to the exception packaging service.

[0093] Specifically, the way to reduce the number of tasks corresponding to the abnormal packaging service is to reallocate some tasks in the packaging service to other existing packaging services, or to expand the packaging service and reallocate some tasks in the abnormal packaging service to the newly added packaging service.

[0094] In one example, when the cause of the exception is insufficient computing resources, the server obtains the load status of all packaged services and determines whether there is a packaged service with a load less than a preset load lower limit; if so, some tasks in the abnormal packaged service are reallocated to the packaged service; if not, the packaged service is expanded.

[0095] Furthermore, when the cause of the exception is insufficient computing resources, it also includes: adjusting the allocation strategy of the packaging task, such as reducing the weight corresponding to the abnormal packaging service, which can help reduce the amount of tasks allocated to the abnormal packaging service.

[0096] Step 404: When the cause of the exception is an abnormal packaging process, restart the packaging service or reallocate the packaging task with the exception.

[0097] In one example, when the cause of the abnormality is an abnormal packaging process, determine whether the time since the last restart of the packaging fee service exceeds the preset restart time threshold; if so, restart the packaging service; if not, reallocate the packaging task with the abnormality. Since the packaging process abnormality may be caused by the packaging service abnormality, or it may also be caused by the packaging task abnormality, and restarting can eliminate some packaging service abnormalities, the above method can assist in determining the cause of the packaging process abnormality and perform corresponding processing.

[0098] Furthermore, in the case of determining that a packaging task with an abnormality is reallocated, it is further determined whether the number of times the packaging task with an abnormality is reallocated is greater than a preset abnormal number threshold, and if so, abnormal prompt information corresponding to the packaging task with an abnormality is generated to prompt the packaging task with an abnormality to be checked. This can help determine that the abnormality of the packaging progress is caused by the abnormality of the packaging task itself, and perform corresponding processing.

[0099] In the above technical scheme, since the task execution status of the packaging service can be monitored, and when an abnormal packaging service is detected in which the task execution speed is lower than the reference execution speed, corresponding processing can be performed in combination with the abnormal cause. This can help determine the execution speed of the packaging task, thereby helping to avoid the impact of the abnormality of a single packaging task on the overall packaging efficiency of the system, and further help the overall packaging efficiency of the system.

[0100] In some embodiments, reference Figure 5The automated distributed packaging method provided by the present application also includes the following steps: Step 501, monitor the status of the packaging service.

[0101] In one example, monitoring the status of the packaging service includes: acquiring working parameters of the packaging service; and monitoring the status of the packaging service based on the working parameters of the packaging service.

[0102] In another example, monitoring the status of the packaging service includes: monitoring abnormal information generated by the packaging service, wherein the abnormal information is generated when the packaging service is in an abnormal state.

[0103] In actual implementation, possible sources of failure for packaging services include: hardware failure, software errors, network problems, etc.

[0104] Step 502: when a fault packaging service is detected to have a fault, stop allocating packaging tasks to the fault packaging service.

[0105] Optionally, when a faulty fault packaging service is detected, the completed packaging tasks, interrupted packaging tasks, and unstarted packaging tasks of the fault packaging service are determined. An interrupted packaging task refers to a packaging task that has been started but not completed. This makes it easier to determine the processing method of the packaging task in combination with the actual processing situation of the packaging task.

[0106] Correspondingly, for the unstarted packaging tasks, the unstarted packaging tasks are directly assigned to other packaging services other than the fault packaging service for execution.

[0107] Furthermore, when a faulty fault packaging service is detected, it is further determined whether the packaging service needs to be expanded. Specifically, it can be determined whether the packaging service needs to be expanded based on the task execution and load conditions of other packaging services other than the fault packaging service.

[0108] Step 503 : for the interrupted packaging task whose execution has started but not been completed, determine whether there is a backup task for the interrupted packaging task.

[0109] The content of the backup task is the same as the content of the corresponding packaging task. Specifically, after the packaging task is generated, the packaging center service will generate backup tasks for part or all of the packaging tasks based on the packaging task. During the task allocation process, the packaging task and its corresponding backup task will be allocated to different packaging services, and when the packaging task is executed normally, the backup task will not be executed, so that a channel package corresponding to a channel can be repeatedly generated.

[0110] In this implementation, the method for determining whether to generate a backup task corresponding to a packaging task is preset. For example: determining whether to generate a corresponding backup task based on the importance of the channel corresponding to the packaging task, in this case, a corresponding backup task is generated for the packaging task corresponding to the channel with a high degree of importance; another example: determining whether to generate a corresponding backup task based on the historical failure rate of the packaging service assigned to the packaging task, in this case, when the packaging service is assigned to a packaging project of a packaging service with a high historical failure rate, a backup task corresponding to the packaging task is generated, and the backup task is assigned to the packaging service with a low failure rate.

[0111] Step 504: if a backup task exists, directly start the backup task.

[0112] Since the backup task is started directly when there is a backup task, and the backup task has already been assigned to other packaging services waiting for execution, there is no need to reallocate the interrupted task, but the backup task can be executed directly, which can help reduce the impact of packaging service abnormalities on the overall execution efficiency of packaging tasks, and thus help ensure the overall execution efficiency of packaging tasks.

[0113] Step 505: in the case where there is no backup task, the interrupted task is reallocated to a packaging service other than the fault packaging service for execution.

[0114] In the above implementation, since the packaging service can be monitored, and when a packaging service abnormality is detected, it is determined whether there is a backup task corresponding to the interrupted packaging task, thereby determining the corresponding processing method for the interrupted packaging task, and directly starting the backup task when there is a backup task without reallocating the interrupted packaging task. This can help reduce the impact of the packaging service abnormality on the overall execution efficiency of the packaging task, and thus help ensure the overall execution efficiency of the packaging task.

[0115] In some embodiments, reference Figure 6 The automated distributed packaging method provided by the present application also includes the following steps: Step 601, after the channel package is generated, hash value calculation is performed on the files in the channel package, and it is determined whether there is a difference between the calculated hash value and the expected hash value.

[0116] The expected hash value is calculated based on the expected result. The expected result corresponds to the source file of the channel package, and the expected result corresponds to the file in the channel package. The calculation method of the expected hash value is the same as the calculation method of the hash value corresponding to the file in the channel package. For example, the expected hash value and the hash value corresponding to the channel package are both calculated by the MD5 algorithm or other hash algorithms. In this way, the expected hash value can be used to verify whether there are errors and omissions in the packaging.

[0117] In one example, in the above step 104, the process of generating the channel package includes the following steps: a. Source file preparation: Organize and prepare the source code or resource files that need to be packaged.

[0118] b. Compile: compile source code into executable binary files or process resource files.

[0119] c. Configuration file processing: Process the corresponding configuration files according to the needs of different channels.

[0120] d. Resource file processing: Pack the required resource files (such as pictures, audio, etc.) into the final channel package.

[0121] e. Signature: Sign the channel package to ensure the integrity and security of the channel package.

[0122] Correspondingly, the files in the channel package may include resource files and configuration files. At this time, the hash values ​​of the resource files and configuration files need to be verified respectively.

[0123] Step 602: If there is a difference between the calculated hash value and the expected hash value, analyze the cause of the error.

[0124] Specifically, if the calculated hash value is different from the expected hash value, it means that there is an error in the packaging process. At this time, it is necessary to check each step of the packaging process step by step for possible sources of problems and check the possible causes of the error. In practice, it is found that possible causes of errors include: missing files, incorrect formats, resource file naming conflicts, program bugs, etc.

[0125] In addition, the system environment of the packaging service will also affect the packaging results. Therefore, in the process of error cause analysis, especially in the application scenario of this solution, the environment variable settings corresponding to different packaging services may be different. Therefore, the environment variables also need to be analyzed in the process of error cause analysis.

[0126] In one example, only the hash value of the resource file in the channel package file is different from the corresponding expected hash value. At this time, it can be determined that a problem occurs in the resource file processing stage.

[0127] In another example, the verification status of the channel packages generated corresponding to each packaging service is monitored, and when the number of channel packages that fail the verification within a preset time period reaches a preset threshold, it is determined that the cause of the error includes an incorrect environment variable setting.

[0128] In this embodiment, the error cause can be obtained by automatic analysis according to the pre-set judgment rules, or can also be obtained by manual judgment by the staff. In actual implementation, automatic judgment can be performed first through the judgment rules. If the error cause cannot be determined through the judgment rules, the staff is prompted to perform manual judgment. At the same time, after the manual judgment, the staff can supplement and adjust the judgment rules. In this way, the judgment rules can be continuously revised during actual use, so as to achieve automatic judgment as much as possible.

[0129] Step 603: When the error reason indicates that the environment variable is set incorrectly, determine whether necessary environment variables are missing.

[0130] Among them, necessary environment variables refer to: environment variables required for the packaging tool to run. Specifically, the packaging service needs to ensure that the environment variable settings meet the requirements and dependencies of the packaging tool, so as to ensure that the packaging service can run normally. Therefore, in the case of an environment variable error, it is necessary to determine whether the necessary environment variables are missing.

[0131] When it is determined that necessary environment variables are missing, the missing necessary environment variables are set; after the necessary environment variables are set, step 604 may be continued, or the process may be terminated directly.

[0132] Step 604: When it is determined that the necessary environment variables are not missing, determine whether the values ​​of the necessary environment variables are correct.

[0133] Specifically, an error in setting the value of an environment variable may also cause an error in the packaging process. Therefore, when it is determined that the environment variable is not missing, it is necessary to further judge whether the value of the environment variable is correct.

[0134] Optionally, determining whether the value of the environment variable is correct includes: determining whether the value of the environment variable is the same as a reference value; if they are the same, determining that the value of the environment variable is correct; if they are different, determining that the value of the environment variable is incorrect.

[0135] Among them, the reference value can be pre-set, or can be determined based on the value of the necessary environment variable of the packaged service corresponding to the channel package that passes the hash check. This embodiment does not limit the method for determining the reference value.

[0136] Step 605: When it is determined that the value of the necessary environment variable is incorrect, modify the value of the necessary environment variable.

[0137] Optionally, modify the value of the necessary environment variable, including: modifying the value of the necessary environment variable to a reference value.

[0138] In actual implementation, optimize environment variables for specific problems. For example, if you find problems under a specific operating system version, you can try to update or adjust the relevant environment variables.

[0139] In one example, the packaging center service regularly checks and updates the environment variable configuration of each packaging service to ensure the stability and consistency of the packaging environment.

[0140] In the above implementation, since it is possible to determine whether errors or omissions occur in the packaging process based on whether there is a difference between the hash value of the file in the channel package and the expected hash value, the accuracy of the generated channel package can be checked, which can help improve the quality of the channel package.

[0141] At the same time, when it is determined that an error occurs in the packaging process, the cause of the error is further analyzed, and when the cause of the error indicates an environment variable error, it is determined whether the necessary environment variables and the values ​​of the necessary environment variables are correct. In this way, the necessary environment variables can be corrected when an environment variable error occurs, so that the environment variable error can be handled in time, thereby avoiding the impact of the environment variable error on the subsequent packaging process.

[0142] In the automatic distributed packaging method provided by this application, since the packaging tasks are processed in parallel by different packaging services, there may be the following two problems: First, resource competition: When multiple packaging services operate on the same resource file at the same time, resource competition may occur, resulting in inaccurate or overwritten content of some channel packages.

[0143] Second, data synchronization: If the packaging process involves reading and writing multiple files, data synchronization problems may occur. Even if each packaging service operates locally, the final merge results may be inconsistent.

[0144] To help solve these problems, we can take the following measures in the actual implementation process: First, implement resource isolation. Specifically, for each packaging task, ensure that each packaging service uses independent file resources to avoid resource competition. At the beginning of packaging, you can copy the files required by the channel package to the local working directory of each packaging service to ensure resource independence.

[0145] Then, we improve the data synchronization method. Specifically, in the scenario of multi-task packaging, there may be data that needs to be synchronized, such as the status of the packaging task, the packaging result, and the operation log. We can use a distributed lock mechanism or an optimistic lock mechanism to solve this problem. For example, we can obtain a lock before the write operation and release the lock after the operation is completed to ensure data consistency.

[0146] However, it should be noted that this locking mechanism may cause other packaging services to be unable to operate on data when one packaging service occupies the data, thus affecting the overall packaging efficiency.

[0147] In order to reduce modification time conflicts, we can minimize operations on shared resources, such as performing some data calculations or file reading and writing operations that can be completed locally locally, and only operate on shared resources when necessary.

[0148] In addition, the locking mechanism can also be optimized. For example, when there is no write operation, multiple read operations are allowed to be performed simultaneously to improve efficiency. When there is a write operation, only one write operation is allowed, and other read and write operations are not allowed to ensure data consistency.

[0149] In some implementations, we can also implement an operation task queue to manage the scheduling of shared resources by different packaging services. In one example, in the process of allocating packaging tasks, the operation rights of shared resources can be allocated to each packaging service based on the allocation of packaging services, and a corresponding operation task queue can be generated; then the write rights of shared files can be opened to the packaging service in combination with the operation task queue. In this way, the packaging service can also reasonably arrange the execution order of packaging tasks according to the access time arranged by the operation task queue, which can help reduce the impact of modification time conflicts on packaging efficiency, and thus can help further improve packaging efficiency.

[0150] In one instance, when the packaging service needs to access shared data during the execution of a packaging task, it first suspends the packaging task and executes other tasks; the packaging center service opens the write permission of the shared file to the corresponding packaging service according to the order of the operation task queue, and sends a prompt message to the corresponding packaging service; after receiving the prompt message, the packaging service accesses the shared file and continues to execute the suspended task.

[0151] In order to help understand the automated distributed packaging method provided in the embodiment of the present application, an example is given below for illustration. Figure 7 , the automated distributed packaging method includes the following steps: Step 701, upload the game master package to the cloud file storage platform (OSS).

[0152] Step 702: Create packaging task A.

[0153] Step 702, select the channel game parent package and channel.

[0154] Step 704, start executing packaging task A and notify the start of task A.

[0155] Step 705: The packaging center server pulls the game master package from the cloud storage platform.

[0156] Step 706, unpacking the pulled mother package.

[0157] Step 707, checking the unpacked data.

[0158] Step 707: If the check is passed, the packaging center server copies the resources corresponding to the packaging task to each packaging server.

[0159] Step 708: The packaging server creates a process to package the channel package.

[0160] Step 709: The packaging server transmits the generated channel package back to the cloud storage platform.

[0161] The specific implementation of the above example can be found in the embodiment of the above method part, and this embodiment will not be repeated here.

[0162] The present application also discloses an automated distributed packaging system. Figure 8 The automated distributed packaging system includes: a packaging center server 810, at least two packaging servers 820 and a cloud storage platform 830. The packaging center server 810 runs a packaging center service, the packaging server 820 runs a packaging service, the packaging center server 810 and the packaging server 820 are connected in communication, and the cloud storage platform 830 stores application master packages and channel resources; The packaging center server 810 is used to, in response to a packaging request, obtain the application parent package and channel resources corresponding to the packaging request from the cloud storage platform 830, where the channel resources include resources corresponding to at least two channels; create packaging tasks corresponding to each channel based on the application parent package and the channel resources; dynamically expand the number of packaging services based on the number of packaging tasks; and distribute the packaging tasks to each packaging server 820.

[0163] The packaging server 820 is used to execute the packaging task issued by the packaging center server 810 to generate a channel package corresponding to the channel.

[0164] The automated distributed packaging system and the automated distributed packaging method provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0165] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.

[0166] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An automated distributed packaging method, characterized in that: In a packaging center service for an automated distributed packaging system, the automated distributed packaging system further comprising at least two packaging services, the method comprising: In response to the packaging request, obtaining an application parent package corresponding to the packaging request and channel resources corresponding to at least two channels; Creating packaging tasks corresponding to each channel based on the application master package and the channel resources; Dynamically expand the packaging service based on the number of packaging tasks; The packaging tasks are distributed to each of the packaging services to generate channel packages corresponding to each channel.

2. The method according to claim 1, characterized in that The dynamically expanding the packaging service based on the number of the packaging tasks includes: Determining a reference processing time based on a task processing time corresponding to a historical packaging task, wherein the historical packaging task is a packaging task that has been executed; determining an expected resource consumption amount based on the reference processing time and the number of packaging tasks; The packaged service is dynamically expanded based on the expected resource consumption.

3. The method according to claim 1, characterized in that The allocating the packaging tasks to each of the packaging services includes: For each of the packaged services, determining a weight corresponding to the packaged service based on a performance parameter of the packaged service; A weighted round-robin scheduling algorithm is used to allocate the packaging tasks to the corresponding packaging services.

4. The method according to claim 3, characterized in that The determining the weight corresponding to the packaged service based on the performance parameter of the packaged service includes: The weight corresponding to the packaging service is determined based on the number of tasks corresponding to the packaging service and the performance parameter.

5. The method according to claim 3, characterized in that: The determining the weight corresponding to the packaged service based on the performance parameter of the packaged service includes: The weight of each packaging service is determined based on the task characteristics of the packaging task corresponding to the packaging service and the performance parameter.

6. The method according to claim 1, characterized in that The method further comprises: Monitoring the execution of tasks in each of the packaging services; In the case of an abnormal packaging service in which the task execution speed is lower than the reference execution speed, determining the abnormal cause corresponding to the abnormal packaging service; When the cause of the exception is insufficient computing resources, reduce the number of tasks corresponding to the exception packaging service; When the abnormal reason is that the packaging process is abnormal, the packaging service is restarted or the packaging task with the abnormality is reallocated.

7. The method according to claim 1, characterized in that The method further comprises: Monitor the status of packaging services; When a fault packaging service is detected to have failed, stop allocating packaging tasks to the fault packaging service; For the interruption packing task that has started to be executed but has not been completed, determining whether there is a backup task for the interruption packing task; If the backup task exists, directly start the backup task; In the case that the backup task does not exist, the interrupted task is reallocated to a packaging service other than the fault packaging service for execution.

8. The method according to claim 1, characterized in that The method further comprises: After generating the channel package, performing hash value calculation on the files in the channel package, and determining whether the calculated hash value is different from the expected hash value; If there is a difference between the calculated hash value and the expected hash value, analyzing the cause of the error; In the case where the error cause indicates that the environment variable is set incorrectly, determining whether a necessary environment variable is missing; In the case where it is determined that the necessary environment variables are not missing, determining whether the values ​​of the necessary environment variables are correct; When it is determined that the value of the necessary environment variable is incorrect, the value of the necessary environment variable is modified.

9. The method according to claim 1, characterized in that: After allocating the packaging tasks to each of the packaging services, the method further includes: Based on the distribution of the packaging tasks, share resource operation permissions are allocated to each packaging service, and a corresponding operation task queue is generated; In conjunction with the operation task queue, the write permission of the shared file is opened to the packaging service.

10. An automated distributed packaging system, characterized in that: The system comprises: a packaging center server, at least two packaging servers and a cloud storage platform, wherein the packaging center server runs a packaging center service, the packaging server runs a packaging service, the packaging center server is in communication connection with the packaging server, and the cloud storage platform stores application master packages and channel resources; The packaging center server is used to, in response to a packaging request, obtain the application master package and channel resources corresponding to the packaging request from the cloud storage platform, wherein the channel resources include resources corresponding to at least two channels; create packaging tasks corresponding to each channel based on the application master package and the channel resources; dynamically expand the number of packaging services based on the number of packaging tasks; and distribute the packaging tasks to each packaging server; The packaging server is used to execute the packaging task issued by the packaging center server to generate a channel package corresponding to the channel.