Virtual object attribute updating method and apparatus, electronic device, computer-readable storage medium, and computer program product

By splitting virtual object attribute data and utilizing multi-threaded parallel updates, the problem of low efficiency in updating virtual object attributes in virtual scenes is solved, achieving efficient and smooth virtual object interaction and a low-power consumption gaming experience.

WO2024217153A1PCT designated stage expired Publication Date: 2024-10-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/078753
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-21
Filing Date
2024-02-27
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

The existing technology has low efficiency in updating virtual object attributes in high-order virtual scenes, resulting in limited performance of game players' terminal hardware and obvious lagging problems.

Method used

By splitting the attribute data of virtual objects into multiple data fields and using multi-threads to perform data update tasks in parallel, the attribute update efficiency is improved, read-write conflicts are reduced, and parallel processing performance is optimized.

Benefits of technology

It significantly improves the efficiency and performance of virtual object attribute updates, achieves a smooth gaming experience for high-order virtual objects in the same virtual scene, and reduces power consumption and CPU usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078753_24102024_PF_FP_ABST
    Figure CN2024078753_24102024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a virtual object attribute updating method and apparatus, an electronic device, a computer-readable storage medium and a computer program product. The method comprises: acquiring attribute data of each attribute of a plurality of virtual objects in a virtual scene; separately calling a main thread corresponding to each attribute, so as to split the attribute data of each attribute into at least two attribute data fields, and to create a data updating task for each attribute data field, wherein each attribute data field corresponds to one splitting dimension, and the data updating tasks are used for instructing updating of the attribute data fields; in respect of each attribute, calling a task thread corresponding to each splitting dimension of the attribute, and executing in parallel the data updating task for each attribute data field, so as to obtain a plurality of updated attribute data fields; and, on the basis of the plurality of updated attribute data fields, updating the attribute of each virtual object.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device, computer-readable storage medium, and computer program product for updating virtual object attributes

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202310461034X and application date April 21, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for updating attributes of a virtual object. Background Art

[0004] With the development of computer technology, electronic devices can realize richer and more vivid virtual scenes. Virtual scenes are digital scenes created by computers through digital communication technology. Users can experience complete or partial virtualization of visual and auditory senses in virtual scenes, and can also control objects in the virtual scenes to interact and obtain feedback.

[0005] In related technologies, when updating the attributes of virtual objects, a serial traversal method is usually used to update the attributes of each virtual object in a virtual scene one by one, which results in low efficiency in updating the attributes of virtual objects.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for updating the attributes of a virtual object, which can effectively improve the efficiency of updating the attributes of a virtual object.

[0008] The technical solution of the embodiment of the present application is implemented as follows:

[0009] The present invention provides a method for updating the attributes of a virtual object, including:

[0010] Acquiring attribute data of various attributes of multiple virtual objects in a virtual scene;

[0011] respectively calling the main thread corresponding to each of the attributes, splitting the attribute data of each of the attributes into at least two attribute data fields, and creating a data update task for each of the attribute data fields;

[0012] Each of the attribute data fields corresponds to a split dimension, and the data update task is used to instruct to update the attribute data field;

[0013] For each of the attributes, calling the task threads corresponding to each of the split dimensions of the attribute, executing the data update tasks of each of the attribute data fields in parallel, and obtaining a plurality of updated attribute data fields;

[0014] Based on the updated multiple attribute data fields, the attributes of each virtual object are updated.

[0015] An embodiment of the present application provides a device for updating attributes of a virtual object, comprising:

[0016] an acquisition module configured to acquire attribute data of various attributes of a plurality of virtual objects in a virtual scene;

[0017] a split creation module configured to respectively call the main thread corresponding to each of the attributes, split the attribute data of each attribute into at least two attribute data fields, and create a data update task for each of the attribute data fields; wherein each of the attribute data fields corresponds to a split dimension, and the data update task is used to instruct to update the attribute data field;

[0018] an execution module configured to, for each of the attributes, call a task thread corresponding to each of the split dimensions of the attribute, and execute data update tasks of each of the attribute data fields in parallel to obtain a plurality of updated attribute data fields;

[0019] The updating module is configured to update the attributes of each virtual object based on the updated multiple attribute data fields.

[0020] An embodiment of the present application provides an electronic device, including:

[0021] a memory configured to store computer-executable instructions or computer programs;

[0022] The processor is configured to implement the attribute updating method of the virtual object provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0023] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute and implement the attribute updating method of a virtual object provided in the embodiment of the present application.

[0024] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual object attribute update method described in the embodiment of the present application.

[0025] The embodiments of the present application have the following beneficial effects:

[0026] The main threads corresponding to the attributes of multiple virtual objects in the virtual scene are called respectively, the attribute data of the corresponding attributes are split into at least two attribute data fields, and a data update task for each attribute data field is created. Then, for each attribute, the task threads corresponding to each split dimension of the attribute are called, and the data update tasks of each attribute data field are executed in parallel, thereby updating the attributes of the virtual object based on the updated multiple attribute data fields. In this way, (1) by calling the main thread of each attribute, the attribute data of each attribute is split into attribute data fields, and the attribute update tasks of each attribute data field are executed in parallel by the task threads of each split dimension, so as to update the attributes of the virtual object based on the updated attribute data fields, thereby effectively improving the attribute update efficiency of the virtual object. (2) by calling the main thread of each attribute, the attribute data of each attribute is split into at least two attribute data fields, so that when at least two task threads execute the data update tasks for the same attribute data field in parallel, the possibility of different attribute data fields corresponding to different data update tasks is greatly increased, thereby reducing the occurrence of read and write conflicts caused by multiple parallel data update tasks updating the same attribute data field, improving the performance of parallel processing, and further improving the attribute update efficiency of the virtual object. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG1 is a schematic diagram of the architecture of a virtual object attribute update system provided in an embodiment of the present application;

[0028] FIG2 is a schematic structural diagram of an electronic device for updating attributes of a virtual object provided by an embodiment of the present application;

[0029] 3 to 5 are schematic flow charts of a method for updating attributes of a virtual object provided in an embodiment of the present application;

[0030] FIG6 is a schematic diagram of an interface of a virtual scene provided in an embodiment of the present application;

[0031] 7 to 9 are schematic diagrams showing the principles of a method for updating attributes of a virtual object provided in an embodiment of the present application;

[0032] FIG10 is a flow chart of a method for updating attributes of a virtual object according to an embodiment of the present application;

[0033] 11 to 14 are schematic diagrams showing the principles of a method for updating attributes of a virtual object provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0035] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0036] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0038] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0039] 1) Virtual scene: This is a virtual scene displayed or provided when an application is running on a terminal. The virtual scene can be a simulation of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiments of the present application do not limit the dimensions of the virtual scene. For example, the virtual scene can include the sky, land, ocean, etc. The land can include environmental elements such as deserts and cities, and users can control virtual objects to move in the virtual scene.

[0040] 2) Virtual Objects: Images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. These movable objects can be virtual people, virtual animals, animated characters, etc., such as people, animals, plants, oil drums, walls, rocks, etc. displayed in a virtual scene. A virtual object can be a virtual avatar in the virtual scene that represents the user. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the space within the virtual scene. Optionally, the virtual object can be a user character controlled through client operations, an artificial intelligence (AI) trained to play in a virtual scene, or a non-player character (NPC) set up for virtual scene interaction. Optionally, the virtual object can be a virtual person engaging in adversarial interaction in the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene can be pre-set or dynamically determined based on the number of clients participating in the interaction.

[0041] 3) Virtual objects: These refer to objects that are moving or stationary in a virtual scene. Moving virtual objects include animals, vehicles, and people in the virtual scene. Stationary virtual objects include walls, rocks, and the ground in the virtual scene.

[0042] 4) Virtual Engine: A virtual engine refers to some already-written editable computer virtual systems or core components of some interactive real-time graphics applications. These systems provide virtual scene designers with various tools needed to write virtual scenes. The purpose is to enable designers to write programs easily and quickly. Virtual engines include rendering engines (rendering engines include two-dimensional rendering engines and three-dimensional rendering engines), physics engines, collision detection engines, sound engines, script engines, animation engines, artificial intelligence engines, network engines, and scene management engines.

[0043] 5) Virtual Events: Events that occur in a virtual scene, such as the appearance of a specific virtual object at point A in the virtual scene, or the appearance of two specific virtual objects at point A in the virtual scene, with the two specific virtual objects interacting. Virtual events are composed of multiple meta-events or visual all-embedded events. Filter conditions can be set for each meta-event or visual all-embedded event within a virtual event. Alternatively, filter conditions can be set for a single meta-event or visual all-embedded event to form a virtual event.

[0044] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0045] With the development of gaming technology, the number of players connected to the game and the number of virtual objects controlled by the players in scenarios such as open world games, strategy games (SLGs), and user interaction spaces in virtual reality have increased exponentially, and the pressure to update the attributes of each virtual object in the same virtual scene has also increased. In related technologies, for updating the attributes of virtual objects, a serial traversal method is usually used to update the attributes of each virtual object in the virtual scene one by one. This results in low efficiency in updating the attributes of virtual objects. Due to the limitations of the player terminal hardware performance, when the attribute update efficiency is low, the related technology will experience obvious lag when playing games with a large number of players (thousands or tens of thousands) or virtual objects in the same virtual scene.

[0046] Embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for updating the attributes of a virtual object, which can effectively improve the efficiency of updating the attributes of a virtual object. The following describes an exemplary application of the virtual object attribute update system provided by the embodiments of the present application.

[0047] See Figure 1, which is a schematic diagram of the architecture of a virtual object attribute update system 100 provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 through a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0048] The terminal 400 is used for the user to use the client 410 and display virtual objects on a graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0049] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a virtual reality device, a smart watch, a car terminal, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.

[0050] In some embodiments, the server 200 sends attribute data of each attribute of multiple virtual objects in the virtual scene to the terminal 400, and the terminal 400 obtains the attribute data of each attribute of the multiple virtual objects in the virtual scene, calls the main thread corresponding to each of the attributes respectively, splits the attribute data of each attribute into at least two attribute data fields, and creates a data update task for each attribute data field. For each attribute, the task thread corresponding to each split dimension of the attribute is called, and the data update task of each attribute data field is executed in parallel to obtain multiple updated attribute data fields. Based on the updated multiple attribute data fields, the attributes of each virtual object are updated.

[0051] In other embodiments, the terminal 400 sends attribute data of each attribute of multiple virtual objects in the virtual scene to the server 200. The server 200 obtains the attribute data of each attribute of the multiple virtual objects in the virtual scene, calls the main thread corresponding to each attribute respectively, splits the attribute data of each attribute into at least two attribute data fields, and creates a data update task for each attribute data field. For each attribute, the task thread corresponding to each split dimension of the attribute is called, and the data update task of each attribute data field is executed in parallel to obtain multiple updated attribute data fields. Based on the updated multiple attribute data fields, the attributes of each virtual object are updated.

[0052] In other embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources.

[0053] Referring to Figure 2, Figure 2 is a schematic diagram of the structure of an electronic device 500 for updating the attributes of a virtual object provided in an embodiment of the present application, wherein the electronic device 500 shown in Figure 2 can be the server 200 or the terminal 400 in Figure 1, and the electronic device 500 shown in Figure 2 includes: at least one processor 410, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together through a bus system 440. It can be understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 440 in Figure 2.

[0054] In some embodiments, the virtual object attribute update device provided in the embodiments of the present application can be implemented in software. FIG2 shows a virtual object attribute update device 455 stored in memory 450. The device 455 can be software in the form of a program or plug-in, and includes the following software modules: an acquisition module 4551, a split creation module 4552, an execution module 4553, and an update module 4554. These modules are logical and can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0055] In other embodiments, the attribute update device of the virtual object provided in the embodiments of the present application can be implemented in hardware. As an example, the attribute update device of the virtual object provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the attribute update method of the virtual object provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.

[0056] In some embodiments, the terminal or server can implement the attribute update method of the virtual object provided by the embodiment of the present application by running a computer program or a computer executable instruction. For example, the computer program can be a native program (for example, a dedicated attribute update program for virtual objects) or a software module in the operating system, for example, a virtual object attribute update module that can be embedded in any program (such as an instant messaging client, an album program, an electronic map client, a navigation client); for example, it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0057] The attribute updating method of the virtual object provided in the embodiment of the present application will be described in combination with the exemplary application and implementation of the server or terminal provided in the embodiment of the present application.

[0058] Refer to Figure 3, which is a flow chart of the attribute update method of a virtual object provided in an embodiment of the present application. It will be explained in conjunction with steps 101 to 104 shown in Figure 3. The attribute update method of a virtual object provided in an embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following will be explained using the example of the terminal alone implementing it.

[0059] In step 101 , attribute data of various attributes of a plurality of virtual objects in a virtual scene is obtained.

[0060] In some embodiments, the above step 101 can be implemented by: obtaining object data of each of multiple virtual objects in the virtual scene, and multiple attributes of each virtual object; for each object data, dividing the object data into attribute data of each attribute.

[0061] In some embodiments, each virtual object has its own object data, the object data of different virtual objects are different, each virtual object has multiple attributes, the multiple attributes of different virtual objects are the same, the attribute data of multiple attributes of different virtual objects are different, and the attribute data of one attribute of a virtual object is at least one.

[0062] As an example, referring to FIG6 , which is a schematic diagram of an interface of a virtual scene provided in an embodiment of the present application, attribute data of various attributes of multiple virtual objects (e.g., virtual object 61 and virtual object 62) in the virtual scene shown in FIG6 is obtained. As an example, the multiple attributes of the virtual objects include, but are not limited to, combat attributes, movement attributes, basic attributes, transformation attributes, and animation attributes.

[0063] As an example, refer to Figure 7, which is a schematic diagram of the principle of the attribute updating method of the virtual object provided in an embodiment of the present application. The multiple attributes of the virtual object include combat attributes, movement attributes, basic attributes, conversion attributes and animation attributes, wherein the attribute data of the combat attributes include virtual object data, virtual object status data, and virtual object skill data; the attribute data of the movement attributes include movement animation data, movement status data, and steering data; the attribute data of the basic attributes include label data, unit owner data, grouped unit data, and attribute data; the attribute data of the conversion attributes include local to world matrix, non-uniform scale, translation, rotation, position, etc.; the attribute data of the animation attributes include animator, animation speed, etc.

[0064] In other embodiments, the above step 101 may be implemented in the following manner: obtaining multiple virtual objects in the virtual scene and multiple attributes of the virtual objects, and obtaining attribute data of each attribute of the virtual object for each virtual object.

[0065] In this way, by obtaining the attribute data of each attribute of multiple virtual objects in the virtual scene, it is convenient to update the attribute data later, thereby realizing the update of the attributes of each virtual object. By organizing multiple virtual objects through attribute data, there is no need to update each virtual object separately, thereby effectively improving the efficiency of virtual object attribute update.

[0066] In step 102, the main thread corresponding to each attribute is called respectively, the attribute data of each attribute is split into at least two attribute data fields, and a data update task is created for each attribute data field.

[0067] Each attribute data field corresponds to a split dimension, and the data update task of the attribute data field is used to instruct to update the attribute data field.

[0068] In some embodiments, before executing the above step 102, the state of the main thread can also be set to the initialization state in the following way: obtain multiple main threads arranged in order of priority, one main thread corresponds to one attribute, and one attribute corresponds to at least one main thread; set the state of each main thread to the initialization state in order of priority.

[0069] It should be noted that each main thread has a corresponding priority. The priority of a main thread indicates the priority with which the main thread executes tasks and processes specific to the main thread. One main thread corresponds to one attribute, but one attribute can correspond to at least one main thread. Therefore, the status of each main thread can be set to the initialization state in the order indicated by the priority.

[0070] As an example, refer to Figure 8, which is a schematic diagram of the principle of the attribute update method of the virtual object provided by an embodiment of the present application. A plurality of main threads arranged in order of priority are obtained (main thread 1, main thread 2, main thread 3, main thread 4 and main thread 5 as shown in Figure 8, wherein main thread 1 has the highest priority and main thread 5 has the lowest priority). Main thread 1 corresponds to the basic attributes of the virtual object, main thread 2 corresponds to the marching attributes of the virtual object, main thread 3 corresponds to the combat attributes of the virtual object, main thread 4 corresponds to the physical attributes of the virtual object, and main thread 5 corresponds to the combat attributes of the virtual object. One main thread corresponds to one attribute. The basic attributes of the virtual object correspond to main thread 1, the combat attributes of the virtual object correspond to main thread 3 and main thread 5, and one attribute corresponds to at least one (one or more than one) main thread. In order of priority, the states of main thread 1, main thread 2, main thread 3, main thread 4 and main thread 5 are set to the initialization state.

[0071] In some embodiments, the above step 102 can be implemented as follows: when the state of the main thread has been set to the initialization state, the target attribute corresponding to the main thread is determined from the attributes of multiple virtual objects, and the main thread is called to split the attribute data of the target attribute into at least two attribute data fields. It should be noted that when the state of the main thread is set to the initialization state, the attribute data can be split; in some examples, in the process of setting the state of each main thread in turn, the main thread whose state is set to the initialization state can split the attribute data. In this way, the efficiency of the main thread in splitting the attribute data can be improved, thereby improving the efficiency of the attribute update of the virtual object.

[0072] As an example, referring to FIG8 , in the process of sequentially setting the states of main thread 1, main thread 2, main thread 3, main thread 4, and main thread 5, when the state of main thread 1 has been set to the initialization state, the target attribute (basic attribute) corresponding to main thread 1 is determined from the various attributes (basic attributes, physical attributes, combat attributes, and marching attributes) of multiple virtual objects, and main thread 1 is called to split the attribute data of the basic attribute into at least two attribute data fields. When the state of main thread 2 has been set to the initialization state, the target attribute (marching attribute) corresponding to main thread 2 is determined from the various attributes (basic attributes, physical attributes, combat attributes, and marching attributes) of multiple virtual objects, and main thread 2 is called to split the attribute data of the marching attribute into at least two attribute data fields.

[0073] As an example, the attribute data of the basic attribute may be "dxwedwef", and the main thread 2 is called to split the attribute data "dxwedwef" of the basic attribute into an attribute data field "dxw" and an attribute data field "edwef".

[0074] In some embodiments, the above-mentioned acquisition of multiple main threads sorted in order of priority can be achieved in the following manner: obtaining the attribute priority of each attribute; for each attribute, creating at least one main thread corresponding to the attribute, and determining the attribute priority of the attribute as the priority of each main thread corresponding to the attribute; arranging each main thread in order of priority of each main thread to obtain multiple main threads arranged in order of priority.

[0075] It should be noted that one main thread corresponds to one attribute, and one attribute corresponds to at least one main thread. This can be achieved by creating at least one main thread corresponding to each attribute, determining the attribute priority of the attribute as the priority of each main thread corresponding to the attribute, and arranging the main threads in order of priority to obtain multiple main threads arranged in order of priority. Here, the priority of the main thread is actually the attribute priority of the attribute corresponding to the main thread. In this way, when the main thread of each attribute is called for processing based on the priority, processing can be achieved according to the attribute priority of the attribute.

[0076] In some embodiments, the attribute priority is positively correlated with the degree of influence of the attribute data of the corresponding attribute on the virtual object. The greater the influence of the attribute data on the virtual object, the higher the attribute priority of the attribute, and the smaller the influence of the attribute data on the virtual object, the lower the attribute priority of the attribute. In this way, the attribute data of the attribute with the higher degree of influence can be prioritized, thereby improving the timeliness of the attribute update of the virtual object.

[0077] As an example, referring to FIG8 , the attribute priority of the attribute is obtained. For example, the attribute priority of the basic attribute is the highest, the attribute priority of the physical attribute is the second highest, the attribute priority of the combat attribute is the second lowest, and the attribute priority of the marching attribute is the lowest. Create a main thread 1 corresponding to the basic attribute, create a main thread 2 corresponding to the physical attribute, create main threads 3 and 4 corresponding to the combat attribute, and create a main thread 5 corresponding to the marching attribute. The attribute priority corresponding to the attribute is determined as the priority of each main thread corresponding to the attribute. For example, the attribute priority of the basic attribute: the highest level is determined as the priority of the main thread 1 corresponding to the basic attribute, the attribute priority of the physical attribute: the second highest level is determined as the priority of the main thread 2 corresponding to the physical attribute, and the attribute priority of the combat attribute: the second lowest level is determined as the priority of the main thread 3 and main thread 4 corresponding to the combat attribute. Arrange the main threads in order of priority to obtain multiple main threads (main thread 1, main thread 2, main thread 3, and main thread 4) arranged in order of priority.

[0078] In some embodiments, the above-mentioned setting the status of each main thread to the initialization state in order of priority can be achieved as follows: setting the status of the first main thread among multiple main threads to the initialization state, the first main thread being the main thread with the highest priority among the multiple main threads; traversing i to perform the following processing: when the i-th main thread among the multiple main threads completes splitting the attribute data field of the attribute, setting the status of the i+1-th main thread to the initialization state.

[0079] In some embodiments, the priority of the i-th main thread is greater than or equal to the priority of the i+1-th main thread, i is a positive integer not less than 1, and i is less than or equal to N-1, where N is the total number of main threads.

[0080] As an example, the state of the first main thread is set to the initialization state. The first main thread is the main thread with the highest priority. When the first main thread completes splitting the attribute data field of the corresponding attribute, the state of the second main thread is set to the initialization state. When the second main thread completes splitting the attribute data field of the corresponding attribute, the state of the third main thread is set to the initialization state. When the third main thread completes splitting the attribute data field of the corresponding attribute, the state of the fourth main thread is set to the initialization state.

[0081] As an example, referring to FIG8 , when main thread 1 completes splitting the attribute data fields of the corresponding attributes, the state of main thread 2 is set to the initialization state. When the state of main thread 2 has been set to the initialization state, the target attribute corresponding to main thread 2 is determined from the attributes of multiple virtual objects (basic attributes, physical attributes, combat attributes, and marching attributes), and main thread 2 is called to split the attribute data of the basic attribute into at least two attribute data fields. When main thread 2 completes splitting the attribute data fields of the corresponding attributes, the state of main thread 3 is set to the initialization state.

[0082] In this way, by serially executing each main thread according to priority, the splitting of the attribute data field and the creation of the data update task are completed. Since the priority is determined according to the attribute priority of each attribute, and since the attribute priority is positively correlated with the degree of influence of the attribute data corresponding to the corresponding attribute on the virtual object, the greater the degree of influence of the attribute data, the higher the priority of the corresponding main thread in executing the splitting of the attribute data field and the creation of the data update task. According to the execution order of the main thread determined by the degree of influence, the attribute data corresponding to the attribute with a large degree of influence can be processed first, thereby effectively improving the timeliness of the attribute update of the virtual object.

[0083] In some embodiments, referring to FIG4 , FIG4 is a flow chart of a method for generating virtual events provided in an embodiment of the present application. Step 102 shown in FIG3 , "respectively calling the main thread corresponding to each attribute and splitting the attribute data of each attribute into at least two attribute data fields," can be implemented by executing steps 1021 to 1022 shown in FIG4 for each main thread.

[0084] In step 1021 , at least two splitting dimensions of the attributes corresponding to the main thread are obtained.

[0085] In some embodiments, the splitting dimensions include different splitting dimensions such as data type dimension and data function dimension. The specific type of splitting dimension and the number of splitting dimensions do not constitute a limitation on the embodiments of the present application.

[0086] In step 1022 , the main thread is called to split the attribute data of the attribute corresponding to the main thread into attribute data fields corresponding to each splitting dimension according to at least two splitting dimensions.

[0087] In some embodiments, each data in the attribute data field belongs to the same splitting dimension, and different splitting dimensions correspond to different attribute data fields. Each attribute has at least two corresponding splitting dimensions.

[0088] As an example, referring to FIG8 , main thread 1 is called to split the attribute data of the basic attributes corresponding to main thread 1 into attribute data fields corresponding to each splitting dimension according to at least two splitting dimensions. As an example, referring to FIG8 , main thread 2 is called to split the attribute data of the basic attributes corresponding to main thread 2 into attribute data fields corresponding to each splitting dimension according to at least two splitting dimensions.

[0089] After the attribute data of each attribute is split into at least two attribute data fields, a data update task is created for each attribute data field. In some embodiments, each attribute data field corresponds to a split dimension, and the data update task is used to instruct to update the corresponding attribute data field.

[0090] As an example, referring to FIG8 , the attribute data of the basic attributes corresponding to the main thread 1 are split into attribute data fields corresponding to split dimensions A, split dimensions B, split dimensions C and split dimensions D, respectively. A data update task 11 is created for the attribute data field corresponding to split dimension A, a data update task 12 is created for the attribute data field corresponding to split dimension B, a data update task 13 is created for the attribute data field corresponding to split dimension C, and a data update task 14 is created for the attribute data field corresponding to split dimension D.

[0091] As an example, referring to FIG8 , the attribute data of the basic attributes corresponding to the main thread 3 are split into attribute data fields corresponding to split dimensions A, B, C, D and E, respectively, according to split dimensions A, B, C, D and E. A data update task 31 is created for the attribute data field corresponding to split dimension A, a data update task 32 is created for the attribute data field corresponding to split dimension B, a data update task 33 is created for the attribute data field corresponding to split dimension C, and a data update task 34 is created for the attribute data field corresponding to split dimension D.

[0092] In this way, by calling the main thread, each attribute data of the attribute corresponding to the main thread is split into attribute data fields corresponding to each splitting dimension according to at least two splitting dimensions, so as to facilitate the subsequent creation of data update tasks for each attribute data field. Since the attribute data field is a subset of the attribute data, by splitting the attribute data, not only the data update amount of the data update task is effectively reduced and the execution efficiency of the data update task is improved, but also different data update tasks can update different attribute data fields of the same attribute data separately when updating the same attribute data, thereby effectively avoiding the possibility of update conflicts when updating the same attribute data.

[0093] In step 103, for each attribute, the task threads corresponding to each split dimension of the attribute are called to execute the data update tasks of each attribute data field in parallel to obtain a plurality of updated attribute data fields.

[0094] It should be noted that one split dimension corresponds to one task thread, and one task thread corresponds to at least one split dimension. Each task thread is executed in parallel.

[0095] As an example, see Figure 8. For the basic attributes, task thread one corresponding to split dimension A and split dimension B is called, and task thread two corresponding to split dimension C and split dimension D is called. Task thread one and task thread two are executed in parallel. When task thread one executes data update task 11, task thread two executes data update task 13 and data update task 14. When task thread two executes data update task 14, task thread one executes data update task 11 and data update task 12. When task thread one executes data update task 12, task thread two executes data update task 14.

[0096] In some embodiments, before executing the above step 103, the target task thread can also be determined in the following manner: create a target number of task threads; perform the following processing for each attribute: obtain the number of dimensions of the splitting dimension of the attribute; divide the number of dimensions by the target number to obtain the division result; based on the division result, determine the target task thread corresponding to each splitting dimension of the attribute from the target number of task threads.

[0097] In some embodiments, the target number of task threads is less than the maximum number of concurrent threads that the hardware device can carry. The specific setting of the target number does not constitute a limitation of the embodiments of the present application. In this way, the effect of concurrent execution of task threads can be guaranteed and the resource utilization of the hardware device can be improved.

[0098] As an example, referring to FIG8 , two task threads (task thread 1 and task thread 2 shown in FIG8 ) are created to perform the following processing on the basic attribute: obtain the number of dimensions (4) of the split dimension corresponding to the basic attribute, divide the number of dimensions (4) by the target number (2) to obtain the division result (2), and based on the division result, determine the target task threads corresponding to each split dimension of the basic attribute from task thread 1 and task thread 2 (the target task thread corresponding to data update task 11 and data update task 12 is task thread 1, and the target task thread corresponding to data update task 13 and data update task 14 is task thread 2).

[0099] In some embodiments, the above step 103 can also be implemented in the following manner: for each attribute, call the target task thread corresponding to each split dimension of the attribute, execute the data update task of each attribute data field in parallel, and obtain multiple updated attribute data fields.

[0100] As an example, referring to FIG8 , for the basic attributes, task thread one and task thread two corresponding to each split dimension of the basic attributes are called to execute the data update tasks of each attribute data field in parallel (task thread one executes data update task 11 and data update task 12, task thread two executes data update task 13 and data update task 14).

[0101] In some embodiments, the above-mentioned determination of the target task threads corresponding to each split dimension of the attribute from multiple task threads based on the division result can be achieved as follows: when the value of the division result is less than 1, a task thread is assigned to each split dimension, and different split dimensions are assigned different task threads; when the value of the division result is greater than or equal to 1, a task thread is assigned to each split dimension, and the difference between the number of split dimensions assigned to a task thread and the division result is less than a difference threshold; the task thread assigned to each split dimension is determined as the target task thread corresponding to each split dimension. In this way, the reasonable allocation of task threads can be achieved, making the execution efficiency of the data update task higher.

[0102] As an example, referring to FIG8 , the following processing is performed on the basic attribute: the number of dimensions (4) of the split dimension corresponding to the basic attribute is obtained, the number of dimensions (4) is divided by the target number (2), and a division result (2) is obtained. When the value of the division result is greater than 1, a task thread is assigned to each split dimension. The difference between the number of split dimensions assigned to a task thread and the division result is less than the difference threshold. Among them, the number of split dimensions assigned to task thread one is 2, the number of split dimensions assigned to task thread two is 2, the target task thread corresponding to data update task 11 and data update task 12 is task thread one, and the target task thread corresponding to data update task 13 and data update task 14 is task thread two.

[0103] In this way, by determining the target task threads corresponding to each splitting dimension of the attribute from multiple task threads, the data update tasks are evenly distributed to different task threads, so that the efficiency of different target task threads in processing data update tasks in parallel is more efficient, thereby effectively improving the concurrent execution efficiency of task threads.

[0104] In some embodiments, referring to FIG. 5 , FIG. 5 is a flowchart of a method for generating a virtual event provided in an embodiment of the present application. Step 103 shown in FIG. 3 can be implemented by executing steps 1031 to 1032 shown in FIG. 5 for each task thread.

[0105] In step 1031, when the attribute data field corresponding to the data update task executed by the task thread is the same as the attribute data field corresponding to the data update task executed by other task threads different from the task thread, the same attribute data field is backed up to obtain a backup attribute data field.

[0106] In some embodiments, when the attribute data field corresponding to the data update task currently executed by the task thread is different from the attribute data field corresponding to the data update task currently executed by other task threads, the task thread and the other task threads continue to execute the corresponding data update tasks concurrently.

[0107] In some embodiments, when the attribute data field corresponding to the data update task currently executed by the task thread is the same as the attribute data field corresponding to the data update task currently executed by other task threads, that is, a conflict still occurs between two different task threads. The same attribute data field is backed up to obtain a backup attribute data field. Through the backup attribute data field and the attribute data field, the data update tasks corresponding to the task thread and the other task threads are supported respectively, thereby effectively avoiding read and write conflicts caused by the task thread and the other task threads performing different data update tasks for the same attribute data field.

[0108] In step 1032, the task thread and other task threads are called to execute the data update task of the attribute data field in parallel based on the attribute data field and the backup attribute data field to obtain an updated attribute data field.

[0109] In some embodiments, the data update task includes at least one of a read task for reading the attribute data field and a write task for writing the attribute data field.

[0110] In some embodiments, the above step 1032 can be implemented as follows: in the process of a task thread executing a write task for an attribute data field, when there is a read task for the attribute data field, other task threads are called to execute the read task corresponding to the backup attribute data field; in the process of a task thread executing a read task for an attribute data field, when there is a write task for the attribute data field, other task threads are called to execute the write task corresponding to the backup attribute data field.

[0111] As an example, referring to FIG8 , when task thread one is executing a write task for an attribute data field, when there is a read task for the attribute data field, task thread two is called to execute a read task corresponding to the backup attribute data field; when task thread one is executing a read task for an attribute data field, when there is a write task for the attribute data field, task thread two is called to execute a write task corresponding to the backup attribute data field.

[0112] In this way, when a task thread executes a write task or a read task for an attribute data field, when there is a read task or a write task for an attribute data field, other task threads are called to execute a read task or a write task corresponding to a backup attribute data field, thereby backing up the same attribute data field and obtaining a backup attribute data field. Through the backup attribute data field and the attribute data field, the data update tasks corresponding to the task thread and other task threads are supported respectively, thereby effectively avoiding read and write conflicts caused by the task thread and other task threads performing different data update tasks for the same attribute data field.

[0113] In some embodiments, in the process of updating the attributes of each virtual object, the main thread corresponding to each attribute is called respectively to create re-update tasks for each of the updated multiple attribute data fields; for each attribute, the task thread corresponding to each split dimension of the attribute is called, and the re-update tasks corresponding to the updated multiple attribute data fields are executed in parallel to obtain multiple attribute data fields after re-update; based on the multiple attribute data fields after re-update, the attributes of each virtual object are updated again.

[0114] In some embodiments, during the process of updating the attributes of each virtual object, the main thread corresponding to the attribute can be called separately without waiting for the attribute update of the virtual object to be completed, and the task of re-updating the attribute data field can be created and executed to obtain multiple attribute data fields after re-updating. After the attribute update of each virtual object is completed, the attributes of each virtual object can be updated again based on the multiple attribute data fields after re-updating.

[0115] In this way, in the process of updating the attributes of each virtual object, there is no need to wait for the attribute update of the virtual object to be completed. Instead, the main thread corresponding to the attribute can be called separately to create and execute the task of updating the attribute data field again, thereby effectively improving the efficiency of the iterative update of the attributes of the virtual object.

[0116] In step 104 , the attributes of each virtual object are updated based on the updated plurality of attribute data fields.

[0117] In some embodiments, the above step 104 can be implemented in the following manner: based on the updated multiple attribute data fields, the attributes of each virtual object are updated and rendered to obtain a virtual object with updated attributes.

[0118] In some embodiments, in the process of calling the task threads corresponding to each splitting dimension and executing the data update tasks of each attribute data field in parallel, the scene elements other than virtual objects in the virtual scene can be updated in the following manner: obtaining the scene element data of the scene elements other than virtual objects in the virtual scene; calling the main thread corresponding to the scene element to update the scene element data to obtain the updated scene element data; and updating the scene element based on the updated scene element data.

[0119] In this way, by calling the task threads corresponding to each split dimension and executing the data update tasks of each attribute data field in parallel, the scene elements other than virtual objects in the virtual scene are updated in parallel, thereby achieving full coverage of parallel updates of all virtual elements in the virtual scene, thereby effectively improving the update efficiency of the virtual scene.

[0120] By applying the above embodiment, the main threads corresponding to the attributes of multiple virtual objects in the virtual scene are respectively called, the attribute data of the corresponding attributes are split into at least two attribute data fields, and a data update task for each attribute data field is created. Then, for each attribute, the task threads corresponding to each split dimension of the attribute are called, and the data update tasks for each attribute data field are executed in parallel, thereby updating the attributes of the virtual object based on the updated multiple attribute data fields. In this way, (1) by calling the main thread of each attribute, the attribute data of each attribute is split into attribute data fields, and the attribute update tasks of each attribute data field are executed in parallel by the task threads of each split dimension, so as to update the attributes of the virtual object based on the updated attribute data fields, thereby effectively improving the attribute update efficiency of the virtual object. (2) by calling the main thread of each attribute, the attribute data of each attribute is split into at least two attribute data fields, so that when at least two task threads execute the data update tasks for the same attribute data field in parallel, the possibility of different attribute data fields corresponding to different data update tasks is greatly increased, thereby reducing the occurrence of read-write conflicts caused by multiple parallel data update tasks updating the same attribute data field, improving the performance of parallel processing, and further improving the attribute update efficiency of the virtual object.

[0121] Below, an exemplary application of an embodiment of the present application in an actual application scenario of updating the attributes of a virtual object will be described. The embodiment of the present application can achieve a high-order (thousands, tens of thousands) of players or virtual objects on the mobile terminal to smoothly perform a gaming experience in the same virtual scene. On mobile devices, due to hardware performance limitations, developers need to pay more attention to the performance of the application to avoid taking up too much power and CPU resources. Therefore, how to achieve a high-order virtual object combat effect on a mobile terminal with limited performance, so that each virtual object can smoothly perform animation and trigger skill logic, while ensuring that the picture is smooth and not stuck, and reducing power consumption has become a research topic. Referring to Figure 6, the embodiment of the present application can achieve the effect of a high-order virtual object fighting, while fully utilizing the multi-core characteristics of the mobile phone, improving the multi-linear parallel efficiency, improving the frame rate and reducing power consumption.

[0122] The embodiment of the present application uses a comprehensive solution based on the UnityDOTS framework to enable mobile devices to support the interaction of thousands of people in 3D virtual scenes on the same screen, with good performance and high operating efficiency. The details are described below.

[0123] In some embodiments, referring to FIG. 7 , data of the team and virtual objects are implemented, including attribute data used in all battles, such as virtual object data, virtual object status data, virtual object skill data, movement animation data, movement status data, etc.

[0124] In some embodiments, as shown in Figure 8, the update process for virtual object logic in a single system, from filtering virtual object attributes, collecting virtual object units, creating logic update tasks, and scheduling tasks, is executed in other threads. Because multiple logic systems exist in virtual scene interactions, there may be multiple tasks that read and write the same virtual object attributes. These tasks are scheduled in different systems, resulting in competing read and write conflicts.

[0125] In some embodiments, referring to FIG9 , FIG9 is a schematic diagram of the principle of the attribute update method of a virtual object provided in an embodiment of the present application. The system shown in FIG8 can be used to process the logical update in the interaction of the virtual scene, realize the multi-threaded concurrent logic in the interaction, filter according to the attributes of the virtual objects in different systems, perform the logical update of the corresponding system on the virtual objects that meet the filtering conditions, and group the virtual objects into blocks in this system. All virtual objects in a single block are distributed to other threads for execution as tasks, thereby realizing multi-threaded operation of the interaction logic.

[0126] In some embodiments, referring to FIG10 , FIG10 is a flow chart of a method for updating the attributes of a virtual object provided in an embodiment of the present application. The execution logic of a single system can be implemented through steps 201 to 204 shown in FIG10 .

[0127] In step 201 , a virtual object attribute filtering condition is created.

[0128] In step 202, virtual objects that meet the filter conditions are searched.

[0129] In step 203, a task for logic execution is created.

[0130] In step 204, the scheduler assigns tasks to different threads.

[0131] In some embodiments, referring to Figure 11, Figure 11 is a schematic diagram of the principle of the attribute update method of the virtual object provided by the embodiment of the present application. In order to improve the concurrent efficiency of multiple threads in the E (game object Entity) C (component Component) S (system System) architecture, it is necessary to design a better thread concurrency logic to avoid multiple threads writing to the same memory data block (attribute data) at the same time and causing thread competition waiting. The embodiment of the present application adopts a more fine-grained logical splitting, allowing a single concurrent task to only process a single logical data field, so that the data in the same structure is split into two structures, which can be used for two different systems to read and write concurrently, thereby improving concurrent efficiency. Different tasks have write logic for the same attribute, which leads to write-write conflicts at the same time, so that the two tasks cannot be executed concurrently. When the two tasks are to write different fields in the same attribute, the two fields can be split into two sub-attributes, so that different tasks write different sub-attributes, in order to avoid multi-threaded competition for write-write conflicts and split data fields to improve concurrent performance. Figure 11 illustrates the implementation principle. When Task 1 and Task 2 write to "Field 1 and Field 2" simultaneously, a write conflict occurs. Therefore, "Field 1 and Field 2" are split into two different data blocks. Task 1 can write data to Field 1 independently and in parallel, while Task 2 can write data to Field 2 independently and in parallel.

[0132] In some embodiments, referring to FIG12 , FIG12 is a schematic diagram of the principle of the attribute update method of the virtual object provided by the embodiment of the present application. Referring to FIG12 , in multi-threaded development, a thread (task 3) will write a data block (see FIG12 data M) at the same time, and another thread (task 4) will wait for the previous thread (task 3) to finish writing before reading the same data block, which will cause logical serial blocking. At the same time, there is a situation where an attribute is filtered out by tasks in two systems. At this time, one task writes and one task reads, resulting in a read-write conflict. Therefore, a temporary data copy is made for this attribute so that reading and writing can be separated. The corresponding two tasks can also be executed in parallel. Only one synchronization is required at the end of the frame. The embodiment of the present application copies a temporary data block (data M and data N) of the write data block (data M) and synchronizes the original data block to the copy data block at the end of each frame, so that the write thread and the read thread can be completely separated without read-write dependency, thereby improving the concurrency of multi-threading. As shown in Figure 12, for threads writing and reading the same data block (Task 3 and Task 4), a complete copy of the data block is made and data synchronization is performed at the end of the frame to avoid thread waits caused by read-write conflicts. (After copying data M to obtain data M and data N, Task 3 and Task 4 can run in parallel without conflict.) After Task 3 and Task 4 run in parallel, Task 5 reads data M and writes data N.

[0133] In some embodiments, referring to FIG13, FIG13 is a schematic diagram of the principle of the attribute update method of the virtual object provided by the embodiment of the present application. When the execution time is long, the subsequent logic execution will be delayed, but there is a certain spatial area before, and only the main thread is executing at this stage, which wastes the utilization of the central processing unit. The embodiment of the present application innovatively parallelizes some of the time-consuming ECS ​​execution logic and the non-ECS logic part to improve global parallelism, reduce the overall execution time, and improve the picture frame rate. As shown in FIG13, when the main thread task and the data update task of the task thread cannot run in parallel, the main thread task needs to wait for the corresponding waiting time before the main thread task can continue to run. By separating the main thread task and the data update task, the global parallelism is optimized so that the main thread task of the main thread no longer waits, thereby improving the utilization of the central processing unit, reducing the execution time of a single frame, increasing global parallelism, and reducing the execution time of each frame without waiting.

[0134] In some embodiments, see Figure 14, which is a schematic diagram of the principles of the virtual object attribute update method provided in an embodiment of the present application. Part of the overhead of a large number of virtual objects fighting comes from the resource loading consumption of the virtual objects. When data and display are not separated, the logic operation needs to wait until the display resources are loaded before updating. This means that when 1,000 virtual objects are loaded simultaneously on the same screen, the logic waiting time will be greatly increased, causing screen freezes. Therefore, it is necessary to separate data and display so that the logic update portion of the data does not rely on all resources to be loaded before execution, but can be updated independently until the resources are loaded. The logic part and the display part are then mapped and associated together, which can improve the smoothness of the screen. As shown in the figure below, data display separation increases the number of objects within a single data block. A virtual object is divided into two stages from logic update to animation display. The logic update stage handles the behavior of the virtual object, including movement, rotation, attribute changes, etc. The animation update part only handles the animation display of this virtual object. Even if there is no animation display, the logic of the virtual object can still be updated normally. This part is synchronized with the virtual object attributes on the server. The virtual object display portion is simply the work performed by the client to present the image to the player, including triggering virtual object animations and displaying character models. For a data block with 16KB of storage space, when the data display is unseparated, a single data block stores 14 objects. When the data display is separated, a single data block stores 32 data objects / 24 display objects.

[0135] In some embodiments, combat involving a large number of virtual objects on a mobile device requires significant computational effort. However, mobile devices have low battery consumption and passive heat dissipation, so reducing application power consumption is crucial. By separating data and display logic, logical operations can be controlled at 12 frames per second. This reduces the overall logical operation load during extended combat, ultimately lowering power consumption.

[0136] It is understandable that in the embodiments of the present application, when attribute data and other related data are involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0137] The following continues to describe an exemplary structure of the attribute updating device 455 of a virtual object provided in an embodiment of the present application implemented as a software module. In some embodiments, as shown in Figure 2, the software modules in the attribute updating device 455 of a virtual object stored in the memory 450 may include: an acquisition module 4551, configured to obtain attribute data of each attribute of multiple virtual objects in a virtual scene; a split creation module 4552, configured to call the main thread corresponding to each attribute respectively, split the attribute data of each attribute into at least two attribute data fields, and create a data update task for each attribute data field; wherein each attribute data field corresponds to a split dimension, and the data update task is used to indicate that the attribute data field is updated; an execution module 4553, configured to call the task thread corresponding to each split dimension of the attribute for each attribute, execute the data update task of each attribute data field in parallel, and obtain multiple updated attribute data fields; an update module 4554, configured to update the attributes of each virtual object based on the updated multiple attribute data fields.

[0138] In some embodiments, the attribute update device 455 of the above-mentioned virtual object also includes: an initialization module, configured to obtain multiple main threads arranged in order of priority, one main thread corresponds to one attribute, and one attribute corresponds to at least one main thread; according to the order of priority, the state of each main thread is set to the initialization state in turn; the above-mentioned split creation module is also configured to perform the following processing for each main thread: when the state of the main thread has been set to the initialization state, determine the target attribute corresponding to the main thread from the various attributes of multiple virtual objects; call the main thread to split the attribute data of the target attribute into at least two attribute data fields.

[0139] In some embodiments, the above-mentioned initialization module is further configured to obtain the attribute priority of each attribute; for each attribute, create at least one main thread corresponding to the attribute, and determine the attribute priority of the attribute as the priority of each main thread corresponding to the attribute; arrange each main thread in the order of priority of each main thread, and obtain multiple main threads arranged in the order of priority.

[0140] In some embodiments, the above-mentioned initialization module is further configured to set the state of the first main thread among multiple main threads to an initialization state, and the first main thread is the main thread with the highest priority among the multiple main threads; traverse i to perform the following processing: when the i-th main thread among the multiple main threads completes splitting the attribute data field of the attribute, set the state of the i+1-th main thread to an initialization state; wherein, the priority of the i-th main thread is greater than or equal to the priority of the i+1-th main thread, i is a positive integer not less than 1, and i is less than or equal to N-1, and N is the total number of main threads.

[0141] In some embodiments, the above-mentioned split creation module 4552 is also configured to perform the following processing for each main thread: obtain at least two split dimensions of the attributes corresponding to the main thread; call the main thread to split the attribute data of the attributes corresponding to the main thread into attribute data fields corresponding to each split dimension according to at least two split dimensions.

[0142] In some embodiments, the attribute update device 455 of the above-mentioned virtual object also includes: a target task thread module, configured to create a target number of task threads; perform the following processing for each attribute: obtain the number of dimensions of the attribute's splitting dimension; divide the number of dimensions by the target number to obtain a division result; based on the division result, determine the target task threads corresponding to each splitting dimension of the attribute from the target number of task threads; the above-mentioned execution module is also configured to call the target task threads corresponding to each splitting dimension of the attribute for each attribute, execute the data update tasks of each attribute data field in parallel, and obtain multiple updated attribute data fields.

[0143] In some embodiments, the above-mentioned execution module 4553 is also configured to allocate a task thread to each splitting dimension when the value of the division result is less than 1, and different splitting dimensions are allocated different task threads; when the value of the division result is greater than or equal to 1, allocate a task thread to each splitting dimension, and the difference between the number of splitting dimensions allocated to a task thread and the division result is less than a difference threshold; the task thread allocated to each splitting dimension is determined as the target task thread corresponding to each splitting dimension.

[0144] In some embodiments, the above-mentioned execution module 4553 is also configured to perform the following processing for each task thread respectively: when the attribute data field corresponding to the data update task executed by the task thread is the same as the attribute data field corresponding to the data update task executed by other task threads different from the task thread, the same attribute data field is backed up to obtain a backup attribute data field; the task thread and other task threads are called to execute the data update task of the attribute data field in parallel based on the attribute data field and the backup attribute data field to obtain an updated attribute data field.

[0145] In some embodiments, the data update task includes at least one of a read task for reading the attribute data field and a write task for writing the attribute data field; the above-mentioned execution module 4553 is also configured to call other task threads to execute the read task corresponding to the backup attribute data field when there is a read task for the attribute data field during the task thread executing the write task for the attribute data field; and call other task threads to execute the write task corresponding to the backup attribute data field when there is a write task for the attribute data field during the task thread executing the read task for the attribute data field.

[0146] In some embodiments, the attribute updating device 455 of the above-mentioned virtual object further includes: a re-update module, which is configured to call the main thread corresponding to each attribute in the process of updating the attributes of each virtual object, and create a re-update task for each of the updated multiple attribute data fields; for each attribute, call the task thread corresponding to each split dimension of the attribute, and execute the re-update tasks corresponding to the updated multiple attribute data fields in parallel to obtain the re-updated multiple attribute data fields; based on the re-updated multiple attribute data fields, update the attributes of each virtual object again.

[0147] In some embodiments, the above-mentioned virtual object attribute updating device 455 also includes: a scene element updating module, configured to obtain scene element data of scene elements other than virtual objects in the virtual scene; call the main thread corresponding to the scene element to update the scene element data to obtain updated scene element data; and update the scene element based on the updated scene element data.

[0148] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual object attribute update method described in the embodiment of the present application.

[0149] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the attribute update method of the virtual object provided by the embodiment of the present application, for example, the attribute update method of the virtual object shown in Figure 3.

[0150] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various electronic devices including one or any combination of the above memories.

[0151] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0152] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0153] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0154] In summary, the embodiments of the present application have the following beneficial effects:

[0155] (1) The main threads corresponding to the attributes of multiple virtual objects in the virtual scene are called respectively, the attribute data of the corresponding attributes are split into at least two attribute data fields, and a data update task is created for each attribute data field. Then, for each attribute, the task threads corresponding to each split dimension of the attribute are called to execute the data update tasks of each attribute data field in parallel, thereby updating the attributes of the virtual object based on the updated multiple attribute data fields. In this way, (1.1) by calling the main thread of each attribute to split the attribute data of each attribute into attribute data fields, and executing the attribute update tasks of each attribute data field in parallel through the task threads of each split dimension, the attributes of the virtual object are updated based on the updated attribute data fields, thereby effectively improving the attribute update efficiency of the virtual object. (1.2) by calling the main thread of each attribute to split the attribute data of each attribute into at least two attribute data fields, when at least two task threads execute the data update tasks for the same attribute data field in parallel, the possibility of different attribute data fields corresponding to different data update tasks is greatly increased, thereby reducing the occurrence of read and write conflicts caused by multiple parallel data update tasks updating the same attribute data field, improving the performance of parallel processing, and further improving the attribute update efficiency of the virtual object.

[0156] (2) By obtaining the attribute data corresponding to each attribute of multiple virtual objects in the virtual scene, it is convenient to update the attribute data later, thereby realizing the update of the attributes of each virtual object. By organizing multiple virtual objects through attribute data, it is not necessary to update each virtual object separately, thereby effectively improving the efficiency of virtual object attribute update.

[0157] (3) By executing each main thread serially according to the priority, the splitting of the attribute data field and the creation of the data update task are completed. Since the priority is determined according to the attribute priority of each attribute, and since the attribute priority is positively correlated with the degree of influence of the attribute data corresponding to the corresponding attribute on the virtual object, the greater the degree of influence of the attribute data, the higher the priority of the corresponding main thread in executing the splitting of the attribute data field and the creation of the data update task. According to the execution order of the main thread determined by the degree of influence, the attribute data corresponding to the attribute with a large degree of influence can be processed first, thereby effectively improving the timeliness of the attribute update of the virtual object.

[0158] (4) By calling the main thread, each attribute data of the attribute corresponding to the main thread is split into attribute data fields corresponding to each split dimension according to at least two split dimensions, so as to facilitate the subsequent creation of data update tasks for each attribute data field. Since the attribute data field is a subset of the attribute data, the data update amount of the data update task is effectively reduced by splitting the attribute data, so that different data update tasks can update different attribute data fields of the same attribute data separately when updating the same attribute data, thereby effectively avoiding the possibility of update conflicts when updating the same attribute data.

[0159] (5) By determining the target task threads corresponding to each split dimension of the attribute from multiple task threads, the data update tasks are evenly distributed to different task threads, so that the efficiency of different target task threads in processing data update tasks in parallel is more efficient, thereby effectively improving the concurrent execution efficiency of task threads.

[0160] (6) During the process of a task thread executing a write task or a read task for an attribute data field, when there is a read task or a write task for an attribute data field, other task threads are called to execute a read task or a write task corresponding to a backup attribute data field, thereby backing up the same attribute data field and obtaining a backup attribute data field. By using the backup attribute data field and the attribute data field, the task thread and other task threads respectively perform corresponding data update tasks, thereby effectively avoiding read-write conflicts caused by the task thread and other task threads performing different data update tasks for the same attribute data field.

[0161] (7) In the process of updating the attributes of each virtual object, it is possible to call the main thread corresponding to the attribute respectively, create and execute the task of updating the attribute data field again without waiting for the attribute update of the virtual object to be completed, thereby effectively improving the efficiency of the iterative update of the attributes of the virtual object.

[0162] (8) By calling the task threads corresponding to each split dimension and executing the data update tasks corresponding to each attribute data field in parallel, the scene elements other than the virtual objects in the virtual scene are updated in parallel, thereby achieving full coverage of parallel updates of all virtual elements in the virtual scene, thereby effectively improving the update efficiency of the virtual scene.

[0163] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A method for updating the attributes of a virtual object, applied to an electronic device, the method comprising: Acquire attribute data of each attribute of multiple virtual objects in the virtual scene; respectively calling the main thread corresponding to each of the attributes, splitting the attribute data of each of the attributes into at least two attribute data fields, and creating a data update task for each of the attribute data fields; Each of the attribute data fields corresponds to a split dimension, and the data update task is used to instruct to update the attribute data field; For each of the attributes, calling the task threads corresponding to each of the split dimensions of the attribute, executing the data update tasks of each of the attribute data fields in parallel, and obtaining a plurality of updated attribute data fields; Based on the updated multiple attribute data fields, the attributes of each of the virtual objects are updated.

2. The method according to claim 1, wherein: Before respectively calling the main threads corresponding to the attributes and splitting the attribute data of the attributes into at least two attribute data fields, the method further includes: Acquire a plurality of the main threads arranged in order of priority, wherein one main thread corresponds to one attribute, and one attribute corresponds to at least one main thread; According to the priority order, the state of each main thread is set to the initialization state in turn; The main threads corresponding to the attributes are respectively called to split the attribute data of the attributes into at least two attribute data fields, including: The following processing is performed for each main thread: When the state of the main thread has been set to the initialization state, determining a target attribute corresponding to the main thread from the attributes of the plurality of virtual objects; The main thread is called to split the attribute data of the target attribute into at least two attribute data fields.

3. The method according to claim 2, wherein: The acquiring of the plurality of main threads arranged in order of priority includes: Obtaining the attribute priority of each of the attributes; For each of the attributes, at least one main thread corresponding to the attribute is created, and the attribute priority of the attribute is determined as the priority of each of the main threads corresponding to the attribute; The main threads are arranged in order of priority to obtain a plurality of main threads arranged in order of priority.

4. The method according to claim 2, wherein: The step of sequentially setting the state of each main thread to an initialization state in the order of priority includes: Setting the state of a first main thread among the plurality of main threads to the initialization state, the first main thread being the main thread with the highest priority among the plurality of main threads; Traversing i, the following processing is performed: when the i-th main thread among the plurality of main threads completes splitting the attribute data field of the attribute, the state of the i+1-th main thread is set to the initialization state; Among them, the priority of the i-th main thread is greater than or equal to the priority of the i+1-th main thread, i is a positive integer not less than 1, and i is less than or equal to N-1, and N is the total number of the main threads.

5. The method according to any one of claims 1 to 4, wherein: The main threads corresponding to the attributes are respectively called to split the attribute data of the attributes into at least two attribute data fields, including: The following processing is performed for each main thread: Obtain at least two split dimensions of the attributes corresponding to the main thread; The main thread is called to split the attribute data of the attribute corresponding to the main thread into attribute data fields corresponding to each of the split dimensions according to the at least two split dimensions.

6. The method according to any one of claims 1 to 5, wherein: Before calling the task threads corresponding to the split dimensions of the attribute for each attribute and executing the data update tasks of each attribute data field in parallel to obtain the updated multiple attribute data fields, the method further includes: Creating a target number of task threads; The following processing is performed for each of the attributes: obtaining the number of dimensions of the split dimension of the attribute; dividing the number of dimensions by the target number to obtain a division result; based on the division result, determining the target task thread corresponding to each of the split dimensions of the attribute from the target number of task threads; For each of the attributes, calling the task threads corresponding to each of the split dimensions of the attribute, executing the data update tasks of each of the attribute data fields in parallel, and obtaining a plurality of updated attribute data fields, including: For each of the attributes, the target task threads corresponding to each of the split dimensions of the attribute are called, and the data update tasks of each of the attribute data fields are executed in parallel to obtain a plurality of updated attribute data fields.

7. The method according to claim 6, wherein: The determining, based on the division result, from the target number of task threads, target task threads corresponding to each of the split dimensions of the attribute includes: When the value of the division result is less than 1, one task thread is allocated to each split dimension respectively, and different task threads are allocated to different split dimensions; When the value of the division result is greater than or equal to 1, one of the task threads is allocated to each of the split dimensions, and the difference between the number of split dimensions allocated to one of the task threads and the division result is less than a difference threshold; The task threads allocated to each of the split dimensions are determined as target task threads corresponding to each of the split dimensions.

8. The method according to any one of claims 1 to 7, wherein: For each of the attributes, calling the task threads corresponding to each of the split dimensions of the attribute, executing the data update tasks of each of the attribute data fields in parallel, and obtaining a plurality of updated attribute data fields, including: The following processing is performed for each task thread: When the attribute data field corresponding to the data update task executed by the task thread is the same as the attribute data field corresponding to the data update task executed by other task threads different from the task thread, backing up the same attribute data field to obtain a backup attribute data field; The task thread and the other task threads are called to execute the data update task of the attribute data field in parallel based on the attribute data field and the backup attribute data field to obtain an updated attribute data field.

9. The method according to claim 8, wherein: The data update task includes at least one of a read task for reading the attribute data field and a write task for writing the attribute data field; The calling of the task thread and the other task threads to execute the data update task of the attribute data field in parallel based on the attribute data field and the backup attribute data field to obtain an updated attribute data field includes: In the process of the task thread executing the writing task for the attribute data field, when there is a reading task for the attribute data field, calling the other task thread to execute the reading task corresponding to the backup attribute data field; During the process of the task thread executing the reading task for the attribute data field, when there is a writing task for the attribute data field, the other task thread is called to execute the writing task corresponding to the backup attribute data field.

10. The method according to any one of claims 1 to 9, wherein: The method further comprises: In the process of updating the attributes of each virtual object, the main thread corresponding to each attribute is called respectively to create respective re-update tasks for the updated multiple attribute data fields; For each of the attributes, calling the task threads corresponding to each of the split dimensions of the attribute, and executing the respective re-updating tasks of the updated multiple attribute data fields in parallel, to obtain the re-updated multiple attribute data fields; Based on the re-updated plurality of attribute data fields, the attributes of each of the virtual objects are updated again.

11. The method according to any one of claims 1 to 10, wherein: In the process of calling the task threads corresponding to the split dimensions to execute the data update tasks of the attribute data fields in parallel, the method further includes: Acquire scene element data of scene elements other than the virtual object in the virtual scene; Calling the main thread corresponding to the scene element to update the scene element data to obtain updated scene element data; The scene element is updated based on the updated scene element data.

12. A device for updating attributes of a virtual object, the device comprising: An acquisition module configured to acquire attribute data of each attribute of a plurality of virtual objects in a virtual scene; A split creation module is configured to respectively call the main thread corresponding to each of the attributes, split the attribute data of each of the attributes into at least two attribute data fields, and create a data update task for each of the attribute data fields; wherein each of the attribute data fields corresponds to a split dimension, and the data update task is used to indicate that the attribute data field is to be updated; An execution module is configured to call, for each of the attributes, a task thread corresponding to each of the split dimensions of the attribute, and execute data update tasks of each of the attribute data fields in parallel to obtain a plurality of updated attribute data fields; The updating module is configured to update the attributes of each of the virtual objects based on the updated multiple attribute data fields.

13. An electronic device, comprising: a memory configured to store computer executable instructions or computer programs; The processor is configured to implement the attribute updating method of the virtual object described in any one of claims 1 to 11 when executing the computer executable instructions or computer programs stored in the memory.

14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the attribute updating method of a virtual object according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program or a computer executable instruction, wherein when the computer program or the computer executable instruction is executed by a processor, the method for updating the attribute of a virtual object according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Data processing method, device and system and computer storage medium

    CN113419824A

  • Data processing method and device

    CN113721862A

  • Data transmission method and device for virtual scene, equipment, medium and program product

    CN114367114A

  • Task processing method and device, equipment, storage medium and program product

    CN115480897A

  • Attribute updating method and device of virtual object, equipment, medium and program product

    CN116974746A