Game resource optimization method, device and storage medium based on predictive algorithm

By compiling into bytecode files during the game voice tool development stage and preloading resources in stages, combining predictive algorithms and dynamic priority adjustments, the resource competition problem during multi-player voice communication is solved, and the game's running efficiency and user experience are improved.

CN120037661BActive Publication Date: 2025-08-22QINGFENG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510520617.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-08-22
Estimated Expiration
2045-04-24

AI Technical Summary

Technical Problem

In the prior art, when multi-player team voice communication, game clients need to handle voice data transmission, scene resource loading and game logic operation at the same time, resulting in excessive pressure on CPU resources and memory resources, resulting in problems of lag and frame rate reduction.

Method used

In the development stage of game voice tool, the source code is compiled into a bytecode file to generate an executable body, and the core resources are loaded during game startup or scene switching, non-core resources are preloaded in stages through background threads, target resource inventory is generated using predictive algorithms, resource loading priority and background thread task allocation are dynamically adjusted, and voice communication modules are set to high priority.

Benefits of technology

It improves memory resource utilization, reduces CPU usage, reduces game lag caused by resource competition, and improves the stability and fluency of game operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120037661B_ABST
    Figure CN120037661B_ABST
Patent Text Reader

Abstract

The present application provides a game resource optimization method, device and storage medium based on a predictive algorithm. The method includes: compiling the source code of the game voice tool into a bytecode file and generating an executable game voice tool body; dividing the loading process of non-core resources into multiple stages, and preloading non-core resources through at least one background thread; using a predictive algorithm to generate a list of target resources for subsequent game scenes; using a background thread to perform a loading operation on target resources that have not yet been loaded, and performing a release operation on loaded resources that the predictive algorithm determines to have a probability of use lower than a preset threshold in subsequent game scenes; setting a high execution priority for the voice communication module, and dynamically adjusting the loading priority of non-core resources and the task allocation order of background threads according to the real-time situation of voice communication. The present application can improve memory resource utilization, reduce CPU occupancy, and reduce game freezes caused by resource competition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of game resource loading, and in particular to a game resource optimization method, device and storage medium based on a predictive algorithm. Background Art

[0002] With the rapid development of online gaming technology and the increasing richness of game content, players often team up with multiple players and engage in real-time voice communication to achieve a better collaborative experience. However, when multiple players team up and enable voice communication, the game client typically needs to simultaneously handle the real-time transmission of voice data, the loading of scene resources, and the execution of game logic. These multiple tasks place significant pressure on the client's CPU and memory resources, leading to performance issues such as game lag or reduced frame rates, which seriously impact the user experience.

[0003] Existing technologies typically preload a large amount of resources at once when the game starts or when switching scenes to reduce loading delays during gameplay. However, this technical solution often lacks dynamic prediction of player behavior and game status, resulting in some preloaded resources not being actually used, causing waste of memory resources and increased CPU load. In addition, existing technologies do not adequately consider the real-time nature of multi-person voice communication during resource loading, which can easily lead to resource competition between resource loading tasks and voice communication tasks, further exacerbating the problems of high CPU usage and game lag. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a game resource optimization method, device and storage medium based on a predictive algorithm to solve the problems of memory resource waste, increased CPU load, resource competition and game lag in the prior art.

[0005] In a first aspect of an embodiment of the present application, a method for optimizing game resources based on a predictive algorithm is provided, comprising: during the development phase of a game voice tool, compiling the source code of the game voice tool into a bytecode file and generating an executable game voice tool body, which is loaded and executed when the game voice tool is subsequently started or the scene is switched; when the game is started or the scene is switched, loading the core resources required for the current scene or operation, dividing the loading process of non-core resources into multiple stages, and preloading the non-core resources through at least one background thread; obtaining the player's historical operation data and current game status data, inputting the historical operation data and current game status data into a predictive algorithm, and generating a target resource list for subsequent game scenes; based on the target resource list, using a background thread to load target resources that have not yet been loaded, and releasing loaded resources that the predictive algorithm determines have a probability of use in subsequent game scenes below a preset threshold; in a multi-person voice communication scenario, setting a high execution priority for the voice communication module, and dynamically adjusting the loading priority of non-core resources and the task allocation order of the background thread based on the real-time situation of the voice communication.

[0006] According to a second aspect of an embodiment of the present application, a game resource optimization device based on a predictive algorithm is provided, comprising: a compilation module for compiling the source code of a game voice tool into a bytecode file during the development phase of a game voice tool and generating an executable game voice tool body, which is loaded and executed when the game voice tool is subsequently started or when a scene is switched; a preloading module for loading core resources required for the current scene or operation when the game is started or when a scene is switched, and dividing the loading process of non-core resources into multiple stages, preloading the non-core resources via at least one background thread; a generation module for obtaining a player's historical operation data and current game status data, inputting the historical operation data and current game status data into a predictive algorithm, and generating a target resource list for subsequent game scenes; a loading and releasing module for loading unloaded target resources using a background thread based on the target resource list, and releasing loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be below a preset threshold; and an adjustment module for setting a high execution priority for the voice communication module in a multi-person voice communication scenario, and dynamically adjusting the loading priority of non-core resources and the task allocation order of the background thread based on the real-time status of the voice communication.

[0007] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.

[0008] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above method are implemented.

[0009] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0010] During the development phase of the game voice tool, the source code of the game voice tool is compiled into a bytecode file and an executable game voice tool body is generated, which is loaded and executed when the subsequent game voice tool is started or the scene is switched; when the game is started or the scene is switched, the core resources required for the current scene or operation are loaded, and the loading process of non-core resources is divided into multiple stages, and non-core resources are preloaded through at least one background thread; the player's historical operation data and current game status data are obtained, and the historical operation data and current game status data are input into the predictive algorithm to generate a target resource list for subsequent game scenes; according to the target resource list, the background thread is used to perform a loading operation on the target resources that have not yet been loaded, and the predictive algorithm determines that the loaded resources have a probability of use lower than a preset threshold in the subsequent game scene. Release operation is performed; in a multi-person voice communication scenario, a high execution priority is set for the voice communication module, and the loading priority of non-core resources and the task allocation order of the background thread are dynamically adjusted according to the real-time situation of the voice communication. This application can improve memory resource utilization, reduce CPU usage, and reduce game lag caused by resource competition. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. 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 any creative work.

[0012] Figure 1 1 is a flowchart of a game resource optimization method based on a predictive algorithm provided in an embodiment of the present application;

[0013] Figure 2 Schematic diagram of the structure of a game resource optimization device based on a predictive algorithm provided in an embodiment of the present application;

[0014] Figure 3 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may 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 avoid obscuring the description of the present application with unnecessary detail.

[0016] In modern large-scale online games, players often need to communicate with teammates via voice chat and collaborate on team tasks. However, voice chat often competes with the game engine's own resource loading, graphics rendering, and game logic calculations for limited computing resources (primarily CPU and memory). If a game requires loading large-scale character models, sound effects, video, special effects, and other resources while multiplayer voice chat is enabled, resource competition can cause game lag or unstable frame rates, severely impacting the player experience.

[0017] To solve this problem, resources need to be managed more scientifically and reasonably during the game, so that the voice module and resource loading can work together to minimize CPU usage and reduce lag.

[0018] Existing technologies typically preload a large amount of resources at once when the game starts or when switching scenes to reduce loading delays during gameplay. However, simple resource preloading consumes excessive memory and fails to adapt to players' dynamic behavior. In multiplayer voice scenarios, voice transmission and processing also require significant CPU resources. If the game also requires loading a large amount of resources at the same time, it can lead to excessive CPU load and performance bottlenecks.

[0019] Therefore, the main technical issue that this application focuses on is how to reduce the CPU usage of the game when the multiplayer team voice function is turned on, reduce the lag or frame rate instability caused by resource competition, and make the gaming experience smoother.

[0020] The contents of the technical solution of this application are described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] Figure 1 Schematic diagram of the process of optimizing game resources based on predictive algorithms provided by the embodiment of the present application. Figure 1 As shown, the game resource optimization method based on the predictive algorithm may specifically include:

[0022] S101, during the game voice tool development phase, compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool body, which is loaded and executed when the game voice tool is subsequently started or the scene is switched;

[0023] S102, when the game is started or the scene is switched, core resources required for the current scene or operation are loaded, and the loading process of non-core resources is divided into multiple stages, and non-core resources are preloaded through at least one background thread;

[0024] S103, obtaining the player's historical operation data and current game status data, inputting the historical operation data and current game status data into a predictive algorithm to generate a target resource list for subsequent game scenarios;

[0025] S104: Based on the target resource list, a background thread is used to load target resources that have not yet been loaded, and a release operation is performed on loaded resources that the predictive algorithm determines have a probability of being used in subsequent game scenes below a preset threshold.

[0026] S105 , in a multi-person voice communication scenario, setting a high execution priority for the voice communication module, and dynamically adjusting the loading priority of non-core resources and the task allocation order of background threads according to the real-time situation of voice communication.

[0027] In some embodiments, during the game voice tool development phase, compiling the source code of the game voice tool into a bytecode file and generating an executable game voice tool body includes:

[0028] Obtain all the source code of the game voice tool, compile it using a compiler, and generate an intermediate bytecode file that is compatible with the platform or virtual machine environment;

[0029] Associate the intermediate bytecode file with the necessary runtime library or link file to form a bytecode execution unit that supports the main functions of the game voice tool;

[0030] The bytecode execution unit is packaged or linked into an executable game voice tool body.

[0031] Specifically, in this embodiment, in view of the large amount of source code and resource files involved in the development stage of the online game voice tool, in order to effectively reduce the memory usage during the startup and operation of the game voice tool and improve the CPU execution efficiency, this application proposes a game voice tool body generation method based on bytecode compilation technology.

[0032] First, during the development phase of the game voice tool, developers use an integrated development environment (such as Visual Studio, Android Studio, or other development tools suitable for specific game platforms) to obtain all the source code involved in the game voice tool, such as various functional modules written in C++, Java, or other programming languages, including but not limited to the source code of the game voice tool's logic module, user interaction module, network communication module, and resource management module.

[0033] Next, developers compile all of the above source code using a compiler compatible with the target platform or virtual machine environment. For example, when developing a game voice tool for the Android platform, the compiler tools provided by Android Studio are used to pre-compile the source code into Java bytecode files adapted to the Android runtime environment. When the game voice tool is targeted at the PC platform, Visual Studio or similar tools are used to compile the source code into bytecode adapted to a specific virtual machine environment (such as the Lua virtual machine).

[0034] Furthermore, developers associate the compiled intermediate bytecode files with the necessary runtime libraries or linker files for the corresponding platform to ensure that the bytecode files have all the necessary functions to call the system's underlying interfaces and complete the logical processing of the game voice tool at runtime. For example, on the Java platform, the bytecode files are associated with the standard runtime library files required by the Java Virtual Machine (JVM); when using other virtual machine environments (such as the Lua virtual machine), the bytecode is associated with the specific Lua runtime library files.

[0035] After completing the aforementioned association operations, developers package or link the bytecode files and their associated runtime libraries to form the executable body of the game voice tool. Specifically, for example, on the Android platform, an APK packaging tool can be used to package the bytecode execution unit and related resource files (such as sound effects, images, and models) into an APK installation file. On the PC platform, a specific packaging tool (such as a custom resource packaging tool) can be used to link the bytecode files with the runtime environment and encapsulate them into an executable program.

[0036] Through the above-mentioned method based on bytecode compilation and packaging, during the subsequent game voice tool startup or scene switching process, the game voice tool client does not need to load all the source code at once, but only needs to load the bytecode execution unit corresponding to the specific scene or functional module, which significantly reduces memory usage and CPU resource consumption, thereby improving the overall operation efficiency of the game voice tool, especially in multi-person voice communication scenarios, and more effectively alleviates the performance bottleneck problem caused by resource competition.

[0037] Those skilled in the art should understand that the platform, compilation tools and packaging methods described in the above embodiments are only schematic descriptions. The technical solution of the present application can also be extended to other mainstream or dedicated game platforms. The specific implementation method can be adjusted by selecting appropriate compilation tools and bytecode formats according to actual conditions.

[0038] In some embodiments, the loading process of non-core resources is divided into multiple stages, and the non-core resources are preloaded through at least one background thread, including:

[0039] Determine core and non-core resources based on pre-set priorities;

[0040] Divide non-core resources into several loading stages, and add the resource list corresponding to each stage to the preloading queue according to preset conditions;

[0041] After the game is started or the scene is switched, at least one background thread is called to traverse the preloading queues of each loading stage and perform preloading operations on the corresponding resources according to the order of the loading stages;

[0042] When the background thread completes preloading of resources in the previous loading phase, it preloads resources in the next loading phase and registers the loaded resources in the available resource management list.

[0043] Specifically, within the game resource management module, game resources are clearly divided into core and non-core resources based on multiple preset priority criteria, such as frequency of use, importance, and size. Core resources typically include resources that must be loaded immediately, such as the player's initial model, basic scene resources, and core UI elements. Non-core resources include resources that are not immediately needed, such as sound effect files, additional character models, non-interactive background elements, and special props.

[0044] The resource management module then further divides the loading of non-core resources into several stages. These loading stages can be determined based on conditions preset by the game developer, such as resource type (audio, video, 3D model), resource usage probability, or the order in which game scenes occur. A specific resource list is then determined for each loading stage and added to the preloading queue for recording.

[0045] After the game client is launched or the player switches scenes, the system first quickly loads core resources to ensure the smooth operation of the basic game scenes. At the same time, the resource management module launches at least one background thread, which sequentially preloads non-core resources according to the loading phase sequence registered in the preload queue.

[0046] In some examples, the background thread first loads all resources in the first loading phase. Upon completion, it updates and registers these resource information in the system's available resource management list to ensure that subsequent game processes can call or use these resources. Subsequently, the background thread loads resources in the second, third, and even further phases in sequence. After each phase of resource loading is complete, the background thread immediately performs the corresponding update and registration operations to achieve real-time and accurate resource management.

[0047] This phased background preloading method allows large or infrequently used resources to be preloaded before the player reaches the corresponding scene or triggers the corresponding demand, effectively avoiding the lag caused by the instantaneous loading of large amounts of resources at game startup. Furthermore, this phased background thread loading mechanism reduces peak CPU and memory usage, significantly improving the overall stability and smoothness of the game.

[0048] Those skilled in the art should understand that the specific division method of the above-mentioned loading stages, the rules for generating the resource list, and the number of background threads can be flexibly adjusted according to the specific game type, platform characteristics, and player needs. The description in this embodiment is only a preferred implementation method and does not limit the scope of protection of the technical solution of this application.

[0049] In some embodiments, a player's historical operation data and current game status data are obtained, and the historical operation data and current game status data are input into a predictive algorithm to generate a target resource list for subsequent game scenarios, including:

[0050] Retrieve historical operation data recorded in the player account from the data storage module or server-side log and format it;

[0051] Monitor current game status data, including the player's current location, ongoing tasks, interactions with other players, and current scene parameters;

[0052] Input historical operation data and current game status data into predictive algorithms to calculate resource requirements related to subsequent game scenarios and form resource requirement probability or priority indicators;

[0053] Perform threshold judgment and sorting on resource demand probability or priority indicators to generate a list of target resources that may need to be loaded in subsequent game scenes.

[0054] Specifically, the client's data storage module or the game server's logging system is used to retrieve historical operation data recorded in the player's account in real time or periodically. This data includes, but is not limited to, the player's previously selected game modes, past operating habits, commonly used game props, skills, equipment, and past in-game interactions. This retrieved historical operation data is then standardized to unify the data format and facilitate subsequent algorithmic analysis.

[0055] Secondly, the game client monitors and records current game state data in real time. This includes, but is not limited to, the player's location coordinates, ongoing mission information, current scene parameters (such as terrain structure and weather effects), the locations of nearby enemies or interactive objects, team status information (such as teammate locations and team health), and real-time player interaction information (such as interactions with teammates or other players). This game state data is collected and updated in real time by the game client's status monitoring module.

[0056] The processed historical player action data and current game status data are then simultaneously input into a predictive algorithm module for comprehensive analysis. In this embodiment, the predictive algorithm can utilize a machine learning model, such as a decision tree, neural network, or deep learning network model. Based on the input data, the predictive algorithm calculates and outputs, in real time, the resources that the player may require in subsequent game scenarios, along with their probability of need or priority indicators.

[0057] Furthermore, the resource demand probability or priority indicators output by the predictive algorithm are input into the resource management module, which determines and ranks resources based on preset demand probability and priority thresholds. Specifically, when a resource's demand probability exceeds a preset probability threshold or its priority ranking falls within a preset high-priority range, the resource is added to the target resource list.

[0058] Finally, the resource management module instructs the background thread to execute the target resource loading operation in advance based on the target resource list generated above to ensure that the relevant resources can be immediately available in the player's subsequent scenes, thereby significantly improving the accuracy and real-time performance of resource loading and avoiding resource competition and lag during the game.

[0059] Those skilled in the art will appreciate that the frequency of historical data collection, the specific selection of predictive algorithms and model training methods, and the specific threshold setting methods for resource demand probability or priority indicators can all be adjusted based on the specific game type and actual application scenario. The description of this embodiment is merely a preferred example and does not limit the scope of protection of the technical solution of this application.

[0060] In some embodiments, based on the target resource list, a background thread is used to load target resources that have not yet been loaded, and a release operation is performed on loaded resources that a predictive algorithm determines have a probability of use in subsequent game scenes below a preset threshold, including:

[0061] Filter out target resources that have not been loaded from the target resource list;

[0062] Call the background thread to load the target resource that has not been loaded yet, and register the loaded resource into the available resource management list;

[0063] Monitor the usage probability of loaded resources in real time and identify resources with usage probability below a preset threshold as releasable resources;

[0064] A release operation is performed on the releasable resources to reclaim the occupied storage space, and the available status of the releasable resources is updated in the resource management module.

[0065] Specifically, after the game client completes its prediction algorithm's analysis of resource requirements, the resource management module first obtains the target resource list generated by the prediction algorithm. It then compares the target resource list with the list of loaded resources to filter out target resources that have not yet been loaded into memory.

[0066] The resource management module then calls at least one background thread to load the target resource that has not yet been loaded. During the loading process, the background thread registers the loaded resource information in the available resource management list in real time for immediate use in subsequent game scenes.

[0067] To further optimize memory usage and CPU load, the resource management module continuously monitors the usage of loaded resources in real time, including statistics on the frequency, duration, and interval between resource calls. Based on this real-time data, the resource management module calculates the probability of each resource being used in subsequent game scenarios. If the usage probability of certain loaded resources is detected to be below a pre-set probability threshold, the resource management module immediately marks these resources as releasable.

[0068] For objects marked as releasable, the resource management module proactively calls the corresponding release function or intelligent garbage collection mechanism to release these resources to reclaim memory and storage space. After the release is completed, the resource management module will also immediately update the resource status information, remove the released resources from the available resource management list, and mark them as unloaded, so that they can be re-triggered for loading later if needed.

[0069] In addition, this embodiment also optimizes the multi-threaded management strategy for resource loading for multi-person voice communication scenarios. Specifically, the resource management module assigns resource loading tasks to multiple independent background threads, while the main game thread focuses on real-time tasks such as rendering images and responding to player interactions. Furthermore, the resource management module sets different loading priorities for loading tasks based on the frequency of resource usage and game scene requirements. For example, core game resources (such as key character models) are loaded first, while non-core resources (such as minor sound effects, background elements, and lesser-used props) are loaded secondarily. This priority setting can significantly reduce the CPU competition caused by resource loading in multi-person voice communication scenarios, effectively alleviating the problem of game lag.

[0070] Those skilled in the art will understand that the above-mentioned technical details such as monitoring frequency, loading priority division method, number of background threads and specific loading release mechanism can be flexibly adjusted according to the specific needs and implementation environment of the game. This embodiment is only a preferred implementation method of this application and does not constitute a limitation on the scope of protection of this application.

[0071] In some embodiments, dynamically adjusting the loading priority of non-core resources and the task allocation order of background threads based on the real-time situation of voice communication includes:

[0072] Monitor the real-time operating indicators of the voice communication module in multi-person team scenarios, including voice data transmission rate, CPU usage, and thread occupancy;

[0073] When the real-time operating indicators are monitored to exceed the preset threshold, the loading priority of non-core resources is lowered, and the background threads responsible for resource loading are reallocated or some loading tasks are suspended;

[0074] After the real-time running indicators are restored to no more than the preset threshold, the loading priority of non-core resources is dynamically increased, and the loading tasks of the background threads are resumed or restarted.

[0075] Specifically, this embodiment provides a method for dynamically adjusting resource loading priority and background thread task allocation according to the real-time situation of voice communication in a multi-person voice communication scenario, so as to ensure the coordinated optimization between voice communication and resource loading and reduce CPU resource competition.

[0076] In some examples, the game client is equipped with a real-time operating indicator monitoring module, which monitors key operating indicators of the voice module during multiplayer team voice communication, including but not limited to voice data transmission rate, CPU usage, and thread usage. For example, in a team competition game, when players turned on the voice team mode for real-time communication, the real-time operating indicator monitoring module found that the voice data transmission rate quickly increased to over 200KB per second, the CPU usage reached over 80%, and the background resource loading thread occupied a large number of CPU cycles.

[0077] When the real-time operation indicator monitoring module detects that any of the above-mentioned operation indicators exceeds the preset threshold (for example, the voice data transmission rate exceeds 150KB per second, and the CPU usage exceeds 75%), it indicates that the current voice communication task has significantly increased its demand for system resources. At this time, the resource management module will respond immediately and actively reduce the loading priority of non-core resources. For example, non-core resources being loaded in the background, such as scene background music, auxiliary character models, and secondary special effects files, will have their loading speed reduced or temporarily suspended. At the same time, the thread management unit will suspend or reallocate the background threads responsible for loading these resources to free up more CPU resources for priority use by the voice communication module, thereby ensuring that the quality of voice communication is not significantly affected.

[0078] After voice communication continues for a period of time, when the real-time performance indicator monitoring module detects that the voice data transmission rate has dropped below 100KB per second and CPU usage has returned to approximately 60%, the resource pressure on the voice communication module has been significantly alleviated. At this point, the resource management module dynamically adjusts its strategy to prioritize non-core resource loading, such as resuming the loading speed of background music and minor special effects files in the background thread. The thread management unit also restarts or resumes previously paused background thread tasks to ensure that these resources are loaded smoothly before the player enters the relevant game scene.

[0079] Through this dynamic adjustment mechanism, in actual game scenarios, such as team competition modes or dungeon exploration missions, the clarity and fluency of real-time voice communication between players can always be guaranteed. At the same time, background threads are efficiently utilized to complete the loading of non-core resources, avoiding game freezes or delays caused by resource competition.

[0080] Those skilled in the art will appreciate that the types of real-time operating indicators, specific threshold settings, and resource adjustment methods in the embodiments can be flexibly adjusted based on the specific game type, number of players, and communication quality requirements. The above description is merely an exemplary implementation and does not limit the scope of protection of the technical solution of this application.

[0081] In some embodiments, the method further comprises:

[0082] Collect player behavior data in real time on the server side and format the collected player behavior data;

[0083] Based on the collected player behavior data, predictive algorithms are used to generate predictions for the player's subsequent gaming scenarios.

[0084] According to a preset data transmission protocol, the prediction information is sent to the client, so that the client can adjust or update the resource loading strategy according to the prediction information and perform corresponding resource loading or releasing operations.

[0085] Specifically, the game server is equipped with a real-time data collection module, which continuously collects the behavioral data of all players in real time. Taking multiplayer online tactical competitive games as an example, the data collected in real time by the server includes the player's movement trajectory (such as the coordinates of the area where the player frequently enters and exits), real-time chat records (such as the mission objectives or location information mentioned in the player team communication), and the player's specific operation frequency in the game (such as the frequency of the player using specific equipment or skills). For example, a player has frequently chosen to use sniper weapons in recent games and has entered specific positions (such as high sniper points) many times in the game. The server will record and format this data for analysis.

[0086] Next, the server-side prediction algorithm module feeds this real-time collected and formatted player behavior data into a pre-set prediction algorithm for comprehensive analysis and calculation. In practical applications, the server can employ prediction algorithms based on machine learning or deep learning (such as long short-term memory (LSTM) networks or decision tree models) to predict in real time the player's likely behavior and corresponding resource requirements in the next game scenario. For example, if a player is about to enter a similar sniper position within the next few minutes, it may be necessary to load high-precision image resources for the relevant area, along with corresponding weapon and equipment models and environmental special effects resources.

[0087] After the prediction information is generated, the server transmits it to the game client in real time via a pre-defined, efficient data transmission protocol (such as UDP or a customized packet transmission protocol). For example, when the server determines that a player is about to enter a specific sniping area, it sends the relevant predicted resource demand information to the player's client with extremely low latency.

[0088] After receiving the prediction information from the server, the client immediately passes it to the resource management module for processing. Based on this prediction information, the resource management module proactively adjusts or updates the current resource loading strategy. For example, it preemptively calls a background thread to load resources predicted to be needed by the player (such as high-precision sniper models, long-range scene effects, and related sound effects). Furthermore, based on the usage probability indicated in the prediction information, the client releases resources with a very low likelihood of future use, further optimizing client memory usage.

[0089] Through real-time behavioral data collection on the server side, real-time calculation of predictive information, and intelligent loading strategy response on the client side, this embodiment can effectively avoid resource loading delays when players enter new scenes or perform special operations, greatly reducing the lag or frame rate fluctuations that may occur during the game, and improving the overall gaming experience.

[0090] Those skilled in the art will appreciate that the server prediction algorithm type, data transmission protocol, and resource loading and release strategy in the embodiments can be flexibly adjusted based on the actual game type and performance requirements. This embodiment is intended only as a preferred exemplary solution and does not constitute any limitation on the scope of protection of the technical solution of this application.

[0091] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0092] Figure 2 Schematic diagram of the structure of the game resource optimization device based on the predictive algorithm provided by the embodiment of the present application. Figure 2 As shown, the game resource optimization device based on the predictive algorithm includes:

[0093] Compilation module 201, used to compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool body during the game voice tool development phase, so as to be loaded and executed when the game voice tool is subsequently started or the scene is switched;

[0094] A preloading module 202 is configured to load core resources required for the current scene or operation when the game is started or the scene is switched, and to divide the loading process of non-core resources into multiple stages, and to preload non-core resources through at least one background thread;

[0095] A generation module 203 is used to obtain the player's historical operation data and current game status data, input the historical operation data and current game status data into a predictive algorithm, and generate a target resource list for subsequent game scenes;

[0096] The loading and releasing module 204 is configured to load unloaded target resources using a background thread based on the target resource list, and to release loaded resources whose probability of use in subsequent game scenarios is determined by the predictive algorithm to be lower than a preset threshold.

[0097] The adjustment module 205 is used to set a high execution priority for the voice communication module in a multi-person voice communication scenario, and dynamically adjust the loading priority of non-core resources and the task allocation order of background threads according to the real-time situation of voice communication.

[0098] In some embodiments, Figure 2 The compilation module 201 obtains all the source codes of the game voice tool, compiles all the source codes using a compiler, and generates an intermediate bytecode file that is compatible with the platform or virtual machine environment; associates the intermediate bytecode file with the necessary runtime library or link file to form a bytecode execution unit that supports the main functions of the game voice tool; and packages or links the bytecode execution unit into an executable game voice tool body.

[0099] In some embodiments, Figure 2 The preloading module 202 determines the core resources and non-core resources according to the preset priority; divides the non-core resources into several loading stages, and adds the resource list corresponding to each stage to the preloading queue according to the preset conditions; after the game is started or the scene is switched, calls at least one background thread to traverse the preloading queues of each loading stage, and performs preloading operations on the corresponding resources according to the sequence of the loading stages; when the background thread completes the preloading of the resources of the previous loading stage, it preloads the resources of the next loading stage, and registers the loaded resources to the available resource management list.

[0100] In some embodiments, Figure 2 The generation module 203 retrieves the historical operation data recorded in the player account from the data storage module or the server-side log and formats it; monitors the current game status data, which includes the player's current position, information about the task being executed, interaction information with other players, and current scene parameters; inputs the historical operation data and the current game status data into the predictive algorithm, calculates the resource requirements related to subsequent game scenes, and forms a resource requirement probability or priority index; performs threshold judgment and sorting on the resource requirement probability or priority index, and generates a list of target resources that may need to be loaded in subsequent game scenes.

[0101] In some embodiments, Figure 2The loading and releasing module 204 filters out target resources that have not been loaded from the target resource list; calls the background thread to perform a loading operation on the target resources that have not been loaded, and registers the loaded resources into the available resource management list; monitors the usage probability of the loaded resources in real time, and identifies resources with a usage probability lower than a preset threshold as releasable resources; performs a release operation on the releasable resources to reclaim the occupied storage space, and updates the available status of the releasable resources in the resource management module.

[0102] In some embodiments, Figure 2 The adjustment module 205 monitors the real-time operating indicators of the voice communication module in a multi-person team scenario, and the real-time operating indicators include the voice data sending rate, CPU usage and thread occupancy; when it is monitored that the real-time operating indicators exceed the preset threshold, the loading priority of non-core resources is lowered, and the background thread responsible for resource loading is reallocated or some loading tasks are suspended; after the real-time operating indicators are restored to no more than the preset threshold, the loading priority of non-core resources is dynamically increased, and the loading tasks of the background threads are restored or restarted.

[0103] In some embodiments, Figure 2 The adjustment module 205 collects player behavior data in real time on the server side and formats the collected player behavior data; based on the collected player behavior data, calls a predictive algorithm to generate prediction information for the player's subsequent game scenes; according to a preset data transmission protocol, sends the prediction information to the client, so that the client can adjust or update the resource loading strategy according to the prediction information and perform corresponding resource loading or release operations.

[0104] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0105] Figure 3 Schematic diagram of the structure of the electronic device 3 provided in the embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, the steps of the above-mentioned method embodiments are implemented. Alternatively, when the processor 301 executes the computer program 303, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0106] For example, computer program 303 may be divided into one or more modules / units, which are stored in memory 302 and executed by processor 301 to implement the present application. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of computer program 303 in electronic device 3.

[0107] The electronic device 3 may be a desktop computer, a notebook, a PDA, a cloud server or other electronic device. The electronic device 3 may include but is not limited to a processor 301 and a memory 302. Those skilled in the art will understand that Figure 3 It is only an example of electronic device 3 and does not constitute a limitation of electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0108] The processor 301 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. The general-purpose processor may be a microprocessor or any conventional processor.

[0109] Memory 302 can be an internal storage unit of electronic device 3, such as a hard drive or memory of electronic device 3. Memory 302 can also be an external storage device of electronic device 3, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, memory 302 can include both an internal storage unit of electronic device 3 and an external storage device. Memory 302 is used to store computer programs and other programs and data required by the electronic device. Memory 302 can also be used to temporarily store data that has been output or is about to be output.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device 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 into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into 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, and will not be repeated here.

[0111] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0112] Those skilled 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 beyond the scope of this application.

[0113] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which may be electrical, mechanical or other forms.

[0114] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0115] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0116] If the integrated module / 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 can implement all or part of the processes in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program may include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium.

[0117] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the technical solutions of the present application are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A game resource optimization method based on a predictive algorithm, characterized in that: include: During the game voice tool development phase, the source code of the game voice tool is compiled into a bytecode file and an executable game voice tool body is generated, which is loaded and executed when the game voice tool is subsequently started or the scene is switched; When the game starts or the scene switches, the core resources required for the current scene or operation are loaded, and the loading process of non-core resources is divided into multiple stages, and the non-core resources are preloaded through at least one background thread; Obtaining the player's historical operation data and current game status data, and inputting the historical operation data and current game status data into a predictive algorithm to generate a list of target resources for subsequent game scenarios; Based on the target resource list, using the background thread, load target resources that have not yet been loaded, and release loaded resources that the predictive algorithm determines have a probability of being used in subsequent game scenes below a preset threshold. In a multi-person voice communication scenario, a high execution priority is set for the voice communication module, and the loading priority of non-core resources and the task allocation order of the background thread are dynamically adjusted according to the real-time situation of the voice communication.

2. The method according to claim 1, characterized in that During the game voice tool development phase, the source code of the game voice tool is compiled into a bytecode file and an executable game voice tool body is generated, including: Obtain all source codes of the game voice tool, compile all source codes using a compiler, and generate an intermediate bytecode file that is compatible with the platform or virtual machine environment; Associating the intermediate bytecode file with the necessary runtime library or link file to form a bytecode execution unit that supports the main functions of the game voice tool; The bytecode execution unit is packaged or linked into an executable game voice tool body.

3. The method according to claim 1, characterized in that The process of loading non-core resources is divided into multiple stages, and the non-core resources are preloaded through at least one background thread, including: Determine core and non-core resources based on pre-set priorities; Divide the non-core resources into several loading stages, and add the resource list corresponding to each stage to the preloading queue according to preset conditions; After the game is started or the scene is switched, at least one background thread is called to traverse the preloading queues of each loading stage and perform preloading operations on the corresponding resources according to the order of the loading stages; When the background thread completes preloading of resources in the previous loading phase, it preloads resources in the next loading phase and registers the loaded resources in the available resource management list.

4. The method according to claim 1, wherein The method of obtaining the player's historical operation data and current game status data, inputting the historical operation data and current game status data into a predictive algorithm, and generating a target resource list for subsequent game scenarios includes: Retrieve historical operation data recorded in the player account from the data storage module or server-side log and format it; Monitoring current game status data, including the player's current location, ongoing task information, interaction information with other players, and current scene parameters; Inputting the historical operation data and current game state data into a predictive algorithm to calculate resource requirements related to subsequent game scenarios and form a resource requirement probability or priority index; Threshold judgment and sorting processing are performed on the resource demand probability or priority index to generate a list of target resources that may need to be loaded in subsequent game scenes.

5. The method according to claim 1, wherein The method of using the background thread to load target resources that have not yet been loaded based on the target resource list and releasing loaded resources that a predictive algorithm determines have a probability of use in subsequent game scenes lower than a preset threshold includes: Filtering target resources that have not been loaded from the target resource list; Calling the background thread to perform a loading operation on the target resource that has not been loaded, and registering the loaded resource into the available resource management list; Monitor the usage probability of loaded resources in real time and identify resources with usage probability below a preset threshold as releasable resources; A release operation is performed on the releasable resource to reclaim the occupied storage space, and an available state of the releasable resource is updated in a resource management module.

6. The method according to claim 1, characterized in that The dynamically adjusting the loading priority of non-core resources and the task allocation order of the background threads according to the real-time situation of the voice communication includes: Monitor the real-time performance indicators of the voice communication module in a multi-person team scenario, including voice data transmission rate, CPU usage, and thread occupancy; When it is detected that the real-time operation indicator exceeds a preset threshold, the loading priority of non-core resources is lowered, and the background thread responsible for resource loading is reallocated or some loading tasks are suspended; After the real-time operation indicator is restored to a value not exceeding a preset threshold, the loading priority of the non-core resources is dynamically increased, and the loading task of the background thread is restored or restarted.

7. The method according to claim 1, characterized in that The method further comprises: Collecting player behavior data in real time on the server side and formatting the collected player behavior data; Based on the collected player behavior data, a predictive algorithm is invoked to generate prediction information for the player's subsequent game scenarios; The prediction information is sent to the client according to a preset data transmission protocol, so that the client adjusts or updates the resource loading strategy according to the prediction information and performs corresponding resource loading or releasing operations.

8. A game resource optimization device based on a predictive algorithm, characterized in that: include: A compilation module is used to compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool body during the game voice tool development phase, so as to be loaded and executed when the game voice tool is subsequently started or the scene is switched; A preloading module, configured to load core resources required for the current scene or operation when the game is started or the scene is switched, and to divide the loading process of non-core resources into multiple stages, and to preload the non-core resources through at least one background thread; A generation module, configured to obtain the player's historical operation data and current game status data, input the historical operation data and current game status data into a predictive algorithm, and generate a target resource list for subsequent game scenarios; a loading and releasing module, configured to utilize the background thread to load target resources that have not yet been loaded based on the target resource list, and to release loaded resources that a predictive algorithm determines have a probability of use in subsequent game scenarios below a preset threshold; The adjustment module is used to set a high execution priority for the voice communication module in a multi-person voice communication scenario, and dynamically adjust the loading priority of non-core resources and the task allocation order of the background thread according to the real-time situation of the voice communication.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • A startup optimization method, system, device and medium for WeChat mini-games

    CN119759443A

  • Predictive data preloading

    US20200391118A1