A method, apparatus, device, and storage medium for packaging games.
Through the parallel processing and load balancing strategies of multiple balers, the problem of low efficiency of automated packaging systems is solved, and the game packaging efficiency and system stability are improved.
Patent Information
- Application Number
- CN202410365313.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-03-28
AI Technical Summary
The existing automated packaging system is inefficient in the game packaging process, and can only handle one packaging task at the same time, which affects the efficiency of the game online.
Through multiple balers, pending requests are allocated using message queues and load balancing strategies to store game data distributed to improve processing efficiency and system stability.
It improves game packaging efficiency, solves the problem of low processing efficiency of single-packaging tasks, and enhances system stability and data consistency.
Smart Images

Figure CN118394397B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game technology, and in particular to a game packaging method, device, equipment and storage medium. Background Art
[0002] The game master package refers to the complete installation package of the game, which contains all the basic files and resources of the game. When the game developer distributes the game to different operating platforms or channels, a game master package will be made first. The game target will then make corresponding parameter and configuration adjustments according to the needs of each channel or platform, and then repackage it into the corresponding game channel package, which will be reviewed and launched by the corresponding channel or platform.
[0003] In the prior art, during the game packaging process, the game target and channel resource package are packaged into a game channel package through an automated packaging system. The channel resource package contains the integrated resources that are packaged into the packaging system after the SDK is connected to the channel SDK interface. The automated packaging system is responsible for inputting the game target and channel resource package, automatically unpacking, merging resources, packaging, and outputting the game channel package. The entire packaging process takes a long time. Moreover, the automated packaging system can only handle one packaging task at a time, resulting in a low packaging efficiency of the automated packaging system, which affects the online efficiency of the game. Summary of the invention
[0004] The present application provides a game packaging method, device, equipment and storage medium, so as to process multiple packaging tasks in parallel through multiple packaging machines, thereby solving the problem in the prior art that the automated packaging system can only process one packaging task at a time, improving the game packaging efficiency, and further improving the game online efficiency.
[0005] In a first aspect, the present application provides a game packaging method, comprising:
[0006] Adding the received pending packaging requests to a message queue, and adjusting the order of the pending packaging requests in the message queue according to the priorities of the pending packaging requests;
[0007] Obtaining the operating status data of each packer in the packer cluster, determining the resource utilization of the packer cluster according to the operating status data, performing weighted summation on the resource utilization and the number of the pending packing requests to obtain a weighted value, and adjusting the number of packers in the packer cluster according to a comparison result between the weighted value and a preset range;
[0008] Through a preset load balancing strategy, each pending packaging request in the message queue is distributed to each packaging machine in the adjusted packaging machine cluster, so that each packaging machine can process the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributedly stored in the storage unit corresponding to each packaging machine, and when processing the packaging task, the packaging machine obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
[0009] In a second aspect, the present application provides a game packaging device, comprising:
[0010] A request adding module is configured to add the received pending packaging request to the message queue, and adjust the order of the pending packaging request in the message queue according to the priority of the pending packaging request;
[0011] A resource adjustment module is configured to obtain operation status data of each packer in the packer cluster, determine the resource utilization of the packer cluster according to the operation status data, perform weighted summation of the resource utilization and the number of the pending packing requests to obtain a weighted value, and adjust the number of packers in the packer cluster according to a comparison result of the weighted value and a preset range;
[0012] The task processing module is configured to distribute each pending packaging request in the message queue to each packaging machine of the adjusted packaging machine cluster through a preset load balancing strategy, so that each packaging machine processes the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributedly stored in the storage unit corresponding to each packaging machine, and when the packaging machine processes the packaging task, it obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
[0013] In a third aspect, the present application provides a game packaging device, including:
[0014] one or more processors;
[0015] A memory stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the game packaging method as described in the first aspect.
[0016] In a fourth aspect, the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the game packaging method as described in the first aspect.
[0017] In the present application, by adding pending packaging requests to the message queue, adjusting the order of pending packaging requests in the message queue according to the priority of the pending packaging requests; obtaining the operating status data of each packer in the packer cluster, determining the resource utilization of the packer cluster according to the operating status data, performing weighted summation of the resource utilization and the number of requests of the pending packaging requests to obtain a weighted value, and adjusting the number of packers in the packer cluster according to the comparison result between the weighted value and the preset range; allocating the pending packaging requests in the message queue to each packer in the packer cluster through a preset load balancing strategy, so that each packer processes the packaging tasks corresponding to the pending packaging requests in parallel, and the game data of the packaging tasks are distributedly stored in the storage units corresponding to each packer, and when the packer processes the packaging tasks, the game data of the packaging tasks are obtained in the corresponding storage units, the game data are packaged to obtain the game data packets, and the game data packets are cached to the corresponding storage units, so that the storage units synchronize the game data packets to the storage units corresponding to the remaining packers. Through the above technical means, the order of the requests in the message queue can be adjusted according to the request priority, so that the packer can give priority to important packaging tasks, thereby improving the overall game packaging efficiency. The number of packers in the packer cluster is adjusted according to the running status data and the number of requests of the packer to optimize the processing performance and running resources of the packer cluster and improve the packing efficiency of the packer cluster. The requests are distributed to each packer in the packer cluster through the load balancing algorithm to balance the load of each packer, avoid the packer being in a high-load running state for a long time, and improve the stability of the system. Multiple packers can process the corresponding assigned packing tasks in parallel, which solves the problem that the automated packing system in the prior art can only process one packing task at the same time, and improves the game packing efficiency. The game data is stored in the storage unit of each packer through distributed caching to improve the reading efficiency of the game data, and the game data packets cached in the storage unit are synchronized to the remaining storage units through database replication to ensure the consistency and synchronization of the data and improve the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a structural diagram of the automated packaging system provided in an embodiment of the present application;
[0019] Figure 2 is a flow chart of a game packaging method provided by an embodiment of the present application;
[0020] Figure 3 It is a flowchart of determining the priority of pending packaging requests provided by an embodiment of the present application;
[0021] Figure 4 This is a flow chart of allocating requests through a load balancing strategy provided by an embodiment of the present application;
[0022] Figure 5 This is a flowchart of detecting the health status of a packer and forwarding a packing task provided by an embodiment of the present application;
[0023] Figure 6 is a structural schematic diagram of a game packaging device provided in an embodiment of the present application;
[0024] Figure 7 It is a structural diagram of a game packaging device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0027] In the more common existing implementation methods, during the game packaging process, the game objectives and channel resource packages are packaged into a game channel package through an automated packaging system. The channel resource package contains the integrated resources that are packaged into the packaging system after the SDK is connected to the channel SDK interface. The automated packaging system is responsible for inputting the game objectives and channel resource packages, automatically unpacking, merging resources, packaging, and outputting the game channel package. The entire packaging process takes a long time. Moreover, the automated packaging system can only handle one packaging task at a time, resulting in low packaging efficiency of the automated packaging system, which affects the online efficiency of the game.
[0028] To solve the above problems, this embodiment provides a game packaging method, which processes multiple packaging tasks in parallel through multiple packaging machines, thereby improving the game packaging efficiency and further improving the game launch efficiency.
[0029] The game packaging method provided in this embodiment can be executed by a game packaging device, which can be implemented by software and / or hardware. The game packaging device can be composed of two or more physical entities, or it can be composed of one physical entity. For example, the packaging task processing device can be an automated packaging system. In this embodiment, Figure 1 Schematic diagram of the structure of the automated packaging system provided in the embodiment of the present application. Figure 1 As shown, the automated packaging system includes a mobile distribution platform, a message queue, a proxy server and a packaging machine cluster, wherein the mobile distribution platform is used to receive pending packaging requests sent by the client and write the pending packaging requests into the message queue, the message queue is used to cache the pending packaging requests, the proxy server is used to distribute the pending packaging requests cached in the message queue to each packaging machine in the packaging machine cluster, and the packaging machine cluster is used to process the packaging tasks corresponding to the received packaging requests in parallel through each packaging machine.
[0030] The game packaging device is installed with at least one type of operating system, wherein the operating system includes but is not limited to Android system, Linux system and Windows system. The game packaging device can install at least one application based on the operating system, and the application can be an application that comes with the operating system or an application downloaded from a third-party device or server. In this embodiment, the game packaging device has at least an application that can execute the game packaging method.
[0031] For ease of understanding, this embodiment is described by taking an automated packaging system as an example of the main body for executing the game packaging method.
[0032] Figure 2 A flowchart of a game packaging method provided by an embodiment of the present application is given. Figure 2 , the game packaging method specifically includes:
[0033] S110: Add the received pending package requests to a message queue, and adjust the order of the pending package requests in the message queue according to the priorities of the pending package requests.
[0034] Exemplarily, the received pending packaging request is stored in the tail of the message queue. When the message queue caches multiple pending packaging requests, the message queue can adjust the order of the pending packaging requests in the message queue based on the priority of the cached multiple pending packaging requests, so that the high-priority pending packaging request is located at the head of the message queue, thereby ensuring that the high-priority pending packaging request is taken out of the message queue first and assigned to the packaging machine for processing. In this embodiment, the message queue can adopt a queue result that supports priority so that the message queue can be sorted according to the priority of the request. For example, the message queue can adopt a redis queue, that is, use the blocking API and list structure of redis to construct a FIFO (first in, first out) message queue, and sort it according to the priority of the request, so that high-priority requests can be pushed to the front of the message queue, so as to be processed preferentially.
[0035] The priority of pending package requests can be set in advance according to the type of request, such as the priority of package requests for core data is the highest, and the priority of package requests for regular data is lower, etc. The order of pending package requests in the message queue can be adjusted according to the preset priority corresponding to each pending package request. In addition, the priority of pending package requests can also be determined according to the generation timestamp of the pending package requests, that is, the earlier the generation time of the pending package requests, the higher the priority, so that the pending package requests with earlier generation time can be processed first.
[0036] However, the above implementation only determines the priority of pending packaging requests from one aspect, and the factors considered are not comprehensive enough, and are not suitable for scenarios with high concurrency and complex logic. In this regard, this embodiment proposes that the priority of pending packaging requests can be comprehensively determined based on the available resource rate of the packaging machine cluster and the urgency, expected processing time and generation timestamp of the pending packaging requests. For example, Figure 3 1 is a flowchart of determining the priority of pending packaging requests provided by an embodiment of the present application. Figure 3 As shown, the step of determining the priority of the pending packaging request specifically includes S1101-S1102:
[0037] S1101. Obtain the available resource rate of the packaging machine cluster, as well as the estimated processing time, urgency and generation timestamp of each pending packaging request.
[0038] Among them, the available resource rate can be understood as the resource rate of the packaging request that can be used for processing in the packaging machine cluster, which can be calculated by the resource utilization of the packaging machine cluster, that is, the difference between 100% and the resource utilization is equal to the available resource rate. The resource utilization rate of the packaging machine cluster can be regarded as the average resource utilization rate of each packaging machine in the packaging machine cluster. The resource utilization rate of the packaging machine represents the degree to which different hardware resources in the packaging machine are used, which can be characterized by CPU utilization, memory utilization, disk utilization and network utilization. In this embodiment, the operating status data of each packaging machine in the packaging machine cluster can be obtained, the resource utilization rate of the packaging machine is determined according to the operating status data, the resource utilization rate of the packaging machine cluster is determined according to the resource utilization rate of each packaging machine, and the resource availability rate of the packaging machine cluster is determined according to the resource utilization rate of the packaging machine cluster.
[0039] Furthermore, the estimated processing time of the pending packaging request can be estimated by the amount of game data to be packaged corresponding to the pending packaging request. Alternatively, the estimated processing time of the pending packaging request can be estimated according to the type of the pending packaging request. In addition, when the user configures the pending packaging request on the client, the estimated processing time of the pending packaging request can be configured based on experience, so as to send the estimated processing time as additional information of the pending packaging request to the mobile distribution platform, and the mobile distribution platform can obtain the estimated processing time of the pending packaging request based on the additional information of the pending packaging request.
[0040] The urgency of the pending packaging request can also be determined according to the type of the pending packaging request. In addition, when the user configures the pending packaging request on the client, the urgency of the pending packaging request can be configured based on experience, so as to send the urgency as additional information of the pending packaging request to the mobile distribution platform, and the mobile distribution platform can obtain the urgency of the pending packaging request based on the additional information of the pending packaging request.
[0041] The generation timestamp of the pending package request is automatically saved in the timestamp field of the pending package request when the request is generated. The timestamp field of the pending package request can be read to obtain the generation timestamp of the pending package request. It should be noted that after the user configures the estimated processing time and urgency of the pending package request to generate the pending package request, the estimated processing time and urgency can also be stored in some fields of the pending package request. The specific fields are determined by the data structure of the pending package request and are not specifically limited here.
[0042] S1102: Input the available resource rate and the estimated processing time, urgency and generation timestamp of each pending packaging request into a pre-trained decision tree model to obtain the priority corresponding to each pending packaging request output by the decision tree model.
[0043] Among them, the decision tree model is a model with available resource rate, estimated processing time, urgency and generation timestamp as nodes, and corresponding request priority as decision result. The pre-trained decision tree model can match the available resource rate of the current packaging machine cluster and the estimated processing time, urgency and generation timestamp of each pending packaging request with each node in the decision tree, so as to determine the priority of each pending packaging request. This embodiment comprehensively considers multiple factors affecting the request priority through the decision tree model, and finally decides on the optimal processing result suitable for the current scenario, which is conducive to improving the request processing efficiency while ensuring the stability of the system.
[0044] S120. Obtain the operating status data of each packer in the packer cluster, determine the resource utilization of the packer cluster based on the operating status data, perform weighted summation on the resource utilization and the number of pending packing requests to obtain a weighted value, and adjust the number of packers in the packer cluster based on the comparison result between the weighted value and a preset range.
[0045] Among them, the running status data is data that characterizes the running status of the packer, which includes the CPU running time, available memory, disk used space and network bandwidth of the packer. The running status data of each packer in the packer cluster can be collected through monitoring tools or monitoring services. The packer in the packer cluster is a server instance in the cluster used to process packaging tasks. The CPU utilization can be determined by the CPU running time in the running status data, the memory utilization can be determined by the available memory in the running status data, the disk utilization can be determined by the used disk space in the running status data, and the network utilization can be determined by the network bandwidth in the running status data. The CPU utilization, memory utilization, disk utilization and network utilization of the packer are weighted to obtain the resource utilization of the packer. However, during the operation of the packer, if the utilization of any hardware resource is too high, it is in an unstable state. Therefore, the maximum of the CPU utilization, memory utilization, disk utilization and network utilization of the packer can be determined as the resource utilization of the packer. The resource utilization of each packer is averaged or median calculated, and the calculation result is used as the resource utilization of the packer cluster.
[0046] It can be understood that when the resource utilization rate of the packer cluster is high, or the number of requests to be processed for packing requests is large, the computing pressure of the packer is large, and it may not be able to process the packing requests efficiently and stably. When the resource utilization rate of the packer cluster is low, or the number of requests to be processed for packing requests is low, the computing pressure of the packer is small, and there may be a problem of resource waste. In this regard, the present embodiment aims to perform a weighted summation of the resource utilization rate and the number of requests, compare the obtained weighted value with the preset range, and adjust the number of packers in the packer cluster according to the comparison result. Among them, the weighted value can characterize the computing pressure faced by the packer cluster, and the preset range can characterize the computing pressure range that the packer cluster can withstand during normal operation. When the weighted value is greater than the upper limit value of the preset range, it indicates that the current packer cluster is facing a large computing pressure, so the number of packers in the packer cluster can be increased to expand the computing resources of the packer cluster to ensure that the packer cluster can process the packing requests efficiently and stably. When the weighted value is less than the lower limit of the preset range, it indicates that the current packer cluster faces less computing pressure. Therefore, the number of packers in the packer cluster can be reduced to reduce the computing resources of the packer cluster and avoid the problem of resource waste in the packer cluster. It should be noted that the maximum computing pressure that a packer cluster with different numbers of packers can withstand during normal operation is different. Therefore, when obtaining the preset range, the corresponding preset range can be obtained according to the number of packers in the current packer cluster. If the weighted value is within the preset range, it means that the current packer cluster will not have problems of overpressure and resource waste when processing packaging requests, so there is no need to adjust the number of packer clusters.
[0047] In one embodiment, the game platform includes an Android platform and an IOS platform. The packaging process of packaging the game into a game package for the Android platform and a game package for the IOS platform is different. Therefore, the packaging request of the Android game package needs to be processed by the Android packager, and the packaging request of the IOS game package needs to be processed by the IOS packager. Correspondingly, the automated packaging system may be provided with a first message queue and a second message queue, so as to cache the pending packaging request of the IOS game package through the first message queue, and cache the pending packaging request of the Android game package through the second message queue. When the mobile distribution platform receives the pending packaging request of the IOS game package, the pending packaging request may be stored in the first message queue, and when the mobile distribution platform receives the pending packaging request of the Android game package, the pending packaging request may be stored in the second message queue. This embodiment stores the pending packaging requests of different types of game packages in different message queues, so that the subsequent proxy server can allocate the pending packaging requests in each message queue to the Android packager and the IOS packager, which is conducive to improving the efficiency and accuracy of request allocation.
[0048] In this embodiment, when adjusting the number of packer clusters, the average resource utilization of all IOS packers can be determined based on the running status data of the IOS packers, and the first weighted value is obtained by weighted summing the number of pending packing requests cached in the first message queue and the average resource utilization of the IOS packers. A first preset range is obtained based on the number of IOS packers in the packer cluster. When the first weighted value is greater than the upper limit of the first preset range, the number of IOS packers in the packer cluster is increased. When the first weighted value is less than the lower limit of the first preset range, the number of IOS packers in the packer cluster is reduced. Similarly, the average resource utilization of all Android packagers can be determined based on the running status data of the Android packagers, and the second weighted value can be obtained by weighted summing the number of pending packaging requests cached in the second message queue and the average resource utilization of the Android packagers. The second preset range is obtained based on the number of Android packagers in the packager cluster. When the second weighted value is greater than the upper limit of the second preset range, the number of Android packagers in the packager cluster is increased, and when the second weighted value is less than the lower limit of the second preset range, the number of Android packagers in the packager cluster is reduced. This embodiment adjusts the number of different types of packager clusters in a targeted manner through the resource utilization rates and corresponding number of pending requests to ensure that the computing performance of the packager always matches the corresponding business needs, thereby achieving effective utilization of resources and improving system performance and stability.
[0049] S130. Allocate each pending packaging request in the message queue to each packaging machine of the adjusted packaging machine cluster through a preset load balancing strategy, so that each packaging machine processes the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributedly stored in the storage unit corresponding to each packaging machine, and when the packaging machine processes the packaging task, it obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
[0050] refer to Figure 1, the proxy server can distribute the pending packaging requests in the message queue to each packaging machine in the packaging machine cluster based on the load balancing strategy. Among them, the proxy server can be Nginx, which has high reliability and can maintain stability during long-term operation. Moreover, Nginx not only realizes load balancing and improves the concurrent processing capability of the system, but also hides the real address of the backend packaging machine and enhances the security of the system. It should be noted that a message queue is set between the proxy server and the mobile distribution platform. The message queue can effectively isolate the message producer and the message consumer, realize asynchronous processing of packaging requests, avoid blocking and waiting of requests, and improve the throughput and response speed of the system.
[0051] When allocating pending packaging requests in the message queue, the proxy server can generate a list of packaging machines to which requests can be allocated based on the packaging machines in the packaging machine cluster. The pending packaging requests are read from the head of the message queue in sequence according to the order of the packaging machines in the packaging machine list through the polling method, and the pending packaging requests read are allocated one-to-one to the packaging machines in the packaging machine cluster. Alternatively, the order of the packaging machines in the packaging machine list is determined according to the number of tasks of the packaging machines through the minimum connection method, and the pending packaging requests are read from the head of the message queue in sequence according to the order of the packaging machines in the packaging machine list, and the read pending packaging requests are allocated one-to-one to the packaging machines in the packaging machine cluster. Different load balancing algorithms have different advantages and applicable scenarios. When a single load balancing algorithm is used to allocate requests, a good load balancing effect may not be achieved. In this regard, this embodiment proposes that a variety of load balancing algorithms can be combined to provide a more flexible and efficient load balancing strategy in different scenarios, thereby greatly optimizing the load balancing effect. Specifically, Figure 4 1 is a flow chart of allocating requests through a load balancing strategy provided by an embodiment of the present application. Figure 4 As shown, the steps of allocating requests through the load balancing strategy specifically include:
[0052] S1301: Compare the number of pending packaging requests with a preset number threshold.
[0053] The preset number threshold is the minimum number of requests in the high concurrent request scenario set in this embodiment. It can be understood that when the number of requests is less than the preset number threshold, it indicates that the flow of the current automated packaging system is small and the computing pressure of the back-end packaging machine is small; when the number of requests is greater than or equal to the preset number threshold, it indicates that the flow of the current automated packaging system is large and the computing pressure of the back-end packaging machine is large.
[0054] The number of pending package requests may be determined based on the pending package requests cached in the message queue.
[0055] S1302: When the number of requests is less than a preset number threshold, the pending packaging requests are allocated one-to-one to each packaging machine in turn according to the order of each pending packaging request in the message queue.
[0056] For example, when the computing pressure of the back-end packing machine is relatively small, each packing machine will not be overloaded. Therefore, the pending packing requests in the message queue can be allocated by polling, that is, the pending packing requests are taken out from the head of the message queue in turn, and the pending packing requests are allocated one-to-one to each packing machine. There is no need to allocate requests according to the load of the packing machine, which is conducive to improving the efficiency of request allocation. It should be noted that according to the structural characteristics of the message queue, after the request at the head of the message queue is taken out, the remaining requests will move forward one position, that is, the request behind the head will automatically become the head request. Therefore, when taking out the pending packing requests cached in the message queue, they will be automatically taken out in the order of the pending packing requests in the message queue, ensuring the accuracy of the request processing order.
[0057] S1303. When the number of requests is greater than or equal to the preset number threshold, the corresponding processing weight is determined according to the load condition and the number of tasks of each packaging machine, and each pending packaging request is allocated one-to-one to each packaging machine in turn according to the order of the processing weights and the order of each pending packaging request in the message queue.
[0058] For example, when the computing pressure of the back-end baler is high, the polling method that does not consider the load distribution of the baler is not applicable to this scenario, otherwise some balers will be overloaded and the stability of the system cannot be guaranteed. In this regard, the corresponding processing weight can be determined according to the load status and number of tasks of each baler. The larger the processing weight, the lighter the load of the corresponding baler and the stronger the baler's ability to process tasks. The pending packaging request with the highest priority is taken out from the head of the message queue, and the pending packaging request is assigned to the baler with the largest processing weight, so that the baler can efficiently and stably process the corresponding pending packaging request, which greatly optimizes the load balancing effect.
[0059] In this embodiment, the processing weight of the packer can be obtained by weighted summing the load condition and the number of tasks, but the processing weight obtained by simple weighted summing cannot accurately represent the load condition of the packer. In this regard, according to the preset reward expectation table, the expected value of each packer assigning the pending packing request to each packer under the load condition and the number of tasks is determined; wherein the reward expectation table is determined by the reinforcement learning model; and the processing weight of the corresponding packer is determined according to the expected value of the packer. It can be understood that the expected value can reflect the potential benefits or risks of the packer receiving a new request under the corresponding load condition and the number of tasks, which can more accurately represent the load condition of the packer when processing the request. Therefore, the corresponding processing weight is determined by the expected value of the packer, which can further optimize the load balancing effect of the back-end packer. When determining the reward expectation table, each state in the reward expectation table can be determined by the load condition and the number of tasks of the packer and an initial reward expectation table can be generated. The states of the packer after processing the packing request and rejecting the packing request in each state are collected, and the reward expectation table is continuously updated according to the state of the packer before and after processing the packing request, the state before and after rejecting the packing request, and the preset reward function until the number of updates reaches the number threshold. This embodiment gradually learns how to make the best decision when the packaging machine is in various states through the reinforcement learning model, and can dynamically adapt to various request allocation scenarios, achieving more efficient resource utilization while ensuring the stability and response speed of the system.
[0060] In another embodiment, a special packaging request requires a specific packaging machine to process, such as an encrypted packaging request that needs to be processed by a packaging machine with encryption function, so the encrypted packaging request needs to be assigned to a packaging machine with encryption function. Exemplarily, when the pending packaging request is an encrypted packaging request, the source address of the encrypted packaging request is processed by a hash function to obtain a hash value; the encrypted packaging request is determined according to the hash value, and the encrypted packaging request is assigned to the encrypted packaging machine. It can be understood that only a specific client can initiate an encrypted packaging request to the automated packaging system. The IP address of a specific client can be processed in advance by a hash function, and the hash value obtained by the processing is used as the serial number of the encrypted packaging machine. Among them, the encrypted packaging machine is a packaging machine with encryption function. Correspondingly, when allocating the pending packaging request, it can be determined whether the pending packaging request is an encrypted packaging request according to the request identifier or request type of the pending packaging request. When it is determined that the pending packaging request is an encrypted packaging request, the IP address of the client sending the encrypted packaging request is obtained as the source address, and the source address is processed by a preset hash function to obtain a hash value. The hash value is compared with the serial number of each packer in the packer cluster, and the packer with the same serial number as the hash value is determined as the encryption packer, and the encrypted packaging request is assigned to the encryption packer. This enables the packer with encryption function to process the encrypted packaging request in a targeted manner, ensures the processing accuracy of the encrypted packaging request, and improves the reliability of the system.
[0061] Furthermore, after being assigned to a pending packaging request, the packaging machine can generate a corresponding packaging task according to the pending packaging request and process the packaging task. The packaging task is to package the corresponding game data into a game package, and the game data corresponding to each packaging task is distributed and stored in the storage unit corresponding to each packaging machine. Figure 1 When the packer processes a packing task, it can query the corresponding storage unit according to the data identifier of the game data corresponding to the packing task to obtain the game data corresponding to the packing task, which greatly improves the efficiency of reading game data. After the packer packs the corresponding game data into a game package according to the packing task, it stores the game package in the corresponding storage unit, which can synchronize the game package to the remaining storage units through database replication to ensure the consistency and synchronization of the data in each storage unit. Since the packer performs read and write operations on the corresponding storage unit, the reading pressure of the storage unit is relatively small, which is conducive to improving the stability of the system.
[0062] It should be noted that during the process of processing packaging tasks, the packaging machine may fail due to various factors. The failed packaging machine cannot continue the packaging task. If these packaging tasks cannot be forwarded to other packaging machines in time, the packaging progress of the game will be seriously affected. In this regard, the health status of each packaging machine can be checked so that when a failed packaging machine is found, the packaging task can be forwarded to other packaging machines in time. For example, Figure 5 This is a flowchart of detecting the health status of the packer and forwarding the packing task provided by the embodiment of the present application. Figure 5 As shown, the steps of detecting the health status of the packer and forwarding the packing task specifically include S1401-S1402:
[0063] S1401. Obtain a system log of the baler, obtain health characteristic data of the baler according to the system log, analyze the health characteristic data through a pre-trained neural network model, and determine the health status of the baler.
[0064] Exemplarily, the proxy server may periodically obtain the system log of the packer, or the packer may periodically upload the system log to the proxy server. The system log contains a large amount of data used to analyze the health status of the packer, which are health feature data, such as error counts, alarm counts, maximum values, minimum values, average values of performance indicators, average CPU usage and memory occupancy in each time period, etc. After the health feature data in the system log is extracted, the health feature data can be input into a pre-trained neural network model, and the neural network model outputs the detection result of whether the packer is abnormal or healthy. Among them, various health feature data when the packer is abnormal and various health feature data when it is healthy can be collected in advance, and the neural network model can be trained based on the collected data, so that the trained neural network model has the function of analyzing the health status of the packer based on the health feature data. In this embodiment, the health feature data contained in the system log is analyzed by a neural network model to accurately detect the health status of the packer, increase the probability of discovering a faulty packer, and help improve the reliability of the system.
[0065] S1402: When an abnormality is detected in a packer, stop allocating pending packing requests to the packer, and allocate the packing tasks of the packer to other packers.
[0066] For example, when the health status of a packer is abnormal, it can be determined that the packer cannot continue to process the packing task, and the serial number of the packer can be removed from the list of packers to which requests can be allocated to stop allocating pending packing requests to the packer. The packing task of the packer can be allocated to other packers for processing, so as to avoid delaying the packing progress of the game due to delayed processing of the packing task.
[0067] In this embodiment, the packer may be assigned multiple packing requests, some of which are being processed, and some of which are not yet processed. In order to process the packing tasks of the faulty packer more efficiently, when the packing tasks have not yet been processed, the first packing request corresponding to the packing task is obtained, and the priority of the first packing request is raised to the highest level and then added to the message queue so that the message queue adjusts the first packing request to the head of the queue. The first packer is determined among the remaining packers by the preset load balancing strategy, and the first packing request at the head of the message queue is assigned to the first packer, so that the first packer processes the packing task based on the first packing request. Among them, the first packing request is the packing request of the packing task that the faulty packer has not started to process, and the first packer is the packer that is reassigned to the first packing request. For the packing tasks that have not yet been processed, the faulty packer has not yet obtained the game data of the packing task from the storage unit, and has not yet generated new task data. At this time, only the first packing request is assigned to the remaining packers, and the remaining packers can process the corresponding packing tasks according to the assigned first packing request, thereby improving the processing efficiency of the packing tasks. The first packaging request of the faulty packaging machine is allocated earlier. In order to process the first packaging request in time, the priority of the first packaging request can be raised to the highest and then written into the message queue, so that the message queue automatically adjusts the first packaging request to the head of the queue. After the proxy server takes out the first packaging request from the head of the message queue, it determines the first packaging machine in the list of packaging machines to which the request can be allocated through the preset load balancing strategy, and allocates the first packaging machine to the first packaging machine to balance the load of each packaging machine. Among them, when the first packaging machine is determined by the preset load balancing strategy, the processing weight of the corresponding packaging machine can be determined according to the load status and number of tasks of each packaging machine in the packaging machine list, and the first packaging request is allocated one-to-one to the packaging machine with a larger processing weight. This embodiment allocates the packaging requests of the packaging tasks that the faulty packaging machine has not started to process to the remaining healthy packaging machines through the load balancing strategy, ensuring the load balancing of the back-end packaging machines while ensuring the timely processing of the packaging tasks.
[0068] When the packing task starts to be processed, the task data of the packing task is cached to the storage unit of the corresponding packer so that the storage unit copies the task data to the storage units of the remaining packers. The idle packer is determined to be the second packer among the remaining packers, and the packing task is transferred to the second packer so that the second packer continues to process the packing task based on the task data in the corresponding storage unit. Among them, the second packer is a packer used to process the packing task that has started to be processed by the faulty packer. For the packing task that has started to be processed, the faulty packer has obtained the game data of the packing task from the storage unit and generated new task data. If only the packing request corresponding to the packing task is assigned to the remaining packers, then the remaining packers need to process the packing task from the beginning, and the task processing efficiency is low. Therefore, the task data of the packing task that has started to be processed can be cached to the storage unit so that the storage unit synchronizes the task data to the storage units of the remaining packers through database replication, so that the remaining packers can subsequently obtain the task data of the packing task from the corresponding storage unit to continue to process the packing task, thereby ensuring the task processing efficiency. Furthermore, the processing order of the packaging tasks is generally determined according to time and / or priority. The delayed processing of a packaging task may affect the execution of related packaging tasks. For example, the game package A generated by packaging task A is the game data of packaging task B, that is, packaging task B needs to wait for the completion of packaging task A before it can start to execute. If the packaging task that is being processed is assigned to the remaining packaging machines like the packaging request of the unprocessed packaging task, then the remaining packaging machines must first process the tasks and requests at hand before processing the packaging task. The completion time of the packaging task will produce a large delay, which will in turn affect the execution of the subsequent corresponding packaging tasks and seriously affect the packaging progress of the game. Therefore, this embodiment determines the second packaging machine in the idle state in the packaging machine list. The second packaging machine may have just finished processing the corresponding packaging task and entered the idle state. The packaging task that is being processed is assigned to the second packaging machine so that the second packaging machine can immediately continue to process the packaging task when it receives the packaging task, ensuring the orderly processing of each packaging task in the system and improving the packaging efficiency of the game. When the second packaging machine continues to process the assigned packaging task, it can obtain the task data of the packaging task from the corresponding storage unit, and continue to process the packaging task according to the task data, thereby improving the processing efficiency of the packaging task. This embodiment improves the processing efficiency of packaging tasks by caching the task data of the packaging task that is being processed in the storage unit so that the remaining packaging machines can continue to process the packaging task based on the task data in the storage unit. The packaging task that is being processed is assigned to an idle packaging machine so that the idle packaging machine can immediately continue to process the packaging task, avoiding delayed processing of the packaging task, ensuring the orderly processing of each packaging task in the system, and improving the packaging efficiency of the game.
[0069] In one embodiment, in order to provide a better user experience, the processing progress of the packaging task can be queried through the progress tracking mechanism so that the user can view the processing progress of the packaging task in real time. In this embodiment, the packaging task can be divided into a plurality of subtasks. Accordingly, when the packaging machine processes the packaging task, the processing status of the subtask can be determined according to the completion condition of the subtask, and the processing status includes a completed state and an uncompleted state; the first number of subtasks in the completed state is determined, and the processing progress of the packaging task is determined according to the percentage of the first number to the total number of subtasks of the packaging task. Exemplarily, assuming that the packaging task is to package the game data in file A, and file A includes four subfiles a1 to a4, the packaging task can be divided into five subtasks, that is, the five subtasks are to package subfile a1, to package subfile a2, to package subfile a3, to package subfile a4, and to package the four packaged subfiles. Correspondingly, the completion condition of the subtask for packaging subfile a1 is that all data in subfile a1 is packaged into one file package, and the same is true for the subtasks for packaging other subfiles. The completion condition for packaging the four packaged subfiles is that the four packaged subfiles are packaged into one file package. It can be determined whether each subtask meets the corresponding completion condition according to the amount of data packaged by each subtask. When the subtask meets the corresponding completion condition, it can be determined that the subtask is in a completed state. When the subtask does not meet the corresponding completion condition, it can be determined that the subtask is in an uncompleted state. If three of the five subtasks corresponding to the packaging task are in a completed state and two subtasks are in an uncompleted state, it can be determined that the processing progress of the packaging task is 60%. This embodiment tracks the processing progress of the packaging task by monitoring the processing status of each subtask of the packaging task, so as to truly reflect the progress of the packaging task and ensure that the user can timely and accurately understand the progress information of the packaging task.
[0070] In summary, the game packaging method provided by the embodiment of the present application adds the pending packaging request to the message queue, and adjusts the order of the pending packaging request in the message queue according to the priority of the pending packaging request; obtains the operation status data of each packer in the packer cluster, determines the resource utilization of the packer cluster according to the operation status data, and weights and sums the resource utilization and the number of requests of the pending packaging request to obtain a weighted value, and adjusts the number of packers in the packer cluster according to the comparison result of the weighted value and the preset range; distributes the pending packaging request in the message queue to each packer in the packer cluster through a preset load balancing strategy, so that each packer processes the packaging task corresponding to the pending packaging request in parallel, and the game data of the packaging task is distributed and stored in the storage unit corresponding to each packer. When the packer processes the packaging task, it obtains the game data of the packaging task in the corresponding storage unit, packs the game data to obtain the game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage unit corresponding to the remaining packers. Through the above technical means, the order of the request in the message queue can be adjusted according to the request priority, so that the packer can give priority to important packaging tasks, thereby improving the overall game packaging efficiency. The number of packers in the packer cluster is adjusted according to the running status data and the number of requests of the packer to optimize the processing performance and running resources of the packer cluster and improve the packing efficiency of the packer cluster. The requests are distributed to each packer in the packer cluster through the load balancing algorithm to balance the load of each packer, avoid the packer being in a high-load running state for a long time, and improve the stability of the system. Multiple packers can process the corresponding assigned packing tasks in parallel, which solves the problem that the automated packing system in the prior art can only process one packing task at the same time, and improves the game packing efficiency. The game data is stored in the storage unit of each packer through distributed caching to improve the reading efficiency of the game data, and the game data packets cached in the storage unit are synchronized to the remaining storage units through database replication to ensure the consistency and synchronization of the data and improve the reliability of the system.
[0071] Based on the above embodiments, Figure 6 This is a schematic diagram of the structure of a game packaging device provided in an embodiment of the present application. Figure 6 The game packaging device provided in this embodiment specifically includes: a request adding module 21, a resource adjustment module 22 and a task processing module 23.
[0072] The request adding module 21 is configured to add the received pending package request to the message queue, and adjust the order of the pending package request in the message queue according to the priority of the pending package request;
[0073] The resource adjustment module 22 is configured to obtain the operation status data of each packer in the packer cluster, determine the resource utilization of the packer cluster according to the operation status data, perform weighted summation on the resource utilization and the number of pending packing requests to obtain a weighted value, and adjust the number of packers in the packer cluster according to the comparison result between the weighted value and a preset range;
[0074] The task processing module 23 is configured to distribute each pending packaging request in the message queue to each packaging machine of the adjusted packaging machine cluster through a preset load balancing strategy, so that each packaging machine processes the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributedly stored in the storage unit corresponding to each packaging machine, and when the packaging machine processes the packaging task, it obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
[0075] Based on the above embodiment, the request adding module 21 includes: a priority feature acquisition unit, configured to obtain the available resource rate of the packaging machine cluster, and the estimated processing time, urgency and generation timestamp of each pending packaging request; a priority determination unit, configured to input the available resource rate and the estimated processing time, urgency and generation timestamp of each pending packaging request into a pre-trained decision tree model to obtain the priority corresponding to each pending packaging request output by the decision tree model.
[0076] On the basis of the above embodiment, the task processing module 23 includes: a first allocation unit, which is configured to allocate each pending packaging request one-to-one to each packaging machine in turn according to the order of each pending packaging request in the message queue when the number of requests is less than a preset number threshold; a second allocation unit, which is configured to determine the corresponding processing weight according to the load condition and the number of tasks of each packaging machine when the number of requests is greater than or equal to the preset number threshold, and allocate each pending packaging request one-to-one to each packaging machine in turn according to the order of the processing weights and the order of each pending packaging request in the message queue.
[0077] Based on the above embodiment, the second allocation unit includes: a weight determination subunit, which is configured to determine the expected value of each packer allocating pending packaging requests to each packer under the load condition and the number of tasks according to a preset reward expectation table; wherein the reward expectation table is determined by a reinforcement learning model; and the processing weight of the corresponding packer is determined according to the expected value of the packer.
[0078] Based on the above embodiment, the game packaging device includes a health detection module, which includes: a health detection unit, configured to obtain the system log of the packaging machine, obtain the health feature data of the packaging machine according to the system log, and analyze the health feature data through a pre-trained neural network model to determine the health status of the packaging machine; a third allocation unit, configured to stop allocating pending packaging requests to the packaging machine when an abnormality is detected in the packaging machine, and allocate the packaging tasks of the packaging machine to the remaining packaging machines.
[0079] On the basis of the above embodiment, the third allocation unit includes: a request allocation subunit, which is configured to obtain the first packaging request corresponding to the packaging task when the packaging task has not started processing, increase the priority of the first packaging request to the highest and then add it to the message queue so that the message queue adjusts the first packaging request to the head of the queue, determines the first packaging machine among the remaining packaging machines through a preset load balancing strategy, and allocates the first packaging request located at the head of the message queue to the first packaging machine, so that the first packaging machine processes the packaging task based on the first packaging request; a task allocation subunit, which is configured to cache the task data of the packaging task to the storage unit of the corresponding packaging machine when the packaging task starts processing, so that the storage unit copies the task data to the storage units of the remaining packaging machines, determines an idle packaging machine among the remaining packaging machines as the second packaging machine, and transfers the packaging task to the second packaging machine, so that the second packaging machine continues to process the packaging task based on the task data in the corresponding storage unit.
[0080] On the basis of the above embodiment, the packaging task includes multiple subtasks; accordingly, the game packaging device also includes a progress tracking module, which includes: a subtask status determination unit, which is configured to determine the processing status of the subtask according to the completion condition of the subtask when the packaging machine processes the packaging task corresponding to the pending packaging request in parallel, and the processing status includes a completed status and an uncompleted status; a task progress determination unit, which is configured to determine a first number of subtasks in a completed state, and determine the processing progress of the packaging task according to the percentage of the first number to the total number of subtasks of the packaging task.
[0081] As mentioned above, the game packaging device provided by the embodiment of the present application adds the pending packaging request to the message queue, and adjusts the order of the pending packaging request in the message queue according to the priority of the pending packaging request; obtains the operation status data of each packer in the packer cluster, determines the resource utilization of the packer cluster according to the operation status data, and performs weighted summation of the resource utilization and the number of requests of the pending packaging request to obtain a weighted value, and adjusts the number of packers in the packer cluster according to the comparison result of the weighted value and the preset range; distributes the pending packaging request in the message queue to each packer in the packer cluster through a preset load balancing strategy, so that each packer processes the packaging task corresponding to the pending packaging request in parallel, and the game data of the packaging task is distributed and stored in the storage unit corresponding to each packer. When the packer processes the packaging task, it obtains the game data of the packaging task in the corresponding storage unit, packs the game data to obtain the game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage unit corresponding to the remaining packers. Through the above technical means, the order of the request in the message queue can be adjusted according to the request priority, so that the packer can give priority to important packaging tasks, thereby improving the overall game packaging efficiency. The number of packers in the packer cluster is adjusted according to the running status data and the number of requests of the packer to optimize the processing performance and running resources of the packer cluster and improve the packing efficiency of the packer cluster. The requests are distributed to each packer in the packer cluster through the load balancing algorithm to balance the load of each packer, avoid the packer being in a high-load running state for a long time, and improve the stability of the system. Multiple packers can process the corresponding assigned packing tasks in parallel, which solves the problem that the automated packing system in the prior art can only process one packing task at the same time, and improves the game packing efficiency. The game data is stored in the storage unit of each packer through distributed caching to improve the reading efficiency of the game data, and the game data packets cached in the storage unit are synchronized to the remaining storage units through database replication to ensure the consistency and synchronization of the data and improve the reliability of the system.
[0082] The game packaging device provided in the embodiment of the present application can be used to execute the game packaging method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0083] Figure 7 is a schematic diagram of the structure of a game packaging device provided in an embodiment of the present application, with reference to Figure 7The game packaging device includes: a processor 31, a memory 32, a communication device 33, an input device 34 and an output device 35. The number of processors 31 in the game packaging device can be one or more, and the number of memories 32 in the game packaging device can be one or more. The processor 31, memory 32, communication device 33, input device 34 and output device 35 of the game packaging device can be connected through a bus or other methods.
[0084] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the game packaging method of any embodiment of the present application (for example, the request adding module 21, the resource adjustment module 22 and the task processing module 23 in the game packaging device). The memory 32 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to the use of the device, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0085] The communication device 33 is used for data transmission.
[0086] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, that is, implements the above-mentioned game packaging method.
[0087] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.
[0088] The game packaging device provided above can be used to execute the game packaging method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0089] The embodiment of the present application also provides a storage medium containing computer executable instructions, which are used to execute a game packaging method when executed by a computer processor. The game packaging method includes: adding the received pending packaging requests to a message queue, and adjusting the order of the pending packaging requests in the message queue according to the priority of the pending packaging requests; obtaining the operation status data of each packaging machine in the packaging machine cluster, determining the resource utilization of the packaging machine cluster according to the operation status data, performing weighted summation of the resource utilization and the number of requests of the pending packaging requests to obtain a weighted value, and adjusting the number of packaging machines in the packaging machine cluster according to the comparison result of the weighted value and a preset range; allocating each pending packaging request in the message queue to each packaging machine of the adjusted packaging machine cluster through a preset load balancing strategy, so that each packaging machine processes the packaging tasks corresponding to the pending packaging requests in parallel; wherein the game data of the packaging tasks are distributedly stored in the storage units corresponding to each packaging machine, and when the packaging machine processes the packaging tasks, it obtains the game data of the packaging tasks in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
[0090] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0091] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above game packaging method, can also execute related operations in the game packaging method provided in any embodiment of the present application.
[0092] The game packaging apparatus, storage medium and game packaging device provided in the above embodiments can execute the game packaging method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the game packaging method provided in any embodiment of the present application.
[0093] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A game packaging method, characterized in that: include: Add the received pending packaging request to the message queue; Obtain the available resource rate of the packer cluster, as well as the estimated processing time, urgency, and generation timestamp of each pending packing request in the message queue; Inputting the available resource rate and the estimated processing time, urgency, and generation timestamp of each of the pending package requests into a pre-trained decision tree model, and obtaining the priority corresponding to each of the pending package requests output by the decision tree model; Adjusting the order of the pending package requests in the message queue according to the priority of the pending package requests; Obtaining operating status data of each baler in the baler cluster, determining a resource utilization rate of the baler cluster based on the operating status data, performing a weighted summation on the resource utilization rate and the number of pending baling requests to obtain a weighted value, and adjusting the number of balers in the baler cluster based on a comparison result of the weighted value with a preset range; Through a preset load balancing strategy, each pending packaging request in the message queue is distributed to each packaging machine in the adjusted packaging machine cluster, so that each packaging machine processes the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributed and stored in the storage unit corresponding to each packaging machine. When processing the packaging task, the packaging machine obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
2. The game packaging method according to claim 1, characterized in that: The method of allocating each pending packaging request in the message queue to each packaging machine in the adjusted packaging machine cluster by using a preset load balancing strategy includes: When the number of requests is less than a preset number threshold, each of the pending packaging requests is sequentially allocated one-to-one to each of the packaging machines according to the order of each of the pending packaging requests in the message queue; When the number of requests is greater than or equal to the preset number threshold, the corresponding processing weight is determined according to the load condition and task quantity of each packer, and each of the pending packing requests is allocated one-to-one to each packer in turn according to the order of the processing weights and the order of each of the pending packing requests in the message queue.
3. The game packaging method according to claim 2, characterized in that: The determining of the corresponding processing weight according to the load condition and the number of tasks of each baler includes: Determining, according to a preset reward expectation table, an expected value of each of the packers allocating the pending packing requests to each of the packers under the load condition and the number of tasks; wherein the reward expectation table is determined by a reinforcement learning model; The processing weight of the corresponding baler is determined according to the expected value of the baler.
4. The game packaging method according to claim 1, characterized in that: The method further comprises: Obtaining a system log of the baler, obtaining health characteristic data of the baler based on the system log, and analyzing the health characteristic data using a pre-trained neural network model to determine a health status of the baler; When an abnormality is detected in the packer, the allocation of pending packing requests to the packer is stopped, and the packing tasks of the packer are allocated to other packers.
5. The game packaging method according to claim 4, characterized in that: The step of stopping allocating pending packaging requests to the packaging machine and allocating the packaging tasks of the packaging machine to other packaging machines includes: When the packaging task has not started processing, obtaining a first packaging request corresponding to the packaging task, raising the priority of the first packaging request to the highest, and then adding it to the message queue so that the message queue adjusts the first packaging request to the head of the queue, determining a first packaging machine from the remaining packaging machines through a preset load balancing strategy, and allocating the first packaging request at the head of the message queue to the first packaging machine, so that the first packaging machine processes the packaging task based on the first packaging request; When the packaging task starts to be processed, the task data of the packaging task is cached in the storage unit of the corresponding packaging machine so that the storage unit copies the task data to the storage units of the remaining packaging machines, and an idle packaging machine among the remaining packaging machines is determined to be the second packaging machine, and the packaging task is transferred to the second packaging machine so that the second packaging machine continues to process the packaging task based on the task data in the corresponding storage unit.
6. The game packaging method according to claim 1, characterized in that: The packaging task includes multiple subtasks; accordingly, when the packaging machine processes the packaging tasks corresponding to the pending packaging requests in parallel, it also includes: Determining a processing status of the subtask according to a completion condition of the subtask, wherein the processing status includes a completed state and an uncompleted state; A first number of subtasks in the completed state is determined, and a processing progress of the packaging task is determined according to a percentage of the first number to a total number of subtasks of the packaging task.
7. A game packaging device, characterized in that: include: A request adding module is configured to add received pending packaging requests to a message queue and adjust the order of the pending packaging requests in the message queue according to the priority of the pending packaging requests; wherein the request adding module includes: a priority feature acquisition unit, configured to obtain the available resource rate of the packaging machine cluster, as well as the estimated processing time, urgency and generation timestamp of each pending packaging request; a priority determination unit, configured to input the available resource rate and the estimated processing time, urgency and generation timestamp of each pending packaging request into a pre-trained decision tree model to obtain the priority corresponding to each pending packaging request output by the decision tree model; a resource adjustment module configured to obtain operating status data of each baler in a baler cluster, determine a resource utilization rate of the baler cluster based on the operating status data, perform a weighted summation of the resource utilization rate and the number of pending baling requests to obtain a weighted value, and adjust the number of balers in the baler cluster based on a comparison result of the weighted value with a preset range; The task processing module is configured to distribute each pending packaging request in the message queue to each packaging machine of the adjusted packaging machine cluster through a preset load balancing strategy, so that each packaging machine processes the packaging task corresponding to the pending packaging request in parallel; wherein, the game data of the packaging task is distributed and stored in the storage unit corresponding to each packaging machine. When processing the packaging task, the packaging machine obtains the game data of the packaging task in the corresponding storage unit, packages the game data to obtain a game data packet, and caches the game data packet to the corresponding storage unit, so that the storage unit synchronizes the game data packet to the storage units corresponding to the remaining packaging machines.
8. A game packaging device, characterized in that: include: one or more processors; A memory stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the game packaging method as described in any one of claims 1-6.
9. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to execute the game packaging method according to any one of claims 1 to 6.
