Method and apparatus for updating a bone model

By employing a multi-threaded approach to calculate and adjust the poses of skeletal nodes, the problem of high computational demands in skeletal models within large-scale multiplayer online games is addressed, thereby improving the efficiency and accuracy of model updates and enhancing performance.

CN115797510BActive Publication Date: 2026-05-19ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
Filing Date
2022-11-23
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, skeletal models require a large amount of computation to run in real time in large-scale multiplayer online games, leading to performance degradation, especially for complex models with a large number of bones and when displaying a large number of models, the computational burden is too heavy.

Method used

By obtaining the adjustment parameters of the specified skeletal nodes, multiple threads are invoked to obtain the current position of the linked skeletal nodes respectively. The target position is calculated based on the adjustment parameters and skeletal constraints, and the pose of the linked skeletal nodes is adjusted to update the skeletal model.

Benefits of technology

It improves the efficiency and accuracy of skeletal model updates, reduces the amount of data processing, and enhances computational performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797510B_ABST
    Figure CN115797510B_ABST
Patent Text Reader

Abstract

The application provides a skeleton model updating method and device, wherein the skeleton model updating method comprises the following steps: acquiring an adjustment parameter for a specified skeleton node in a skeleton model; calling a multithreading, respectively acquiring a current position of each linkage skeleton node, and calculating a target position of each linkage skeleton node according to the adjustment parameter, the acquired current position of each linkage skeleton node and a skeleton constraint relationship, wherein the linkage skeleton node has a linkage relationship with the specified skeleton node; and adjusting a pose of each linkage skeleton node according to the target position of each linkage skeleton node to obtain an updated skeleton model. The efficiency and accuracy of the skeleton model updating can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for updating a skeletal model. This application also relates to a skeletal model updating apparatus, a computing device, and a computer-readable storage medium. Background Technology

[0002] With the development of computer technology, model animation has emerged. Traditional model animation uses the direct model skeleton keyframe creation method, which is relatively rigid compared to the constraint controller keyframe method. Constraint controller keyframes can achieve the effect of a single controller being associated with multiple bones at the same time, and separating the controller and constraint components allows a single animation to produce different animation effects corresponding to different constraints.

[0003] However, when this constraint control method is implemented in real-time within a game, the computational load increases significantly compared to the traditional skeletal keyframe-driven approach, especially for complex models with a large number of bones. Furthermore, in large-scale multiplayer online games that need to display a large number of models simultaneously, the computation causes a sharp performance drop. Therefore, an effective solution is urgently needed to address these issues. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method for updating a skeletal model to address the technical deficiencies in the prior art. Embodiments of this application also provide a skeletal model updating apparatus, a computing device, and a computer-readable storage medium.

[0005] According to a first aspect of the embodiments of this application, a skeletal model updating method is provided, including:

[0006] Get the adjustment parameters for a specified bone node in the skeletal model;

[0007] Multithreading is invoked to obtain the current position of each linked skeletal node, and the target position of each linked skeletal node is calculated based on the adjustment parameters, the obtained current position of the linked skeletal node, and the skeletal constraint relationship. The linked skeletal node has a linkage relationship with the specified skeletal node.

[0008] Based on the target position of each linked skeletal node, the pose of each linked skeletal node is adjusted to obtain the updated skeletal model.

[0009] Optionally, calculating the target position of each linked skeletal node based on the adjusted parameters, the obtained current position of the linked skeletal nodes, and the skeletal constraint relationships includes:

[0010] For each linked bone node, based on the bone constraint relationship, obtain the transformation offset relationship between the current linked bone node and the specified bone node;

[0011] Based on the adjustment parameters and conversion offset relationship, as well as the current position of the current linked skeleton node, calculate the target position of the current linked skeleton node.

[0012] Optionally, there may be multiple designated skeletal nodes;

[0013] The step of calculating the target position of the current linked skeleton node based on the adjustment parameters and the conversion offset relationship, as well as the current position of the current linked skeleton node, includes:

[0014] For each specified bone node, calculate the sub-target position of the current linked bone node based on the adjustment parameters and transformation offset relationship corresponding to the current specified bone node, as well as the current position of the current linked bone node.

[0015] According to the preset overlay strategy, the positions of multiple sub-targets are calculated to obtain the target position of the current linked skeletal node.

[0016] Optionally, before obtaining the transformation offset relationship between the current linked bone node and each specified bone node according to the bone constraint relationship, the method further includes:

[0017] Based on the parent-child relationship of each bone node in the skeletal model, the transformation offset relationship between each bone node is constructed.

[0018] Optionally, the target location includes multiple sub-target locations;

[0019] The step of adjusting the pose of each linked skeletal node according to its target position to obtain an updated skeletal model includes:

[0020] For each linked skeletal node, identify the adjustment type corresponding to the position of each sub-target of the current linked skeletal node;

[0021] Based on the adjustment type, determine the adjustment order of each sub-target position;

[0022] Following the adjustment order, starting from the first sub-target position, the pose of the current linked bone node is adjusted according to the current sub-target position until the last sub-target position, resulting in the updated bone model.

[0023] Optionally, before invoking multiple threads to obtain the current position of each linked skeletal node, the method further includes:

[0024] According to the adjustment parameters, the target storage point corresponding to the specified bone node is located in the contiguous memory corresponding to the bone model, wherein the contiguous memory contains multiple storage points;

[0025] Based on the parent-child relationship marked between the target storage point and the plurality of storage points, determine the plurality of associated bone nodes of the specified bone node.

[0026] Optionally, adjusting the pose of each linked skeletal node according to its target position to obtain an updated skeletal model includes:

[0027] Based on the specified bone node and the parent-child relationship between each linked bone node, determine the leaf bone node corresponding to the specified bone node from among the linked bone nodes.

[0028] Based on the target position of the leaf bone node, adjust the pose of the leaf bone node to obtain the updated bone model.

[0029] Optionally, before invoking multiple threads to obtain the current position of each linked skeletal node, the method further includes:

[0030] Determine the first number of linked bone nodes corresponding to the specified bone node;

[0031] Based on the first quantity and the second quantity of the multi-threads, determine the corresponding linked skeleton nodes for each thread;

[0032] The invocation of multiple threads to obtain the current position of each linked skeletal node includes:

[0033] For each thread, obtain the current position of the linked skeletal node corresponding to the current thread.

[0034] According to a second aspect of the embodiments of this application, a skeletal model updating apparatus is provided, comprising:

[0035] The acquisition module is configured to acquire adjustment parameters for a specified bone node in the skeletal model;

[0036] The calculation module is configured to call multiple threads to obtain the current position of each linked skeletal node, and calculate the target position of each linked skeletal node based on the adjustment parameters, the obtained current position of the linked skeletal node and the skeletal constraint relationship, wherein the linked skeletal node has a linkage relationship with the specified skeletal node.

[0037] The adjustment module is configured to adjust the pose of each linked bone node according to the target position of each linked bone node, so as to obtain an updated bone model.

[0038] According to a third aspect of the embodiments of this application, a computing device is provided, comprising:

[0039] Memory and processor;

[0040] The memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions to implement the steps of the skeletal model update method.

[0041] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the skeletal model update method.

[0042] According to a fifth aspect of the present application, a chip is provided that stores a computer program, which, when executed by the chip, implements the steps of the skeletal model update method.

[0043] The skeletal model update method provided in this application obtains adjustment parameters for specified bone nodes in the skeletal model; invokes multiple threads to obtain the current position of each linked bone node, and calculates the target position of each linked bone node based on the adjustment parameters, the obtained current positions of the linked bone nodes, and the skeletal constraint relationships, wherein the linked bone nodes have a linkage relationship with the specified bone node; and adjusts the pose of each linked bone node according to the target position of each linked bone node to obtain the updated skeletal model. By invoking multiple threads, the efficiency and accuracy of skeletal model updates can be improved. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the structure of a skeletal model update system provided in one embodiment of this application;

[0045] Figure 2 This is a flowchart of a skeletal model updating method provided in an embodiment of this application;

[0046] Figure 3A This is a tree structure diagram of a skeletal model provided in one embodiment of this application;

[0047] Figure 3B This is a tree structure diagram of another skeletal model provided in one embodiment of this application;

[0048] Figure 3C This is a schematic diagram illustrating the updating of a skeletal model according to an embodiment of this application;

[0049] Figure 4 This is a flowchart illustrating a method for updating a skeletal model in a game scene, provided in one embodiment of this application.

[0050] Figure 5 This is a schematic diagram of the structure of a skeletal model updating device provided in one embodiment of this application;

[0051] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this application. Detailed Implementation

[0052] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0053] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.

[0054] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first.

[0055] The methods provided in one or more embodiments of this specification can be applied to skeletal model updates in various scenarios: skeletal animation based on skeletal models, game graphics based on skeletal models, etc. The specific method can be selected according to the actual situation, and the embodiments of this specification do not limit it in any way.

[0056] This application provides a method for updating a skeletal model. This application also relates to a skeletal model updating apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0057] The execution entity of the skeletal model update method provided in this application embodiment can be a server or a terminal, and this application embodiment does not limit this. Furthermore, the terminal can be any electronic product capable of human-computer interaction with the user, such as a PC (Personal Computer), mobile phone, PPC (PocketPC), tablet computer, etc. The server can be a single server, a server cluster composed of multiple servers, or a cloud computing service center, and this application embodiment does not limit this. In addition, the skeletal model update method provided in this application embodiment can also be jointly completed by the terminal and the server.

[0058] Taking the server as the executing entity as an example, see [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of a skeletal model update system provided in an embodiment of this application: A user adjusts a specified bone node in the skeletal model via a terminal, and the terminal correspondingly sends the adjustment parameters for the specified bone node to the server. After obtaining the adjustment parameters for the specified bone node in the skeletal model, the server invokes multiple threads to obtain the current position of each linked bone node, and calculates the target position of each linked bone node based on the adjustment parameters, the obtained current positions of the linked bone nodes, and the skeletal constraint relationships. The linked bone nodes have a linkage relationship with the specified bone node. Based on the target positions of each linked bone node, the pose of each linked bone node is adjusted to obtain the updated skeletal model.

[0059] Correspondingly, the server can also send the updated skeletal model to the terminal so that the terminal can display the updated skeletal model.

[0060] In this embodiment, adjustment parameters for a specified bone node in the skeletal model are obtained. Multithreading is invoked to obtain the current position of each linked bone node. Based on the adjustment parameters, the obtained current positions of the linked bone nodes, and the skeletal constraint relationships, the target position of each linked bone node is calculated. The linked bone nodes have a linkage relationship with the specified bone node. Based on the target positions of each linked bone node, the pose of each linked bone node is adjusted to obtain an updated skeletal model. This improves the efficiency and accuracy of skeletal model updates.

[0061] Figure 2 The flowchart shown is a skeletal model update method according to an embodiment of this application, which specifically includes the following steps:

[0062] Step 202: Obtain the adjustment parameters for a specified bone node in the skeletal model.

[0063] Specifically, a skeletal model is a skeleton structure composed of interconnected "bones" or "bones nodes." The orientation and position of the bones nodes can be changed, as in robot models and human models. Specifying a bone node refers to the bone node that is being adjusted.

[0064] In practical applications, there are several ways to obtain adjustment parameters for a specific bone node in a skeletal model. For example, a user can send a command to the execution entity to update the skeletal model, or to obtain adjustment parameters for a specific bone node in the skeletal model. Upon receiving the command, the execution entity then begins obtaining the adjustment parameters for the specified bone node. Alternatively, the execution entity can automatically obtain the adjustment parameters for the specified bone node at preset intervals. For instance, after a preset interval, a server with skeletal model update functionality can automatically obtain the adjustment parameters for the specified bone node; or after a preset interval, a terminal with skeletal model update functionality can automatically obtain the adjustment parameters for the specified bone node. This specification does not limit the method of obtaining adjustment parameters for a specific bone node in the skeletal model.

[0065] It should be noted that the adjustment parameters for a specific bone node in the skeletal model can be the adjustment parameters identified when the user adjusts the coordinates and orientation of the specified bone node in the skeletal model to the desired pose; or they can be the parameters set by the user for the specified bone node when adjusting it.

[0066] Step 204: Invoke multiple threads to obtain the current position of each linked skeletal node, and calculate the target position of each linked skeletal node based on the adjustment parameters, the obtained current position of the linked skeletal node and the skeletal constraint relationship, wherein the linked skeletal node has a linkage relationship with the specified skeletal node.

[0067] Specifically, a thread is the smallest unit of computation that an operating system can schedule. It is contained within a process and is the actual unit of operation within a process. A thread refers to a single, sequential flow of control within a process. Multiple threads can run concurrently within a process, each executing different tasks in parallel. A linked skeletal node is a skeletal node that changes position in response to changes in the pose of a specified skeletal node. The current position refers to the sum of pose parameters such as rotation angle, direction, and coordinates of the linked skeletal node. Skeletal constraint relationships refer to the type and form of influence of a change in the pose of one skeletal node on the pose of another skeletal node. The target position refers to the sum of pose parameters such as rotation angle, direction, and coordinates of the target pose to which the linked skeletal node is to be adjusted.

[0068] In practical applications, after determining the adjustment parameters of the specified bone node, the associated bone nodes corresponding to the specified bone node in the bone model are determined. Multithreading is invoked to obtain each associated bone node separately. Based on the adjustment parameters of the specified bone node, the current position of the linked bone node, and the bone constraint relationship, the target position of each linked bone node is calculated according to a preset algorithm.

[0069] It should be noted that a single thread in a multi-threaded environment can obtain the current position of a single associated skeletal node and calculate its target position based on adjustment parameters, the current position of the associated skeletal node, and skeletal constraints. Alternatively, it can obtain the current positions of multiple associated skeletal nodes and calculate their respective target positions based on adjustment parameters, the current positions of these associated skeletal nodes, and skeletal constraints.

[0070] In one or more optional embodiments of this specification, to improve computational efficiency, the transformation offset relationship can be determined first based on the skeletal constraint relationship, and then the target position can be determined based on the transformation offset relationship and adjustment parameters. That is, the specific implementation process of calculating the target position of each linked skeletal node based on the adjustment parameters, the obtained current position of the linked skeletal node, and the skeletal constraint relationship can be as follows:

[0071] For each linked bone node, based on the bone constraint relationship, obtain the transformation offset relationship between the current linked bone node and the specified bone node;

[0072] Based on the adjustment parameters and conversion offset relationship, as well as the current position of the current linked skeleton node, calculate the target position of the current linked skeleton node.

[0073] Specifically, the transformation offset relationship refers to the relationship between two related bone nodes. When the pose of one bone node changes, the pose of the other bone node also changes. The relative offset relationship between the two poses can be in the form of a matrix or a vector.

[0074] By using the transformation offset correlation calculation to determine the target position of linked bone nodes, the calculation between jumping parent and child bone nodes can be simplified, and the target position of linked bone nodes can be quickly determined. This not only reduces the amount of data processing, but also improves the computational cost, thereby improving the efficiency of bone model updates.

[0075] Optionally, if there is only one specified skeletal node, for each linked skeletal node, the transformation offset relationship between the current linked skeletal node and the specified skeletal node can be obtained based on the skeletal constraints. The transformation offset relationships between each skeletal node can be pre-stored. Further, based on the adjustment parameters and the transformation offset relationships, the position offset of the current linked skeletal node is calculated. Then, the position offset of the current linked skeletal node is superimposed with the current position to obtain the target position of the current linked skeletal node. This improves the efficiency of determining the target position, thereby improving the efficiency of skeletal model updates.

[0076] Optionally, when there are multiple specified bone nodes, the sub-target position of the currently linked bone node can be calculated for each specified bone node, and then the target position can be determined based on the multiple sub-target positions. That is, when there are multiple specified bone nodes, the calculation of the target position of the current linked bone node based on the adjustment parameters and transformation offset relationship, as well as the current position of the current linked bone node, can be implemented as follows:

[0077] For each specified bone node, calculate the sub-target position of the current linked bone node based on the adjustment parameters and transformation offset relationship corresponding to the current specified bone node, as well as the current position of the current linked bone node.

[0078] According to the preset overlay strategy, the positions of multiple sub-targets are calculated to obtain the target position of the current linked skeletal node.

[0079] Specifically, the preset overlay strategy refers to a pre-set strategy that accumulates the positions of sub-targets.

[0080] In practical applications, the positions of multiple sub-targets of the currently linked skeletal node can be determined based on adjusted parameters, transformation offset relationships, and parent-child relationships between skeletal nodes. Specifically, the positions of each sub-target are calculated by recursively calculating from child nodes to higher-level nodes in a tree structure using a tree-like approach (parent-child relationships between skeletal nodes), transformation offset relationships, and state flags. Then, following a preset overlay strategy, the multiple target positions are superimposed to obtain the target position of the currently linked skeletal node. This improves the accuracy of the target position, thereby enhancing the accuracy of skeletal model adjustments.

[0081] For example, the parent node of the first bone node is the second bone node, the parent node of the second bone node is the third bone node, and the first bone node is an associated bone node of both the second and third bone nodes. When calculating the target position of the first bone node, the first sub-target position is calculated first based on the transformation offset relationship between the second and first bone nodes, the adjustment parameters of the second bone node, and the current position of the first bone node. The second bone node is then marked to indicate that it has been used for update calculation. Next, the second sub-target position is calculated based on the transformation offset relationship between the third and first bone nodes, the adjustment parameters of the third bone node, and the current position of the first bone node. The third bone node is also marked to indicate that it has been used for update calculation. Finally, the first and second sub-target positions are superimposed according to a preset superposition strategy to obtain the target position of the first bone node.

[0082] It should be noted that before obtaining the transformation offset relationships between the current linked bone node and each specified bone node based on the skeletal constraints, it is also necessary to construct the transformation offset relationships between the bone nodes based on the parent-child relationships of the bone nodes in the skeletal model. Thus, by recording the transformation offset relationships between the bone nodes based on the parent-child relationships of the bone nodes, i.e., the tree structure corresponding to the skeletal model, it is convenient to directly use the transformation offset relationships to calculate the target positions of the associated bone nodes, laying the foundation for improving data processing efficiency.

[0083] It should be noted that the jump-type transformation offset relationship is calculated based on all bone nodes between two bone nodes. For example, if bone node A is the parent node of bone node B, and bone node B is the parent node of bone node C, then the relationship between bone node A and bone node C is a jump-type parent-child relationship, and the corresponding transformation offset relationship is a jump-type transformation offset relationship, which is calculated based on bone node A, bone node B, and bone node C.

[0084] Alternatively, the linked bone nodes corresponding to a specified bone node can be determined through the tree structure corresponding to the skeletal model, thus simplifying the process of obtaining the current position and making it simple and easy to implement.

[0085] Optionally, the associated skeletal nodes with specified skeletal nodes can also be read from contiguous memory. That is, before calling multiple threads to obtain the current position of each linked skeletal node, the process also includes:

[0086] According to the adjustment parameters, the target storage point corresponding to the specified bone node is located in the contiguous memory corresponding to the bone model, wherein the contiguous memory contains multiple storage points;

[0087] Based on the parent-child relationship marked between the target storage point and the plurality of storage points, determine the plurality of associated bone nodes of the specified bone node.

[0088] Specifically, contiguous memory refers to memory that can store data contiguously, such as native contiguous memory. A storage point refers to a storage unit within contiguous memory.

[0089] In practical applications, for skeletal models, all bone nodes associated with the model's animation constraints are collected in descending order of the tree structure and stored in a contiguous block of memory. This reduces issues such as garbage collection (GC) and cache missing in managed memory. Cache missing refers to the inability to retrieve the required data from the cache, forcing the retrieval of data from the next lower-level cache, resulting in time consumption due to this back-and-forth process.

[0090] See Figure 3A , Figure 3A This is a tree structure diagram of a skeleton model provided in an embodiment of this application: that is, the original tree structure diagram of the skeleton model. It can be seen that skeleton node A is the root node, skeleton node B and skeleton node C are child nodes of skeleton node A, skeleton node D, skeleton node E and skeleton node F are child nodes of skeleton node B, and skeleton node G and skeleton node H are child nodes of skeleton node C.

[0091] After storing all skeletal nodes in a contiguous block of memory, the parent node of each skeletal node is recorded using an index, thus constructing a tree structure. In this way, converting discrete data into contiguous memory data and restoring the tree structure by recording the parent node using an index can significantly reduce cache missing during data access.

[0092] See Figure 3B , Figure 3A This is another tree structure diagram of a skeletal model provided in one embodiment of this application: that is, a tree structure diagram in which each bone node in the skeletal model is stored in contiguous memory, arranged as follows: Figure 3A The tree structure collects all skeletal nodes sequentially from top to bottom, i.e., from skeletal node A to skeletal node H. Each skeletal node is stored, and the parent-child relationship between each skeletal node is represented by an index, i.e., the arrows in the figure. That is, skeletal node A is the root node, skeletal nodes B and C are child nodes of skeletal node A, skeletal nodes D, E and F are child nodes of skeletal node B, and skeletal nodes G and H are child nodes of skeletal node C.

[0093] Based on this, the target storage point of a specified bone node can be located in the contiguous memory corresponding to the bone model by adjusting the parameters. Then, based on the parent node marked by the target storage point, i.e. the parent-child relationship, the storage points of multiple related bone nodes can be determined, i.e., multiple related bone nodes can be determined.

[0094] See Figure 3B Assuming the specified bone node corresponding to the adjusted parameters is bone node C, then the third storage point where bone node C is located is the target storage point. Since the target storage point C has a parent-child relationship with the first, seventh, and eighth storage points, the bone nodes A, G, and H corresponding to the first, seventh, and eighth storage points are respectively the associated bone nodes.

[0095] Optionally, when calling multiple threads, each thread can randomly process the tasks corresponding to each linked skeletal node, such as obtaining the current position of each linked skeletal node and calculating the target position.

[0096] Optionally, when invoking multithreading, an appropriate number of processing tasks for the linked skeletal nodes can be allocated to each thread based on the number of linked skeletal nodes and the number of threads. That is, before invoking multithreading to obtain the current position of each linked skeletal node, the process further includes:

[0097] Determine the first number of linked bone nodes corresponding to the specified bone node;

[0098] Based on the first quantity and the second quantity of the multi-threads, determine the corresponding linked skeleton nodes for each thread;

[0099] The invocation of multiple threads to obtain the current position of each linked skeletal node includes:

[0100] For each thread, obtain the current position of the linked skeletal node corresponding to the current thread.

[0101] Specifically, the first quantity refers to the number of linked skeletons; the second quantity refers to the number of threads in a multi-threaded system.

[0102] In practical applications, we can first determine the linked skeleton nodes corresponding to a specified skeleton node, as well as the first number of linked skeleton nodes. Then, the quotient of the first number and the second number of multiple threads is used as the third number of linked skeleton nodes corresponding to each thread. Based on the third number, the task of obtaining the current position of each linked skeleton node is assigned to each thread.

[0103] For example, if a given skeletal node has nine associated skeletal nodes—skeletal node 1 to skeletal node 9—and there are three threads in the multithreaded environment, thread one to thread three, then 9 / 3 = 3, meaning each thread corresponds to three skeletal nodes. In this case, according to the order of the associated skeletal nodes, skeletal nodes 1 to 3 are assigned to thread one, skeletal nodes 4 to 6 are assigned to thread two, and skeletal nodes 7 to 9 are assigned to thread three. That is, thread one obtains the current position of skeletal nodes 1 to 3, thread two obtains the current position of skeletal nodes 4 to 6, and thread three obtains the current position of skeletal nodes 7 to 9.

[0104] It should be noted that if the first quantity M cannot divide the second quantity N, such as 9 / 5, then the sum of the quotient of the first quantity M and the second quantity N of the multi-threaded network and 1 is determined as the third quantity L of the linked skeletal nodes corresponding to the first (N-1) threads. The difference between the first quantity M and the total number of linked skeletal nodes corresponding to the first (N-1) threads is determined as the fourth quantity of the linked skeletal nodes corresponding to the Nth thread. That is, the third quantity is M / N+1 and the fourth quantity is M-(M / N+1)(N-1).

[0105] For example, if there are 11 associated skeletal nodes and 4 threads, then the number of associated skeletal nodes corresponding to the first 3 threads is 3, and the number of associated skeletal nodes corresponding to the 4th thread is 2.

[0106] Step 206: Adjust the pose of each linked bone node according to its target position to obtain the updated bone model.

[0107] Optionally, pose refers to the general term for the posture, position, size, etc. of the associated skeletal nodes.

[0108] If there is only one specified skeletal node, the target position of each linked skeletal node is one. In this case, it is only necessary to adjust the pose of the linked skeletal node according to the target position. After traversing all linked skeletal nodes, the updated skeletal model is obtained.

[0109] When there are multiple specified skeletal nodes, each linked skeletal node has multiple target positions, meaning each target position includes multiple sub-target positions. In this case, the pose of the linked skeletal node can be adjusted sequentially according to the adjustment order of the sub-target positions. After traversing all linked skeletal nodes, an updated skeletal model is obtained. That is, when the target position includes multiple sub-target positions, the specific implementation process of adjusting the pose of each linked skeletal node according to its target position to obtain an updated skeletal model can be as follows:

[0110] For each linked skeletal node, identify the adjustment type corresponding to the position of each sub-target of the current linked skeletal node;

[0111] Based on the adjustment type, determine the adjustment order of each sub-target position;

[0112] Following the adjustment order, starting from the first sub-target position, the pose of the current linked bone node is adjusted according to the current sub-target position until the last sub-target position, resulting in the updated bone model.

[0113] Specifically, the adjustment types include translation, rotation, and scaling. The adjustment order refers to the order in which the positions of each sub-target are adjusted.

[0114] In practical applications, for each linked skeletal node, the adjustment type of each sub-target position of the current linked skeletal node can be identified first. Since different adjustment types have preset adjustment priorities, the adjustment priority of each sub-target position can be determined according to the preset first priority mapping relationship between the adjustment type and the adjustment priority. The higher the adjustment priority, the earlier the adjustment order. Then, based on the sub-target position with the highest adjustment priority (i.e., the sub-target position with the first adjustment order), the pose of the current linked skeletal node is adjusted; then, based on the sub-target position with the second highest update priority (i.e., the sub-target position with the second adjustment order), the pose of the current linked skeletal node is adjusted, and so on, until the pose of the current linked skeletal node is adjusted based on the sub-target position with the lowest update priority (i.e., the sub-target position with the last adjustment order). This process is repeated for all linked skeletal nodes to obtain the updated skeletal model. In this way, the reliability and accuracy of the skeletal model update can be improved.

[0115] In one or more optional embodiments described herein, the step of adjusting the pose of each linked bone node according to the target position of each linked bone node to obtain the updated bone model can be implemented as follows:

[0116] Based on the specified bone node and the parent-child relationship between each linked bone node, determine the leaf bone node corresponding to the specified bone node from among the linked bone nodes.

[0117] Based on the target position of the leaf bone node, adjust the pose of the leaf bone node to obtain the updated bone model.

[0118] Specifically, a leaf bone node is a bone node that does not have any child bone nodes.

[0119] In practical applications, a parent-child relationship is established between a specified skeletal node and each linked skeletal node. Based on this relationship, the leaf skeletal nodes within the linked skeletal nodes are determined. Then, the pose of the leaf skeletal nodes is adjusted according to their target positions to obtain the updated skeletal model. Because adjusting the leaf skeletal nodes also changes the poses of the associated skeletal nodes connected to the specified skeletal node, the data processing volume is reduced and the update efficiency is improved while updating the skeletal model.

[0120] See Figure 3C , Figure 3CThis is a schematic diagram illustrating the updating of a skeletal model according to an embodiment of this application. The skeletal model is a human skeletal model, with a designated skeletal node A. Associated skeletal nodes include skeletal nodes B, C, and D. Based on the parent-child relationships among skeletal nodes A, B, C, and D, skeletal node D is a leaf skeletal node. Therefore, the pose of skeletal node D is adjusted according to its target position, which in turn causes skeletal nodes C and B to undergo adaptive pose adjustments, resulting in the updated skeletal node. The target position of skeletal node D can be determined based on the target position of skeletal node A and the conversion offset relationship between skeletal nodes A and D, significantly reducing the amount of data computation.

[0121] Furthermore, when there are multiple skeletal models, multiple threads can be invoked to update each skeletal model.

[0122] The skeletal model update method provided in this application obtains adjustment parameters for specified bone nodes in the skeletal model; invokes multiple threads to obtain the current position of each linked bone node, and calculates the target position of each linked bone node based on the adjustment parameters, the obtained current positions of the linked bone nodes, and the skeletal constraint relationships, wherein the linked bone nodes have a linkage relationship with the specified bone node; and adjusts the pose of each linked bone node according to the target position of each linked bone node to obtain the updated skeletal model. By invoking multiple threads, the efficiency and accuracy of skeletal model updates can be improved.

[0123] The following is in conjunction with the appendix Figure 4 Taking the application of the skeletal model update method provided in this application to a game scene as an example, the skeletal model update method will be further explained. Among other things, Figure 4 This application provides a flowchart of a method for updating a skeletal model in a game scene, which includes the following steps:

[0124] Step 402: For a skeletal model in the game scene, according to the tree structure of the skeletal model, collect all the bone nodes associated with all model animation constraints in order from the top to the bottom, and organize them all into a contiguous native memory.

[0125] This can reduce issues such as GC and cache missing in managed memory.

[0126] Step 404: Record the parent node of each skeletal node using the Index to construct a tree structure, and record the transformation offset matrix of the skip-type parent-child nodes.

[0127] Among them, skip-type parent-child nodes refer to two nodes that are N-degree nodes to each other, where N is an integer greater than or equal to 2.

[0128] Step 406: Record the calculation data of different types of animation constraints into a contiguous native memory according to the same rules of the skeleton, and map them to the bone nodes through the index.

[0129] Step 408: Obtain the simplified local data after modifying the skeletal animation by parallelizing the Job.

[0130] The simplest local data is the data that needs to be read or adjusted later, which is the current position of each associated skeletal node.

[0131] Step 410: Calculate each animation constraint in the Job, optimize the calculation based on the LOD configuration, and calculate the target position based on the constraint configuration.

[0132] That is, for each linked bone node, the conversion offset relationship between the current linked bone node and the specified bone node is obtained according to the bone constraint relationship; based on the adjustment parameters and conversion offset relationship, as well as the current position of the current linked bone node, the target position of the current linked bone node is calculated.

[0133] In addition, updates can be made to the real-time skeletal nodes. The target position is calculated by recursively moving from child nodes to upper-level nodes in a tree structure using a tree-like structure, a jump-type parent-child node transformation offset matrix, and state flags.

[0134] Step 412: Minimize the number of skeletal nodes that need to be written, and write the final local simplified data.

[0135] That is, based on the specified skeletal node and the parent-child relationship between each linked skeletal node, the leaf skeletal node corresponding to the specified skeletal node is determined from each linked skeletal node; based on the target position of the leaf skeletal node, the pose of the leaf skeletal node is adjusted to obtain the updated skeletal model.

[0136] Steps 408 to 412 involve calculating the skeletal data affected by the constraints based on the adjustment parameters and writing the skeletal data into the corresponding skeletal nodes.

[0137] Furthermore, SIMD compilation optimizations such as SSE2 are added to the Job code to achieve HP C# multi-instruction set optimizations. The Job uses a thread pool to allocate the most appropriate number of threads for computations between different models based on the number of machine cores, maximizing parallelism. Specifically, a first number of linked skeletal nodes corresponding to a specified skeletal node is determined; based on the first number and the second number of threads, the linked skeletal nodes corresponding to each thread are determined; and for each thread, the current position of the linked skeletal node corresponding to the current thread is obtained.

[0138] It should be noted that the scheduling of the Job can also be controlled, and the execution order of the script can be controlled to ensure parallelism with the main thread. This reduces the mutual waiting time between the main thread and the Job thread.

[0139] In this way, by utilizing Unity's DOTS system and designing ingenious data structures and algorithms, HPC# performance is accelerated and optimized through multi-threading, greatly improving performance.

[0140] The skeletal model update method provided in this manual was tested and applied to a skeletal animation mapping system containing 12 mechs using the controlled variable method. The data before and after optimization using the skeletal model update method are as follows: before optimization, the average frame rate was 26.45, and the average frame time was 37.29ms; after optimization, the average frame rate was 33.65, and the average frame time was 29.23ms. It is evident that the optimization effect in actual project implementation is very significant, with the average frame rate increasing from 26.45 to 33.65, an improvement of 7.2 frames and an optimization of 8.06ms. Performance is greatly improved, with an optimization of 99.79%, enabling the final implementation of the skeletal animation constraint mapping system.

[0141] Corresponding to the above method embodiments, this application also provides embodiments of a skeletal model updating device. Figure 5 A schematic diagram of a skeletal model updating device according to an embodiment of this application is shown. Figure 5 As shown, the device includes:

[0142] The acquisition module 502 is configured to acquire adjustment parameters for a specified bone node in the skeletal model;

[0143] The calculation module 504 is configured to call multiple threads to obtain the current position of each linked skeletal node, and calculate the target position of each linked skeletal node based on the adjustment parameters, the obtained current position of the linked skeletal node and the skeletal constraint relationship, wherein the linked skeletal node has a linkage relationship with the specified skeletal node.

[0144] The adjustment module 506 is configured to adjust the pose of each linked bone node according to the target position of each linked bone node to obtain an updated bone model.

[0145] Optionally, the computing module 504 is further configured to:

[0146] For each linked bone node, based on the bone constraint relationship, obtain the transformation offset relationship between the current linked bone node and the specified bone node;

[0147] Based on the adjustment parameters and conversion offset relationship, as well as the current position of the current linked skeleton node, calculate the target position of the current linked skeleton node.

[0148] Optionally, there may be multiple designated skeletal nodes;

[0149] The computing module 504 is further configured to:

[0150] For each specified bone node, calculate the sub-target position of the current linked bone node based on the adjustment parameters and transformation offset relationship corresponding to the current specified bone node, as well as the current position of the current linked bone node.

[0151] According to the preset overlay strategy, the positions of multiple sub-targets are calculated to obtain the target position of the current linked skeletal node.

[0152] Optionally, the device further includes a building module configured to:

[0153] Based on the parent-child relationship of each bone node in the skeletal model, the transformation offset relationship between each bone node is constructed.

[0154] Optionally, the target location includes multiple sub-target locations;

[0155] The adjustment module 506 is further configured to:

[0156] For each linked skeletal node, identify the adjustment type corresponding to the position of each sub-target of the current linked skeletal node;

[0157] Based on the adjustment type, determine the adjustment order of each sub-target position;

[0158] Following the adjustment order, starting from the first sub-target position, the pose of the current linked bone node is adjusted according to the current sub-target position until the last sub-target position, resulting in the updated bone model.

[0159] Optionally, the device further includes a first determining module, configured to:

[0160] According to the adjustment parameters, the target storage point corresponding to the specified bone node is located in the contiguous memory corresponding to the bone model, wherein the contiguous memory contains multiple storage points;

[0161] Based on the parent-child relationship marked between the target storage point and the plurality of storage points, determine the plurality of associated bone nodes of the specified bone node.

[0162] Optionally, the adjustment module 506 is further configured to:

[0163] Based on the specified bone node and the parent-child relationship between each linked bone node, determine the leaf bone node corresponding to the specified bone node from among the linked bone nodes.

[0164] Based on the target position of the leaf bone node, adjust the pose of the leaf bone node to obtain the updated bone model.

[0165] Optionally, the device further includes a second determining module configured to:

[0166] Determine the first number of linked bone nodes corresponding to the specified bone node;

[0167] Based on the first quantity and the second quantity of the multi-threads, determine the corresponding linked skeleton nodes for each thread;

[0168] The computing module 502 is further configured to:

[0169] For each thread, obtain the current position of the linked skeletal node corresponding to the current thread.

[0170] The skeletal model updating device provided in this application obtains adjustment parameters for specified bone nodes in the skeletal model; invokes multiple threads to obtain the current position of each linked bone node, and calculates the target position of each linked bone node based on the adjustment parameters, the obtained current positions of the linked bone nodes, and the skeletal constraint relationships, wherein the linked bone nodes have a linkage relationship with the specified bone node; and adjusts the pose of each linked bone node according to the target position of each linked bone node to obtain the updated skeletal model. By invoking multiple threads, the efficiency and accuracy of skeletal model updating can be improved.

[0171] The above is a schematic scheme of a skeletal model updating device according to this embodiment. It should be noted that the technical solution of this skeletal model updating device and the technical solution of the above-described skeletal model updating method belong to the same concept. For details not described in detail in the technical solution of the skeletal model updating device, please refer to the description of the technical solution of the above-described skeletal model updating method.

[0172] Furthermore, the components in the device embodiment should be understood as functional modules necessary to implement each step of the program flow or method, and these functional modules are not actual functional divisions or separations. A device claim defined by such a set of functional modules should be understood as a functional module architecture that primarily implements the solution through the computer program described in the specification, and not as a physical device that primarily implements the solution through hardware.

[0173] Figure 6 A structural block diagram of a computing device according to an embodiment of this application is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.

[0174] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0175] In one embodiment of this application, the aforementioned components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0176] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 600 can also be a mobile or stationary server.

[0177] The processor 620 is used to execute computer-executable instructions for the bone model update method.

[0178] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described skeletal model update method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described skeletal model update method.

[0179] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used for a skeletal model update method.

[0180] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above-described skeletal model update method belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-described skeletal model update method.

[0181] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0182] An embodiment of this application also provides a chip that stores a computer program, which, when executed by the chip, implements the steps of the skeletal model update method.

[0183] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

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

[0185] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A method for updating a skeletal model, characterized in that, include: Get the adjustment parameters for a specified bone node in the skeletal model; Multithreading is invoked to obtain the current position of each linked bone node. For each linked bone node, the transformation offset relationship between the current linked bone node and the specified bone node is obtained according to the bone constraint relationship. Based on the adjustment parameters, the transformation offset relationship, and the current position of the current linked bone node, the target position of the current linked bone node is calculated. The linked bone node and the specified bone node have a linkage relationship. The transformation offset relationship refers to the relative offset relationship between the poses of two related bone nodes. Based on the target position of each linked skeletal node, the pose of each linked skeletal node is adjusted to obtain the updated skeletal model.

2. The method according to claim 1, characterized in that, There are multiple designated skeletal nodes; The step of calculating the target position of the current linked skeleton node based on the adjustment parameters and the conversion offset relationship, as well as the current position of the current linked skeleton node, includes: For each specified bone node, calculate the sub-target position of the current linked bone node based on the adjustment parameters and transformation offset relationship corresponding to the current specified bone node, as well as the current position of the current linked bone node. According to the preset overlay strategy, the positions of multiple sub-targets are calculated to obtain the target position of the current linked skeletal node.

3. The method according to claim 1 or 2, characterized in that, Before obtaining the conversion offset relationship between the current linked bone node and the specified bone node based on the bone constraint relationship, the method further includes: Based on the parent-child relationship of each bone node in the skeletal model, the transformation offset relationship between each bone node is constructed.

4. The method according to claim 1, characterized in that, The target location includes multiple sub-target locations; The step of adjusting the pose of each linked skeletal node according to its target position to obtain an updated skeletal model includes: For each linked skeletal node, identify the adjustment type corresponding to the position of each sub-target of the current linked skeletal node; Based on the adjustment type, determine the adjustment order of each sub-target position; Following the adjustment order, starting from the first sub-target position, the pose of the current linked bone node is adjusted according to the current sub-target position until the last sub-target position, resulting in the updated bone model.

5. The method according to any one of claims 1-2, characterized in that, Before calling multiple threads to obtain the current position of each linked skeletal node, the process also includes: According to the adjustment parameters, the target storage point corresponding to the specified bone node is located in the contiguous memory corresponding to the bone model, wherein the contiguous memory contains multiple storage points; Based on the parent-child relationship marked between the target storage point and the plurality of storage points, determine the plurality of linked bone nodes of the specified bone node.

6. The method according to any one of claims 1-2, characterized in that, The step of adjusting the pose of each linked skeletal node according to its target position to obtain an updated skeletal model includes: Based on the specified bone node and the parent-child relationship between each linked bone node, determine the leaf bone node corresponding to the specified bone node from among the linked bone nodes. Based on the target position of the leaf bone node, adjust the pose of the leaf bone node to obtain the updated bone model.

7. The method according to any one of claims 1-2, characterized in that, Before calling multiple threads to obtain the current position of each linked skeletal node, the process also includes: Determine the first number of linked bone nodes corresponding to the specified bone node; Based on the first quantity and the second quantity of the multi-threads, determine the corresponding linked skeleton nodes for each thread; The invocation of multiple threads to obtain the current position of each linked skeletal node includes: For each thread, obtain the current position of the linked skeletal node corresponding to the current thread.

8. A skeletal model updating device, characterized in that, include: The acquisition module is configured to acquire adjustment parameters for a specified bone node in the skeletal model; The calculation module is configured to call multiple threads to obtain the current position of each linked skeletal node. For each linked skeletal node, based on the skeletal constraint relationship, the transformation offset relationship between the current linked skeletal node and the specified skeletal node is obtained. Based on the adjustment parameters, the transformation offset relationship, and the current position of the current linked skeletal node, the target position of the current linked skeletal node is calculated. The linked skeletal node and the specified skeletal node have a linkage relationship. The transformation offset relationship refers to the relative offset relationship between the poses of two related skeletal nodes. The adjustment module is configured to adjust the pose of each linked bone node according to the target position of each linked bone node, so as to obtain an updated bone model.

9. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the skeletal model update method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the skeletal model update method according to any one of claims 1 to 7.