Animation loading methods, devices, equipment, storage media and products
By obtaining runtime status information in a virtual environment to calculate the animation loading probability and preloading animation clips, the latency and stuttering issues caused by animation loading time are resolved, achieving smooth animation playback and efficient utilization of cached resources.
Patent Information
- Application Number
- CN202510585450.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2026-11-10
AI Technical Summary
In existing technologies, the animation loading process in a virtual environment takes a long time, resulting in animation playback delays or stuttering, which affects the playback effect.
By acquiring the running status information of the virtual environment, the loading probability of the animation is calculated, and animation segments that meet the caching conditions are preloaded into the cache space, while subsequent segments are loaded asynchronously to ensure smooth playback.
It reduces animation playback latency and stuttering, improves animation playback quality, and increases the utilization rate of cached resources.
Smart Images

Figure CN123067944A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual environments, and in particular to an animation loading method, apparatus, device, storage medium, and product. Background Technology
[0002] Many applications that support virtual environments currently have the ability to trigger animation playback during the operation of the virtual environment.
[0003] In related technologies, if an animation is triggered during the operation of a virtual environment, the computer device can obtain the animation file from the local machine or network and load the animation, and then play the animation after it has been loaded.
[0004] However, the animation loading process in the above scheme usually takes a long time, resulting in delays or stutters in animation playback, which affects the animation playback effect. Summary of the Invention
[0005] This application provides an animation loading method, apparatus, device, storage medium, and product that can balance animation playback quality and cache resource utilization. The technical solution is as follows:
[0006] On the one hand, an animation loading method is provided, the method being executed by a computer device, the method comprising:
[0007] Obtain first status information of the virtual environment displayed by the terminal device; the first status information is used to indicate the running status of the virtual environment;
[0008] Based on the first state information, the loading probability of one or more animations in the virtual environment is obtained; each animation contains one or more animation segments;
[0009] In response to the loading probability of the first animation satisfying the caching condition, the first animation segment is loaded into the cache space of the computer device; the first animation is one of the one or more animations.
[0010] On the other hand, an animation loading device is provided, the device comprising:
[0011] An attribute acquisition module is used to acquire first status information of the virtual environment displayed by a computer device; the first status information is used to indicate the running status of the virtual environment.
[0012] The probability acquisition module is used to acquire the loading probability of one or more animations in the virtual environment based on the first state information; each animation contains one or more animation segments;
[0013] A caching module is configured to add the first animation segment to the cache space of the computer device in response to the loading probability of the first animation satisfying the caching condition; the first animation is one of the one or more animations.
[0014] In one possible implementation, the probability acquisition module is used to,
[0015] Based on the first state information, query the probability table to obtain the loading probability of the one or more animations;
[0016] The probability table contains at least one state information and a correspondence between the loading probabilities of various animations in the virtual environment.
[0017] In one possible implementation, the probability table includes at least one correspondence table; each of the correspondence tables includes state information and at least one animation loading probability;
[0018] The probability acquisition module is used for,
[0019] The first correspondence table is queried in the probability table, and the first correspondence table is the correspondence table containing the first state information;
[0020] The loading probability of the animation in the first correspondence table is used as the loading probability of the one or more animations.
[0021] In one possible implementation, the probability acquisition module is further configured to:
[0022] If the first correspondence table does not exist in the probability table, the second correspondence table is queried in the probability table, and the difference between the second state information and the first state information in the second correspondence table satisfies the filtering condition.
[0023] Based on the loading probability of the animation in the second relationship table, the loading probability of the one or more animations is obtained.
[0024] In one possible implementation, the filtering criteria include one or more of the following:
[0025] The difference between the second state information and the first state information is minimal;
[0026] The difference between the second state information and the first state information is less than the difference threshold.
[0027] In one possible implementation, the probability acquisition module is used to acquire the loading probability of the animation in the second relation table as the loading probability of the one or more animations.
[0028] In one possible implementation, the probability acquisition module is used to perform a correction process on the loading probability of the animation in the second relationship table based on the difference between the second state information and the first state information, so as to obtain the loading probability of the one or more animations.
[0029] In one possible implementation, the probability acquisition module is used to,
[0030] Based on the difference between the second state information and the first state information, a correction coefficient k is obtained, where 0 < k < 1; the value of k is inversely correlated with the difference between the second state information and the first state information.
[0031] The loading probability of the animation in the second relation table is multiplied by a coefficient k to obtain the loading probability of the one or more animations.
[0032] In one possible implementation, the device further includes:
[0033] The request sending module is used to send a probability table acquisition request to the probability management server before the probability acquisition module queries the probability table based on the first status information to obtain the loading probability of the one or more animations.
[0034] The probability table receiving module is used to receive the probability table returned by the probability management server.
[0035] In one possible implementation, the device further includes:
[0036] The reporting module is used to report the first status information and the identifier of the first animation to the probability management server in response to the instruction to load the first animation, so that the probability management server updates the probability table based on the first status information and the identifier of the first animation.
[0037] In one possible implementation, the caching conditions include one or more of the following conditions:
[0038] The probability of loading the first animation is greater than the probability threshold;
[0039] After the loading probabilities of the one or more animations are arranged in descending order, the loading probability of the first animation is in the first N positions, where N≥1 and N is an integer.
[0040] In one possible implementation, the loading module is used for,
[0041] In response to the loading probability of the first animation satisfying the caching condition, and the first animation segment not existing in the cache space, query whether the remaining space size in the cache space is not less than the size of the first animation segment;
[0042] If the remaining space in the cache space is not less than the size of the first animation clip, the first animation clip is loaded into the cache space.
[0043] In one possible implementation, the loading module is further configured to remove data that meets the removal conditions from the cache space if the remaining space in the cache space is less than the size of the first animation clip.
[0044] In one possible implementation, the data that satisfies the removal condition includes one or more of the following:
[0045] The second animation is an animation segment whose loading probability does not meet the caching conditions;
[0046] The animation segment of the third animation, wherein the third animation is an animation with a loading probability lower than that of the first animation;
[0047] Non-animation data with a duration greater than the duration threshold was not used.
[0048] In one possible implementation, the first state information includes at least one of the following:
[0049] Scene data, which includes scene data of the virtual environment displayed by the computer device;
[0050] Object data, wherein the object data includes data of virtual objects controlled by the first account;
[0051] User operation data, which includes data of received user operations;
[0052] Activity data, which includes data on virtual activities within the virtual environment;
[0053] Categorized data, which includes categorized data for the first account.
[0054] The beneficial effects of the technical solutions provided in this application include at least the following:
[0055] The computer device displaying the virtual environment can obtain the loading probability of animations in the virtual environment based on the running status of the virtual environment, and preload animation segments from animations whose loading probabilities meet the conditions into the cache space. Through the above scheme, on the one hand, when the animation is triggered to be displayed later, the animation can be played quickly based on the pre-loaded animation segments, thereby reducing the delay and stuttering of animation playback and improving the animation playback effect. On the other hand, by filtering the pre-loaded animations by loading probabilities and loading the corresponding animation segments in the cache space, the amount of data that needs to be pre-loaded can be effectively reduced, and the utilization rate of cache resources can be improved. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0057] Figure 1 This is a system configuration diagram of a virtual environment system involved in this application;
[0058] Figure 2 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0059] Figure 3 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0060] Figure 4 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0061] Figure 5 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0062] Figure 6 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0063] Figure 7 This is a flowchart illustrating an animation loading method according to an exemplary embodiment;
[0064] Figure 8 This is a flowchart illustrating an animation loading method in a game environment, as described in an embodiment of this application.
[0065] Figure 9 This is a system framework diagram related to the embodiments of this application;
[0066] Figure 10This is a framework diagram of animation playback control in a game application scenario involved in the embodiments of this application;
[0067] Figure 11 This is a framework diagram of game animation cache update and loading probability prediction involved in the embodiments of this application;
[0068] Figure 12 This is a flowchart of an animation loading method in an AR application scenario according to an embodiment of this application;
[0069] Figure 13 This is a structural block diagram of an animation loading device provided in an exemplary embodiment of this application;
[0070] Figure 14 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0071] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0072] First, the terms used in the embodiments of this application will be introduced:
[0073] 1) Virtual Environment: A virtual environment is a virtual scene displayed (or provided) by an application when it runs on a terminal. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional three-dimensional environment, or a purely fictional three-dimensional environment. A virtual environment can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment. The following examples use a three-dimensional virtual environment as an illustration, but this is not a limitation. Optionally, the virtual environment can also be used for virtual battles / competitions between at least two virtual characters. Optionally, the virtual environment can also be used for battles between at least two virtual characters using virtual items within a target area.
[0074] Virtual environments are typically generated by applications on computer devices such as terminals and displayed based on the hardware (such as a screen) on those terminals. These terminals can be mobile devices such as smartphones, tablets, or e-readers; alternatively, they can be personal computer devices such as laptops or stationary computers.
[0075] 2) Virtual objects: In a virtual environment, developers need to pre-set several virtual objects; in the game field, these virtual objects can also be called game assets, which are the basic building blocks of the virtual environment. The categories of virtual objects include, but are not limited to, virtual characters, virtual items, virtual terrain, virtual buildings, etc.
[0076] Please refer to Figure 1 This illustrates a system configuration diagram of a virtual environment system according to various embodiments of this application. For example... Figure 1 As shown, the system includes a terminal 140 and a server 160; optionally, the system may also include a database 180.
[0077] Terminal 140 can be a terminal device with certain processing capabilities, input / output capabilities, and interface display functions. For example, terminal 140 can be a mobile phone, tablet computer, e-book reader, smart glasses, laptop computer, desktop computer, etc.
[0078] Terminal 140 can be a terminal used by users or a terminal used by developers.
[0079] When terminal 140 is implemented as a terminal for developers, developers can use terminal 140 to develop applications that support virtual environments and deploy the applications to server 160 or user terminals.
[0080] When terminal 140 is implemented as a terminal for user use, an application corresponding to the virtual environment can be installed in terminal 140.
[0081] Among them, server 160 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.
[0082] The aforementioned server 160 may be a server that provides background services for the application installed in the terminal 140. This background server may be responsible for application version management, background synchronization of the virtual environment corresponding to the application, and returning processing results.
[0083] The aforementioned database 180 can be a Redis database, or it can be any other type of database. Database 180 is used to store various types of data.
[0084] Optionally, terminal 140 and server 160 are connected via a communication network. Optionally, the communication network can be a wired network or a wireless network.
[0085] Optionally, the system may also include a management device ( Figure 1 (Not shown), the management device is connected to the server 160 via a communication network. Optionally, the communication network can be a wired network or a wireless network.
[0086] Figure 2 This is a flowchart illustrating an animation loading method according to an exemplary embodiment. The method can be executed by a computer device, which can be at least one of a terminal device and a server. For example, the terminal device can be one described above. Figure 1 In the illustrated embodiment, the terminal 140 used by the user can be the server described above. Figure 1 Server 160 in the illustrated embodiment. (As shown) Figure 2 As shown, the animation loading method may include the following steps.
[0087] Step 210: Obtain the first status information of the virtual environment displayed by the computer device; the first status information is used to indicate the running status of the virtual environment.
[0088] When the aforementioned computer device is a terminal device, the terminal device can generate and display the virtual environment screen through a locally running client application.
[0089] When the aforementioned computer device is a server, the server can generate a virtual environment image through a client application running in the cloud, and push the generated virtual environment image to the terminal device for display.
[0090] In some embodiments, the operating state indicated by the first state information is the current operating state of the virtual environment displayed by the computer device.
[0091] In some embodiments, the first state information described above may indicate the state of at least one of the following: the scene currently displayed in the virtual environment, the currently logged-in user account, and virtual objects in the virtual environment.
[0092] Step 220: Based on the first state information, obtain the loading probability of one or more animations in the virtual environment; each animation contains one or more animation segments.
[0093] The loading probability of the above animation can also be considered as the probability that the animation will be triggered to load and be displayed in the state indicated by the first state information.
[0094] In this embodiment of the application, each animation in the virtual environment can be pre-divided / cut / set into one or more animation segments.
[0095] In this embodiment of the application, for an animation in a virtual environment, the loading probability of the animation is different depending on the running state of the virtual environment.
[0096] For example, if an animation is triggered by a specific action of a virtual object in a specified scene, then the animation has different loading probabilities depending on the different states of the virtual object in that specified scene. In other scenes, the loading probability of the animation is 0.
[0097] In this embodiment of the application, the computer device can obtain the loading probability of one or more animations in the virtual environment through the aforementioned first state information.
[0098] For example, a computer device can perform a query operation using the aforementioned first state information to obtain the loading probability of one or more animations. For instance, the computer device can query a preset probability table for the loading probability of the animation corresponding to the first state information.
[0099] For example, a computer device can perform a probability prediction operation using the aforementioned first state information to obtain the loading probability of one or more animations. For instance, the computer device may have a pre-set machine learning model or formula for probability prediction. The computer device can input the first state information into the aforementioned machine learning model or formula for probability prediction to obtain the loading probability of one or more animations output by the machine learning model or formula for probability prediction.
[0100] For example, a computer device can use the aforementioned first state information to perform query and probability calculation operations to obtain the loading probability of one or more animations. For instance, the computer device can use the first state information to query a suitable machine learning model or formula for probability prediction, and input the first state information into the queried machine learning model or formula to obtain the loading probability of one or more animations output by the aforementioned machine learning model or formula.
[0101] In some embodiments, one or more animation segments of the above animation may be divided by the animation creators during the animation production process.
[0102] In some embodiments, one or more animation segments of the above animation may be obtained from the developer's terminal device or server, or automatically divided from the complete animation by the server of the virtual environment.
[0103] For example, the smallest divisible unit of animation is a frame. However, if each frame is considered a segment, the animation segment needs to be loaded every time an animation frame is viewed. Any fluctuations in between (such as sudden I / O interruptions) will cause delays in animation loading, thus delaying animation playback. Therefore, choosing an appropriate segment size becomes crucial, and it needs to meet the following two conditions:
[0104] 1) It cannot be too large; the loading time of a single segment cannot exceed the time consumed by a single frame.
[0105] 2) It cannot be too small; the size of a single segment cannot be smaller than the smallest access unit of memory and I / O.
[0106] The above two conditions can be used to define the size range of an animation segment. Then, based on the actual size of the animation, an appropriate value can be selected, for example, ensuring that more than 50% of the animation segments are no more than 10. For example, the specific calculation process for segmenting animation can be as follows:
[0107] S1, first set the animation segment size to n; the original value of n is the size of the smallest access unit of memory and input / output (I / O), and the unit of n can be a data volume unit such as bit or byte. Among them, the above-mentioned I / O can be the data transfer process between the application and memory.
[0108] S2, divide each animation in the virtual environment into segments according to n, and calculate the number of segments for each animation.
[0109] For example, when segmenting an animation, calculate the number of frames m corresponding to the segment size n, and segment the animation according to the number of frames m, ensuring that the number of frames in each segment except the last segment is m, and the number of frames in the last segment can be less than or equal to m.
[0110] S3, calculates the percentage of animations with more than 10 animation segments out of the total number of animations.
[0111] S4. If this ratio exceeds 50%, then increase n by a certain value (e.g., increase by 10%) and jump to step S2 to continue the calculation.
[0112] S5, if this proportion does not exceed 50%, then set the current n to the segment size.
[0113] Taking the virtual environment as an example, after determining the segment size n according to the aforementioned rules, each animation is segmented and stored and indexed by segment, as shown in Table 1 below for use during playback.
[0114] Table 1
[0115] field name Field type Field Description Animation ID Plastic Surgery The unique ID that identifies the animation within the game. Number of segments Plastic Surgery Number of current animation segments Segmented storage address String The relative storage path of animation segments within the game directory
[0116] Step 230: In response to the loading probability of the first animation satisfying the caching condition, load the first animation segment into the cache space of the computer device; the first animation is one of one or more animations.
[0117] In some embodiments, the first animation segment is the first animation segment loaded among one or more animation segments of the first animation, or at least one animation segment that is loaded first in the loading order.
[0118] The above caching conditions can be pre-set by developers or operations personnel.
[0119] In this embodiment of the application, the computer device can detect whether the loading probability of one or more animations meets the caching condition. If the loading probability of the first animation meets the caching condition, the first animation segment in the first animation can be preloaded. Specifically, before the virtual environment triggers the playback of the first animation, the first animation segment is loaded into the cache space.
[0120] In this embodiment, after step 230, in response to the first animation being triggered for display, the computer device can display the first animation segment in the cache space, and during the display of the first animation segment, load other animation segments in the first animation besides the first animation segment. Optionally, the computer device can load the other animation segments sequentially according to their playback order.
[0121] For example, during animation playback, the computer device first loads the first animation segment that needs to be played from the cache space (such as the first animation segment). While the first animation segment is playing, subsequent animation segments are loaded one by one in sequence. In this way, the loading time of a single animation segment is controllable, which can ensure the smoothness of the entire animation playback process.
[0122] To minimize the impact of animation clip loading on playback, the playback process of animation clips and the loading process of subsequent animation clips can be set to be executed asynchronously and multi-threadedly, thus avoiding the loading process affecting the playback of the animation itself.
[0123] In summary, through the solution shown in the embodiments of this application, the computer device displaying the virtual environment can obtain the loading probability of animations in the virtual environment based on the running state of the virtual environment, and preload animation segments from animations whose loading probabilities meet the conditions into the cache space. Through the above solution, on the one hand, when the display of the animation is triggered subsequently, the animation can be played quickly based on the preloaded animation segments, thereby reducing the delay and stuttering of animation playback and improving the animation playback effect. On the other hand, by filtering the preloaded animations through loading probabilities and loading the corresponding animation segments in the cache space, the amount of data that needs to be preloaded can be effectively reduced, and the utilization rate of cache resources can be improved.
[0124] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, when the load occupancy of the computer device by the application corresponding to the above virtual environment meets the execution conditions, the computer device executes the above step 210.
[0125] For example, when the application in the virtual environment uses more than a certain percentage of the computer device's hardware resources (such as at least one of processing resources and memory resources) than a certain percentage threshold, the computer device executes step 210.
[0126] Through the above-described solution in the embodiments of this application, the computer device can determine whether to preload animation segments based on the load of the application corresponding to the virtual environment. For example, when the load of the application corresponding to the virtual environment is high, the preloading of animation is not performed to ensure the smooth operation of the virtual environment. When the load of the application corresponding to the virtual environment is low, the preloading of animation is performed to ensure the smooth playback of the animation.
[0127] Based on the solutions shown in any one or more embodiments of the above-described embodiments of this application, in some embodiments, the first state information includes at least one of the following:
[0128] 1) Scene data, which includes the scene data of the virtual environment displayed by the computer device.
[0129] The aforementioned scene data can indicate the current scene (such as a game scene) of the virtual environment. For example, in a game, the virtual objects loaded by the game will be very different in different scenes (such as a match or a dungeon), and the animations that these virtual objects may trigger will also be different. Therefore, the scene of the virtual environment will directly affect the probability of the animation being loaded.
[0130] 2) Object data, which includes data of virtual objects controlled by the first account.
[0131] The aforementioned object data can indicate at least one of the following: virtual objects in the virtual environment (e.g., the identifier of the virtual object, the type of the virtual object, etc.), the state of the virtual objects in the virtual environment, and the actions / behaviors performed by the virtual objects in the virtual environment.
[0132] In some embodiments, different virtual objects are associated with different animations. Taking a game as an example, the game objects currently loaded in the game (i.e., the virtual objects mentioned above) are associated with certain animations, and these game objects have a certain probability of triggering these animations after being loaded. For example, the animations loaded for game objects with ranged attacks and those with melee attacks will be significantly different. For instance, when a certain virtual object exists in the virtual environment, the probability of loading the animation associated with that virtual object is usually higher than the probability of loading the animation associated with virtual objects that are not currently displayed in that virtual environment.
[0133] In some embodiments, the actions / behaviors triggered by the same virtual object may differ in different states, and these actions / behaviors are associated with different animations. Therefore, the state of the virtual object also affects the probability of an animation being loaded. For example, the animations loaded for a virtual object in a virtual environment will vary significantly depending on whether it is stationary, running, riding, or equipped with different items. For instance, when a virtual object exists in a virtual environment and is in a specific state, the probability of loading the animation associated with that specific state is usually higher than the probability of loading the animation associated with other states of that virtual object.
[0134] In some embodiments, different actions / behaviors performed by the same virtual object will trigger different animations; for example, the animations loaded and displayed when a virtual object performs an attack action and a defense action are usually different. For instance, when a virtual object exists in a virtual environment and is performing a specified action, the probability of loading the animation associated with that specified action is usually higher than the probability of loading the animation associated with other actions of that virtual object.
[0135] 3) User operation data, which includes the data of user operations received.
[0136] When a user performs an action, it affects virtual objects within the virtual environment, and these effects may trigger the loading of corresponding animations. For example, different actions such as accelerating or shooting (using items) will result in different loading animations. For instance, when a user performs a specific action, the probability of loading animations associated with the effects of that action is usually higher than the probability of loading animations associated with the effects of other actions.
[0137] 4) Activity data, which includes data on virtual activities in the virtual environment.
[0138] In virtual environments, there are often virtual activities that occur periodically or irregularly. For example, taking a game environment as an example, games typically have virtual activities such as operational activities and game events. When these virtual activities are activated, they may trigger changes in the state of virtual objects within the game and may also have some impact on user operations. These impacts ultimately change the probability of animations being loaded. For instance, when a virtual activity is active, the probability of loading animations associated with that virtual activity is usually higher than the probability of loading animations associated with inactive virtual activities.
[0139] 5) Categorized data, which includes categorized data of the first account that logs into the virtual environment.
[0140] In this application embodiment, the animations triggered by different types of users / players will also be different. For example, user accounts can be divided into different types in advance according to the user's operations. Users corresponding to different types of accounts may have different operations, thereby triggering the loading and display of different animations. For example, some users are competitive and tend to fight when they encounter enemies, so the virtual objects controlled by their accounts are more likely to trigger combat-related animations; some users are non-competitive and tend to defend or dodge when they encounter enemies, so the virtual objects controlled by their accounts are more likely to trigger defense or movement-related animations.
[0141] In the solution shown in the embodiments of this application, the loading probability of each animation is obtained by considering factors such as the scene, virtual object, user operation, virtual activity and account classification involved in the virtual environment. This ensures the accuracy of obtaining the loading probability of the animation, and thus ensures the accuracy of the subsequent preloading of animation segments.
[0142] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, please refer to some embodiments. Figure 3 This is a flowchart illustrating an animation loading method according to an exemplary embodiment; such as Figure 3 As shown, step 220 above can be implemented as step 220a.
[0143] Step 220a: Based on the first state information, query the probability table to obtain the loading probability of one or more animations.
[0144] In the embodiments of this application, the probability table above contains at least one state information and the correspondence between the loading probabilities of various animations in the virtual environment.
[0145] For example, the probability table above may contain the correspondence between at least one status information identifier (such as name or ID), the animation identifier (such as animation ID), and the loading probability (percentage value) of the animation.
[0146] In this embodiment of the application, the computer device can perform a matching between the first state information and the state information in the probability table to query the identifier of the animation and the loading probability of the animation that have a corresponding relationship with the first state information in the probability table.
[0147] With the solution shown in the above embodiments of this application, after the computer device obtains the first state information, it only needs to look up a table to obtain the loading probability of one or more animations. The implementation logic of this process is relatively simple, the time required to obtain the loading probability of the animation is short, and the efficiency of obtaining the loading probability of the animation can be guaranteed, thereby improving the efficiency of preloading animation segments.
[0148] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, the probability table includes at least one correspondence table; each correspondence table includes a state information and at least one animation loading probability.
[0149] Each of the above correspondence tables contains an identifier for a set of status information, an identifier for at least one animation, and the loading probability corresponding to the at least one animation.
[0150] In some embodiments, taking the virtual environment as a game environment as an example, the above correspondence table can be as shown in Table 2 below.
[0151] Table 2
[0152]
[0153] As shown in Table 2, it contains the names or IDs of various status information, as well as the IDs of the animations corresponding to these various status information and the loading probabilities of the animations; among them, the correspondence table shown in Table 2 contains a single animation ID and its corresponding loading probability.
[0154] In some embodiments, a correspondence table may also contain multiple animation IDs and multiple loading probabilities corresponding to each animation. In this case, the fields of animation ID and loading probability in Table 2 above can be an integer list and a percentage list, respectively. The integer list consists of multiple animation IDs, and the percentage list consists of multiple loading probabilities. The multiple animation IDs in the integer list correspond one-to-one with the multiple loading probabilities in the percentage list.
[0155] Please refer to Figure 4This is a flowchart illustrating an animation loading method according to an exemplary embodiment; such as Figure 4 As shown, step 220a can be implemented as steps 220a1 and 220a2.
[0156] Step 220a1: Query the first correspondence table in the probability table. The first correspondence table is a correspondence table that contains the first state information.
[0157] In this embodiment of the application, the computer device can query the first state information in each correspondence table, and obtain the correspondence table containing the first state information as the first correspondence table.
[0158] In some embodiments, the types of state information contained in the first correspondence table are the same as the types of first state information; or, the types of state information contained in the first correspondence table include, but are not limited to, the types of first state information.
[0159] For example, the state information in the first correspondence table mentioned above can be {Scene ID; User Operation; Game Object; User Category}, and the first state information is also {Scene ID; User Operation; Game Object; User Category}, and the state information in the first correspondence table is the same as the first state information.
[0160] For example, the status information in the first correspondence table mentioned above can be {Scene ID; User Operation; Game Object; Operation Activity; User Category}, and the first status information is {Scene ID; User Operation; Game Object; User Category}, and the Scene ID, User Operation, Game Object, and User Category in the first correspondence table are the same as the first status information.
[0161] Step 220a2: Obtain the loading probability of one or more animations from the first correspondence table.
[0162] In this embodiment of the application, after the computer device queries the first correspondence table, it can use the loading probability of the animation in the first correspondence table as the loading probability of one or more animations.
[0163] In some embodiments, such as when each correspondence table contains the loading probability of a single animation, or when different correspondence tables contain different amounts of state information, the computer device may query multiple correspondence tables containing first state information, that is, query multiple first correspondence tables. In this case, the computer device can obtain the loading probability of the animation in the multiple correspondence tables as the loading probability of one or more of the above-mentioned animations.
[0164] In the solution shown in the above embodiments of this application, the status information and the loading probability of the animation are organized in a corresponding relationship table. When querying the loading probability of the animation, if a corresponding relationship table containing the first status information is found, it means that the probability table clearly records the loading probability of the animation corresponding to the first status information. At this time, the loading probability of the animation in the corresponding relationship table can be obtained as the loading probability of one or more of the above-mentioned animations, which can ensure the accuracy of the obtained loading probability of the animation.
[0165] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, please refer to some embodiments. Figure 5 This is a flowchart illustrating an animation loading method according to an exemplary embodiment; such as Figure 5 As shown, step 220a above may also include steps 220a3 and 220a4. The above-mentioned method of querying the probability table based on the first state information to obtain the loading probability of one or more animations further includes:
[0166] Step 220a3: If the first correspondence table does not exist in the probability table, query the second correspondence table in the probability table. The difference between the second state information and the first state information in the second correspondence table satisfies the filtering condition.
[0167] In this embodiment of the application, if the computer device does not find a corresponding relationship table containing the first state information, it means that the probability table does not explicitly record the loading probability of the animation corresponding to the first state information. In this case, the computer device can query other corresponding relationship tables containing state information that are similar or close to the first state information, as the aforementioned second corresponding relationship table.
[0168] For example, for each correspondence table, the computer device can calculate the number of distinguishing fields between the first state information and the state information in the correspondence table. The distinguishing field refers to a field with the same field name but different field value. Based on the number of distinguishing fields, the computer device obtains the difference between the state information in the correspondence table and the first state information. For example, the computer device obtains the number of distinguishing fields as the difference between the state information in the correspondence table and the first state information, or the computer device obtains the ratio between the number of distinguishing fields and the total number of fields in the first state information as the difference between the state information in the correspondence table and the first state information.
[0169] For example, for each correspondence table, the computer device can extract the semantic feature vector of the first state information and the semantic feature vector of the state information in the correspondence table through the embedding model. Then, it can calculate the distance (such as cosine distance, Euclidean distance, Manhattan distance, etc.) between the semantic feature vector of the first state information and the semantic feature vector of the state information in the correspondence table. The distance between the semantic feature vector of the first state information and the semantic feature vector of the state information in the correspondence table is obtained as the difference between the state information in the correspondence table and the first state information.
[0170] After obtaining the differences between the status information in each corresponding relationship table and the first status information, the computer device can filter the corresponding relationship tables in each corresponding relationship table such that the differences between the status information and the first status information meet the filtering conditions, and use them as the aforementioned second corresponding relationship table.
[0171] Step 220a4: Based on the loading probability of the animation in the second relation table, obtain the loading probability of one or more animations.
[0172] Since the second state information in the second correspondence table is similar to or close to the first state information, the loading probability of the animation contained in the second correspondence table is likely to be similar to or close to the loading probability of the animation under the first state information. Therefore, the loading probability of the animation under the current first state information can be obtained through the loading probability of the animation in the second correspondence table.
[0173] In the solution shown in the above embodiments of this application, when the probability table does not explicitly record the loading probability of the animation corresponding to the first state information, the computer device can estimate the loading probability of the animation under the first state information by using the loading probability of the animation corresponding to the state information that is similar to the first state information. While ensuring the accuracy of the obtained loading probability of the animation, this avoids or reduces the situation where the loading probability of the animation fails to be obtained because the probability table does not directly record the loading probability of the animation corresponding to the current state information, thereby improving the success rate of obtaining the loading probability of the animation.
[0174] Based on the solutions shown in any one or more embodiments of the above-described embodiments of this application, in some embodiments, the above-described screening conditions include one or more of the following conditions:
[0175] The difference between the second state information and the first state information is minimal; the difference between the second state information and the first state information is less than the difference threshold.
[0176] In some embodiments, after the computer device obtains the differences between the state information in each correspondence table and the first state information, it can determine the correspondence table with the smallest difference as the second correspondence table.
[0177] In some embodiments, after the computer device obtains the differences between the state information in each correspondence table and the first state information, it can determine the correspondence table whose differences are less than a certain difference threshold as the second correspondence table.
[0178] In some embodiments, after the computer device obtains the differences between the state information in each correspondence table and the first state information, it can determine the correspondence table corresponding to the smallest difference threshold. If the difference corresponding to the correspondence table is also less than the difference threshold, then the correspondence table is determined as the second correspondence table.
[0179] The aforementioned difference threshold can be a threshold preset by the developer or maintainer.
[0180] In the solution shown in the above embodiments of this application, if the probability table does not explicitly record the loading probability of the animation corresponding to the first state information, the computer device can estimate the loading probability of the animation under the first state information by using the loading probability of the animation corresponding to the state information that has a small difference from the first state information, thereby ensuring the accuracy of the obtained loading probability of the animation.
[0181] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, step 220a4 can be implemented as: obtaining the loading probability of the animation in the second relation table as the loading probability of one or more animations.
[0182] In the above embodiments of this application, after the computer device queries the second relation table, it can read the loading probability of the animation contained in the second relation table as the loading probability of one or more animations in the current running state of the virtual environment. This process has low logical complexity, requires short processing time, and can ensure the efficiency of obtaining the loading probability of the animation.
[0183] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, step 220a4 can be implemented as follows:
[0184] Based on the difference between the second state information and the first state information, the loading probability of the animation in the second relation table is corrected to obtain the loading probability of one or more animations.
[0185] In the above embodiments of this application, after the computer device queries the second relation table, it can perform a correction process on the loading probability of the animation in the second relation table, and use the corrected loading probability of the animation in the second relation table as the loading probability of one or more animations in the current running state of the virtual environment.
[0186] For example, a computer device can perform probability suppression processing (that is, reduce the loading probability of the animation) on the loading probability of the animation in the second relation table according to the difference between the second state information and the first state information. The greater the difference between the second state information and the first state information, the greater the probability value or proportion of the loading probability of the animation is reduced.
[0187] With the solution shown in the above embodiments of this application, after the computer device queries the second relation table, it can adjust the loading probability of the animation in the second relation table according to the difference between the second state information and the first state information, so that the adjusted loading probability of the animation is closer to the loading probability of the animation in the current running state of the virtual environment, thereby improving the accuracy of the obtained loading probability of the animation.
[0188] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, the process of performing correction processing on the loading probability of animations in the second relation table based on the difference between the second state information and the first state information to obtain the loading probability of one or more animations can be implemented as follows:
[0189] S1. Based on the difference between the second state information and the first state information, obtain the correction coefficient k, 0 < k < 1; the value of k is inversely correlated with the difference between the second state information and the first state information.
[0190] In this embodiment of the application, the computer device can obtain the correction coefficient k by pre-setting the calculation rules or formulas for the correction coefficient and by the difference between the second state information and the first state information.
[0191] In some embodiments, the above calculation rules or formulas are rules or formulas pre-set by developers or operations personnel.
[0192] For example, suppose the difference between the second state information and the first state information is the number of distinguishing fields between the first and second state information, or the ratio between the number of distinguishing fields and the total number of fields in the first state information. The correction coefficient k = 1 - the ratio between the number of distinguishing fields and the total number of fields in the first state information. For instance, suppose the total number of fields in the first state information is 5 and the number of distinguishing fields is 1, then the correction coefficient k = 1 - 1 / 5, which is 4 / 5.
[0193] For example, suppose the difference between the second state information and the first state information is the distance between the semantic feature vector of the first state information and the semantic feature vector of the state information in the corresponding relation table. Then the computer device can input this distance into a pre-set calculation formula to obtain the correction coefficient k. The larger the distance, the smaller the value of the correction coefficient k, and vice versa.
[0194] S2, multiply the loading probability of the animation in the second relation table by the coefficient k to obtain the loading probability of one or more animations.
[0195] In this embodiment of the application, the computer device multiplies the loading probability of the animation in the second relation table with the correction coefficient k, thereby correcting the loading probability of the animation in the second relation table. The corrected loading probability of the animation can be obtained as the loading probability of one or more of the above-mentioned animations.
[0196] The solution described in the above embodiments of this application determines the correction coefficient by the difference between the second state information and the first state information, and then corrects the loading probability of the animation by the correction coefficient. This provides an achievable way to correct the loading probability of the animation by the difference between state information, ensuring the accuracy of the correction of the loading probability of the animation.
[0197] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, before step 220a, the above animation loading method further includes the following steps:
[0198] Send a probability table retrieval request to the probability management server; receive the probability table returned by the probability management server.
[0199] The probability management server mentioned above is the server that generates and maintains the probability table mentioned above. The probability management server and the server that runs or supports the virtual environment can be independent servers, or the probability management server and the server that runs or supports the virtual environment can be the same server.
[0200] In this embodiment, the computer device can obtain the probability table from the probability management server. For example, the computer device sends a probability table retrieval request to the probability management server each time it runs the application corresponding to the virtual environment; or, the computer device can periodically send a probability table retrieval request to the probability management server, such as once a week; or, the computer device can send a probability table retrieval request when it detects that the conditions for updating the probability table are met. For example, if the number of times animation clips in the cache space are loaded is less than a certain threshold during a specified period of time in the virtual environment, it indicates that the animation clips in the cache space are not being fully utilized. At this time, the computer device can determine that the conditions for updating the probability table are met and send the above-mentioned probability table retrieval request. Correspondingly, after receiving the above-mentioned probability table retrieval request, the probability management server obtains the latest probability table and sends the latest probability table to the computer device.
[0201] In this embodiment, various environmental factors (corresponding to the aforementioned state information) jointly determine the probability of an animation being loaded. Accordingly, the state information of each animation being loaded during game operation can be recorded. Based on the recorded information, the probability management server calculates the probability of an animation being loaded under various environmental factors using a specific mathematical model. Taking the virtual environment as an example (the game environment), the recorded information can be shown in Table 3 below.
[0202] Table 3
[0203]
[0204]
[0205] Among them, environmental variables are the collection of all the factors that affect the probability of animation playback, such as scene, user operation, etc.
[0206] To predict which animations will be loaded next, we need to know the current running state of the game. By using the data recorded above, we can know the probability of the current running state occurring and the probability of each animation being loaded in the current running state. Therefore, predicting which animations will be loaded can be transformed into a conditional probability calculation process. The following formula (1) can be used as a reference:
[0207]
[0208] Where P(A|B) is the probability of loading animation A under the current scene and environmental variables (i.e., the state information mentioned above).
[0209] P(AB) is the probability that event A and event B occur simultaneously. In other words, under the current scene and environment variables (corresponding to event B), the current animation A (corresponding to event A) is also loaded at the same time. This probability can be calculated or statistically obtained from the information shown in Table 3 above.
[0210] Specifically, Table 3 above contains all the data. Through Table 3, we can calculate the scenario data where events A and B occur simultaneously (that is, the number of times events A and B occur simultaneously). Dividing this by the total number (such as the total number of recorded animation loading events) allows us to calculate the probability that events A and B occur simultaneously, which is P(AB).
[0211] P(B) represents the probability of event B occurring, which is the probability of the current scene and environmental variables appearing. Similarly, this probability can be directly calculated using the table above. Specifically, Table 3 can be used to calculate the scene data of event B (the number of times event B occurs), and then divided by the total number (such as the total number of recorded animation loading events). That is, the probability of event B occurring can be calculated by using the number of times event B occurs as the numerator and the total number as the denominator.
[0212] Substituting P(AB) and P(B) into the above formula, we can obtain the conditional probability of loading each animation under the corresponding scene and environmental variables (i.e., the loading probability mentioned above). The obtained animation loading probability can be stored in a table (such as the correspondence table shown in Table 2 above) according to the scene and environmental variables, thus obtaining the above probability table.
[0213] With the solution shown in the above embodiments of this application, the computer device can obtain the probability table from the probability management server in advance and store it locally, without having to query the server when determining the loading probability of the animation, which can improve the efficiency of obtaining the loading probability of the animation.
[0214] Based on the solutions shown in any one or more embodiments of the above-described embodiments of this application, in some embodiments, the above-described animation loading method further includes:
[0215] In response to the instruction to load the first animation, the first state information and the identifier of the first animation are reported to the probability management server so that the probability management server can update the probability table based on the first state information and the identifier of the first animation.
[0216] In this embodiment of the application, if the first animation is fully loaded and played in the running state corresponding to the first state information during the operation of the virtual environment, the computer device can report the first state information and the identifier of the first animation to the probability management server. For example, the computer device can report the first state information and the identifier of the first animation to the probability management server in the format of Table 3 above.
[0217] After receiving the first status information and the identifier of the first animation, the probability management server can update the probability table according to the above formula (1) based on the newly received status information and the identifier of the corresponding animation, as well as the existing status information and the identifier of the corresponding animation.
[0218] In some embodiments, the probability management server can periodically update the probability table according to the above formula (1) based on newly received status information and the corresponding animation identifier, as well as existing status information and the corresponding animation identifier; for example, the probability management server updates the probability table at a fixed time every week.
[0219] In some embodiments, the probability management server can update the probability table according to the formula (1) above, based on the newly received status information and the corresponding animation identifier, as well as the existing status information and its corresponding animation identifier, when the data volume of the newly received status information and the corresponding animation identifier meets the update conditions. For example, the probability management server can update the probability table when the ratio between the data volume of the newly received status information and the corresponding animation identifier and the data volume of the existing status information and its corresponding animation identifier is not less than a ratio threshold (e.g., 10%). The aforementioned ratio threshold can be preset by the developers or maintenance personnel.
[0220] In some embodiments, when a specified event exists in an application that supports a virtual environment, the probability management server can update the probability table according to the above formula (1) based on the newly received state information and the corresponding animation identifier, as well as the existing state information and its corresponding animation identifier; for example, the probability management server can update the probability table when the application undergoes a version update or when a specified virtual activity is started in the virtual environment.
[0221] In some embodiments, when the probability management server generates or updates the probability table based on the status information and its corresponding animation identifiers, it can perform data cleaning on the status information and its corresponding animation identifiers, for example, removing data with abnormal format or value. For instance, if the aforementioned status information and its corresponding animation identifiers are organized and reported according to the format in Table 3, the probability management server can check the data format, such as checking whether one or more pieces of information are missing. The probability management server can also check whether the value of each piece of information conforms to the corresponding value range. The probability management server can discard or delete data with missing information or that exceeds the value range to achieve data cleaning.
[0222] With the solution shown in the above embodiments of this application, after the computer device loads the first animation segment of the first animation into the cache space, if the first animation is loaded, the identifier of the first animation and the first status information can be reported to the probability management server together, so that the probability management server can update the probability table in a timely manner, ensure the accuracy of the probability table, and ensure the loading effect of subsequent animation segments.
[0223] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, the above caching conditions include one or more of the following conditions:
[0224] The probability of loading the first animation is greater than the probability threshold;
[0225] After the loading probabilities of one or more animations are sorted from largest to smallest, the loading probability of the first animation is in the first N positions, where N≥1 and N is an integer.
[0226] In some embodiments, the above probability threshold is a threshold preset by the developer or operations personnel.
[0227] In some embodiments, after a computer device obtains the loading probabilities of one or more animations, it can compare the loading probabilities of one or more animations with a probability threshold, and determine the animation with a loading probability greater than the probability threshold as the first animation.
[0228] In some embodiments, after the computer device obtains the loading probability of one or more animations, it can arrange the one or more animations in descending order of loading probability, and take the first N animations as the first animation. If the number of one or more animations is less than N, then one or more animations are determined as the first animation.
[0229] In some embodiments, after a computer device obtains the loading probabilities of one or more animations, it can arrange the one or more animations in descending order of loading probability, compare the loading probabilities of the top N animations with a probability threshold, and determine the animations with loading probabilities greater than the probability threshold as the first animation; if the number of one or more animations is less than N, the loading probabilities of one or more animations are compared with a probability threshold, and the animations with loading probabilities greater than the probability threshold are determined as the first animation.
[0230] In the solution shown in the embodiments of this application, the computer device selects animations with higher loading probabilities and preloads their animation segments into the cache space by sorting according to loading probabilities and comparing with probability thresholds, thereby ensuring the accuracy of subsequent preloading of animation segments.
[0231] In some embodiments, the value of N is preset by the developers or operations personnel.
[0232] In some embodiments, the value of N is determined by the load of the computer device on the computer device based on the application corresponding to the virtual environment; for example, the value of N is negatively correlated with the proportion of the hardware resources (such as processing resources and memory resources) of the computer device occupied by the application corresponding to the virtual environment. That is, the higher the proportion of the hardware resources of the computer device occupied by the application corresponding to the virtual environment, the lower the value of N, and vice versa.
[0233] Through the above-described solution in the embodiments of this application, the computer device can dynamically adjust the number of preloaded animations according to the load of the application corresponding to the virtual environment. When the load of the application corresponding to the virtual environment is high, the number of preloaded animations is reduced to prioritize the smooth operation of the virtual environment. When the load of the application corresponding to the virtual environment is low, the number of preloaded animations is increased to ensure the smooth playback of the animations.
[0234] In other embodiments, the computer device may also query the probability management server for the loading probability of one or more of the above-mentioned animations based on the first state information.
[0235] For example, a computer device can send a probability query request to a probability management server. This request includes first status information. The probability management server then queries a probability table based on this first status information to obtain the loading probability of one or more animations and returns this probability to the computer device. The computer device then receives the loading probability of the one or more animations. The process by which the probability management server queries the probability table based on the first status information to obtain the loading probability of the one or more animations can be referenced from the process described above for a computer device to obtain the loading probability of one or more animations; it will not be elaborated upon here.
[0236] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, please refer to some embodiments. Figure 6 This is a flowchart illustrating an animation loading method according to an exemplary embodiment; such as Figure 6 As shown, step 230 above may include steps 230a and 230b.
[0237] Step 230a: In response to the fact that the loading probability of the first animation meets the caching condition and there is no first animation segment in the cache space of the computer device, query whether the remaining space in the cache space is not less than the size of the first animation segment.
[0238] In some embodiments, when a computer device detects that the loading probability of the first animation in one or more of the above animations meets the caching conditions, it may first check whether the first animation segment corresponding to the first animation already exists in the cache space. If the first animation segment does not exist in the cache space, it may further query the remaining space size in the cache space, compare the remaining space size with the size of the first animation segment, and check whether the remaining space size is not less than the size of the first animation segment.
[0239] In some embodiments, the computer device can query the size of the first animation segment. For example, the computer device locally stores the identifiers of each animation and the correspondence between them and the sizes of the preloaded animation segments in each animation. After the computer device determines the first animation, it can query the correspondence through the identifier of the first animation to obtain the size of the first animation segment.
[0240] Step 230b: If the remaining space in the cache is not less than the size of the first animation clip, load the first animation clip into the cache.
[0241] In this embodiment of the application, if the remaining space in the cache space is smaller than the size of the first animation segment, loading the first animation segment into the cache space will cause the first animation segment to fail to load. Therefore, the computer device can load the first animation segment if the remaining space is not smaller than the size of the first animation segment.
[0242] By using the solution shown in the above embodiments of this application, when the computer device loads the first animation segment in a cache space where the first animation segment does not exist and the remaining space in the cache space is not less than the size of the first animation segment, it can avoid the situation of repeatedly loading the animation segment and the failure of loading the animation segment, thus ensuring the effective utilization of the cache and the loading effect of the animation segment.
[0243] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, please refer to some embodiments. Figure 7 This is a flowchart illustrating an animation loading method according to an exemplary embodiment; such as Figure 7 As shown, step 230 above also includes step 230c.
[0244] Step 230c: If the remaining space in the cache is less than the size of the first animation clip, remove the data in the cache that meets the removal conditions.
[0245] In some embodiments, if the computer device does not have the first animation segment in the cache space and the remaining space in the cache space is smaller than the size of the first animation segment, it can remove the data with lower priority (that is, the removal condition is met) in the cache space to make room for loading the first animation segment. Then, the computer device can return to execute step 230a.
[0246] By using the solution shown in the above embodiments of this application, when a computer device loads a first animation segment in a cache space where the first animation segment does not exist and the remaining space in the cache space is smaller than the size of the first animation segment, low-priority data in the cache space can be removed so that the first animation segment can be successfully loaded into the cache space subsequently, thus ensuring the success rate of animation segment loading.
[0247] Based on the solutions shown in any one or more embodiments of the above embodiments of this application, in some embodiments, the data in the cache space that satisfies the above removal conditions includes one or more of the following data:
[0248] 1) The animation clip of the second animation, which is the animation whose loading probability does not meet the caching conditions.
[0249] The loading probability of the second animation mentioned above refers to the loading probability of the second animation in the running state corresponding to the first state information.
[0250] In some embodiments, if a clip of the second animation already exists in the cache space, the computer device can detect whether the second animation belongs to one or more of the above animations that meet the caching conditions. For example, the computer device compares the identifier of the second animation with the identifiers of the one or more animations that meet the caching conditions. If the identifier of the second animation is not the same as the identifiers of the one or more animations that meet the caching conditions, it is determined that the loading probability of the second animation does not meet the caching conditions. At this time, the clip of the second animation can be removed from the cache space.
[0251] 2) The animation segment of the third animation, which has a lower loading probability than the first animation.
[0252] The loading probability of the third animation mentioned above refers to the loading probability of the third animation in the running state corresponding to the first state information.
[0253] In some embodiments, if a third animation clip already exists in the cache space, the computer device can detect whether the third animation belongs to one or more of the aforementioned animations. If the third animation is one of the aforementioned animations, the loading probability of the third animation is further compared with the loading probability of the first animation. If the loading probability of the third animation is less than the loading probability of the first animation, the animation clip of the third animation is removed from the cache space. If the third animation is not one of the aforementioned animations, it can be considered that the loading probability of the third animation in the running state corresponding to the first state information is low, or that the third animation is not associated with or has a low association with the running state corresponding to the first state information. In this case, the computer device can remove the animation clip of the third animation from the cache space.
[0254] 3) Non-animation data with a duration greater than the duration threshold was not used.
[0255] The above duration thresholds are thresholds preset by developers or operations personnel.
[0256] In this embodiment of the application, the cache space can be used not only for preloading animation clips, but also for caching non-animation data, such as audio data, model data of virtual objects in the virtual environment, etc.
[0257] If the aforementioned non-animation data has not been accessed by the application corresponding to the virtual environment, the aforementioned unused duration refers to the duration between the moment the non-animation data was added to the cache space and the current moment.
[0258] In cases where the aforementioned non-animation data has been accessed by the application corresponding to the virtual environment, the aforementioned unused duration refers to the duration between the most recent access time of the non-animation data and the current time.
[0259] For non-animation data in the cache space, the computer device can obtain the unused duration of the non-animation data and compare the unused duration with the duration threshold. If the unused duration is greater than the duration threshold, it means that the application has not called the non-animation data for a long period of time before the current moment. The non-animation data may be expired data. At this time, the computer device can remove the non-animation data from the cache space.
[0260] In some embodiments, when there are multiple non-animation data in the cache space with an unused duration greater than a duration threshold, the computer device may remove the non-animation data in descending order of unused duration until the remaining space in the cache space is not less than the size of the first animation segment.
[0261] Through the solution shown in the above embodiments of this application, the computer device can remove at least one of the following from the cache space: animation segments with a low probability of loading in the current running state, and non-animation data that has not been used for a long time. This avoids removing important data from the cache space and ensures the accuracy of data removal.
[0262] The solutions shown in the above embodiments of this application can be applied to various application scenarios that support the display and interaction of virtual environments. For example, the solutions shown in the embodiments of this application can be applied to application scenarios of display and interaction in game environments, or the solutions shown in the embodiments of this application can be applied to application scenarios of display and interaction based on Augmented Reality (AR). The corresponding solutions will be described below using these two application scenarios as examples.
[0263] I. Application Scenarios of Game Environment Display and Interaction
[0264] Please refer to Figure 8 This is a flowchart of an animation loading method in a game environment, as described in an embodiment of this application; Figure 8 As shown, the method may include the following steps.
[0265] Step 810: Obtain the first status information of the game environment displayed by the computer device; the first status information is used to indicate the running status of the game environment.
[0266] Step 820: Based on the first state information, obtain the loading probability of one or more game animations in the game environment; each game animation contains one or more animation segments.
[0267] Step 830: In response to the loading probability of the first animation satisfying the caching condition, load the first animation segment into the cache space of the computer device; the first animation is one of one or more game animations.
[0268] To create more refined game quality and achieve a more immersive gaming experience, games require increasingly more animations to enhance game scenes. However, some animations are very complex, resulting in long loading times and even stuttering, negatively impacting the user experience. The solution described in this application reduces the impact of single loading on the normal game experience by loading animations in segments, allowing long animations to load as smoothly as short animations without affecting the user's normal gaming experience.
[0269] The solution described in this application optimizes the animation playback experience, making the playback of long animations smoother. During the animation production stage, the animation is segmented and stored according to certain rules. Simultaneously, during playback, animation loading information is recorded and stored. Then, the loading probability of the animation under different conditions is calculated based on the stored information. Based on this loading probability, the first segment of the animation can be cached in advance, and the remaining segments can be loaded during actual playback. This ensures smooth playback from the first frame to the end, without any stuttering or delays caused by waiting for loading, thus avoiding any impact on the user experience.
[0270] Please refer to Figure 9 It shows a system framework diagram related to the embodiments of this application, such as Figure 9 As shown in the embodiments of this application, the solution can be implemented by the following modules working together:
[0271] 1) Game client 910 side:
[0272] Animation Cache Control Module 912: When the scene (or other variables) changes or the cache space is full, the animation to be loaded is predicted to be cached first, and animations with low loading probability in the cache are evicted.
[0273] Animation loading control module 914: Loads and caches the first segment of the animation according to the instructions of animation caching control module 912; during animation playback, it loads and caches each segment of the animation sequentially for use by animation playback control module 916.
[0274] Animation playback control module 916: controls the playback process of the animation, retrieves cache information, and if it is available, uses the corresponding cache directly; if not (including cases where the first segment is cached but no subsequent segments are available), it notifies the animation loading control module 914 to load the segments one by one.
[0275] Data acquisition module 918: Collects environmental variable information for animation playback (such as scene, user status, etc.) and reports it to game server 920, so that game server 920 can predict the probability of each animation being loaded under different conditions, thereby enabling the pre-loading and caching of animations.
[0276] 2) Game server 920 side:
[0277] Client interaction module 922: Receives and stores animation loading information data (such as status information and the identifier of the animation loaded under the status information) reported by game client 910; receives requests from game client 910 and sends corresponding prediction information (i.e. the probability table mentioned above).
[0278] Animation loading analysis module 924: Based on the stored animation loading information data, calculates the probability of the animation being loaded under various conditions and stores it in storage module 926 for querying by client interaction module 922.
[0279] Storage module 926: Stores the raw data reported by the game client 910 (such as the animation loading information data mentioned above) and the result data analyzed by the animation loading analysis module 924 (such as the probability table mentioned above), and provides a query interface.
[0280] Animations are stored frame by frame. For example, each frame stores key information about the skeleton, such as position and orientation. During playback, the differences between two frames are blended to achieve a smooth animation effect. When an animation is particularly long, the corresponding resource file will also be very large. If the conventional approach is to load the entire animation file first and then play it frame by frame, the loading phase will take a very long time, causing a delay in the initial playback process and severely impacting the user experience.
[0281] Through the segmented control described in the above embodiments of this application, the animation playback process is very smooth. However, when a new animation needs to be played, the playback of the first segment still requires a certain amount of time. When the system performance is insufficient, it may still cause a delay in the playback of the first frame of the animation, thereby affecting the user experience. At this time, caching is needed to optimize this experience. The solution shown in this application only needs to cache the first segment to achieve the optimization effect, which can greatly save memory space. However, even if only the first segment is cached, when there are many animations, the cache space is still insufficient, and the problem of updating the cached objects needs to be solved. In addition, when entering a new scene, which animations need to be cached in advance; after an animation finishes playing, should the first segment continue to be kept in memory for caching; when the cache space is full, which animations need to be cleared are all problems solved by the above embodiments of this application.
[0282] The key to this problem is determining which animations are more likely to be used in the current game scenario. In reality, many factors determine whether an animation will be loaded, such as the scene ID, user actions, game objects, object states, object actions, operational activities, user classification, etc., as mentioned in Table 3 above. These factors collectively determine the probability of an animation being loaded. Therefore, the solution shown in the above embodiments of this application can record this process data during game operation and then calculate the probability of an animation being loaded using a specific mathematical model, as shown in formula (1) and Table 2 above.
[0283] During the actual operation of the game, after obtaining the game scene and environment variables, the probability of each animation being loaded can be obtained by querying Table 2 above. Based on the probability, it can be determined whether to cache or remove it from the current cache.
[0284] Please refer to Figure 10 This diagram illustrates a framework for animation playback control in a game application scenario according to an embodiment of this application. Figure 10 As shown, the animation playback control process may include the following steps:
[0285] S1001, Start animation playback.
[0286] When there is an animation that needs to be played in the game, the game client initiates this process to load and control the playback of the animation.
[0287] S1002, check if there is a cache; the game client checks if the first segment of the animation data exists in the cache. If it does, proceed to S1004; otherwise, proceed to S1003.
[0288] S1003, the first segment of the loading animation.
[0289] If the first segment of the animation is not in the cache, the game client will synchronously load the first segment of the animation.
[0290] S1004, dynamic loading and playback.
[0291] The game client uses the first animation data cached or loaded in real time in the aforementioned steps to play the first animation in real time, and asynchronously loads subsequent animation segments during playback.
[0292] S1005 collects environment variable data during animation loading.
[0293] The game client collects environment variable data during animation loading based on the fields determined in the aforementioned steps.
[0294] S1006, Reporting and Storage.
[0295] The game client reports the collected data to the game server, which stores it in a database for later analysis.
[0296] S1007, End.
[0297] After completing the above steps, the game client will end the current animation playback process.
[0298] Please refer to Figure 11 This diagram illustrates the framework for game animation cache update and loading probability prediction in embodiments of this application. Figure 11As shown, the process of updating the game animation cache can include the following steps:
[0299] S1-1, the process begins.
[0300] The game client initiates this process when at least one of the scene and key environmental variables within the scene changes, or when the animation cache storage space is full.
[0301] S1-2, Get environment variables.
[0302] The game client obtains key in-game environment variables related to animation loading based on the aforementioned rules, which are then used to calculate the probability of subsequent animation loading.
[0303] S1-3, obtain the animation loading probability.
[0304] The game client obtains the loading probability of each animation under the current scene and environment variables from the game server. This step can be done by directly requesting the server, or, from a performance perspective, by fully fetching the data to the game client when the game starts. This way, during real-time calculations, the data can be loaded directly from the local machine without needing to fetch it from the server in real time.
[0305] S1-4, determine if the cache space is full.
[0306] The game client determines whether the current cache space is full, and based on the aforementioned rules and the latest animation loading probability, determines the number of animation caches that need to be evicted.
[0307] S1-5, cache eviction.
[0308] The game client discards a corresponding number of low-probability animation caches based on the latest animation loading probability and in accordance with the aforementioned rules.
[0309] S1-6, Load cache.
[0310] When there is enough space in the cache, the game client determines which animations need to be cached based on the aforementioned rules and the latest loading probability of each animation, loads the animation data of the first segment of the animation, and caches it in memory.
[0311] S1-7, End. This process ends after the cache update is complete.
[0312] like Figure 11 As shown, the above-mentioned probability prediction process may include the following steps:
[0313] S2-1, scheduled start.
[0314] The management server / game server periodically starts this process to update the probability of the animation being loaded. It is triggered when any one of the following three conditions is met: timed, such as once a week; data volume increases, when the newly reported data increases to a certain amount (such as exceeding 10% of the existing data); or there is a major update in the game, such as the release of a major version or the launch of a major operation event.
[0315] S2-2, Data Cleaning.
[0316] The management server / game server cleans newly reported data, removing data with abnormal format or values.
[0317] S2-3, Calculate the loading probability.
[0318] The management server / game server calculates the probability of each animation being loaded under different variables based on the aforementioned rules.
[0319] S2-4, Store the results.
[0320] The management server / game server stores the results calculated in the aforementioned steps in the database for later use, such as providing query functionality during subsequent client actions.
[0321] S2-5, End. This process concludes after completing the above steps.
[0322] This solution avoids loading all animation resources simultaneously and consuming excessive memory by using a segmented loading method. At the same time, by predicting the animations that may play in the game scene, it caches them more accurately in advance, thereby greatly improving the user's animation playback experience during gameplay while consuming very little memory resources.
[0323] In games, preloading or caching methods require runtime memory resources. This method works well when there are few animation resources and a small number of animations. However, if there are many animations or the animation resources are large, this method will consume a lot of memory resources, affecting the normal allocation and use of memory resources in the game.
[0324] The solution described in the above embodiments of this application avoids loading all animation resources simultaneously and consuming excessive memory by using a segmented loading method. Simultaneously, by predicting the animations that may play in the game scene, it caches them more accurately in advance. Therefore, while consuming very little memory, it greatly improves the user's animation playback experience during gameplay. Specifically, it can solve the following problems:
[0325] 1) Dynamic segmentation of animation. The animation is segmented and stored according to keyframes for segmented loading;
[0326] 2) Loading the first segment of the animation. Based on the game's current scene, predict which animations might be played and preload the first segment of the corresponding animation in a fixed memory area to ensure that there is no stuttering when playing a long animation for the first time;
[0327] 3) Dynamic loading during animation playback. Load animations in segments in advance based on the game's current performance load. When the game load is low, load as many segments as possible; when the game load is high, reduce or pause loading to ensure smooth animation playback without affecting the game's performance.
[0328] II. Application Scenarios Based on Augmented Reality Display and Interaction
[0329] Please refer to Figure 12 This is a flowchart of an animation loading method in an AR application scenario involved in the embodiments of this application; such as Figure 12 As shown, the method may include the following steps.
[0330] Step 1210: Obtain the first state information of the AR environment displayed by the computer device; the first state information is used to indicate the operating status of the AR environment.
[0331] Step 1220: Based on the first state information, obtain the loading probability of one or more AR animations in the AR environment; each AR animation contains one or more animation segments.
[0332] Step 1230: In response to the loading probability of the first animation satisfying the caching condition, load the first animation clip into the cache space of the computer device; the first animation is one of one or more AR animations.
[0333] Figure 13 This is a structural block diagram of an animation loading device provided in an exemplary embodiment of this application, such as... Figure 13 As shown, the device includes the following parts:
[0334] The attribute acquisition module 1301 is used to acquire first status information of the virtual environment displayed by the computer device; the first status information is used to indicate the running status of the virtual environment.
[0335] The probability acquisition module 1302 is used to acquire the loading probability of one or more animations in the virtual environment based on the first state information; each animation contains one or more animation segments;
[0336] The loading module 1303 is configured to load the first animation segment into the cache space of the computer device in response to the loading probability of the first animation satisfying the caching condition; the first animation is one of the one or more animations.
[0337] In one possible implementation, the probability acquisition module 1302 is used for,
[0338] Based on the first state information, query the probability table to obtain the loading probability of the one or more animations;
[0339] The probability table contains at least one state information and a correspondence between the loading probabilities of various animations in the virtual environment.
[0340] In one possible implementation, the probability table includes at least one correspondence table; each of the correspondence tables includes state information and at least one animation loading probability;
[0341] The probability acquisition module 1302 is used for,
[0342] The first correspondence table is queried in the probability table, and the first correspondence table is the correspondence table containing the first state information;
[0343] The loading probability of the animation in the first correspondence table is used as the loading probability of the one or more animations.
[0344] In one possible implementation, the probability acquisition module 1302 is further configured to,
[0345] If the first correspondence table does not exist in the probability table, the second correspondence table is queried in the probability table, and the difference between the second state information and the first state information in the second correspondence table satisfies the filtering condition.
[0346] Based on the loading probability of the animation in the second relationship table, the loading probability of the one or more animations is obtained.
[0347] In one possible implementation, the filtering criteria include one or more of the following:
[0348] The difference between the second state information and the first state information is minimal;
[0349] The difference between the second state information and the first state information is less than the difference threshold.
[0350] In one possible implementation, the probability acquisition module 1302 is used to acquire the loading probability of the animation in the second relation table as the loading probability of the one or more animations.
[0351] In one possible implementation, the probability acquisition module 1302 is used to perform a correction process on the loading probability of the animation in the second relationship table based on the difference between the second state information and the first state information, so as to obtain the loading probability of the one or more animations.
[0352] In one possible implementation, the probability acquisition module 1302 is used for,
[0353] Based on the difference between the second state information and the first state information, a correction coefficient k is obtained, where 0 < k < 1; the value of k is inversely correlated with the difference between the second state information and the first state information.
[0354] The loading probability of the animation in the second relation table is multiplied by a coefficient k to obtain the loading probability of the one or more animations.
[0355] In one possible implementation, the device further includes:
[0356] The request sending module is used to send a probability table acquisition request to the probability management server before the probability acquisition module 1302 queries the probability table based on the first status information to obtain the loading probability of the one or more animations.
[0357] The probability table receiving module is used to receive the probability table returned by the probability management server.
[0358] In one possible implementation, the device further includes:
[0359] The reporting module is used to report the first status information and the identifier of the first animation to the probability management server in response to the instruction to load the first animation, so that the probability management server updates the probability table based on the first status information and the identifier of the first animation.
[0360] In one possible implementation, the caching conditions include one or more of the following conditions:
[0361] The probability of loading the first animation is greater than the probability threshold;
[0362] After the loading probabilities of the one or more animations are arranged in descending order, the loading probability of the first animation is in the first N positions, where N≥1 and N is an integer.
[0363] In one possible implementation, the loading module 1303 is used for,
[0364] In response to the loading probability of the first animation satisfying the caching condition, and the first animation segment not existing in the cache space, query whether the remaining space size in the cache space is not less than the size of the first animation segment;
[0365] If the remaining space in the cache space is not less than the size of the first animation clip, the first animation clip is loaded into the cache space.
[0366] In one possible implementation, the loading module 1303 is further configured to remove data that meets the removal conditions from the cache space if the remaining space in the cache space is smaller than the size of the first animation clip.
[0367] In one possible implementation, the data that satisfies the removal condition includes one or more of the following:
[0368] The second animation is an animation segment whose loading probability does not meet the caching conditions;
[0369] The animation segment of the third animation, wherein the third animation is an animation with a loading probability lower than that of the first animation;
[0370] Non-animation data with a duration greater than the duration threshold was not used.
[0371] In one possible implementation, the first state information includes at least one of the following:
[0372] Scene data, which includes scene data of the virtual environment displayed by the computer device;
[0373] Object data, wherein the object data includes data of virtual objects controlled by the first account;
[0374] User operation data, which includes data of received user operations;
[0375] Activity data, which includes data on virtual activities within the virtual environment;
[0376] Categorized data, which includes categorized data for the first account.
[0377] It should be noted that the animation loading device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the animation loading device and the animation loading method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0378] Figure 14 This illustration shows a schematic diagram of a computer device provided in an exemplary embodiment of this application. Specifically, the computer device 1400 includes a Central Processing Unit (CPU) 1401, a system memory 1404 including Random Access Memory (RAM) 1402 and Read Only Memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the CPU 1401. The computer device 1400 also includes a mass storage device 1406 for storing an operating system 1413, application programs 1414, and other program modules 1415.
[0379] Mass storage device 1406 is connected to central processing unit 1401 via a mass storage controller (not shown) connected to system bus 1405. Mass storage device 1406 and its associated computer-readable media provide non-volatile storage for computer device 1400. That is, mass storage device 1406 may include computer-readable media (not shown) such as hard disk or compact disc read-only memory (CD-ROM) drive.
[0380] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1404 and mass storage device 1406 described above can be collectively referred to as memory.
[0381] According to various embodiments of this application, the computer device 1400 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1400 can be connected to the network 1412 via the network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).
[0382] The aforementioned memory also includes one or more programs, which are stored in the memory and configured to be executed by the central processing unit 1401 to implement the animation loading methods provided in the above-described method embodiments.
[0383] Embodiments of this application also provide a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the animation loading method provided in the above-described method embodiments.
[0384] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the animation loading method provided in the above-described method embodiments.
[0385] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the animation loading methods described in the above embodiments.
[0386] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0387] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0388] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An animation loading method, characterized in that, The method is performed by a computer device, and the method includes: Obtain first status information of the virtual environment displayed by the computer device; the first status information is used to indicate the operating status of the virtual environment; Based on the first state information, the loading probability of one or more animations in the virtual environment is obtained; each animation contains one or more animation segments; In response to the loading probability of the first animation satisfying the caching condition, the first animation segment is loaded into the cache space of the computer device; the first animation is one of the one or more animations.
2. The method according to claim 1, characterized in that, The step of obtaining the loading probability of one or more animations in the virtual environment based on the first state information includes: Based on the first state information, query the probability table to obtain the loading probability of the one or more animations; The probability table contains at least one state information and a correspondence between the loading probabilities of various animations in the virtual environment.
3. The method according to claim 2, characterized in that, The probability table includes at least one correspondence table; each of the correspondence tables includes a state information and the loading probability of at least one animation. The step of querying the probability table based on the first state information to obtain the loading probability of the one or more animations includes: The first correspondence table is queried in the probability table, and the first correspondence table is the correspondence table containing the first state information; The loading probability of the animation in the first correspondence table is used as the loading probability of the one or more animations.
4. The method according to claim 3, characterized in that, The step of querying the probability table based on the first state information to obtain the loading probability of the one or more animations further includes: If the first correspondence table does not exist in the probability table, the second correspondence table is queried in the probability table, and the difference between the second state information and the first state information in the second correspondence table satisfies the filtering condition. Based on the loading probability of the animation in the second relationship table, the loading probability of the one or more animations is obtained.
5. The method according to claim 4, characterized in that, The filtering criteria include one or more of the following: The difference between the second state information and the first state information is minimal; The difference between the second state information and the first state information is less than the difference threshold.
6. The method according to claim 4 or 5, characterized in that, The step of obtaining the loading probability of the one or more animations based on the loading probability of the animations in the second relation table includes: The loading probability of the animation in the second relationship table is used to obtain the loading probability of the one or more animations.
7. The method according to claim 4 or 5, characterized in that, The step of obtaining the loading probability of the one or more animations based on the loading probability of the animations in the second relation table includes: Based on the difference between the second state information and the first state information, the loading probability of the animation in the second relationship table is corrected to obtain the loading probability of the one or more animations.
8. The method according to claim 7, characterized in that, The step of correcting the loading probability of the animation in the second relationship table based on the difference between the second state information and the first state information to obtain the loading probability of the one or more animations includes: Based on the difference between the second state information and the first state information, a correction coefficient k is obtained, where 0 < k < 1; the value of k is inversely correlated with the difference between the second state information and the first state information. The loading probability of the animation in the second relation table is multiplied by a coefficient k to obtain the loading probability of the one or more animations.
9. The method according to any one of claims 2 to 8, characterized in that, Before querying the probability table based on the first state information to obtain the loading probability of the one or more animations, the method further includes: Send a probability table retrieval request to the probability management server; Receive the probability table returned by the probability management server.
10. The method according to claim 9, characterized in that, The method further includes: In response to the instruction to load the first animation, the first status information and the identifier of the first animation are reported to the probability management server so that the probability management server updates the probability table based on the first status information and the identifier of the first animation.
11. The method according to any one of claims 1 to 10, characterized in that, The caching conditions include one or more of the following conditions: The probability of loading the first animation is greater than the probability threshold; After the loading probabilities of the one or more animations are arranged in descending order, the loading probability of the first animation is in the first N positions, where N≥1 and N is an integer.
12. The method according to any one of claims 1 to 11, characterized in that, The step of loading the first animation segment into the cache space of the computer device in response to the loading probability of the first animation satisfying the caching condition includes: In response to the loading probability of the first animation satisfying the caching condition, and the first animation segment not existing in the cache space, query whether the remaining space size in the cache space is not less than the size of the first animation segment; If the remaining space in the cache space is not less than the size of the first animation clip, the first animation clip is loaded into the cache space.
13. The method according to claim 12, characterized in that, The step of loading the first animation segment into the cache space of the computer device in response to the loading probability of the first animation satisfying the caching condition further includes: If the remaining space in the cache is less than the size of the first animation clip, the data in the cache that meets the removal conditions will be removed.
14. The method according to claim 13, characterized in that, The data that meets the removal criteria includes one or more of the following: The second animation is an animation segment whose loading probability does not meet the caching conditions; The animation segment of the third animation, wherein the third animation is an animation with a loading probability lower than that of the first animation; Non-animation data with a duration greater than the duration threshold was not used.
15. The method according to any one of claims 1 to 14, characterized in that, The first status information includes at least one of the following: Scene data, which includes scene data of the virtual environment displayed by the computer device; Object data, wherein the object data includes data of virtual objects controlled by the first account; User operation data, which includes data of received user operations; Activity data, which includes data on virtual activities within the virtual environment; Categorized data, which includes categorized data for the first account.
16. An animation loading device, characterized in that, The device includes: An attribute acquisition module is used to acquire first status information of the virtual environment displayed by a computer device; the first status information is used to indicate the running status of the virtual environment. The probability acquisition module is used to acquire the loading probability of one or more animations in the virtual environment based on the first state information; each animation contains one or more animation segments; A loading module is configured to load the first animation segment into the cache space of the computer device in response to the loading probability of the first animation satisfying the caching condition; the first animation is one of the one or more animations.
17. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the animation loading method as described in any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the animation loading method as described in any one of claims 1 to 15.
19. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the animation loading method as described in any one of claims 1 to 15.
