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

By compiling and generating executable bytecode files during the game voice tool development stage, and using a resource optimization method based on predictive algorithms, the high CPU usage and resource competition problems when the multi-player team voice function is turned on, achieving a smoother gaming experience.

CN120037661AActive Publication Date: 2025-05-27QINGFENG (BEIJING) TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

When the voice function of multi-player teaming is turned on, the game CPU occupies high and the resource competition is serious, resulting in game lag and unstable frame rate, affecting the user experience.

Method used

The game resource optimization method based on predictive algorithms is adopted. By compiling and generating executable bytecode files during the game voice tool development stage, loading core resources and pre-loading non-core resources in stages, dynamically adjusting resource loading priorities and background thread task allocation to ensure that the voice communication module has high execution priority.

Benefits of technology

It improves memory resource utilization, reduces CPU usage, reduces game lag caused by resource competition, and improves the smoothness of the game experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120037661A_ABST
    Figure CN120037661A_ABST
Patent Text Reader

Abstract

The invention provides a game resource optimization method and device based on a predictive algorithm and a storage medium. The method comprises the following steps: compiling a source code of a game voice tool into a bytecode file and generating an executable game voice tool main body; dividing the loading process of the non-core resources into a plurality of stages, and pre-loading the non-core resources through at least one background thread; generating a target resource list for a subsequent game scene by using a predictive algorithm; executing a loading operation on the target resource which is not loaded by utilizing a background thread, and executing a releasing operation on the loaded resource which is judged to be lower than a preset threshold value in the subsequent game scene by the predictive algorithm, wherein the use probability of the loaded resource is lower than the preset threshold value; a high execution priority is set for a voice communication module, and the loading priority of non-core resources and the task allocation order of background threads are dynamically adjusted according to the real-time condition of voice communication. According to the method and the device, memory resource utilization can be improved, CPU (Central Processing Unit) occupation is reduced, and game jamming caused by resource competition is reduced.
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 game technology, game content is becoming increasingly rich. Players often form teams and conduct real-time voice communication during the game to obtain a better collaborative experience. However, when multiple players form teams and start voice communication, the game client usually needs to handle the real-time transmission of voice data, the loading of scene resources, and the operation of game logic at the same time. The above multiple tasks put a lot of pressure on the client's CPU resources and memory resources, resulting in performance issues such as freezes or reduced frame rates during game operation, which seriously affects the user experience.

[0003] The existing technology usually adopts the method of preloading a large amount of resources at one time when the game starts or the scene switches to reduce the loading delay during the game. 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, the existing technology does not give enough consideration to the real-time nature of multi-person voice communication during the resource loading process, which easily leads 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 the first aspect of the embodiments of the present application, a game resource optimization method based on a predictive algorithm is provided, including: during the game voice tool development stage, compiling the source code of the game voice tool into a bytecode file and generating an executable game voice tool main body, which is used to be loaded and executed when the game voice tool is started or the scene is switched subsequently; when the game is started or the scene is switched, loading the core resources required for the current scene or operation, and 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 historical operation data and current game state data of the player, inputting the historical operation data and current game state data into the predictive algorithm, and generating a target resource list for the subsequent game scene; according to the target resource list, using the background thread to perform a loading operation on the target resources that have not been loaded, and performing a release operation on the loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be lower than a preset threshold; in a multi-person voice communication scene, 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 according to the real-time situation of the voice communication.

[0006] In the second aspect of the embodiments of the present application, a game resource optimization device based on a predictive algorithm is provided, including: a compilation module, which is used to compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool main body during the game voice tool development stage, which is used to be loaded and executed when the game voice tool is started or the scene is switched subsequently; a preloading module, which is used to load the core resources required for the current scene or operation when the game is started or the scene is switched, and divide the loading process of non-core resources into multiple stages, and preload the non-core resources through at least one background thread; a generation module, which is used to obtain the historical operation data and current game state data of the player, input the historical operation data and current game state data into the predictive algorithm, and generate a target resource list for the subsequent game scene; a loading and release module, which is used to perform a loading operation on the target resources that have not been loaded according to the target resource list by using the background thread, and perform a release operation on the loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be lower than a preset threshold; an adjustment module, which is used to set a high execution priority for the voice communication module in a multi-person voice communication scene, 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.

[0007] In the third aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.

[0008] In the fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] The above at least one technical solution adopted in the embodiments of the present application can achieve the following beneficial effects: During the development stage 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 main body is generated, which is used to be loaded and executed when the game voice tool is started or the scene is switched later; 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 at least one background thread is used to preload the non-core resources; the historical operation data and the current game state data of the player are obtained, and the historical operation data and the current game state data are input into a predictive algorithm to generate a target resource list for the subsequent game scene; according to the target resource list, the background thread is used to perform a loading operation on the target resources that have not been loaded, and a release operation is performed on the loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be lower than a preset threshold; in a multi-person voice communication scene, 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 background threads are dynamically adjusted according to the real-time situation of voice communication. The present application can improve the utilization of memory resources, reduce the CPU occupancy, and reduce game stuttering caused by resource competition. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.

[0011] Figure 1 is a schematic flowchart of a game resource optimization method based on a predictive algorithm provided by an embodiment of the present application; Figure 2 is a schematic structural diagram of a game resource optimization device based on a predictive algorithm provided by an embodiment of the present application; Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0012] 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.

[0013] In modern large-scale online games, players often need to communicate with teammates through voice chat and collaborate to complete team tasks. However, the voice chat function often competes with the game engine's own resource loading, graphics rendering, and game logic calculations for limited computing resources (mainly CPU and memory). If the game needs to load large-scale character models, sound effects, videos, special effects and other resources while multiplayer team voice is turned on, it will cause resource competition, resulting in problems such as game freezes or unstable frame rates, which seriously affects the player experience.

[0014] In order to solve this problem, it is necessary to manage resources more scientifically and reasonably during the game running process, so that the voice module and resource loading can work together to reduce CPU usage and reduce lag as much as possible.

[0015] Existing technologies usually preload a large amount of resources at once when the game is started or the scene is switched to reduce loading delays during the game. However, simple resource preloading will take up too much memory and cannot load according to the dynamic behavior of players; in multi-person voice scenarios, voice transmission and processing also require a lot of CPU resources. If the game needs to load a large amount of resources at the same time, it may cause excessive CPU load, resulting in performance bottlenecks.

[0016] 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.

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

[0018] Figure 1 is a flowchart of a game resource optimization method based on a predictive algorithm provided in an embodiment of the present application. Figure 1 As shown, the game resource optimization method based on the predictive algorithm may specifically include: S101, in the game voice tool development stage, compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool body, which is used to be loaded and executed when the game voice tool is started or the scene is switched; S102. When the game starts or the scene is switched, load the core resources required for the current scene or operation, and divide the loading process of non-core resources into multiple stages, and preload the non-core resources through at least one background thread; S103. Obtain the player's historical operation data and current game state data, input the historical operation data and current game state data into the predictive algorithm, and generate a target resource list for the subsequent game scene; S104. According to the target resource list, use the background thread to perform a loading operation on the target resources that have not been loaded, and perform a release operation on the loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be lower than the preset threshold; S105. In the multi-person voice communication scenario, set a high execution priority for the voice communication module, 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.

[0019] In some embodiments, during the game voice tool development stage, compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool main body, including: Obtain all the source code of the game voice tool, use a compiler to compile all the source code, and generate an intermediate bytecode file adapted to the platform or virtual machine environment; Associate the intermediate bytecode file with the necessary runtime libraries or link files to form a bytecode execution unit that supports the main functions of the game voice tool; Package or link the bytecode execution unit into an executable game voice tool main body.

[0020] Specifically, in this embodiment, for 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 occupancy during the startup and operation of the game voice tool and improve the CPU execution efficiency, the present application proposes a method for generating a game voice tool main body based on bytecode compilation technology.

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

[0022] Next, the developer uses a compiler compatible with the target platform or virtual machine environment to compile all the above source code. For example, when the game voice tool is developed for the Android platform, the compilation tool provided by Android Studio is used to pre-compile the source code into a Java bytecode file adapted to the Android running environment; when the game voice tool is targeted at the PC platform, Visual Studio or a similar tool is used to compile the source code into bytecode adapted to a specific virtual machine environment (such as the Lua virtual machine).

[0023] Further, the developer associates the compiled intermediate bytecode file with the necessary runtime libraries or link files for the corresponding platform to ensure that the bytecode file has all the functions necessary to call the system's underlying interfaces and complete the logic processing of the game voice tool during runtime. For example, in the Java platform, the bytecode file is 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 specific Lua runtime library files.

[0024] After completing the above association operation, the developer packages or links the above bytecode file and its associated runtime libraries to form the main body of the executable game voice tool. Specifically, for example, on the Android platform, the APK packaging tool can be used to package the bytecode execution unit and related resource files (such as sound effects, images, 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 and encapsulate the bytecode file with the runtime environment into an executable program.

[0025] Through the above method based on bytecode compilation and packaging, during the subsequent startup or scene switching of the game voice tool, 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 a specific scene or function module, significantly reducing memory occupancy and CPU resource consumption, thereby improving the overall operation efficiency of the game voice tool. Especially in the scenario of multi-person voice communication, it more effectively alleviates the performance bottleneck problem caused by resource competition.

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

[0027] In some embodiments, the loading process of non-core resources is divided into multiple stages, and at least one background thread is used to pre-load the non-core resources, including: Determine core resources and non-core resources according to preset priorities; Divide several loading stages for non-core resources, and add the resource list corresponding to each stage to the preloading queue according to preset conditions; After the game starts or the scene is switched, call at least one background thread to traverse the preloading queue of each loading stage, and perform preloading operations on the corresponding resources according to the order of the loading stages; When the background thread finishes preloading the resources of the previous loading stage, preload the resources of the next loading stage, and register the resources that have been loaded to the available resource management list.

[0028] Specifically, first, in the game resource management module, according to multiple preset priority conditions such as resource usage frequency, resource importance, and resource size, the game resources are clearly divided into core resources and non-core resources. Specifically, core resources usually 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 sound files, additional character models, background elements for non-instant interaction, and special items, etc., which are not immediately needed.

[0029] Then, the resource management module further divides several loading stages for non-core resources. These loading stages can be determined based on conditions preset by game developers, such as being divided according to resource types (audio, video, 3D models), the usage probability of resources, or the order of game scenes, etc., and determine the specific resource list for each loading stage, and add it to the preloading queue for recording.

[0030] After the game client starts or the player switches scenes, the system first quickly loads the core resources to ensure the smooth operation of the basic game scene. At the same time, the resource management module starts at least one background thread, and this thread sequentially performs preloading operations on non-core resources according to the order of the loading stages registered in the preloading queue.

[0031] In some examples, the background thread first loads all the resources in the first loading stage. After completion, it updates and registers the information of these resources to the system's available resource management list to ensure that subsequent game processes can call or use these resources; then, the background thread loads the resources of the second stage, the third stage, and even more stages in order. After the resources of each stage are loaded, the background thread will immediately perform corresponding update and registration operations to achieve the real-time and accuracy of resource management.

[0032] Through the above-mentioned phased background preloading method, large or infrequently used resources can be preloaded before the player reaches the corresponding scene or triggers the corresponding demand, thus effectively avoiding the lag problem caused by instantaneously loading a large number of resources at game startup. In addition, this phased background thread loading mechanism can also reduce the peak usage of the CPU and memory, significantly improving the overall stability and smoothness of game operation.

[0033] Those skilled in the art should understand that the specific division method of the above loading stage, the generation rule of 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 manner and does not limit the protection scope of the technical solution of this application.

[0034] In some embodiments, historical operation data and current game state data of the player are obtained, and the historical operation data and current game state data are input into a predictive algorithm to generate a target resource list for subsequent game scenes, including: Retrieve the historical operation data recorded under the player's account from the data storage module or server-side log and perform formatting processing; Monitor the current game state data, which includes the player's current location, the task information being executed, the interaction information with other players, and the current scene parameters; Input the historical operation data and current game state data into the predictive algorithm, calculate the resource requirements related to subsequent game scenes, and form a resource requirement probability or priority index; Perform threshold judgment and sorting processing on the resource requirement probability or priority index to generate a target resource list that may need to be loaded in subsequent game scenes.

[0035] Specifically, first, through the data storage module of the client or the game server-side log system, the historical operation data recorded under the player's account is retrieved in real-time or periodically. These data include, but are not limited to, the game modes selected by the player in the past, previous operation habits, commonly used game props, skills, equipment, and interaction behaviors in previous games. Subsequently, the retrieved historical operation data is processed in a standardized format to unify the data format and facilitate subsequent algorithm analysis.

[0036] Secondly, the game client monitors and records the current game state data in real time. The current game state data includes, but is not limited to, the position coordinates of the player, the ongoing task information, the current scene parameters (such as terrain structure, weather effects), the positions of nearby enemies or interactive objects, the team state information (such as the positions of teammates, the team's health status), and the real-time player interaction information (such as the interaction with teammates or other players). The above game state data is collected and updated in real time through the state monitoring module of the game client.

[0037] Then, the processed player historical operation data and the current game state data are simultaneously input into the predictive algorithm module for comprehensive analysis. In this embodiment, the predictive algorithm can select a machine learning model, such as a predictive model based on decision trees, neural networks, or deep learning network models, etc., for modeling. The predictive algorithm calculates and outputs in real time the resources that the player may need in the subsequent game scenario and their demand probabilities or priority metrics based on the input data.

[0038] Furthermore, the resource demand probability or priority metric output by the predictive algorithm will be input into the resource management module, and this module will perform determination and sorting processing according to the preset demand probability threshold and priority threshold. Specifically, when the demand probability of a certain resource exceeds the set probability threshold or the resource priority ranking is within the preset high-priority range, this resource is included in the target resource list.

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

[0040] Those skilled in the art should understand that the collection frequency of the above historical data, the specific selection of the predictive algorithm and the model training method, and the specific threshold setting method of the resource demand probability or priority metric can all be adjusted according to the specific game type and actual application scenario. The description of this embodiment is only a preferred example and does not limit the protection scope of the technical solution of this application.

[0041] In some embodiments, according to the target resource list, the background thread is used to perform the loading operation on the unloaded target resources and perform the release operation on the loaded resources whose usage probability in the subsequent game scenario is determined by the predictive algorithm to be lower than the preset threshold, including: Screen out the unloaded target resources from the target resource list; Call the background thread to perform the loading operation on the unloaded target resources and register the loaded resources in the available resource management list; Monitor the usage probability of loaded resources in real time, and identify resources with usage probability lower than a preset threshold as releasable resources; A release operation is performed on the releasable resources to reclaim the occupied storage space, and the available state of the releasable resources is updated in the resource management module.

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

[0043] The resource management module then calls at least one background thread to perform a loading operation on the target resource that has not been loaded. During the loading operation, the background thread registers the loaded resource information in the available resource management list in real time for immediate calling by subsequent game scenes.

[0044] At the same time, in order 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 of resource calls. Based on the real-time data obtained from monitoring, the resource management module calculates the probability of use of each resource in subsequent game scenes. When it is detected that the usage probability of some loaded resources is lower than the pre-set probability threshold, the resource management module immediately marks these resources as releasable resources.

[0045] For objects marked as releasable resources, the resource management module actively 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 update the resource status information immediately, remove the released resources from the available resource management list, and mark them as unloaded, so that they can be re-triggered for loading if necessary.

[0046] In addition, the multi-threaded management strategy for resource loading is optimized for multi-person voice communication scenarios in this embodiment. Specifically, the resource management module assigns resource loading tasks to multiple independent background threads, and the main thread of the game 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 use and game scene requirements, such as prioritizing the loading of core game resources (such as key character models) and secondary loading of non-core resources (such as secondary sound effects, background elements, and lesser-used props). This priority setting can significantly reduce the CPU competition caused by resource loading in multi-person voice communication scenarios, and effectively alleviate the problem of game freezes.

[0047] Those skilled in the art can understand that technical details such as the above monitoring frequency, loading priority division method, number of background threads, and specific loading and releasing mechanisms can be flexibly adjusted according to the specific requirements and implementation environment of the game. This embodiment is only a preferred implementation manner of the present application and does not constitute a limitation on the protection scope of the present application.

[0048] In some embodiments, the loading priority of non-core resources and the task allocation order of background threads are dynamically adjusted according to the real-time situation of voice communication, including: Monitoring the real-time operation metrics of the voice communication module in a multi-player teaming scenario, where the real-time operation metrics include voice data transmission rate, CPU usage rate, and thread occupancy; When it is detected that the real-time operation metrics exceed the preset threshold, lower the loading priority of non-core resources, and reallocate or suspend some loading tasks for the background threads responsible for resource loading; After the real-time operation metrics return to not exceeding the preset threshold, dynamically increase the loading priority of non-core resources, and resume or restart the loading tasks of the background threads.

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

[0050] In some examples, the game client is provided with a real-time operation metrics monitoring module, which monitors the key operation metrics of the voice module during multi-player teaming voice communication in real time, including but not limited to voice data transmission rate, CPU occupancy rate, and thread occupancy. For example, in a certain team competitive game, when players turn on the voice teaming mode for real-time communication, the real-time operation metrics monitoring module finds that the voice data transmission rate quickly rises to more than 200 KB per second, the CPU occupancy rate reaches more than 80%, and the background resource loading threads occupy a large number of CPU cycles.

[0051] When the real-time operation metrics monitoring module detects that any of the above operation metrics exceeds the preset threshold (for example, the voice data transmission rate exceeds 150 KB per second, the CPU occupancy exceeds 75%), it indicates that the current voice communication task has a significantly increased demand for system resources. At this time, the resource management module will immediately respond and actively lower 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 effect files, will have their loading speed reduced or loading postponed. At the same time, the thread management unit will pause or reallocate the background threads responsible for loading these resources to release more CPU resources for the voice communication module to use first, so as to ensure that the voice communication quality is not significantly affected.

[0052] After the voice communication process continues for a period of time, when the real-time operation indicator monitoring module detects that the voice data transmission rate drops below 100KB per second and the CPU usage recovers to about 60%, it means that the pressure on the voice communication module's demand for resources has been significantly alleviated. At this time, the resource management module will dynamically adjust the strategy and increase the priority of non-core resource loading again, such as restoring the background thread's loading speed for scene background music and secondary special effects files. The thread management unit will also restart or resume the previously suspended background thread tasks to ensure that these resources are successfully loaded before the player is about to enter the relevant game scene.

[0053] Through the above-mentioned dynamic adjustment mechanism, in actual game scenarios, such as team competition mode or dungeon exploration missions, the clarity and fluency of real-time voice communication between players can always be guaranteed, while efficiently utilizing background threads to complete the loading of non-core resources, thus avoiding game freezes or delays caused by resource competition.

[0054] 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 according to specific game types, number of players, and communication quality requirements. The above description is only an exemplary implementation and does not limit the scope of protection of the technical solution of this application.

[0055] In some embodiments, the method further comprises: Collect player behavior data in real time on the server side and format the collected player behavior data; Based on the collected player behavior data, predictive algorithms are called to generate prediction information for the player's subsequent game scenarios; 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.

[0056] 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 include 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 locations (such as high sniper points) many times in the game. The server will record and format these data for analysis.

[0057] Next, the prediction algorithm module on the server side inputs the above-mentioned real-time collected and formatted player behavior data into a preset prediction algorithm for comprehensive analysis and calculation. In actual application scenarios, the server side can adopt prediction algorithms based on machine learning or deep learning (such as Long Short-Term Memory Network LSTM or Decision Tree Model) to predict in real time the possible behaviors of players in the next game scenario and the corresponding resource requirements. For example, it is predicted that the player will enter a similar sniper position again within the next few minutes and may need to load high-precision image resources, corresponding weapon equipment models, and environmental special effect resources in the relevant area.

[0058] After the prediction information is generated, the server side transmits the prediction information to the game client in real time through a pre-established efficient data transmission protocol (such as using the UDP protocol or a customized data packet transmission protocol). Taking the actual situation as an example, when the server side determines that the player is about to enter a specific sniper area, it will send the relevant predicted resource requirement information to the client where the player is located in a manner with extremely low latency.

[0059] After the client receives the prediction information sent by the server, it immediately hands it over to the resource management module for processing. The resource management module actively adjusts or updates the current resource loading strategy according to the prediction information. For example, it calls the background thread in advance to load the resources that the player may use in the prediction (such as high-precision sniper models, long-distance scene special effects, relevant sound effect resources). At the same time, the client will also release the resources with extremely low possibility of being used in the future scenario according to the usage probability indicated in the prediction information to further optimize the memory usage of the client.

[0060] Through the real-time behavior data collection on the server side, the real-time calculation of prediction information, and the intelligent loading strategy response of the client, this embodiment can effectively avoid the resource loading delay when the player enters a new scenario or performs special operations, greatly reduce the possible lag or frame rate fluctuation phenomena during the game process, and improve the overall game experience.

[0061] Those skilled in the art should understand that the specific settings of the server prediction algorithm type, data transmission protocol, and resource loading and release strategies in the embodiment can be flexibly adjusted according to the actual game type and performance requirements. This embodiment is only a preferred exemplary solution and does not constitute any limitation to the protection scope of the technical solution of this application.

[0062] The following is an embodiment of the device of this application, which can be used to execute the method embodiment of this application. For the details not disclosed in the embodiment of the device of this application, please refer to the method embodiment of this application.

[0063] Figure 2 It is a schematic structural diagram of a game resource optimization device based on a predictive algorithm provided by an embodiment of this application. As Figure 2As shown in the figure, the game resource optimization device based on a predictive algorithm includes: A compilation module 201, which is used to compile the source code of the game voice tool into a bytecode file and generate an executable game voice tool main body during the development stage of the game voice tool, and is used to be loaded and executed when the game voice tool is started or the scene is switched subsequently; A preloading module 202, which is used to load the core resources required for the current scene or operation when the game is started or the scene is switched, and divide the loading process of non-core resources into multiple stages, and preload the non-core resources through at least one background thread; A generation module 203, which is used to obtain the historical operation data and current game state data of the player, input the historical operation data and current game state data into the predictive algorithm, and generate a target resource list for the subsequent game scene; A loading and releasing module 204, which is used to execute a loading operation on the target resources that have not been loaded by using a background thread according to the target resource list, and execute a releasing operation on the loaded resources whose usage probability in the subsequent game scene is determined by the predictive algorithm to be lower than a preset threshold; An adjustment module 205, which is used to set a high execution priority for the voice communication module in a multi-person voice communication scene, 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.

[0064] In some embodiments, Figure 2 The compilation module 201 of obtains all the source code of the game voice tool, uses a compiler to compile all the source code, and generates an intermediate bytecode file adapted to the platform or virtual machine environment; associates the intermediate bytecode file with necessary runtime libraries or link files to form a bytecode execution unit that supports the main functions of the game voice tool; packs or links the bytecode execution unit into an executable game voice tool main body.

[0065] In some embodiments, Figure 2 The preloading module 202 of determines core resources and non-core resources according to a preset priority; divides several loading stages for non-core resources, and adds 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, calls at least one background thread to traverse the preloading queue of each loading stage, and performs a preloading operation on the corresponding resources according to the sequence of loading stages; when the background thread completes the preloading of the resources in the previous loading stage, preloads the resources in the next loading stage, and registers the resources that have been loaded to the available resource management list.

[0066] In some embodiments, Figure 2The generation module 203 retrieves the historical operation data recorded under the player's account from the data storage module or the server-side log, and performs formatting processing; monitors the current game state data, which includes the player's current location, the task information being executed, the interaction information with other players, and the current scene parameters; inputs the historical operation data and the current game state data into a predictive algorithm to calculate the resource requirements related to subsequent game scenarios, forming a resource requirement probability or a priority indicator; performs threshold judgment and sorting processing on the resource requirement probability or the priority indicator to generate a list of target resources that may need to be loaded in subsequent game scenarios.

[0067] In some embodiments, Figure 2 The loading and releasing module 204 filters out the unloaded target resources from the list of target resources; calls a background thread to perform a loading operation on the unloaded target resources, and registers the loaded resources in the available resource management list; monitors the usage probability of the loaded resources in real time, and identifies the resources with a usage probability lower than the 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.

[0068] In some embodiments, Figure 2 The adjustment module 205 monitors the real-time operation metrics of the voice communication module in a multi-player teaming scenario. The real-time operation metrics include the voice data sending rate, the CPU usage rate, and the thread occupancy; when it is detected that the real-time operation metrics exceed the preset threshold, the loading priority of non-core resources is lowered, and the background threads responsible for resource loading are re-allocated or some loading tasks are paused; after the real-time operation metrics return to not exceed the preset threshold, the loading priority of non-core resources is dynamically raised, and the loading tasks of the background threads are resumed or restarted.

[0069] In some embodiments, Figure 2 The adjustment module 205 collects the player behavior data in real time on the server side, and performs formatting processing on the collected player behavior data; according to the collected player behavior data, calls a predictive algorithm to generate prediction information for the player's subsequent game scenarios; according to the preset data transmission protocol, sends the prediction information to the client, so that the client adjusts or updates the resource loading strategy according to the prediction information, and performs corresponding resource loading or releasing operations.

[0070] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do 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 to the implementation process of the embodiments of the present application.

[0071] Figure 3It is a schematic structural diagram of the electronic device 3 provided by an embodiment of the present application. As Figure 3 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 in the above-mentioned method embodiments are implemented. Alternatively, when the processor 301 executes the computer program 303, the functions of each module / unit in the above-mentioned device embodiments are implemented.

[0072] Exemplarily, the computer program 303 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete the present application. The one or more modules / units can 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 the computer program 303 in the electronic device 3.

[0073] The electronic device 3 can be a desktop computer, a notebook, a palm computer, a cloud server and other electronic devices. The electronic device 3 may include, but is not limited to, the processor 301 and the memory 302. Those skilled in the art can understand that Figure 3 merely examples of the electronic device 3, and do not constitute a limitation to the electronic device 3. It may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, the electronic device may further include input / output devices, network access devices, buses, etc.

[0074] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0075] The memory 302 can be an internal storage unit of the electronic device 3. For example, it can be the hard disk or memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3. For example, it can be a plug-in hard disk equipped on the electronic device 3, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 302 can also include both the internal storage unit and the external storage device of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device. The memory 302 can also be used to temporarily store the data that has been output or will be output.

[0076] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, 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. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0077] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0078] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

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

[0080] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0081] In addition, in each embodiment of the present application, the various functional units can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0082] 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, to implement all or part of the processes in the above method embodiments of the present application, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. The computer program can include computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the 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, etc.

[0083] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the technical solutions of the present application have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included within the protection scope of the present application.

Claims

1. A game resource optimization method based on a predictive algorithm, characterized in that: include: In the game voice tool development stage, 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 used to be loaded and executed when the 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 the non-core resources are preloaded 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 scenarios; According to the target resource list, using the background thread to perform a loading operation on target resources that have not yet been loaded, and performing a releasing operation on loaded resources that the predictive algorithm determines to have a probability of use in subsequent game scenes lower than 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 In the game voice tool development stage, 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 preset priorities; Divide the non-core resources into several loading stages, and add a resource list corresponding to each stage to a 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 preload 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, characterized in that: The obtaining of 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 log and format it; Monitoring current game status data, including the player's current position, information about the task being performed, information about interactions with other players, and current scene parameters; Inputting the historical operation data and current game status data into a predictive algorithm to calculate resource requirements related to subsequent game scenarios to 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, characterized in that The method of using the background thread to perform a loading operation on target resources that have not been loaded according to the target resource list, and performing a releasing operation on loaded resources that a predictive algorithm determines to have a probability of use in subsequent game scenes lower than a preset threshold, includes: Filter out 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 lower than 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 the non-core resources and the task allocation order of the background thread according to the real-time situation of the voice communication includes: Monitor the real-time operating 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 monitored that the real-time operation index exceeds a preset threshold, the loading priority of non-core resources is lowered, and the background thread responsible for resource loading is reallocated or part of the loading tasks are suspended; After the real-time operation index is restored to not more than 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 called 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 compiling module, 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, which is used to be loaded and executed when the game voice tool is started or the scene is switched; A preloading module, used to load core resources required for the current scene or operation when the game is started or the scene is switched, and divide the loading process of non-core resources into multiple stages, and preload the non-core resources through at least one background thread; A generation module, 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; A loading and releasing module, configured to use the background thread to perform a loading operation on target resources that have not yet been loaded according to the target resource list, and to perform a releasing operation on loaded resources that the predictive algorithm determines to have a probability of use in subsequent game scenes lower than 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, characterized in that: 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

  • Method and device for loading resources in multiplayer online game

    CN104598270A

  • Resource loading method and system

    CN113946447A

  • Software resource loading method and system, electronic equipment and medium

    CN118689562A

  • Game resource processing method, system and equipment for H5 micro terminal and medium

    CN119701324A

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

    CN119759443A

Cited By

  • Resource scheduling method, device and equipment

    CN120803668A

  • Game development method and device based on packaging function library

    CN121255151A