A method and apparatus for performance optimization of multiplayer voice games based on dynamic resource management

By pre-compiling and generating bytecode for game voice tools, combined with just-in-time compilation and segmented loading, and dynamically adjusting resource strategies and priorities, the problem of real-time processing and high-load handling of multiplayer voice functions in multiplayer online games is solved, resulting in a more stable and smoother gaming experience.

CN120045337BActive Publication Date: 2025-11-14QINGFENG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510520644.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-11-14
Estimated Expiration
2045-04-24

AI Technical Summary

Technical Problem

Existing technologies struggle to balance real-time processing of multiplayer voice chat with the high load demands of multiplayer online games, leading to loading delays, frame rate drops, and communication latency issues.

Method used

By obtaining the core source code of the game voice tool, pre-compiling it to generate bytecode files, and combining just-in-time compilation technology and segmented loading strategy, the resource loading strategy and priority are dynamically adjusted. The monitoring module collects performance status data in real time, prioritizes the processing of multi-person voice resources, and coordinates the scheduling of memory and CPU load.

Benefits of technology

It reduces loading latency, improves frame rate, reduces communication latency, and dynamically balances real-time voice processing and high game load requirements, providing a more stable and smooth gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045337B_ABST
    Figure CN120045337B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for performance optimization of multiplayer voice games based on dynamic resource management. The method includes: acquiring the core source code of the game's voice tool and pre-compiling it to generate bytecode files; analyzing target scenario requirements and pre-loading relevant resource files; collecting and analyzing memory usage and CPU load in real time to obtain current system performance status data; based on the performance status data, automatically adjusting the pre-compilation method and resource loading strategy when memory usage and / or CPU load exceed preset thresholds; and when multiplayer voice functionality is detected to be enabled, placing the resources and bytecode required for voice processing in a high-priority queue and coordinating the scheduling of memory usage and / or CPU load. This application can reduce loading latency, improve frame rate, reduce communication latency, and dynamically balance the high load requirements of real-time voice processing and games.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game performance optimization technology, and in particular to a method and apparatus for optimizing the performance of multiplayer voice games based on dynamic resource management. Background Technology

[0002] With the continuous development of online games, especially the increasing popularity of multiplayer online games, in-game multiplayer voice chat has become an important means of improving the player interaction experience. However, when multiplayer voice chat is enabled, it often consumes a lot of CPU and memory resources to maintain the acquisition, encoding, transmission, and decoding of voice data. This causes the game's own graphics rendering, logic operations, and other resource management tasks to compete with voice processing for system resources, easily leading to problems such as lag, latency, or crashes.

[0003] In existing technologies, to improve the overall performance of multiplayer online games, methods such as resource preloading, dynamic memory management, multi-threaded scheduling, and source code compilation optimization are commonly used to reduce real-time load during game startup and operation. However, these existing solutions focus more on single memory or CPU optimization, making it difficult to balance the resource priority scheduling required for real-time multiplayer voice processing, and they also lack timely and effective responses to dynamic changes in game scenes and player behavior. Especially when multiplayer voice is concurrent with large-scale scene rendering or complex game logic, existing solutions struggle to achieve a balance, and problems such as loading delays, frame rate drops, or communication latency still occur, failing to meet players' needs for simultaneous assurance of multiplayer voice and game smoothness. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method and apparatus for performance optimization of multiplayer voice games based on dynamic resource management, in order to solve the problems of loading delay, frame rate drop, communication latency, inability to simultaneously meet real-time voice processing and high load requirements in the prior art.

[0005] A first aspect of this application provides a performance optimization method for multiplayer voice games based on dynamic resource management, comprising: acquiring the core source code of a game voice tool and pre-compiling the core source code to generate bytecode files called by the game voice tool at runtime; when the game voice tool is executed, using the bytecode files to replace real-time compilation operations so that the game voice tool can directly call the bytecode files during operation; when the game is initialized or a player is about to enter a target scene, analyzing the requirements of the target scene and preloading relevant resource files, and caching the relevant resource files in the storage medium of the target system; during game operation, using a monitoring module to collect and analyze memory usage and CPU load in real time to obtain the current system performance status data; based on the performance status data, when memory usage and / or CPU load are detected to exceed a preset threshold, automatically adjusting the pre-compilation method and resource loading strategy; when multiplayer voice function is detected to be enabled, based on a voice high-priority strategy, placing the resources and bytecode required for voice processing in a high-priority queue, and coordinating the scheduling of memory usage and / or CPU load.

[0006] A second aspect of this application provides a performance optimization device for multiplayer voice games based on dynamic resource management, comprising: a pre-compilation module for acquiring the core source code of a game voice tool and pre-compiling the core source code to generate bytecode files called by the game voice tool at runtime; a calling module for using the bytecode files instead of real-time compilation operations when the game voice tool is executed, so that the game voice tool can directly call the bytecode files during operation; a preloading module for analyzing the requirements of the target scene and preloading relevant resource files when the game is initialized or when the player is about to enter the target scene, and caching the relevant resource files in the storage medium of the target system; a collection and analysis module for collecting and analyzing memory usage and CPU load in real time during game operation using a monitoring module to obtain the current system performance status data; an automatic adjustment module for automatically adjusting the pre-compilation method and resource loading strategy based on the performance status data when memory usage and / or CPU load exceed a preset threshold; and a collaborative scheduling module for placing the resources and bytecode required for voice processing in a high-priority queue based on a high-priority voice strategy when the multiplayer voice function is detected to be enabled, and performing collaborative scheduling of memory usage and / or CPU load.

[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.

[0008] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.

[0009] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0010] By acquiring and pre-compiling the core source code of the voice tool game, bytecode files are generated for the game's voice tool to run. When the voice tool executes, the bytecode files replace real-time compilation, allowing the voice tool to directly call the bytecode files during runtime. During game initialization or when the player is about to enter a target scene, the requirements of the target scene are analyzed, and relevant resource files are pre-loaded and cached in the target system's storage medium. During game operation, a monitoring module collects and analyzes memory usage and CPU load in real time to obtain the current system's performance status data. Based on this performance status data, when memory usage and / or CPU load exceed preset thresholds, the pre-compilation method and resource loading strategy are automatically adjusted. When multi-person voice functionality is detected, based on a high-priority voice strategy, the resources and bytecode required for voice processing are placed in a high-priority queue, and memory usage and / or CPU load are coordinated and scheduled. This application can reduce loading latency, improve frame rate, reduce communication latency, and dynamically balance the high-load requirements of real-time voice processing and the game. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating the performance optimization method for multiplayer voice games based on dynamic resource management provided in an embodiment of this application.

[0013] Figure 2 This is a schematic diagram of the structure of the multiplayer voice game performance optimization device based on dynamic resource management provided in the embodiments of this application;

[0014] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0015] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0016] With the development of online games, especially the increasing popularity of massively multiplayer online games (MMORPGs), multiplayer voice chat functionality is often introduced to enhance teamwork and gaming experience. However, when multiplayer voice chat is enabled, games need to collect, transmit, and process voice data in real time, which often leads to a significant increase in CPU and memory usage. Excessive CPU or memory usage can cause issues such as screen stuttering, increased latency, or even program crashes, severely impacting the player's gaming experience.

[0017] In existing game systems, to improve game performance, solutions such as the following are typically employed:

[0018] Resource preloading: Preload commonly used models and sound effects to avoid frequent loading at runtime;

[0019] JIT (Just-In-Time) or AOT (Ahead-of-Time) technologies: Compile or optimize critical code before or during game startup to reduce the CPU load during runtime;

[0020] Game memory monitoring and management: Real-time detection of memory usage; when it exceeds a certain threshold, resource unloading or compression is performed to a certain extent.

[0021] Multi-threaded allocation: Rendering, networking, AI and other modules are allocated to different CPU cores to improve overall utilization.

[0022] However, when voice chat is enabled in multiplayer teams, the system often needs to process audio data quickly and frequently in order to achieve low-latency voice processing, which will cause CPU and memory usage to rise continuously. Traditional solutions often focus on a single aspect (such as optimizing only memory or only targeting the CPU), making it difficult to dynamically balance the high load requirements brought about by real-time voice processing and large-scale scene rendering in games.

[0023] Therefore, in game scenarios, this application ensures smooth multiplayer voice chat while minimizing lag caused by excessive CPU and memory usage, thus providing players with a more stable and smooth gaming experience.

[0024] The technical solution of this application will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0025] Figure 1 This is a flowchart illustrating the performance optimization method for multiplayer voice games based on dynamic resource management provided in an embodiment of this application. Figure 1 As shown, this performance optimization method for multiplayer voice games based on dynamic resource management can specifically include:

[0026] S101, Obtain the core source code of the game voice tool and pre-compile the core source code to generate the bytecode file called by the game voice tool at runtime;

[0027] S102, When the game voice tool is executed, bytecode files are used instead of real-time compilation operations, so that the game voice tool can directly call bytecode files during operation;

[0028] S103: When the game is initialized or the player is about to enter the target scene, analyze the requirements of the target scene and preload the relevant resource files, and cache the relevant resource files in the storage medium of the target system.

[0029] S104, during game operation, uses the monitoring module to collect and analyze memory usage and CPU load in real time to obtain the current system performance status data;

[0030] S105, based on performance status data, automatically adjusts the pre-compilation method and resource loading strategy when it detects that memory usage and / or CPU load exceed preset thresholds;

[0031] S106 When the multi-person voice function is detected to be enabled, the resources and bytecode required for voice processing are placed in a high-priority queue based on the voice high-priority strategy, and memory usage and / or CPU load are coordinated and scheduled.

[0032] In some embodiments, the core source code of the game voice tool is obtained and pre-compiled to generate bytecode files that are called by the game voice tool at runtime, including:

[0033] Analyze the source files related to the core logic of the game's voice tool and the multi-person voice function in the core source code to identify the target code;

[0034] The target code is preprocessed using compilation tools to generate the corresponding bytecode file, which is then stored in the target system's storage medium.

[0035] Based on just-in-time compilation technology, bytecode files involving multi-person voice interaction are dynamically optimized and compiled, and the bytecode files are loaded in segments according to performance status data.

[0036] Specifically, in this embodiment, the development team of the game voice tool will first compile a core source code list, which includes several source files closely related to the multi-person voice function, such as:

[0037] VoiceEncoder.cpp: Performs audio data encoding and compression after voice acquisition;

[0038] VoiceTransporter.cpp: Responsible for network transmission and decoding of voice data;

[0039] VoiceSessionManager.cpp: Manages user connections, voice channel priorities, etc. in multi-person voice conversations.

[0040] The system performs static analysis on the aforementioned source files and, in conjunction with project configuration files or scripts, further identifies the key algorithms and methods contained in these source files (such as "encodeFrame", "sendPacket", etc.) and marks them as "target code" that needs to be pre-compiled.

[0041] Furthermore, after defining the scope of the "target code," the system uses compilation tools (which can be based on LLVM or other mature compilers) to perform preprocessing, generating bytecode files that can be called at runtime. This embodiment can divide the preprocessing into the following stages:

[0042] Search for third-party libraries or internal library functions that files such as "VoiceEncoder.cpp" and "VoiceTransporter.cpp" depend on to ensure that linking can be completed in the same compilation environment; at the same time, enable appropriate optimization techniques such as function inlining and loop unrolling according to tool or compiler options;

[0043] Multiple corresponding bytecode files are generated for different voice function modules, such as "VoiceEncoder.bc" and "VoiceTransporter.bc". To facilitate subsequent quick location or segmented loading, the compilation script will index and archive each bytecode file and store it in the target system's storage medium (e.g., under the path " / data / voiceModules / bytecode / ").

[0044] In some examples, when the game starts or loads the voice function, in order to reduce the waiting cost caused by a one-time loading and avoid excessive memory consumption, this embodiment will combine JIT technology to dynamically compile and load the bytecode involving multi-person voice interaction in segments. The specific details are as follows:

[0045] Segmented loading strategy: When the user has not yet started voice chat in the game lobby, only the most basic initialization and session management logic (such as "VoiceSessionManager.bc") is loaded and JIT compiled first, while the code segment of "a large number of encoding or decoding algorithms" is delayed until the user actually joins a multi-person voice chat.

[0046] JIT compilation scenario example: When players begin to discuss or give commands in the voice channel, the voice tool will perform on-the-fly optimizations (such as register allocation or instruction inlining) on ​​frequently called methods in "VoiceEncoder.bc" to accelerate the encoding and transmission of subsequent audio frames. If it is found that some advanced audio filters or noise reduction modules have not been called for a long time, the system can temporarily refrain from deep compilation of them, thereby reducing CPU load.

[0047] Furthermore, in scenarios involving large-scale concurrent multi-user voice communication, if the CPU or memory load is detected to be close to the threshold, the system can make appropriate adjustments to the compilation frequency and loading timing in this embodiment based on performance status data.

[0048] If some filtering algorithms are only used in very few cases, the system will reduce the compilation depth of the algorithm or postpone its compilation during periods of high CPU load to ensure that the currently executing voice transmission logic is not additionally occupied by resources.

[0049] If certain voice enhancement modules (such as advanced sound reverb) are not part of the core needs of the current team's voice communication, the system can postpone their loading until the CPU load recovers, thereby reducing stuttering or latency.

[0050] This embodiment significantly reduces the real-time compilation pressure faced by multi-person voice communication in high-concurrency scenarios by performing targeted pre-compilation and bytecode generation on the core source files of the game voice communication tool, combined with just-in-time compilation and segmented loading strategies. This solution ensures the stable operation of critical voice functions while leaving ample room for subsequent dynamic scheduling and optimization, making it particularly suitable for game applications with large-scale team voice communication, team command, or high-density voice communication needs.

[0051] In some embodiments, when the game initializes or the player is about to enter the target scene, the requirements of the target scene are analyzed and relevant resource files are preloaded, and the relevant resource files are cached in the storage medium of the target system, including:

[0052] Determine the basic requirements of the target scenario and generate a resource list for preloading;

[0053] Retrieve resource files that match the resource list from the resource repository and compress the resource files;

[0054] The compressed resource files are pre-stored in the target system's storage medium for quick loading when the game enters the target scene;

[0055] When abnormal fluctuations in memory usage or CPU load are detected during game operation, resource files that are not currently in use will be loaded later according to the priority order of the resource list.

[0056] Specifically, before the game starts or a player selects a target scene (such as a large dungeon, city square, or arena), the system reads the basic requirements information for that scene. For example, when a player is about to enter a "fortress" scene, the system retrieves the NPC models, sound effects, background music, light maps, etc. required for that scene, and generates a "preloaded resource list" based on this.

[0057] For example, Example Scenario 1: Arena Battle

[0058] When a player chooses to enter the arena, the system can list the arena's spectator seating model, background sound effects, countdown sound effects, character skill particle effects, etc. in the list;

[0059] For example, in scenario 2: a city square

[0060] When players enter social scenes such as city squares, the system will list the necessary ground textures, building models, city environment background sound effects, and a large number of NPC model files.

[0061] Furthermore, the system extracts resource files that match the "preloaded resource list" from a pre-established resource library. To reduce memory usage, this embodiment preferably uses efficient compression algorithms such as LZ4 to compress the resource files.

[0062] After the resource files are processed by LZ4, an associated index is established with the original resource paths or identifiers, so that they can be matched one by one during subsequent fast decompression.

[0063] Before players enter the scene, these compressed files are stored in the target system's storage medium (such as memory cache or fast read memory) so that they can be quickly decompressed and used when needed later.

[0064] For example, in a sample scenario, when the player's party is about to enter a dungeon instance, it is often necessary to load multiple large monster models, scene effects, and BOSS-specific sound effects. After compression, these resources are written to the " / cache / preload / bossDungeon" directory, and the game can quickly find and decompress them according to the index in this directory during the execution phase.

[0065] After the player confirms entry into the target scene, the system will first load the necessary resources from the "preloaded resource list". Basic textures, lighting information, or key sound effects necessary for scene initialization will be decompressed into memory first, thereby avoiding stuttering during the initial rendering of the screen or the playback of sound effects.

[0066] If a player enters the "Fortress" scene, the game first loads and decompresses key terrain data and basic lighting textures; the background music is decompressed within a few seconds of the player entering the scene to ensure that the user can have a relatively complete audio-visual experience as soon as they enter the scene.

[0067] After the necessary resources for the scene are preloaded, other resources (such as distant scene models, additional decorative sound effects, and NPC images that appear infrequently) will be loaded gradually based on the current system performance data.

[0068] Set a lower loading priority for non-critical resources in the resource list, and only decompress and load them when the CPU and memory loads are within acceptable limits;

[0069] When a significant increase in system load is detected (e.g., players simultaneously enabling multi-player voice chat or triggering numerous skill effects leading to a surge in CPU and memory usage), this embodiment can temporarily suspend loading or compress and unload models that are not currently in the field of view. If players do not temporarily access certain remote areas after entering a battle, texture or sound effect resources for these areas will be unloaded first to free up resource space for more real-time calculations in the battle scene.

[0070] As can be seen from the above specific embodiments, the solution proposed in this application, which comprehensively analyzes scene requirements and preloads relevant resource files when the game initializes or when the player is about to enter the target scene, not only improves the loading speed of key resources in actual use, but also reduces memory usage using an efficient compression algorithm. Furthermore, the priority-based delayed loading and abnormal fluctuation monitoring mechanism enables more flexible resource management in multi-player voice or high-load scenarios, significantly reducing the probability of game lag. This solution is suitable for various games with large-scale scenes or multi-player online interaction requirements, and has good applicability and scalability in optimizing player experience.

[0071] In some embodiments, during game operation, a monitoring module is used to collect and analyze memory usage and CPU load in real time to obtain current system performance status data, including:

[0072] Set the monitoring frequency and trigger conditions for capturing memory usage and CPU load, and collect system operating parameters according to the monitoring frequency and trigger conditions during game execution;

[0073] The system operating parameters are compared with preset benchmark thresholds to obtain performance indicators that characterize the current system usage status.

[0074] Performance status data is generated based on performance metrics and output to subsequent resource management and bytecode invocation stages to perform corresponding adjustment operations when memory usage and / or CPU load rise abnormally.

[0075] Specifically, in this embodiment, the game introduces a dedicated monitoring module to capture memory usage and CPU load information. The system configures two monitoring strategies for this module: timed monitoring and event-triggered monitoring.

[0076] For example, the current memory usage and CPU load are read every 200 milliseconds and recorded in a cache object named "PerfMonitor".

[0077] When memory usage surges to over 80% in a short period of time (e.g., 1 second) or CPU load increases to over 90% in a short period of time (e.g., 500 milliseconds), the system immediately triggers an emergency data collection to obtain the key operating parameters of the current system as quickly as possible.

[0078] Furthermore, after collecting data on memory and CPU load, the monitoring module compares the obtained values ​​with preset benchmark thresholds to generate performance indicators that reflect the system's usage status.

[0079] For example, in a sample scenario (CPU spike during a raid), when a player's party enters a large-scale combat scenario, character skills, monster AI, and multi-player voice interaction occur simultaneously, which can easily cause a sudden spike in CPU load. Once the system detects that the CPU load rate is approaching a set baseline of 85%, it will mark the indicator as "approaching overload"; if the CPU load exceeds 90%, it will be marked as "high load".

[0080] Similarly, when memory usage exceeds the preset 70% but has not yet reached 85%, the performance metric will be displayed as "needs attention" to remind subsequent modules to be cautious when scheduling or loading resources.

[0081] Based on the above performance indicators, the monitoring module generates the current "Performance State Data" of the system, which includes information such as memory usage, CPU load, whether there are abnormal fluctuations, and the duration of overload.

[0082] This "performance status data" is immediately fed back to the modules responsible for resource management and bytecode calls. For example, after receiving a notification that memory usage is approaching a threshold, the "ResourceManager" can pause the lazy loading of certain texture resources; and if the "BytecodeManager" detects that the CPU is under high load, it can postpone or reduce the frequency of compilation tasks for unused effects calculation modules to avoid further increasing CPU pressure during the compilation process.

[0083] In some examples, if the "TeamVoiceHandler" module (multi-person voice processing) requires more CPU time slices, and the current system metrics show that the CPU overload threshold has been reached, the system, guided by the "performance status data," can prioritize ensuring that the voice module maintains sufficient resource usage, reducing unnecessary resource decompression or rendering details, thereby ensuring the real-time performance of multi-person voice.

[0084] In this embodiment, the feedback mechanism between the monitoring module and the subsequent resource scheduling module is continuous. The monitoring module updates the performance status data periodically or when triggered by an event. The subsequent module performs corresponding adjustment operations based on the latest data, and then feeds back the operation results or newly generated load information to the monitoring module for the next comparison and evaluation.

[0085] If the CPU and memory loads are relieved within a certain period of time, the monitoring module will then detect that the system metrics have fallen back to a safe range and output this updated status to subsequent modules, so that the resource management process can gradually resume normal loading or compilation strategies.

[0086] This embodiment demonstrates that during game operation, by appropriately setting the monitoring frequency and triggering conditions, and combining this with a threshold comparison mechanism to promptly obtain memory usage and CPU load information, subsequent resource management or compilation strategy adjustments can be quickly initiated when the load reaches a critical point. This provides timely and reliable data support for multi-player voice communication and collaboration between other game modules. In high-concurrency or high-load game scenarios, this technical solution can effectively reduce the probability of sudden stuttering, allowing the game to maintain a relatively stable and smooth running experience even under performance pressure.

[0087] In some embodiments, based on performance status data, when memory usage and / or CPU load are detected to exceed a preset threshold, the pre-compilation method and resource loading strategy are automatically adjusted, including:

[0088] Compare performance status data with preset thresholds to determine the triggering conditions for memory usage and / or CPU load exceeding limits;

[0089] Based on the triggering conditions, modify the pre-compilation method, which includes adjusting the compilation frequency, compilation depth, or compilation priority;

[0090] Dynamically switch resource loading strategies, select resource files in low-resolution or high-compression formats, and delay loading resources that are not in the core usage scope according to usage priority.

[0091] Specifically, in this embodiment, the system continuously acquires key indicators such as current memory usage and CPU load through a performance monitoring module. Once the monitoring results show that one or more indicators exceed a predefined threshold (such as memory usage reaching 80% or CPU load exceeding 85%), the corresponding performance optimization process is triggered.

[0092] For example, Example Scenario 1: When a large-scale multiplayer instance is launched.

[0093] When players gather at the entrance of a large instance, the system detects that the simultaneous activation of multiplayer voice chat and scene loading causes memory usage to rise rapidly to a threshold exceeding 80%, triggering a memory optimization strategy.

[0094] For example, Example Scenario 2: High-intensity combat or intensive computation

[0095] When players enter high-intensity battle scenarios or trigger a large number of special effects, the system will immediately activate CPU optimization strategies once the CPU load rate is detected to exceed 85%.

[0096] Based on the above triggering conditions, the system makes appropriate modifications to the pre-compilation frequency, compilation depth, or compilation priority of the source code to alleviate the additional pressure brought about by real-time compilation under high load.

[0097] If the system detects that the CPU is frequently in a high-load range, it will temporarily reduce or suspend the compilation tasks of certain functional modules that have not yet been triggered by the player, and resume the normal compilation process after the CPU load drops.

[0098] When certain functional modules are not important in the current scenario or are used infrequently, the system can adjust their compilation depth to a low level to reduce the CPU usage during the compilation process; or directly lower their compilation priority to reserve computing resources for critical multi-person voice modules.

[0099] For example, in a sample scenario (tiered compilation of skill scripts and voice modules), in a large team voice communication scenario, if high CPU load is detected, the game will first ensure that the bytecode corresponding to the voice module is compiled or run at the highest priority; for high-level skill scripts that players are unlikely to use in the short term, the compilation priority will be lowered, or even the compilation time will be delayed.

[0100] When resource overload is triggered, this embodiment provides the following resource optimization methods to address memory and CPU pressure:

[0101] If memory usage exceeds a threshold, the system can automatically switch some high-resolution textures, sound files, etc., to lower-resolution or higher-compression alternatives. For example, if players only need to maintain combat or communication in a simplified rendering environment, there is no need to continue loading ultra-high-definition textures.

[0102] Based on the resource priority list, resources that are not currently in view or are not critical functional modules are temporarily excluded from the immediate loading queue and will continue to be loaded when the system load recovers.

[0103] For example, in a sample scenario (real-time switching during a raid boss fight), when players first enter the boss room, the system typically needs to load a large number of boss-specific sound effects, skill effects, and other resources. If load monitoring shows that memory usage is already severely high, the system will postpone loading scene decoration resources (such as ambient effects) or use lower-resolution versions to prioritize ensuring that the real-time processing of boss fights and multiplayer voice chat is not affected.

[0104] While triggering the above strategies, this embodiment can be combined with intelligent preloading and asynchronous computing mechanisms to further reduce peak load: when the multi-person voice function is frequently activated, the system will automatically increase the priority of voice processing resources based on the players' voice activity, and adjust the resource usage of rendering and AI calculation accordingly; if certain algorithm modules (such as game AI and combat simulation) are not triggered in the short term, the system can allocate them to time segments with lower load to avoid resource conflicts with real-time voice processing or critical scene rendering.

[0105] As can be seen from the above specific embodiments, when the game detects that memory usage or CPU load exceeds a preset threshold during operation, it can automatically adjust the pre-compilation method and resource loading strategy according to the actual scenario requirements and user operation behavior. By reducing the priority of certain non-essential compilation tasks, switching to low-resolution or high-compression resource files, and delaying the loading of resources that are not critical to the current game, the system achieves an effective balance between key interactive functions such as multiplayer voice chat and resource management, which helps reduce lag and latency and ensures a smooth experience for players in high-load scenarios.

[0106] In some embodiments, based on a high-priority voice strategy, resources and bytecode required for voice processing are placed in a high-priority queue, and memory usage and / or CPU load are coordinated and scheduled, including:

[0107] Allocate or load resources and bytecode files related to speech processing in the high-priority queue, and adjust the proportion of other tasks in the processor and memory based on performance status data;

[0108] When memory usage and / or CPU load exceed a preset threshold, processor time slices and necessary memory space are reserved for voice tasks first, and compilation tasks unrelated to core voice processing are postponed.

[0109] Once memory usage and / or CPU load recover to below a preset threshold, processor and memory resources are reallocated to delayed compilation tasks according to a predetermined resource management strategy.

[0110] Specifically, in this embodiment, the game system first creates or enables a high-priority queue based on the real-time requirements of the multi-person voice function, which is used to centrally manage the resources and bytecode required for voice processing.

[0111] Core algorithms related to multi-person voice communication (such as audio encoding and decoding, voice data packaging and network transmission) and their corresponding bytecode files are marked as "high priority" and loaded into the processor time slice and memory space first.

[0112] For example, in a typical scenario (large-scale battle with voice chat), before a guild war or large-scale dungeon begins, most players will simultaneously enable voice chat for command and communication. The system preloads the bytecode and resources of modules such as "TeamVoiceHandler" or "GuildVoiceModule" in a high-priority queue, ensuring that these voice processing flows do not need to wait or be recompiled when the game officially starts.

[0113] During actual operation, the game's performance monitoring module continuously provides real-time memory and CPU load information to the resource scheduling engine (or multi-threaded scheduling mechanism). In this embodiment, once an increase in voice demand or a higher frequency of player voice activity is detected, the system automatically allocates more or more stable resource usage to the voice module in the processor and memory based on the current performance status data.

[0114] If the CPU load is increasing, the system will prioritize ensuring that the voice processing threads get a fixed or sufficient time slice, and reduce the execution frequency of other auxiliary tasks (such as decorative effects rendering, low-priority compilation).

[0115] For example, in a scenario like cross-server alliance voice chat, when a large number of players team up across servers and engage in lively discussions in the same channel, the server may detect a significant increase in the call volume to the voice module. In this case, the scheduling engine will reserve a certain number of CPU cores and a minimum amount of memory for the voice module to ensure that player voice chat is not interrupted or delayed.

[0116] When the system detects that memory usage and / or CPU load exceed a preset threshold (e.g., CPU load exceeds 85%), it will prioritize reserving the processor time slice and necessary memory space required for voice tasks, and temporarily postpone compilation or loading tasks unrelated to core voice processing. This embodiment explicitly places the needs of multi-person voice communication in a higher priority, so even when CPU or memory resources are strained, the voice function can continue to run relatively smoothly.

[0117] For example, in a sample scenario (critical command moment), the guild leader issues a crucial command during the final boss battle, causing a sudden surge in scene rendering and skill effects. Once the system detects that the CPU is about to be overloaded, it will halt the compilation of some low-priority AI scripts and allocate more processing power to the voice queue module to ensure the real-time transmission of commands.

[0118] Once the system detects that memory usage and / or CPU load have returned to below a preset threshold, it will reschedule previously delayed compilation, loading, or rendering tasks to the processor and memory in a predetermined order according to a set strategy: the game will prioritize restoring critical information or visual effects that may affect the player experience, and then gradually load the remaining low-priority resources.

[0119] For example, in a sample scenario (post-battle recovery), after the guild war ends, the CPU load is no longer too high, and the system begins to resume previously shelved rendering effects or certain background tasks (such as leaderboard data synchronization) to ensure the integrity of game functions.

[0120] To further improve resource scheduling efficiency, this embodiment can also combine a machine learning-based resource scheduling engine to predict future loads and utilize a multi-threaded parallel computing strategy to allocate tasks such as voice processing, rendering, and resource loading to different CPU cores, for example:

[0121] If a peak in multi-person voice communication is predicted in the next phase, the system will preload some resources in a low-resolution manner or schedule the compilation tasks of modules that do not need to be called immediately to be executed during periods of lower load.

[0122] By rationally allocating the number of cores, one or more threads are dedicated to voice processing, and bytecode in the high-priority queue is also allocated to relatively idle cores as much as possible to avoid excessive contention with high-intensity graphics rendering threads.

[0123] This embodiment centrally manages the critical resources and bytecode files required for multi-player voice communication in a high-priority queue and performs real-time processor and memory scheduling based on performance status data, ensuring that the voice function maintains sufficient system resource utilization even under high load scenarios. Especially in large-scale multiplayer battles, guild wars, or cross-server team battles, this solution can significantly reduce voice latency or packet loss, thereby improving team collaboration efficiency and player experience. Simultaneously, once the load indicators subside, the system can quickly release resource scheduling space outside of voice tasks, smoothly restoring delayed compilation or rendering tasks, thus achieving a good performance balance between multi-player voice communication and other important game modules.

[0124] In some embodiments, the method further includes:

[0125] Analyze historical game data and real-time player operation data to predict future scene transitions and player interaction needs;

[0126] Based on the prediction results, determine the time period when high load occurs, and adjust bytecode loading, resource file scheduling, and speech processing resource allocation before the high load occurs;

[0127] Based on performance status data, prioritize the scenes to be loaded or the operations to be executed, and reserve memory and CPU resources.

[0128] Specifically, in this embodiment, the system first continuously collects and analyzes historical game data (such as the length of time a player stays in a specific instance or scene, and past use of team voice chat) and the player's current operation trajectory (such as real-time movement path, voice interaction frequency, and use of combat skills).

[0129] In some examples, the data source may include server logs, client behavior statistics, and voice channel interaction records; by comprehensively judging the player's past operation patterns and real-time location, the system can predict the types of scene transitions that may occur next (such as entering a dungeon or crossing terrain boundaries) or resource consumption events (such as peak voice communication periods or concentrated BOSS battles).

[0130] Based on the above data analysis results, the system can predict that a high load will occur at some point in the future, such as when a large number of players simultaneously activate voice chat or trigger large-scale combat effects in the same scene. To avoid lag or delays due to insufficient resource preparation when the load peaks, this embodiment makes the following adjustments before the high load arrives:

[0131] The scripts and algorithm modules most likely to be called in subsequent scenarios or functions are pre-loaded into memory, and pre-compilation or local optimization is performed as appropriate based on possible CPU load.

[0132] High-resolution textures or large sound files are pre-decompressed to a cache so that they do not need to be decompressed in real time when players enter the scene or start multiplayer voice chat.

[0133] If it is predicted that multi-person voice communication will soon enter a period of high activity, some CPU cores or memory blocks will be pre-allocated or reserved for the voice processing module to prevent it from competing with other high-load tasks.

[0134] Furthermore, after completing the aforementioned preloading and resource allocation, the system continues to monitor performance data during game execution. If the monitoring module indicates that the player has not entered a specific scene or triggered the expected operation as predicted, the previously reserved CPU / memory space can be released or adjusted according to the actual situation. When a prediction deviation is confirmed, the weight of resources allocated to the voice module or other high-load processing will be reduced to ensure that other game functions that require resources can operate normally.

[0135] For example, Example Scenario 1: Emergency preparations before a guild war

[0136] When the analysis results showed that most players would gather at a fortress to start a guild war a few minutes later, the system preloaded the main resources required for the large scene, the BOSS interaction script, and the guild war-specific voice module to avoid emergency scheduling that would consume a lot of CPU and memory when the guild war broke out.

[0137] For example, in scenario 2: switching between solo and raid instances.

[0138] Players previously explored dungeons in single-player mode. Historical data analysis shows that players typically invite friends to team up and challenge elite dungeons after completing a single dungeon. The system preloads potentially needed multiplayer voice scripts as the player's single-player dungeon is about to end, reducing the resource loading pressure from subsequent real-time switching.

[0139] For example, in scenario 3: moving between regions

[0140] If the system detects that a player's walking route will pass through multiple high-load areas (such as towns or guild capitals), it will pre-cache the main NPC models, chat voice modules, and corresponding background sound effect files for these areas to minimize loading delays during rapid traversal.

[0141] This embodiment predicts player actions and historical game data to prepare resources and compile bytecode before peak load times, effectively reducing stuttering caused by real-time loading or compilation. Especially during peak multiplayer voice interaction periods, pre-allocating CPU and memory resources to the voice module ensures smooth voice communication between players, significantly improving teamwork and game fluidity. When load demands subside or prediction errors occur, the system can flexibly adjust previously reserved resources to maintain overall game performance.

[0142] In some embodiments, to ensure the smoothness of voice communication when multiple players are in a team without affecting the loading of game graphics and other important resources, this application also provides a dynamic balance optimization technology for game scenes and voice interaction.

[0143] When multi-person voice interaction is enabled, the system prioritizes the real-time transmission and processing of voice data to ensure that the voice is not affected by delays or stuttering. For voice data processing, the system marks it as a high-priority resource and allocates CPU and memory resources to it preferentially.

[0144] To avoid excessive impact on game visuals during voice interaction, the system dynamically adjusts the level of detail in the graphics rendering based on the game's running status. When game performance allows, it maintains high-quality graphics rendering; when performance degrades, it appropriately reduces the graphics quality, for example, by decreasing the rendering frame rate or adjusting visual details.

[0145] Through the above technical solutions, this application not only solves the problem of lag caused by excessive resource consumption during multi-person voice interaction, but also provides an efficient and adaptive technical solution by combining dynamic memory management, bytecode pre-compilation, intelligent resource scheduling, and CPU and memory collaborative optimization. The technical solution of this application will greatly improve the smoothness of the game when multi-person team voice is enabled, and provide users with a better gaming experience.

[0146] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0147] Figure 2 This is a schematic diagram of the multiplayer voice game performance optimization device based on dynamic resource management provided in an embodiment of this application. Figure 2 As shown, the multiplayer voice game performance optimization device based on dynamic resource management includes:

[0148] The pre-compilation module 201 is used to obtain the core source code of the game voice tool and pre-compile the core source code to generate the bytecode file called by the game voice tool at runtime.

[0149] Module 202 is called to replace real-time compilation with bytecode files when the game voice tool is executed, so that the game voice tool can directly call the bytecode files during operation;

[0150] The preloading module 203 is used to analyze the requirements of the target scene and preload the relevant resource files when the game is initialized or when the player is about to enter the target scene, and cache the relevant resource files in the storage medium of the target system.

[0151] The data acquisition and analysis module 204 is used to collect and analyze memory usage and CPU load in real time during game operation, and obtain the current system performance status data.

[0152] The automatic adjustment module 205 is used to automatically adjust the pre-compilation method and resource loading strategy based on performance status data when memory usage and / or CPU load exceed a preset threshold.

[0153] The collaborative scheduling module 206 is used to place the resources and bytecode required for voice processing in a high-priority queue based on the voice high-priority strategy when the multi-person voice function is detected to be enabled, and to perform collaborative scheduling of memory usage and / or CPU load.

[0154] In some embodiments, Figure 2 The pre-compilation module 201 analyzes the source files related to the core logic of the game voice tool and the multi-person voice function in the core source code to determine the target code; it uses the compilation tool to perform pre-processing on the target code to generate the corresponding bytecode file and stores the bytecode file in the storage medium of the target system; according to the just-in-time compilation technology, it dynamically optimizes and compiles the bytecode file involving multi-person voice interaction, and loads the bytecode file in segments according to the performance status data.

[0155] In some embodiments, Figure 2 The preloading module 203 determines the basic requirements information of the target scene and generates a resource list for preloading; it retrieves resource files that match the resource list from the resource library and performs compression processing on the resource files; it pre-stores the compressed resource files in the storage medium of the target system so that they can be quickly loaded when the game enters the target scene; when abnormal fluctuations in memory usage or CPU load are detected during the game operation, resource files that are not currently in use are delayed in loading according to the priority order of the resource list.

[0156] In some embodiments, Figure 2 The data acquisition and analysis module 204 is configured with monitoring frequency and triggering conditions for capturing memory usage and CPU load, and collects system operating parameters according to the monitoring frequency and triggering conditions during game execution; compares the system operating parameters with preset benchmark thresholds to obtain performance indicators that characterize the current system usage; generates performance status data based on the performance indicators, and outputs the performance status data to the subsequent resource management and bytecode calling stages to perform corresponding adjustment operations when memory usage and / or CPU load rise abnormally.

[0157] In some embodiments, Figure 2The automatic adjustment module 205 compares performance status data with preset thresholds to determine the triggering conditions for memory usage and / or CPU load exceeding limits; based on the triggering conditions, it modifies the pre-compilation method, which includes adjusting the compilation frequency, compilation depth, or compilation priority; it dynamically switches resource loading strategies, selects low-resolution or high-compression ratio resource files, and delays the loading of resources not in the core usage scope according to usage priority.

[0158] In some embodiments, Figure 2 The collaborative scheduling module 206 allocates or loads resources and bytecode files related to speech processing in the high-priority queue, and adjusts the proportion of other tasks in the processor and memory based on performance status data. When the memory usage and / or CPU load exceed the preset threshold, it prioritizes reserving processor time slices and necessary memory space for speech tasks, and postpones the execution of compilation tasks unrelated to core speech processing. After the memory usage and / or CPU load recover to below the preset threshold, it reallocates processor and memory resources for the postponed compilation tasks according to the predetermined resource management strategy.

[0159] In some embodiments, Figure 2 The prediction module 207 analyzes historical game data and real-time player operation data to predict future scene switching and player interaction needs; based on the prediction results, it determines the time period of high load and adjusts bytecode loading, resource file scheduling and voice processing resource allocation before the high load occurs; according to performance status data, it prioritizes the scenes to be loaded or the operations to be executed and reserves memory and CPU resources.

[0160] It should be understood that the sequence number of each step in the above embodiments does not imply 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.

[0161] Figure 3 This is a schematic diagram of the structure of the electronic device 3 provided in an embodiment of this application. For example... 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, it implements the steps in the various method embodiments described above. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the various device embodiments described above.

[0162] 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 complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 303 in electronic device 3.

[0163] Electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 3 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device may also include input / output devices, network access devices, buses, etc.

[0164] Processor 301 can 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. A general-purpose processor can be a microprocessor or any conventional processor.

[0165] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or RAM. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 302 can include both internal and external storage units 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 data that has been output or will be output.

[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to 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 embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0167] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0168] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art 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.

[0169] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and 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, and the indirect coupling or communication connection of apparatus or units may be electrical, mechanical, or other forms.

[0170] The units described as separate components may or may not be physically separate. The 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0171] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0172] If an integrated module / unit is implemented as 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, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0173] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although the technical solutions of this application are described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A performance optimization method for multiplayer voice games based on dynamic resource management, characterized in that, include: Obtain the core source code of the game voice tool and pre-compile the core source code to generate the bytecode file called by the game voice tool at runtime; When the game voice tool is executed, the bytecode file is used to replace the real-time compilation operation. Based on the just-in-time compilation technology, the bytecode file involving multi-person voice interaction is dynamically optimized and compiled. The bytecode file is loaded in segments according to the performance status data so that the game voice tool can directly call the bytecode file during operation. When the game initializes or when the player is about to enter the target scene, the requirements of the target scene are analyzed and the relevant resource files are preloaded, and the relevant resource files are cached in the storage medium of the target system. During game operation, the monitoring module collects and analyzes memory usage and CPU load in real time to obtain the current system performance status data; Compare the performance status data with preset thresholds to determine the triggering conditions for memory usage and / or CPU load exceeding limits; modify the pre-compilation method according to the triggering conditions, wherein the pre-compilation method includes adjusting the compilation frequency, compilation depth, or compilation priority; dynamically switch resource loading strategies, select resource files in low-resolution or high-compression ratio formats, and delay loading resources not in the core usage scope according to usage priority; When the multi-person voice function is detected to be enabled, based on the voice high priority strategy, when the memory usage and / or CPU load are detected to exceed the preset threshold, processor time slices and necessary memory space are reserved for voice tasks first, and compilation tasks unrelated to core voice processing are postponed. The resources and bytecode required for voice processing are placed in a high priority queue, and the memory usage and / or CPU load are coordinated and scheduled. The step of obtaining the core source code of the game voice tool and pre-compiling the core source code to generate the bytecode file called by the game voice tool at runtime includes: Analyze the source files related to the core logic of the game voice tool and the multi-person voice function in the core source code to determine the target code; The target code is preprocessed using a compilation tool to generate a corresponding bytecode file, which is then stored in the storage medium of the target system. A segmented loading strategy is adopted. When the user has not yet started voice chat in the game lobby, only the most basic initialization and session management logic is loaded and compiled first, while the remaining encoding or decoding algorithm code segments are delayed until the user actually joins a multi-person voice chat. The step of placing the resources and bytecode required for voice processing in a high-priority queue and coordinating the scheduling of memory usage and / or CPU load includes: Allocate or load resources and bytecode files related to speech processing in the high-priority queue, and adjust the proportion of other tasks in the processor and memory based on the performance status data; After the memory usage and / or CPU load recover to below a preset threshold, processor and memory resources are reallocated to the delayed compilation tasks according to a predetermined resource management strategy. The game system creates or enables a high-priority queue based on the real-time requirements of the multi-person voice function, which is used to centrally manage the resources and bytecode required for voice processing.

2. The method according to claim 1, characterized in that, The step of analyzing the target scene requirements and preloading relevant resource files during game initialization or when the player is about to enter the target scene, and caching the relevant resource files in the target system's storage medium, includes: Determine the basic requirements of the target scenario and generate a resource list for preloading; Retrieve resource files that match the resource list from the resource library and compress the resource files; The compressed resource files are pre-stored in the target system's storage medium so that they can be quickly loaded when the game enters the target scene; When abnormal fluctuations in memory usage or CPU load are detected during game operation, resource files that are not currently in use will be loaded later according to the priority order of the resource list.

3. The method according to claim 1, characterized in that, During game operation, the monitoring module collects and analyzes memory usage and CPU load in real time to obtain current system performance status data, including: Set the monitoring frequency and monitoring trigger conditions for capturing the memory usage and CPU load, and collect system operating parameters according to the monitoring frequency and monitoring trigger conditions during game execution; The system operating parameters are compared with preset benchmark thresholds to obtain performance indicators that characterize the current system usage status. The performance status data is generated based on the performance metrics, and the performance status data is output to the subsequent resource management and bytecode calling stages to perform corresponding adjustment operations when memory usage and / or CPU load rise abnormally.

4. The method according to claim 1, characterized in that, The method further includes: Analyze historical game data and real-time player operation data to predict future scene transitions and player interaction needs; Based on the prediction results, determine the time period when high load occurs, and adjust bytecode loading, resource file scheduling, and speech processing resource allocation before the high load occurs; Based on performance status data, prioritize the scenes to be loaded or the operations to be executed, and reserve memory and CPU resources.

5. A performance optimization device for multiplayer voice games based on dynamic resource management, characterized in that, include: The pre-compilation module is used to obtain the core source code of the game voice tool and pre-compile the core source code to generate the bytecode file called by the game voice tool at runtime. The calling module is used to replace the real-time compilation operation with the bytecode file when the game voice tool is executed, and to dynamically optimize and compile the bytecode file involving multi-person voice interaction according to the just-in-time compilation technology, and to load the bytecode file in segments according to the performance status data, so that the game voice tool can directly call the bytecode file during operation; The preloading module is used to analyze the requirements of the target scene and preload the relevant resource files when the game is initialized or when the player is about to enter the target scene, and cache the relevant resource files in the storage medium of the target system. The data acquisition and analysis module is used to collect and analyze memory usage and CPU load in real time during game operation, and obtain the current system performance status data. An automatic adjustment module is used to compare the performance status data with preset thresholds to determine the triggering conditions for memory usage and / or CPU load exceeding limits; based on the triggering conditions, modify the pre-compilation method, wherein the pre-compilation method includes adjusting the compilation frequency, compilation depth, or compilation priority; dynamically switch resource loading strategies, select low-resolution or high-compression ratio resource files, and delay loading resources not in the core usage scope according to usage priority; The collaborative scheduling module is used to, when the multi-person voice function is detected to be enabled, based on the voice high priority strategy, when the memory usage and / or CPU load are detected to exceed a preset threshold, prioritize reserving processor time slices and necessary memory space for voice tasks, postpone the execution of compilation tasks unrelated to core voice processing, place the resources and bytecode required for voice processing in a high priority queue, and perform collaborative scheduling on the memory usage and / or CPU load. The pre-compilation module is used to analyze the source files related to the core logic of the game voice tool and the multi-person voice function in the core source code to determine the target code; use the compilation tool to perform compilation preprocessing on the target code to generate the corresponding bytecode file, and store the bytecode file in the storage medium of the target system; adopt a segmented loading strategy, when the user has not yet started voice in the game lobby, only the most basic initialization and session management logic is loaded and compiled first, and the remaining encoding or decoding algorithm code segments are delayed until the user actually joins the multi-person voice; The collaborative scheduling module is used to allocate or load resources and bytecode files related to voice processing in the high-priority queue, and adjust the proportion of other tasks in processor and memory based on the performance status data; after the memory usage and / or CPU load recover to below a preset threshold, processor and memory resources are reallocated for delayed compilation tasks according to a predetermined resource management strategy; the game system creates or enables a high-priority queue based on the real-time requirements of the multi-person voice function, for centralized management of the resources and bytecode required for voice processing.

6. 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, it implements the steps of the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Task management method and related equipment

    CN117519918A

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

    CN119759443A