A startup optimization method, system, device and medium for WeChat mini-games
By applying machine learning algorithms to dynamically adjust resource loading strategies in WeChat mini games, and combining the classification of game engine components and optimized loading order of player behavior data, the problem of slow startup speed of WeChat mini games is solved, significantly improving user experience and game performance.
Patent Information
- Application Number
- CN202411834498.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
AI Technical Summary
During the startup process, WeChat mini-games are difficult to achieve user expectations due to the complex resource loading mechanism, complex initialization logic and changing network environment, which affects the user experience and may lead to user churn.
The resource loading strategy is dynamically adjusted through machine learning algorithms, and the components are divided into preload and lazy loading based on the resource occupation status and historical loading time data of game engine components, and the loading priority of lazy loading components is determined through player behavior data, and the loading order is determined based on the dependencies of resource files and player historical data.
It significantly improves the startup speed and user experience of WeChat mini games, reduces the cost of resource loading and updating, reduces user churn, and improves the game's response speed and user retention rate.
Smart Images

Figure CN119759443A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game optimization technology, and in particular to a startup optimization method, system, device and medium for WeChat mini-games. Background Art
[0002] As a lightweight entertainment application, WeChat mini games have rapidly become popular among users in recent years due to their convenience and fun, and have become the first choice for users to kill time and relax. This type of mini game mainly relies on the WeChat platform and uses the basic services provided by WeChat to load and start, which brings great convenience to users. However, although the WeChat platform has made many technical optimizations to improve the startup speed of mini games, it is still difficult to meet user expectations due to factors such as the resource loading mechanism of the mini game itself, the complexity of the initialization logic, and the changeable network environment.
[0003] Specifically, WeChat mini games need to load a large number of resource files during the startup process, including but not limited to game engines, image resources, audio resources, etc. The size and number of these resource files are often large, resulting in a long loading time, which affects the user's initial experience. In addition, the initialization process of the game engine also involves complex logical processing, including engine loading, configuration, rendering and other steps, and the time consumption of these steps cannot be ignored.
[0004] More importantly, the startup speed of WeChat mini games is also restricted by the network environment. When the network is in good condition, the resource loading speed is relatively fast and the startup time is relatively short. However, when the network environment is poor, such as high network latency and insufficient bandwidth, the resource loading speed will drop significantly, resulting in a longer startup time and even possible startup failure. This not only seriously affects the user experience, but may also lead to a decrease in user satisfaction with the mini games, resulting in user loss.
[0005] The industry has made some attempts and optimizations to address the above issues, but the results are not ideal. For example, some small game developers try to shorten loading time by reducing the size and number of resource files, but this often comes at the expense of game quality and functionality, making it difficult to balance user experience and game quality. Other developers try to shorten startup time by optimizing the initialization logic of the game engine, but this type of optimization often requires deep customization and modification of the game engine, which is difficult and costly to implement. Summary of the invention
[0006] The purpose of the present invention is to provide a startup optimization method, system, device and medium for WeChat mini-games, which significantly improves the startup speed and user experience of WeChat mini-games, reduces the cost of resource loading and updating, and solves at least one of the above-mentioned prior art problems.
[0007] In a first aspect, the present invention provides a startup optimization method for a WeChat mini-game, the method specifically comprising:
[0008] Based on the startup performance data of WeChat Mini Games at each stage of the startup process under different devices and network environments, the resource loading strategy of WeChat Mini Games is dynamically adjusted through machine learning algorithms;
[0009] According to the resource usage and historical loading time data of each game engine component of WeChat Mini Games, each game engine component is divided into pre-loaded components and lazy-loaded components, and the loading priority of each lazy-loaded component is determined by player behavior data;
[0010] According to the resource dependency relationship of each resource file of the WeChat Mini Game, determine the first loading order of each resource file in the startup process of the WeChat Mini Game;
[0011] According to the historical access scene data and historical function usage data of the player in the WeChat mini game, the second loading order of each resource file of the WeChat mini game on the corresponding player account is determined.
[0012] In a second aspect, the present invention provides a startup optimization system for WeChat mini-games, the system specifically comprising:
[0013] The first optimization module is used to dynamically adjust the resource loading strategy of WeChat Mini Games through machine learning algorithms based on the startup performance data of WeChat Mini Games at each stage of the startup process under different devices and different network environments;
[0014] The second optimization module is used to divide each game engine component of the WeChat Mini Game into a pre-loaded component and a lazy-loaded component according to the resource usage and historical loading time data of each game engine component, and determine the loading priority of each lazy-loaded component according to the player behavior data;
[0015] The third optimization module is used to determine the first loading order of each resource file in the startup process of the WeChat Mini Game according to the resource dependency relationship of each resource file of the WeChat Mini Game;
[0016] The fourth optimization module is used to determine the second loading order of various resource files of the WeChat mini game on the corresponding player account based on the player's historical access scene data and historical function usage data in the WeChat mini game.
[0017] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor and a computer program stored in the memory, and when the computer program is executed on the processor, a startup optimization method for WeChat mini-games as described in any one of the above methods is implemented.
[0018] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the startup optimization method for WeChat mini-games as described in any one of the above methods is implemented.
[0019] Compared with the prior art, the present invention has at least one of the following technical effects:
[0020] 1. The present invention significantly improves the startup speed and user experience of WeChat mini-games, reduces the cost of resource loading and updating, thereby improving the user experience and reducing user churn.
[0021] 2. By collecting startup performance data under different devices and different network environments and analyzing it using a machine learning algorithm, the present invention can dynamically adjust the resource loading strategy of WeChat mini games, optimize it for different devices and network environments, and ensure that WeChat mini games can be started at the fastest speed under various conditions, thereby improving the user experience.
[0022] 3. The present invention divides the game engine components into preload components and lazy load components, and classifies them according to resource occupancy and historical loading time data, so as to optimize resource allocation during the startup process.
[0023] 4. The present invention determines the loading priority of lazy-loaded components through player behavior data, which can ensure that the components most frequently used by players can be loaded first, further shortening the startup time.
[0024] 5. The present invention determines the loading order according to the dependency relationship of resource files, which can avoid the waiting time caused by improper resource loading order during the startup process, ensure that the resources are loaded in the correct order, and thus improve the startup efficiency.
[0025] 6. The present invention determines the second loading order of resource files by analyzing the player's historical access scenarios and usage function data, which can ensure that the resources most frequently accessed and used by players can be loaded first, thereby improving the game's response speed and user experience.
[0026] 7. The present invention establishes a resource dependency graph through a dependency analysis algorithm and uses the Kahn topological sorting algorithm to generate a loading order, which can ensure that there will be no circular dependency problems in the resource files during the loading process, can minimize the waiting time for resource loading, and improve startup efficiency.
[0027] 8. The present invention generates a personalized resource loading order for each player account based on the player's historical access scenarios and usage function data, which can ensure that players can quickly access the content they are most interested in when starting the game, thereby improving the game's attractiveness and user retention rate.
[0028] 9. The present invention adds a unique MD5 hash value to each resource file of the WeChat mini-game, which can quickly compare the resource package of the server and the resource package of the client at startup, find the difference files and update them, which can reduce unnecessary resource download and transmission time, improve update efficiency, and ensure that players can always use the latest version of resource files. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 It is a flowchart of a startup optimization method for WeChat mini-games provided by the first embodiment of the present invention;
[0031] Figure 2 It is a flowchart of a startup optimization method for WeChat mini-games provided by the second embodiment of the present invention;
[0032] Figure 3 1 is a flow chart of a method for optimizing the startup of a WeChat mini-game provided in a third embodiment of the present invention;
[0033] Figure 4 4 is a flowchart of a startup optimization method for a WeChat mini-game provided in a fourth embodiment of the present invention;
[0034] Figure 5 1 is a flowchart of a startup optimization method for a WeChat mini-game provided in a fifth embodiment of the present invention;
[0035] Figure 6 1 is a flowchart of a startup optimization method for a WeChat mini-game provided in a sixth embodiment of the present invention;
[0036] Figure 7 1 is a flow chart of a method for optimizing the startup of a WeChat mini-game provided in a seventh embodiment of the present invention;
[0037] Figure 8 It is a structural diagram of a startup optimization system for WeChat mini-games provided by an embodiment of the present invention;
[0038] Fig. 9 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0040] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0041] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0042] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0043] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0044] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0045] In the embodiment of the present application, the execution subject of the process includes a terminal device, which includes but is not limited to: a server, a computer, a smart phone, a tablet computer, and other devices capable of executing the method disclosed in the present application. Figure 1 A schematic diagram of a process flow of a startup optimization method for a WeChat mini-game disclosed in a first embodiment of the present invention is shown, and is described in detail as follows:
[0046] S101, dynamically adjust the resource loading strategy of the WeChat Mini Game through a machine learning algorithm according to the startup performance data of the WeChat Mini Game at each stage of the startup process under different devices and different network environments.
[0047] In this embodiment, the startup performance data of WeChat games at each stage of the startup process are collected under different devices (such as smart phones, tablet computers, etc.) and different network environments (such as 2G, 3G, 4G, Wi-Fi, etc.), and the collected data covers multiple dimensions, such as startup time, memory usage, CPU usage, etc. Features related to resource loading strategies are extracted from the original data, such as device type, network type, startup stage, resource size, loading time, etc., and the selected features are further processed and converted to extract information useful for the machine learning algorithm. The machine learning algorithm is trained using pre-processed data to obtain a model that can predict the startup performance of WeChat games under different devices and different network environments. According to the prediction results of the machine learning model, resource loading strategies for WeChat games under different devices and different network environments are formulated, and the formulated resource loading strategies are embedded in the code of WeChat games to ensure that the appropriate loading strategy can be automatically selected according to the current device and network environment when the game is started. Real-time monitoring of startup performance data during the game running process, including resource loading time, memory usage, etc. Fine-tune the resource loading strategy according to the real-time monitoring results to further improve game performance and user experience.
[0048] In this embodiment, by dynamically adjusting the resource loading strategy, the order and quantity of resource loading can be optimized according to the actual situation of the current device and network environment, thereby reducing the waiting time during the startup process and improving the game startup speed. Using different resource loading strategies in different devices and network environments can reasonably allocate resources, avoid unnecessary resource waste, and reduce memory usage and CPU usage. Faster startup speed and more optimized resource usage can significantly improve the user experience, allowing users to enter the game more quickly and enjoy a smooth game process.
[0049] S102, according to the resource usage and historical loading time data of each game engine component of the WeChat mini game, each game engine component is divided into a pre-loaded component and a lazy-loaded component, and the loading priority of each lazy-loaded component is determined according to the player behavior data.
[0050] In this embodiment, the resource usage of each game engine component at runtime is collected through the performance analysis tool provided by the game engine, including the usage of memory, CPU, GPU and other resources. The time required for each component to load during the game startup or running process is recorded, including the time for the first load and subsequent loads. For example, key components such as rendering components and physics components are classified as preloaded components, and other non-essential components such as sound components are classified as lazy loaded components.
[0051] During the initialization of the game engine, a hierarchical initialization strategy is adopted. First, preload components are loaded and initialized to ensure that basic game functions are available. For lazy-loaded components, a proxy mode is introduced to create a proxy object of the component, and the actual component initialization is delayed until the proxy object is called for the first time, reducing resource overhead at startup. During the game running process, the usage of the component is dynamically evaluated by recording indicators such as the call frequency and time interval of the lazy-loaded component proxy object. When the call frequency exceeds the preset threshold or the time interval is less than the preset value, early initialization is triggered, and the lazy-loaded component is converted to a preloaded component to improve the response speed of subsequent calls. For different types of games, player behavior data is collected, the usage pattern and frequency of each component are analyzed, and a component initialization priority queue is established. The division of preloaded and lazy-loaded components is dynamically adjusted according to priority, high-priority components are initialized in advance, and low-priority components are initialized later to optimize resource allocation. For frequently used lazy-loaded components, their resources and status are cached in memory during the first initialization. When initialization is required again, it is directly restored from the memory cache to avoid repeated resource loading and initialization operations, improve response speed, and reduce resource overhead. By combining the above strategies, we can minimize the resource overhead at startup and improve game performance and user experience while ensuring the availability of basic game functions. During operation, we can dynamically adjust the initialization timing and priority of components according to actual conditions to achieve reasonable allocation and optimization of resources.
[0052] S103, determining the first loading order of each resource file in the startup process of the WeChat mini game according to the resource dependency relationship of each resource file of the WeChat mini game.
[0053] In this embodiment, by analyzing the functional modules of the mini-game, the resource list that each module depends on is obtained, and a directed graph of resource dependencies is constructed. These dependencies may include: script dependencies, where some script files may depend on functions or variables provided by other script files; resource dependencies, such as character models may depend on specific texture files or animation files; scene dependencies: game scenes may depend on multiple resource files, including characters, props, backgrounds, etc.
[0054] Use tools such as Graphviz to visualize resource dependency graphs for easy analysis and optimization. After analyzing the resource dependencies, the first loading order of each resource file can be determined according to the following steps: First, identify the core resources that must be loaded when the game starts, such as the main engine file, core script files, necessary textures and sound effects, etc. These resources are usually the basis for the game to run, and the game will not run properly without them. Then, starting from the core resources, analyze the other resources they depend on, and determine the loading order of these dependent resources in turn, which usually forms a resource dependency chain, and each resource in the chain depends on the previous resource in the chain. Next, based on the resource dependency chain, the first loading order of each resource file in the WeChat mini-game startup process can be determined. This order should ensure that all resources it depends on have been loaded before loading any resources.
[0055] During the game startup process, the asynchronous loading mechanism is used to load these core resources first to ensure the quick startup of the game. For non-core resources, a delayed loading strategy is adopted. During the game running process, by monitoring the user's interactive events, it is determined whether a certain functional module is triggered. If a certain functional module is triggered, the non-core resources required by it are dynamically loaded.
[0056] In this embodiment, by determining the loading order according to the resource dependency, it can be ensured that all necessary resources can be correctly loaded when the game is started, thereby avoiding game crashes or abnormal operation. A reasonable resource loading order can reduce unnecessary resource loading and repeated loading, thereby improving loading efficiency. By providing feedback on the loading progress and reducing the loading time, the user experience can be significantly improved. A reasonable resource loading strategy can enhance the stability of the game and reduce game crashes or freezes caused by resource loading problems.
[0057] S104, determining a second loading order of various resource files of the WeChat mini game on the corresponding player account based on the player's historical access scene data and historical function usage data of the WeChat mini game.
[0058] In this embodiment, each scene visited by the player in the WeChat mini-game is recorded, including the scene name, visit time, stay time, etc.; each function used by the player in the WeChat mini-game is recorded, including the function name, number of times used, frequency of use, etc.
[0059] According to the players' historical access scene data, the players' preference for different scenes can be analyzed, which can be evaluated by calculating the players' stay time in each scene, access frequency and other indicators. According to the players' historical use function data, the players' usage habits of different functions can be analyzed, which can be evaluated by calculating the number of times the players use each function, the frequency of use and other indicators. The resource files of WeChat mini games are classified according to functions, scenes, etc., such as character resources, scene resources, sound effect resources, etc. According to the players' scene preferences and function usage habits, the loading priority of each resource file on the corresponding player account is calculated. The weighted average method and other methods can be used to convert the scene preferences and function usage habits into a specific loading order. After calculating the loading priority of all resource files, they are sorted from high to low according to the priority, and the second loading order of each resource file on the corresponding player account is determined. The first loading order usually includes the core resource files that must be loaded when the game starts, and the second loading order includes other resource files that the player may need during the game.
[0060] Embed the determined resource file loading order into the WeChat Mini Game code to ensure that resource files can be loaded in the second loading order when the game is running. Monitor the loading status of resource files in real time during the game running, including loading time, loading success rate, etc. Fine-tune the loading strategy based on the monitoring results to further improve loading efficiency and user experience.
[0061] In this embodiment, by determining the loading order of resource files based on the player's historical access scene data and historical usage function data, the resource files most needed by the player can be loaded first, thereby reducing unnecessary waiting time and improving loading efficiency. Faster loading speed and more accurate resource loading can significantly improve the user experience, allowing players to enter the game more quickly and enjoy a smooth game process. By optimizing the resource loading strategy, the WeChat mini game can stand out in the fiercely competitive market, attract more players and improve user stickiness.
[0062] In some embodiments, Figure 2 As shown, in the above step S101, the resource loading strategy of the WeChat Mini Game is dynamically adjusted through a machine learning algorithm according to the startup performance data of the WeChat Mini Game at each stage of the startup process in different devices and different network environments, specifically including:
[0063] S1011, collecting startup performance data of WeChat mini games at each stage of the startup process under different devices and different network environments, wherein the startup process includes a stage of downloading the first package of resources, a stage of rendering the first screen using the WeChat webgl interface, a stage of initializing the engine, a stage of injecting game code, a stage of clearing the first screen, and a stage of rendering the game screen using the game engine;
[0064] S1012, performing cluster analysis using a K-Means algorithm based on the startup performance data to obtain cluster analysis results, wherein the cluster analysis results include performance patterns of WeChat mini games at each stage of the startup process under different devices and different network environments;
[0065] S1013, based on the cluster analysis result, determining the resource loading strategy for each stage of the WeChat mini game startup process.
[0066] In this embodiment, the performance data of each stage in the WeChat mini-game startup process under different devices and network environments are obtained, including the time overhead of downloading the first package of resources, rendering the first screen using the WeChat WebGL interface, initializing the engine, injecting game code, clearing the first screen, and using the game engine to render the game screen. The collected startup performance data is preprocessed, outliers are removed, and grouped according to the device type and network type to obtain a startup performance data set under different devices and network environments. The K-Means algorithm is used to perform cluster analysis on the startup performance data set under different devices and network environments, and the startup performance is divided into different performance modes according to the cluster center, and each performance mode corresponds to a group of typical devices and network environment combinations. For each performance mode, the time overhead distribution characteristics of each stage in its startup process are analyzed to determine the resource loading strategy for each stage, such as reducing the download amount of the first package of resources in low-performance mode, and increasing the number of concurrent download threads in high-performance mode. According to the performance mode and resource loading strategy, the resource loading method of each stage in the startup process of the WeChat mini-game is dynamically adjusted, such as using progressive loading in low-performance mode and preloading in high-performance mode, etc., to improve the startup speed under different devices and network environments. During the running of the mini-game, we continuously collect performance data, and regularly update cluster analysis results and resource loading strategies to adapt to changes in equipment and network environment, and continuously optimize the startup performance of the mini-game. We establish a mini-game startup performance monitoring and early warning mechanism to determine whether the current startup speed is abnormal based on real-time performance data. If it is lower than expected, we trigger an early warning, analyze performance bottlenecks, and adjust resource loading strategies to ensure that the mini-game can be quickly started in various environments.
[0067] For example, during the startup of a WeChat mini-game, the first thing to pay attention to is the stage of downloading the first package of resources. At this stage, the game will download the necessary resource files from the server for subsequent game rendering and logic processing. For example, assuming that the total size of the first package of resources that a mini-game needs to load is 5MB, and in a 4G network environment, the download speed is about 1MB / s, then the theoretical download time is 5 seconds. However, in a 3G or worse network environment, the download speed may drop to 0.3MB / s, causing the download time to increase to about 17 seconds. This difference in network environment has a significant impact on the user experience.
[0068] Next is the first screen rendering stage using the WeChat webgl interface. In this stage, the game uses the downloaded resources to render the first game screen. The speed of first screen rendering depends not only on the network download speed, but also on the device performance. For example, a high-performance device can process graphics data faster, and the first screen rendering time may only take 1 second, while a low-performance device may take 3 seconds. This difference directly affects the user's first experience.
[0069] The initialization engine phase is a critical part of game startup. The game engine is responsible for handling all subsequent game logic and rendering tasks. During this phase, the engine loads and initializes its core components, such as the physics engine, sound processing module, etc. The device's CPU and memory resources are particularly important during this phase. For example, a device with a high-speed CPU and large memory can complete initialization within 2 seconds, while an older device may take 5 seconds.
[0070] The game code injection phase is to load the game logic code written by the developer into the game engine. The speed of this process depends on the complexity of the code and the processing power of the device. For example, a game with complex interactions and advanced AI may take longer to inject and initialize its code.
[0071] The first screen clearing phase usually occurs before the game enters the main interface, at which time the game will clean up the temporary resources used during the first screen loading process. This step helps free up memory for the main game and ensures smooth game operation.
[0072] Finally, the actual game begins when the game engine is used to render the game screen. The game engine will generate corresponding images based on the game logic and output them to the screen. The graphics processing capability of the device is particularly important at this stage. A high-performance GPU can ensure smooth game screens and rich details.
[0073] By collecting performance data from each of the above stages and using the K-Means algorithm for cluster analysis, we can identify performance patterns in different devices and network environments. For example, devices can be divided into three performance levels: high, medium, and low, and network environments can be divided into three levels: excellent, good, and poor. Cluster analysis can be used to find typical performance under each combination. This information can help developers optimize their resource loading strategies for different devices and network environments. For example, for low-performance devices or poor network environments, developers can choose to load lower resolution resources or delay the loading of non-critical resources to improve the user experience. In this way, not only can the user's gaming experience be improved, but the use of network resources can also be optimized, and user churn caused by loading delays can be reduced, thereby gaining an advantage in the highly competitive gaming market.
[0074] In some embodiments, Figure 3As shown, in the above step S102, the game engine components are divided into preload components and lazy load components according to the resource occupancy and historical loading time data of each game engine component of the WeChat mini game, specifically including:
[0075] S1021, collecting resource occupancy and historical loading time data of each game engine component of the WeChat Mini Game, and determining usage pattern data of each game engine component according to the resource occupancy and the historical loading time data;
[0076] S1022, determining, based on the usage pattern data, game engine components that need to be loaded during the startup of the WeChat Mini Game and game engine components that do not need to be loaded during the startup of the WeChat Mini Game;
[0077] S1023, determining the game engine components that need to be loaded during the startup of the WeChat mini game as pre-loaded components, and determining the game engine components that do not need to be loaded during the startup of the WeChat mini game as lazy-loaded components.
[0078] In this embodiment, the resource occupancy and historical loading time data of each game engine component of the WeChat mini game are obtained and stored in a database. The usage pattern data of each game engine component is obtained by clustering the resource occupancy and historical loading time data. According to the usage pattern data, it is determined whether the game engine component needs to be loaded during the startup of the WeChat mini game. If necessary, it is determined as a preloaded component, otherwise it is determined as a lazy loading component. When the WeChat mini game is started, the preloaded component is loaded first to improve the game startup speed and user experience. For lazy loading components, they are dynamically loaded as needed during the game operation to reduce unnecessary resource loading at startup. The resource occupancy and loading time data of each component of the WeChat mini game are continuously collected, the usage pattern data is regularly updated, and the division of preloaded and lazy loading components is dynamically adjusted. By optimizing the division of preloaded components and lazy loading components, the startup time of the WeChat mini game is minimized, and the user experience and retention rate are improved.
[0079] Exemplarily, by collecting resource occupancy and historical loading time data, resource loading strategies can be effectively formulated, preloading and lazy loading components can be distinguished, thereby improving the startup speed. First, it is necessary to collect the resource occupancy and historical loading time data of each game engine component of WeChat mini-games. For example, the resource occupancy (memory, CPU, GPU occupancy) of the physics engine component, audio engine component, particle system component, animation component, etc. of the game engine in different scenarios, as well as their loading time, can be recorded. The way to collect these data can be to perform point statistics during the game running process and upload them to the server for analysis. Assume that the average CPU occupancy rate of the physics engine component in game scene A is 15%, the memory occupancy is 20MB, and the loading time is 500ms; in game scene B, the CPU occupancy rate is 5%, the memory occupancy is 5MB, and the loading time is 100ms. By comparing the data in different scenarios, the usage pattern of the physics engine component can be analyzed. Next, based on the collected resource occupancy and historical loading time data, the usage pattern data of each game engine component can be determined. If a game engine component is frequently used in most scenarios, has a high resource usage rate and a long loading time, then its usage pattern can be defined as "high frequency use". Conversely, if a component is only used in specific scenarios, has a low resource usage rate and a short loading time, then its usage pattern can be defined as "low frequency use". Suppose the analysis finds that the physics engine component is often used in the game, has a high resource usage rate, and a loading time of about 500ms. The particle system component is only used in the explosion effect in a specific scenario, has a low resource usage, and a loading time of about 100ms. Then, the usage pattern of the physics engine component is "high frequency use", and the usage pattern of the particle system component is "low frequency use". Then, based on the usage pattern data of each game engine component, it is possible to determine the game engine components that need to be loaded during the startup of the WeChat Mini Game and the game engine components that do not need to be loaded during the startup of the WeChat Mini Game. For "high frequency use" components, in order to avoid jamming during the game, they should be preloaded at the startup stage. For "low frequency use" components, they can be loaded when they are needed, that is, lazy loading, to reduce the startup time. In the above example, the physics engine component is a "high frequency use" component, so it should be preloaded during the startup phase. The particle system component is a "low frequency use" component and can be loaded when needed, such as when the player triggers an explosion effect. Finally, the game engine components that need to be loaded during the startup of the WeChat Mini Game are determined as preloaded components, and the game engine components that do not need to be loaded during the startup of the WeChat Mini Game are determined as lazy loading components.In this way, a reasonable resource loading strategy can be formulated according to the usage pattern of the game engine components, thereby optimizing the startup speed of WeChat mini games and improving the user experience. The physics engine component can be defined as a preloaded component, which is loaded when the game starts. The particle system component is defined as a lazy loading component, which is dynamically loaded when the player triggers the explosion effect. This not only ensures the smooth operation of the core functions, but also reduces the startup time and optimizes the game performance. In this way, the amount of resource loading in the startup phase can be minimized, and only the necessary components are loaded, thereby speeding up the startup speed. Other components can be loaded on demand to avoid unnecessary resource consumption and improve the overall game performance.
[0080] In some embodiments, Figure 4 As shown, in the above step S102, the loading priority of each lazy loading component is determined by the player behavior data, specifically including:
[0081] S1024, collecting player behavior data corresponding to different types of WeChat mini-games, and determining the calling frequency of each lazy loading component according to the player behavior data;
[0082] S1025, performing correlation analysis on the type data of WeChat mini games and the calling frequency of each lazy loading component to form a training data set;
[0083] S1026, using the training data set as input, performing modeling training through a decision tree algorithm, and obtaining a component call frequency prediction model;
[0084] S1027, determining the call frequency prediction data of each lazy loading component of different types of WeChat mini games according to the component call frequency prediction model;
[0085] S1028, based on the call frequency prediction data, determine the loading priority of each lazy loading component of different types of WeChat mini games.
[0086] In this embodiment, the player behavior log data of different types of WeChat mini-games are obtained, and the number of calls of each lazy loading component is counted to calculate the calling frequency. The type of WeChat mini-game is used as a label attribute, and the calling frequency of the lazy loading component is used as a characteristic attribute to construct a training data set. A decision tree algorithm is used, and the training data set is used as input to perform modeling training to obtain a decision tree model. Using the trained prediction model, the calling frequency data of each lazy loading component in different types of WeChat mini-games in the future period of time is predicted; according to the predicted calling frequency data, a priority sorting algorithm such as heap sorting is used to calculate the loading priority score of each lazy loading component; the calculated loading priority score is compared with the preset priority threshold. If it is higher than the threshold, the component is marked as high priority, otherwise it is marked as low priority; in the loading process of WeChat mini-games, according to the priority mark of the component, the high-priority lazy loading component is loaded first, and the low-priority component is loaded late, thereby improving the loading speed and user experience of the game.
[0087] Exemplarily, first, it is necessary to collect player behavior data of different types of WeChat mini-games. For example, for the casual puzzle game "Tiantian Xiaoxiaole", you can collect player behavior data such as clicking on different levels, using props, and watching advertisements. For the simulation business game "My Restaurant", you can collect player behavior data such as building facilities, cooking dishes, and receiving customers. For the role-playing game "Legend of the Brave", you can collect player behavior data such as completing tasks, interacting with NPCs, and participating in battles. Next, you need to determine the calling frequency of each lazy loading component based on these player behavior data.
[0088] For example, in the game "Candy Crush Saga", the settlement interface after the game is a lazy loading component. By analyzing the number of games played by players, the call frequency of this component can be calculated. Assuming that each player plays 10 games per day on average, the daily call frequency of the settlement interface is 10 times / day / user.
[0089] For example, in "My Restaurant", the recipe interface is a lazy loading component that is opened every time a player wants to learn a new dish. By counting the number of times a player learns a new dish, the calling frequency of this component can be determined. Assuming that an average player learns 2 new dishes per week, the calling frequency of the recipe interface is 2 times / week / user.
[0090] For example, in "Legend of the Brave", the equipment enhancement interface is a lazy loading component. Assuming that each player enhances their equipment 5 times per month on average, the calling frequency of this component is 5 times / month / user.
[0091] The type data of WeChat mini games and the calling frequency of each lazy loading component are correlated and analyzed to form a training data set. For example, "Tiantian Xiaoxiaole" (casual puzzle), settlement interface, 10 times / day / user; "My Restaurant" (simulation business), recipe interface, 2 times / week / user; "Legend of the Brave" (role-playing), equipment enhancement interface, 5 times / month / user, etc. These data constitute the training data set. With the training data set, the decision tree algorithm can be used for modeling training to obtain a component call frequency prediction model. The decision tree algorithm predicts the calling frequency of each lazy loading component in different types of games based on the game type and other related features (such as the number of daily active users of the game, the average game time, etc.). The component call frequency prediction model obtained through training can predict the call frequency prediction data of each lazy loading component of different types of WeChat mini games. For example, for a newly launched casual puzzle game, it can be predicted that the calling frequency of its settlement interface is 8 times / day / user; for a newly launched simulation business game, it can be predicted that the calling frequency of its recipe interface is 3 times / week / user. Finally, based on these call frequency prediction data, the loading priority of each lazy loading component of different types of WeChat mini-games can be determined. Components with high call frequency have high priority and should be loaded first; components with low call frequency have low priority and can be loaded later. For example, the settlement interface has a high call frequency, so it should be given a higher loading priority to ensure that players can quickly see the settlement interface after the game ends. Some less commonly used functional modules, such as the achievement system interface in "Legend of the Brave", can be given a lower loading priority and loaded later due to their low call frequency, thereby reducing startup time and improving user experience. In this way, the component call frequency can be predicted more accurately according to the characteristics of different types of games, so as to set the loading priority more effectively, effectively reduce startup time, improve resource utilization, and ultimately improve user experience.
[0092] In some embodiments, Figure 5 As shown, in the above step S103, the first loading order of each resource file in the startup process of the WeChat mini game is determined according to the resource dependency relationship of each resource file of the WeChat mini game, which specifically includes:
[0093] S1031, establishing a resource dependency graph through a dependency analysis algorithm according to the resource dependency relationships of various resource files of the WeChat Mini Game;
[0094] S1032, based on the resource dependency graph, using the Kahn topological sorting algorithm to generate the first loading order of each resource file during the startup process of the WeChat mini game.
[0095] In this embodiment, a list of all resource files of WeChat mini games is obtained, and for each resource file, other resource files that it depends on are analyzed to construct a resource dependency matrix. According to the resource dependency matrix, a graph theory algorithm is used to construct a directed acyclic graph (DAG) to obtain a dependency graph between resource files. A depth-first search (DFS) is performed on the resource dependency graph to obtain all possible resource file loading orders and form multiple topological sorting sequences. For each topological sorting sequence, by simulating the mini game startup process, the first loading time point of each resource file is counted to obtain the resource loading efficiency evaluation results under different sorting. A heuristic optimization algorithm, such as a genetic algorithm or a simulated annealing algorithm, is used to optimize the resource loading efficiency, search for the optimal resource file loading order, and obtain the globally optimal Kahn topological sorting sequence. The optimal resource file loading order is applied to the resource management module of the WeChat mini game. When the mini game is started, each resource file is loaded in the optimal order to optimize the startup speed. Continuously monitor the actual operation of the mini-game, collect statistical information on the loading time and dependencies of each resource file, re-execute the above steps regularly, dynamically adjust and optimize the resource loading order, and adapt to changes in game version iterations and user usage habits.
[0096] Exemplarily, first, a resource dependency graph is established through a dependency analysis algorithm. For example, a mini-game may contain multiple scenes, each of which is composed of different resource files, such as images, audio, and scripts. There are dependencies between these resource files. For example, a script in a scene may need to load a completed image file before it can be executed correctly. The dependency analysis algorithm analyzes the dependencies between these resource files and visualizes these relationships into a graph, which helps developers understand the complexity and dependencies of resource loading.
[0097] Next, based on the resource dependency graph, using the Kahn topological sorting algorithm to generate the loading order of resource files is the key to improving loading efficiency. Topological sorting is an algorithm for sorting directed acyclic graphs (DAGs). It generates a linear sorting result to ensure that the predecessor nodes (i.e., dependent resources) of each node (here, the resource file) are processed (loaded) before it. For example, if the main interface of the game depends on background music and background images, the loading of background music and images should be arranged before the main interface script. Through the Kahn algorithm, such a loading order can be automatically calculated, so that when the game starts, the necessary resources can be quickly loaded in the optimal order, reducing the player's waiting time. Such processing not only optimizes the resource loading process, but also significantly improves the startup speed and running efficiency of the game. By accurately controlling the order of resource loading, it is possible to avoid the situation where resources are not ready during the game operation, thereby providing a smoother user experience. In addition, reasonable resource management can also reduce the memory usage of the game at runtime, because resources can be loaded on demand, and all resources do not have to be loaded into memory at one time. In this way, developers of WeChat Mini Games can manage and optimize game resources more effectively, ensuring that the games can provide high-quality performance and user experience on a variety of devices.
[0098] In some embodiments, Figure 6 As shown, in the above step S104, the second loading order of each resource file of the WeChat mini game on the corresponding player account is determined based on the player's historical access scene data and historical use function data of the WeChat mini game, specifically including:
[0099] S1041, obtaining historical access scene data and historical usage function data of the player in the WeChat mini-game, and determining the access frequency of each access scene and the usage frequency of each usage function according to the historical access scene data and the historical usage function data;
[0100] S1042, determining a first loading frequency of each resource file called by each access scenario according to the access frequency, and determining a second loading frequency of each resource file called by each usage function according to the usage frequency;
[0101] S1043: Determine a second loading order of each resource file of the WeChat mini game on the corresponding player account according to the first loading frequency and the second loading frequency.
[0102] In this embodiment, the player's historical access scene data and historical usage function data in the WeChat mini-game are obtained, and the access frequency of each access scene and the usage frequency of each usage function are obtained through statistical analysis; the first loading frequency of the resource files called by each access scene is determined according to the access frequency, and the second loading frequency of the resource files called by each usage function is determined according to the usage frequency; the first loading frequency and the second loading frequency are weighted to obtain the comprehensive loading frequency of each resource file; the resource files are sorted according to the comprehensive loading frequency to obtain a loading priority list of the resource files; when the player logs in to the WeChat mini-game, the loading order of each resource file is determined according to the loading priority list of the resource files; each resource file is loaded in sequence according to the determined loading order until all are loaded; during the resource file loading process, if a resource file fails to load, the file is skipped and the next resource file is loaded to ensure smooth operation of the game.
[0103] For example, first, the player's historical access scene data and historical use function data need to be obtained. For example, the player A's historical access scene data can be recorded as: {Login scene: 5 times, Game lobby: 10 times, Dungeon scene 1: 20 times, Dungeon scene 2: 5 times, Friend scene: 1 time}. The player A's historical use function data can be recorded as: {View backpack: 30 times, Send chat: 15 times, Use skill A: 25 times, Use skill B: 5 times, Share record: 1 time}.
[0104] Next, we calculated the visit frequency of each scene and the use frequency of each function based on these data. For example, player A visited "Dungeon Scene 1" more frequently than other scenes, and used the functions "View Backpack" and "Use Skill A" more frequently.
[0105] Then, determine the resource files called by each scene and function, and calculate the loading frequency of these resource files. For example, the resource files that need to be loaded for "copy scene 1" include {map resource 1, character resource A, monster resource B, sound effect resource C}. The "view backpack" function needs to load {backpack interface resources, prop icon resources, special effect resources D}. "Use skill A" needs to load {skill special effect A, sound effect resource E}. Then, the first loading frequency of "map resource 1, character resource A, monster resource B, sound effect resource C" is higher because they are called by the frequently accessed "copy scene 1". The second loading frequency of "backpack interface resources, prop icon resources, special effect resources D" and "skill special effect A, sound effect resource E" is higher because they are called by the frequently used "view backpack" and "use skill A" functions. Finally, according to the first loading frequency and the second loading frequency, determine the final loading order of the resource files.
[0106] Here, the first loading frequency has a higher priority than the second loading frequency. Assuming that sound effect resource C is called by both "copy scene 1" and "use skill A", since the access frequency of "copy scene 1" is much higher than the usage frequency of "use skill A", the final loading order of sound effect resource C will be higher. Similarly, even if the resource files called by the "share battle record" function (for example, sharing interface resources) are very small, the loading priority of these resources will be very low because the frequency of use of this function is extremely low. In this way, the resources that players use more frequently can be loaded first, thereby reducing the player's waiting time and improving the gaming experience.
[0107] For example, if player A often plays "Dungeon Scene 1", then the resources required for this scene should be loaded first. Even if the resources of the "Friends Scene" are smaller, they should not be loaded first. In this way, after player A enters the game, he can quickly enter the scene he often plays without having to wait for a long time for the infrequently used resources to be loaded. At the same time, for some low-frequency functions, such as "Share Battle Records", the required resources can be loaded late to avoid taking up precious loading time, further improving the game's startup speed and operating efficiency. This resource loading optimization strategy based on player historical data can achieve personalized loading solutions for thousands of people, so that every player can get the best gaming experience. This optimization effect is particularly significant for players who only play specific game modes or use specific functions.
[0108] In some embodiments, Figure 7 As shown, the method also includes:
[0109] S201, adding a unique MD5 hash value to each resource file of the WeChat mini game;
[0110] S202, when the WeChat mini game is started, the difference files between the resource package of the server and the resource package of the client are determined by comparing the MD5 hash values, and a difference file list is formed;
[0111] S203: Determine the resource files to be updated according to the difference file list, and perform resource update on the resource files to be updated.
[0112] In this embodiment, for each resource file of the WeChat mini game, a unique hash value is generated using the MD5 algorithm, and a mapping relationship is established between the hash value and the corresponding resource file, which is stored in a preset hash value-resource file mapping table. When the WeChat mini game is started, the hash value list of the server resource package and the hash value list of the client resource package are obtained, and the difference files of the server resource package and the client resource package are determined by comparing the differences between the two lists, and a hash value list of the difference files is generated. According to the hash value list of the difference files, the corresponding difference resource files are obtained from the hash value-resource file mapping table to form a list of resource files to be updated. For each resource file in the list of resource files to be updated, the update data of the resource file is obtained from the server through a network request. After the client receives the update data of the resource file, the incremental update algorithm is used to merge the update data with the local old version resource file to obtain the new version of the resource file. The new version of the resource file is checked for integrity, its hash value is calculated by the MD5 algorithm, and compared with the hash value of the resource file provided by the server. If the two are consistent, the new version of the resource file replaces the local old version of the resource file to complete the update of the resource file. If all resource files to be updated have been updated, the hash value list of the client resource package will be updated to the latest hash value list, the WeChat mini game will complete the resource update and enter the main logic of the game.
[0113] For example, a unique MD5 hash value is added to each resource file of the WeChat mini-game, which is similar to setting a digital fingerprint for each file. The MD5 algorithm generates a unique 32-bit hexadecimal string based on the file content. For example, a background music file named "bg_music.mp3" has an MD5 hash value of "e4f9e87520e9f8c8f683328631e4a772". Another title image file named "title.png" has an MD5 hash value of "a8fe4953cbe16293d899673491fed7d9". Even if the two files differ by only one byte in size, their MD5 values will be completely different. In this way, it is possible to determine whether the file has been modified by comparing the MD5 values.
[0114] When the WeChat Mini Game is started, the difference files between the resource package of the server and the resource package of the client are determined by comparing the MD5 hash values, and a difference file list is formed. The client will send the MD5 values of all local resource files to the server. The server will compare the MD5 values of its own resource files with the MD5 values of the client.
[0115] Assume that the client version is older and lacks a new game character "character_new.png", whose MD5 value is "b7c59f02c2f4882676388c9b527b90a9". When the server finds that the client lacks this file, it will add "character_new.png" and its MD5 value to the difference file list. At the same time, if the MD5 value of the client's "bg_music.mp3" file is different from that of the server, it means that the file has been updated, and the server will also add the new "bg_music.mp3" and its MD5 value to the difference file list. In this way, the difference file list records all the files that need to be updated or downloaded.
[0116] According to the difference file list, the resource files to be updated are determined, and the resource files to be updated are updated. After the client gets the difference file list, it knows which files need to be updated. It will download the newly added or modified files from the server according to the information in the list, such as "character_new.png" and the new "bg_music.mp3". After the download is complete, the client will verify the MD5 value of the downloaded file again to ensure that the downloaded file is complete and correct. After the update is completed, the client has the latest resources and can run the game normally. This can achieve incremental updates and only download necessary resource files, thereby saving users' traffic and time. For example, a game may have tens of MB of resources. If all resources are downloaded for each update, it will be very time-consuming and waste traffic. By comparing the MD5 values, only the difference files need to be downloaded, which may be only a few MB or even smaller, which greatly improves the update efficiency and optimizes the user experience. This optimization is particularly important for users with poor network environment.
[0117] Reference Figure 8 An embodiment of the present invention provides a startup optimization system 8 for WeChat mini-games, and the system 8 specifically includes:
[0118] The first optimization module 801 is used to dynamically adjust the resource loading strategy of the WeChat Mini Game through a machine learning algorithm according to the startup performance data of the WeChat Mini Game at each stage of the startup process under different devices and different network environments;
[0119] The second optimization module 802 is used to divide each game engine component of the WeChat Mini Game into a preload component and a lazy load component according to the resource usage and historical loading time data of each game engine component, and determine the loading priority of each lazy load component according to the player behavior data;
[0120] The third optimization module 803 is used to determine the first loading order of each resource file in the startup process of the WeChat mini game according to the resource dependency relationship of each resource file of the WeChat mini game;
[0121] The fourth optimization module 804 is used to determine the second loading order of each resource file of the WeChat mini game on the corresponding player account according to the player's historical access scene data and historical function usage data in the WeChat mini game.
[0122] It is understandable that if Figure 1 The contents of the startup optimization method embodiment for WeChat mini-games shown in the embodiment are all applicable to the startup optimization system embodiment for WeChat mini-games. The functions specifically implemented by the startup optimization system embodiment for WeChat mini-games are similar to those of the embodiment shown in the embodiment. Figure 1 The startup optimization method for WeChat mini-games shown in the embodiment is the same as that shown in the embodiment, and the beneficial effects achieved are the same as those shown in the embodiment. Figure 1 The beneficial effects achieved by the embodiment of the startup optimization method for WeChat mini-games shown are also the same.
[0123] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0124] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0125] Reference Fig. 9 The embodiment of the present invention further provides a computer device 9, comprising: a memory 902 and a processor 901 and a computer program 903 stored in the memory 902. When the computer program 903 is executed on the processor 901, the startup optimization method for WeChat mini-games described in any one of the above methods is implemented.
[0126] The computer device 9 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 9 may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will appreciate that Fig. 9 It is only an example of the computer device 9 and does not constitute a limitation on the computer device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0127] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0128] In some embodiments, the memory 902 may be an internal storage unit of the computer device 9, such as a hard disk or memory of the computer device 9. In other embodiments, the memory 902 may also be an external storage device of the computer device 9, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 9. Further, the memory 902 may also include both an internal storage unit of the computer device 9 and an external storage device. The memory 902 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 902 may also be used to temporarily store data that has been output or is to be output.
[0129] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the startup optimization method for WeChat mini-games as described in any one of the above methods is implemented.
[0130] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0133] In the embodiments disclosed in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Claims
1. A startup optimization method for WeChat mini-games, characterized in that: The method specifically comprises: Based on the startup performance data of WeChat Mini Games at each stage of the startup process under different devices and network environments, the resource loading strategy of WeChat Mini Games is dynamically adjusted through machine learning algorithms; According to the resource usage and historical loading time data of each game engine component of WeChat Mini Games, each game engine component is divided into pre-loaded components and lazy-loaded components, and the loading priority of each lazy-loaded component is determined by player behavior data; According to the resource dependency relationship of each resource file of the WeChat Mini Game, determine the first loading order of each resource file in the startup process of the WeChat Mini Game; According to the historical access scene data and historical function usage data of the player in the WeChat mini game, the second loading order of each resource file of the WeChat mini game on the corresponding player account is determined.
2. The method according to claim 1, characterized in that The resource loading strategy of the WeChat Mini Game is dynamically adjusted through a machine learning algorithm according to the startup performance data of the WeChat Mini Game at each stage of the startup process under different devices and different network environments, specifically including: Collect the startup performance data of WeChat Mini Games at each stage of the startup process on different devices and in different network environments. The startup process includes the stage of downloading the first package of resources, using the WeChat webgl interface to render the first screen, initializing the engine, injecting game code, clearing the first screen, and using the game engine to render the game screen. Based on the startup performance data, a K-Means algorithm is used to perform cluster analysis to obtain cluster analysis results, wherein the cluster analysis results include performance patterns of WeChat mini games at each stage of the startup process under different devices and different network environments; Based on the cluster analysis results, the resource loading strategy for each stage of the WeChat mini game startup process is determined.
3. The method according to claim 1, characterized in that According to the resource occupancy and historical loading time data of each game engine component of the WeChat Mini Game, each game engine component is divided into a preload component and a lazy load component, specifically including: Collect resource occupancy and historical loading time data of each game engine component of the WeChat Mini Game, and determine usage pattern data of each game engine component based on the resource occupancy and historical loading time data; Determine, based on the usage pattern data, game engine components that need to be loaded during the startup of the WeChat Mini Game and game engine components that do not need to be loaded during the startup of the WeChat Mini Game; The game engine components that need to be loaded during the startup of the WeChat mini game are determined as preloaded components, and the game engine components that do not need to be loaded during the startup of the WeChat mini game are determined as lazy loaded components.
4. The method according to claim 3, characterized in that Determining the loading priority of each lazy loading component by using the player behavior data specifically includes: Collect player behavior data corresponding to different types of WeChat mini-games, and determine the calling frequency of each lazy loading component based on the player behavior data; Correlate and analyze the type data of WeChat mini games and the calling frequency of each lazy loading component to form a training data set; Taking the training data set as input, performing modeling training through a decision tree algorithm, and obtaining a component call frequency prediction model; Determine the call frequency prediction data of each lazy loading component of different types of WeChat mini games according to the component call frequency prediction model; Based on the call frequency prediction data, the loading priority of each lazy loading component of different types of WeChat mini games is determined.
5. The method according to claim 1, characterized in that Determining the first loading order of each resource file in the startup process of the WeChat Mini Game according to the resource dependency relationship of each resource file of the WeChat Mini Game specifically includes: According to the resource dependency relationship of each resource file of WeChat Mini Game, a resource dependency graph is established through dependency analysis algorithm; Based on the resource dependency graph, the Kahn topological sorting algorithm is used to generate the first loading order of each resource file during the startup process of the WeChat mini game.
6. The method according to claim 1, characterized in that The determining of the second loading order of various resource files of the WeChat Mini Game on the corresponding player account according to the player's historical access scene data and historical use function data of the WeChat Mini Game specifically includes: Obtain the player's historical access scenario data and historical usage function data in the WeChat mini-game, and determine the access frequency of each access scenario and the usage frequency of each usage function according to the historical access scenario data and the historical usage function data; Determine a first loading frequency of each resource file called by each access scenario according to the access frequency, and determine a second loading frequency of each resource file called by each usage function according to the usage frequency; According to the first loading frequency and the second loading frequency, a second loading order of each resource file of the WeChat mini game on the corresponding player account is determined.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Add a unique MD5 hash value to each resource file of the WeChat Mini Game; When the WeChat mini game is started, the difference files between the resource package of the server and the resource package of the client are determined by comparing the MD5 hash values to form a difference file list; The resource files to be updated are determined according to the difference file list, and resource update is performed on the resource files to be updated.
8. A startup optimization system for WeChat mini-games, characterized in that: The system specifically comprises: The first optimization module is used to dynamically adjust the resource loading strategy of WeChat Mini Games through machine learning algorithms based on the startup performance data of WeChat Mini Games at each stage of the startup process under different devices and different network environments; The second optimization module is used to divide each game engine component of the WeChat Mini Game into a pre-loaded component and a lazy-loaded component according to the resource usage and historical loading time data of each game engine component, and determine the loading priority of each lazy-loaded component according to the player behavior data; The third optimization module is used to determine the first loading order of each resource file in the startup process of the WeChat Mini Game according to the resource dependency relationship of each resource file of the WeChat Mini Game; The fourth optimization module is used to determine the second loading order of various resource files of the WeChat mini game on the corresponding player account based on the player's historical access scene data and historical function usage data in the WeChat mini game.
9. A computer device, characterized in that: include: A memory and a processor and a computer program stored in the memory, when the computer program is executed on the processor, implements the startup optimization method for WeChat mini-games as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the startup optimization method for WeChat mini-games as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Game resource optimization method and device based on predictive algorithm and storage medium
CN120037661A
Game resource optimization method, device and storage medium based on predictive algorithm
CN120037661B
Multi-player voice game performance optimization method and device based on dynamic resource management
CN120045337A
A method and apparatus for performance optimization of multiplayer voice games based on dynamic resource management
CN120045337B
Application program starting method and device, equipment, storage medium and program product
CN121560402A