CN117732054A - Data processing method, device, computer equipment and storage medium - Google Patents

Data processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117732054A
CN117732054A CN202311639922.2A CN202311639922A CN117732054A CN 117732054 A CN117732054 A CN 117732054A CN 202311639922 A CN202311639922 A CN 202311639922A CN 117732054 A CN117732054 A CN 117732054A
Authority
CN
China
Prior art keywords
virtual scene
loading
instance data
virtual
instance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311639922.2A
Other languages
Chinese (zh)
Inventor
刘泽宇
张之栋
张传
王健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuming Technology Hangzhou Co ltd
Original Assignee
Wuming Technology Hangzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuming Technology Hangzhou Co ltd filed Critical Wuming Technology Hangzhou Co ltd
Priority to CN202311639922.2A priority Critical patent/CN117732054A/en
Publication of CN117732054A publication Critical patent/CN117732054A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a data processing method, a data processing device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: in the case of running the first virtual scene, creating at least one loading thread in response to a loading request for at least one second virtual scene; for any second virtual scene, loading a plurality of instance data from a storage path of the second virtual scene through a corresponding loading thread; and processing the plurality of instance data of the second virtual scene according to the operation logic associated with the second virtual scene to generate the second virtual scene. According to the scheme, the multiple virtual scenes can be loaded in parallel through the multiple loading threads, and the loading efficiency of the virtual scenes is improved. In addition, when the virtual scene is switched in the game, the virtual scene can be directly switched to be generated, waiting for loading is not needed, and therefore the user can obtain the game experience of seamlessly switching the virtual scene.

Description

Data processing method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method, a data processing device, a computer device, and a storage medium.
Background
With the development of game engine technology, more and more open world games are favored by players. In an open world game, players are free to explore in a virtual scene. Virtual scenes in open world games are often quite bulky. Numerous instance data are also typically contained in virtual scenes, such as tens of thousands of static grid bodies, lights, clouds, and the like. In the process of exploring a virtual scene, a player can be involved in the problem of switching virtual scenes. In general, when a player switches a current virtual scene to a target virtual scene, the player needs to wait for the loading of the target virtual scene to be completed before playing normally. Therefore, how to improve the loading efficiency of the virtual scene to ensure that the player obtains the game experience of the seamless switching game scene is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application provides a data processing method, a device, computer equipment and a storage medium, which can load a plurality of virtual scenes in parallel by multiple threads, the instance data among the virtual scenes cannot be affected mutually, and the loading efficiency of the virtual scenes is improved. The technical proposal is as follows:
according to an aspect of an embodiment of the present application, there is provided a data processing method, including:
Under the condition of running a first virtual scene, responding to a loading request of at least one second virtual scene, and creating at least one loading thread, wherein the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data is used for generating the second virtual scene;
for any second virtual scene, loading a plurality of instance data from a storage path of the second virtual scene through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene;
and processing a plurality of instance data of the second virtual scene according to the operation logic associated with the second virtual scene to generate the second virtual scene, wherein the operation logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
According to another aspect of embodiments of the present application, there is provided a data processing apparatus, the apparatus comprising:
The system comprises a creation module, a processing module and a processing module, wherein the creation module is used for responding to a loading request of at least one second virtual scene under the condition of running a first virtual scene, wherein the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data are used for generating the second virtual scene;
the loading module is used for loading a plurality of instance data from a storage path of any second virtual scene through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene;
and the processing module is used for processing a plurality of instance data of the second virtual scene according to the running logic associated with the second virtual scene so as to generate the second virtual scene, and the running logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
In some embodiments, the loading module is configured to determine, for any second virtual scene, a plurality of instance data stored in a storage path of the second virtual scene in a disk through a corresponding loading thread; and loading the plurality of instance data from the disk to a memory through the loading thread.
In some embodiments, the creating module is configured to determine, by a game engine, at least one second virtual scene that is a virtual scene adjacent to the first virtual scene in a case where the first virtual scene is executed, the game engine being configured to generate a loading request based on the at least one second virtual scene; responding to a loading request sent by the game engine, and analyzing the loading request to obtain at least one identifier of a second virtual scene; at least one loading thread is created based on the identification of the at least one second virtual scene.
In some embodiments, the apparatus further comprises:
the first determining module is used for determining the type of the second virtual scene based on the loading request for any second virtual scene, wherein the loading request also carries the type of each second virtual scene in the at least one second virtual scene, and the type comprises an editing type, a play type and a test type;
a second determining module, configured to determine that the second virtual scene is associated with first running logic when the type of the second virtual scene is an editing type, where the first running logic indicates that an operation to be performed includes an editing operation on instance data; determining that the second virtual scene is associated with second execution logic, wherein the second execution logic indicates that the executed operation comprises an interaction operation with an instance object represented by instance data, in the case that the type of the second virtual scene is a play type; and in the case that the type of the second virtual scene is a test type, determining that the second virtual scene is associated with third running logic, wherein the third running logic indicates that the executed operation comprises an editing operation on instance data, an interaction operation with an instance object represented by the instance data and a test operation on the instance data.
In some embodiments, the processing module is configured to read, in a memory, a plurality of instance data of the second virtual scene; processing the plurality of instance data according to a plurality of operations and an execution sequence of the plurality of operations, which are instructed to be executed by the operation logic, based on the operation logic associated with the second virtual scene, wherein the plurality of operations belong to at least one operation of editing operation of the instance data, interaction operation with an instance object represented by the instance data and test operation of the instance data; rendering the plurality of instance data to generate the second virtual scene.
In some embodiments, the apparatus further comprises:
the state switching module is used for responding to the starting of loading a plurality of instance data of the second virtual scene for any second virtual scene, and switching the state of the second virtual scene into an initialization state; switching the state of the second virtual scene to an initialization completion state in response to successfully loading the plurality of instance data of the second virtual scene; responding to the state of the second virtual scene as an initialization completion state, processing a plurality of instance data of the second virtual scene according to the running logic associated with the second virtual scene, and switching the state of the second virtual scene into a loading state; and responding to the successful generation of the second virtual scene, and switching the state of the second virtual scene into a loading completion state, wherein the loading completion state is used for indicating that the first virtual scene can be switched into the second virtual scene currently.
In some embodiments, the apparatus further comprises:
the creation module is further configured to, in case of running at least one second virtual scene, create at least one unloading thread in case of receiving an unloading request, where the unloading request carries an identifier of at least one third virtual scene, where the at least one unloading thread corresponds to the at least one third virtual scene one by one, and the unloading thread is configured to unload instance data of the corresponding virtual scene, where the third virtual scene is at least one of the first virtual scene and the at least one second virtual scene;
and the deleting module is used for deleting the instance data of any third virtual scene in the memory through the corresponding unloading thread.
In some embodiments, the apparatus further comprises:
a third determining module, configured to determine, in a case of running a plurality of fourth virtual scenes, at least two fifth virtual scenes based on the identifiers of the plurality of fourth virtual scenes, where the identifiers of the at least two fifth virtual scenes are the same, the at least two fifth virtual scenes are different in type, and the at least two fifth virtual scenes are generated from the same instance data;
And an adjustment module, configured to perform an adjustment operation on instance data in any one of the fifth virtual scenes, where the adjustment operation includes at least one of an addition operation, a deletion operation, a shape adjustment operation, and an attribute adjustment operation in other fifth virtual scenes.
In some embodiments, the apparatus further comprises:
the dividing module is used for dividing the target virtual scene into a plurality of virtual scenes under the condition that the number of the target instance data is larger than a number threshold value, and the target instance data is used for generating the target virtual scene;
a fourth determining module, configured to determine, for any virtual scene, a plurality of instance data for generating the virtual scene from the target instance data;
the establishing module is used for establishing the association relation between the scene instance of the virtual scene and the storage paths of the instance data.
According to another aspect of embodiments of the present application, there is provided a computer device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the data processing method as described in the above aspects.
According to another aspect of embodiments of the present application, there is provided a chip comprising programmable logic circuits and/or program instructions for implementing the data processing method of the above aspects when the chip is run on a computer device.
According to another aspect of embodiments of the present application, there is provided a computer readable storage medium storing at least one program code for execution by a processor to implement the data processing method as described in the above aspect.
According to another aspect of embodiments of the present application, there is provided a computer program product storing at least one program code for execution by a processor to implement the data processing method of the above aspect.
The embodiment of the application provides a data processing method, which can load a plurality of virtual scenes in parallel through a plurality of loading threads. Since a plurality of instance data of the virtual scene is stored in the storage path of the virtual scene. Therefore, in the process of generating any virtual scene, a plurality of instance data of the virtual scene can be acquired in the corresponding storage path and processed, and the instance data of other virtual scenes cannot be affected. By adopting the method, a plurality of virtual scenes can be loaded in parallel, and the instance data among the virtual scenes can not be mutually influenced, so that the loading efficiency of the virtual scenes is improved. In addition, when the virtual scene is switched in the game, the virtual scene can be directly switched to be generated, waiting for loading is not needed, and therefore the user can obtain the game experience of seamlessly switching the virtual scene.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of a data processing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a data processing method according to an embodiment of the present application;
FIG. 3 is a flow chart of another data processing method provided in an embodiment of the present application;
FIG. 4 is a flow chart of a data process provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Reference herein to "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
It should be noted that, information related to the present application (including, but not limited to, device information of a user, personal information of a user, etc.), data (including, but not limited to, data for analysis, stored data, presented data, etc.), and signals are all authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, virtual scenes, instance data, etc., referred to in this application are acquired with sufficient authorization.
Hereinafter, terms related to the present application are explained.
Virtual scene: is a virtual scene that an application program displays (or provides) while running on a terminal. The virtual scene may be a simulation environment for the real world, a semi-simulation and semi-fictional virtual environment, or a pure fictional virtual environment. The virtual scene may be any one of a two-dimensional virtual space, a 2.5-dimensional virtual space or a three-dimensional virtual space, and the dimension of the virtual scene is not limited in the embodiment of the present application. For example, the virtual scene includes sky, land, sea, etc., the land includes environmental elements of desert, city, etc., and the user can control the virtual object to move in the virtual scene.
Virtual object: refers to movable objects in a virtual scene. The movable object may be a virtual character, a virtual animal, a cartoon character, or the like. For example: the virtual objects may be characters, animals, plants, walls, stones, etc. displayed in the virtual scene. The virtual object may be an avatar in the virtual scene for representing a user. A virtual scene may include a plurality of virtual objects, each virtual object having its own shape and volume in the virtual scene, occupying a portion of space in the virtual scene.
Alternatively, the virtual object may be a Player Character controlled by a user through an operation on a client, artificial intelligence (Artificial Intelligence, AI) set in a virtual scene, or a Non-Player Character (NPC) set in virtual scene interaction. Optionally, the number of virtual objects participating in the interaction in the virtual scene may be preset, or may be dynamically determined according to the number of clients joining the interaction.
Game engine: refers to the core components of some compiled editable computer game systems or some interactive real-time image applications. The game engine provides game designers with various tools required to write games in order to allow the game designer to easily and quickly make game programs without starting from zero. The game engine comprises the following systems: rendering engines (i.e., "renderers," including two-dimensional and three-dimensional image engines), physics engines, collision detection systems, sound effects, script engines, computer animations, artificial intelligence, network engines, and scene management, among others.
Fig. 1 is a schematic diagram of an implementation environment of a data processing method according to an embodiment of the present application. Referring to fig. 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
In some embodiments, terminal 101 is a smart phone, tablet, notebook, desktop, or the like device, but is not limited thereto. The terminal 101 installs and runs an application program supporting a virtual scene. The application may be a scene editor for editing virtual scenes in a game. The virtual scene may be a virtual scene of any one of an open world game, a first person shooter game, a third person shooter game, a multiplayer online tactical game, a virtual reality application, a three-dimensional map program, or a multiplayer gunfight survival game. Optionally, the application may also be a game engine for building virtual scenes and rendering instance data in the virtual scenes. For example, at least one of the illusion engine 4, unity3D, a riot engine, a frost engine, and the like.
In some embodiments, the server 102 is a stand-alone physical server, can be a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), and basic cloud computing services such as big data and artificial intelligence platforms. The server 102 is used to provide background services for applications. In some embodiments, the server 102 takes on primary computing work and the terminal 101 takes on secondary computing work; alternatively, the server 102 takes on secondary computing work and the terminal 101 takes on primary computing work; alternatively, a distributed computing architecture is used for collaborative computing between the server 102 and the terminal 101.
Those skilled in the art will recognize that the number of terminals may be greater or lesser. Such as the above-mentioned terminals may be only one, or the above-mentioned terminals may be several tens or hundreds, or more. The number of terminals and the device type are not limited in the embodiment of the present application.
Fig. 2 is a flowchart of a data processing method provided in an embodiment of the present application, and referring to fig. 2, in the embodiment of the present application, an example of execution by a terminal is described. The data processing method comprises the following steps:
201. Under the condition that the terminal runs the first virtual scene, at least one loading thread is created in response to a loading request of at least one second virtual scene, the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data is used for generating the second virtual scene.
In the embodiment of the application, the terminal is provided with an application program supporting a virtual scene. The terminal can display a virtual scene on a screen when running the application program. Under the condition that the terminal currently runs the virtual scene, the user can control the virtual object to perform activities in the virtual scene through the terminal. Such activities include, but are not limited to: adjust at least one of body posture, walking, running, riding, jumping, driving, attacking, throwing.
Under the condition that the terminal runs the first virtual scene, the game engine sends a loading request to the terminal in response to the switching operation of the virtual scene. The loading request is used for indicating the terminal to load at least one second virtual scene. The second virtual scene is a virtual scene operated by the terminal after the terminal executes the switching operation, that is, the first virtual scene is a virtual scene to be switched in the process of executing the switching operation by the terminal, and the second virtual scene is a target virtual scene to be switched. Alternatively, both the first virtual scene and the second virtual scene may be virtual scenes provided for an open world game. The plurality of first virtual scenes and the plurality of second virtual scenes together constitute a game scene provided by the open world game.
The terminal responds to the received loading request, and the terminal creates at least one loading thread. Wherein, at least one loading thread corresponds to at least one second virtual scene one by one. Therefore, the terminal can load the instance data of at least one second virtual scene in parallel through at least one loading thread, so that the loading efficiency is improved. The instance data includes data of instances with spatial position attributes in the virtual scene, such as data of instances of illumination, static grid body, object model, trigger and the like. The instance data also includes data of instances in the virtual scene that do not have spatial location attributes, such as cloud cover, terrain, and fog effects. The above example data together constitute sky, land, sea, virtual characters, virtual buildings, etc. in the virtual scene.
202. And for any second virtual scene, loading a plurality of instance data from a storage path of the second virtual scene by the terminal through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene.
In the embodiment of the application, for any second virtual scene to be loaded, the terminal determines a storage path of the second virtual scene. Wherein, the storage path stores a plurality of instance data of the second virtual scene. Then, the terminal loads a plurality of instance data of the second virtual scene from the storage path of the second virtual scene through a loading thread corresponding to the second virtual scene. Wherein, different loading threads are mutually independent and do not influence each other. Thus, the terminal loads instance data of at least one virtual scene in at least one storage path in parallel by at least one loading thread.
203. And the terminal processes the plurality of instance data of the second virtual scene according to the operation logic associated with the second virtual scene to generate the second virtual scene, wherein the operation logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
In the embodiment of the application, for any second virtual scene, the terminal determines the operation logic associated with the second virtual scene. Wherein the execution logic is capable of instructing the terminal to execute a plurality of operations and an execution order of the plurality of operations in processing the instance data of the second virtual scene. After the terminal loads the plurality of instance data of the second virtual scene through the loading thread, the terminal executes the plurality of operations on the plurality of instance data of the second virtual scene according to the execution sequence of the plurality of operations indicated by the running logic so as to generate the second virtual scene. The operations include editing operations, verification operations, rendering operations, and the like.
In some embodiments, in response to the terminal successfully generating the second virtual scene, the terminal switches the currently running virtual scene from the first virtual scene to the second virtual scene, so that the user can control the virtual object to perform activities in the second virtual scene through the terminal.
The embodiment of the application provides a data processing method, which can load a plurality of virtual scenes in parallel through a plurality of loading threads. Since a plurality of instance data of the virtual scene is stored in the storage path of the virtual scene. Therefore, in the process of generating any virtual scene, a plurality of instance data of the virtual scene can be acquired in the corresponding storage path and processed, and the instance data of other virtual scenes cannot be affected. By adopting the method, a plurality of virtual scenes can be loaded in parallel, and the instance data among the virtual scenes can not be mutually influenced, so that the loading efficiency of the virtual scenes is improved. In addition, when the virtual scene is switched in the game, the virtual scene can be directly switched to be generated, waiting for loading is not needed, and therefore the user can obtain the game experience of seamlessly switching the virtual scene.
Fig. 3 is a flowchart of another data processing method provided in the embodiment of the present application, and referring to fig. 3, in the embodiment of the present application, an example of execution by a terminal is described. The data processing method comprises the following steps:
301. the terminal divides the target virtual scene into a plurality of virtual scenes.
In the embodiment of the application, the terminal is provided with an application program supporting a virtual scene. The terminal can display a virtual scene on a screen when running the application program. For example, the application is an open world game, a game engine or a scene editor for producing an open world game, or the like. The target virtual scene is a game scene provided by an open world game. Since the target virtual scene is usually quite huge, instance data included in the target virtual scene is also usually more. Thus, to facilitate loading and managing instance data in a target virtual scene, a terminal divides the target virtual scene into multiple virtual scenes to load one or more virtual scenes as needed without directly loading the entire target virtual scene. Thus, a player may control virtual objects to be active within a single virtual scene, or to move between different virtual scenes, through a terminal. A technician may edit a single virtual scene through a terminal or edit multiple virtual scenes in batches.
In some embodiments, the target virtual scene may be partitioned by a technician through a terminal. And a technician determines the coordinates of the target virtual scene in the two-dimensional plane coordinate system through the terminal, and divides the target virtual scene according to the coordinates. For example, in the case where the projection of the target virtual scene in the two-dimensional plane coordinate system is a rectangular region, a technician divides the rectangular region into a plurality of sub-regions by the terminal according to the coordinates of the rectangular region. Wherein each sub-region corresponds to a virtual scene. The areas of the plurality of sub-areas may be the same or different, and the embodiment of the present application does not limit this. The two-dimensional plane coordinate system generally refers to a plane coordinate system composed of an X axis and a Y axis. The coordinates of the rectangular region are the coordinates of the rectangular region on the X-axis and the coordinates on the Y-axis, that is, the X-Y coordinates. Alternatively, the technician may divide the target virtual scene into a plurality of virtual scenes through the terminal according to the game play of the open world game. For example, the target virtual scene may be divided into a mine area, a sea area, a forest area, and the like according to game play. Wherein each region corresponds to a virtual scene. The player can control the virtual object to perform different game playing methods such as mining, fishing or cutting trees in the virtual scenes corresponding to different areas through the terminal; the player can also control the virtual object to move between virtual scenes corresponding to different areas through the terminal, for example, from a mine area to a forest area.
It should be noted that, in order to facilitate management of the virtual scene and instance data in the virtual scene, the game engine will generally define the virtual scene as world; a set of a plurality of instance data constituting a virtual scene is defined as a level. For example, the instance data of lighting, static grid, object model, trigger, cloud layer, topography, fog effect and the like in world form a level. A level or set of levels may be included in a world. Wherein, a group of levels comprises a plurality of levels. The opportunities for loading, running and unloading of each set of levels can be managed by world. Therefore, the game engine can manage the loading time of the instance data of the world in the process of running the world, and all levels are loaded without running the world, so that the loading efficiency of the instance data is further improved, and the performance requirement on the terminal is reduced. For example, the game engine may manage multiple levels contained in a World by reading and writing instances contained in the World class or invoking functions contained in the World class. For example, the World class includes a Level m_persistence_level field and a Dynamicarray < Level > m_streaming_levels field. The Level m_persistent_level field is used to store an instance of a Level that persists in the life cycle of the world, that is, an instance of a persistent Level. The world can implement a persistent Level under the updated world by updating the Level m_persistent_level field. For example, world switches any Level to a persistent Level by writing an instance of that Level to the Level m_persistent_level field. In addition, for other non-persistent levels in the world, the world may load or unload any one or more of the non-persistent levels as needed during the world's operation. The Dynamicarray < Level > m_streaming_levels field is used to store an instance of a Level that is streamed during world run. The world can also implement the Level loaded by streaming under the updated world by updating the Dynamicarray < Level > m_streaming_levels field. In addition, the World class also includes functions such as LoadLevel, un LoadLevel, getpersistence level, setpersistence level, getStreamingLevel, and un streaminglevel. The game engine may load at least one level in the world via a LoadLevel function. The game engine may also offload at least one level in the world via the UnLoadlevel function.
In some embodiments, the terminal is also capable of establishing an association between the virtual scene and instance data of the virtual scene. In the process of constructing the target virtual scene, the terminal determines the number of target instance data. The target instance data is used for generating a target virtual scene. For example, the target instance data is used to generate instance objects such as trees, rocks, rivers, birds, clouds, etc. in the target virtual scene. In the case that the number of the target instance data is greater than the number threshold, the terminal divides the target virtual scene into a plurality of virtual scenes. The number threshold may be a preset value, such as 1000, 5000, or 10000, which is not limited in the embodiment of the present application. Then, for any virtual scene, the terminal determines a plurality of instance data for generating the virtual scene among the target instance data. The terminal determines storage paths of the instance data and establishes an association relationship between a scene instance of the virtual scene and the storage paths of the instance data. By dividing the target virtual scene into a plurality of virtual scenes, the terminal can load and manage one or more virtual scenes as required, and the terminal is prevented from directly loading the whole target virtual scene, so that the loading efficiency and the management efficiency of the virtual scenes are improved.
In some embodiments, a scene instance of a virtual scene includes a plurality of fields. The terminal establishes an association relationship between the scene instance and the storage path by writing the storage paths of the plurality of instance data of the virtual scene into the target field of the scene instance. Wherein the target field is a field representing a storage path of the instance data.
In some embodiments, the terminal may further create a storage path after determining the plurality of instance data of the virtual scene, and copy the plurality of instance data into the created storage path. Then, the terminal writes the newly created storage path into the target field of the scenario instance.
302. Under the condition that the terminal runs the first virtual scene, at least one loading thread is created in response to a loading request of at least one second virtual scene, the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data is used for generating the second virtual scene.
In this embodiment of the present application, the first virtual scene is any one of the target virtual scenes. And under the condition that the terminal runs the first virtual scene, the first virtual scene is displayed on a screen of the terminal. The player may control the virtual object to be active within the first virtual scene through the terminal. In response to receiving a switching operation on the virtual scene, the game engine sends a loading request to the terminal. The loading request is used for requesting the terminal to load at least one second virtual scene. The second virtual scene is a virtual scene to be loaded in the target virtual scene. By executing the switching operation, the currently running virtual scene can be switched from the first virtual scene to at least one second virtual scene. Accordingly, the terminal creates at least one loading thread in response to receiving the loading request. The terminal can load instance data of at least one second virtual scene through the at least one loading thread in parallel, so that the loading efficiency of the second virtual scene is improved.
In some embodiments, the switching operation on the virtual scene may be an operation that the player leaves the first virtual scene and enters any second virtual scene by controlling the virtual object through the terminal; the switching operation can also be that the player completes the game task in the first virtual scene successfully through the terminal; the switching operation may also be a trigger operation of a control of the switching scenario by a technician, which is not limited in the embodiment of the present application. Accordingly, the game engine may determine one or more second virtual scenes according to different switching operations. For example, the second virtual scene is a virtual scene that the player controls the virtual object to enter, or is a virtual scene corresponding to the next game level, which is not limited in the embodiment of the present application.
In some embodiments, the second virtual scene is a virtual scene adjacent to the first virtual scene. Under the condition that the terminal runs the first virtual scenes, the terminal determines at least one virtual scene adjacent to the first virtual scene, namely at least one second virtual scene through the game engine. The game engine is further capable of generating a loading request according to the identification of the at least one second virtual scene, and sending the loading request to the terminal to request the terminal to load the at least one second virtual scene. Correspondingly, the terminal responds to the received loading request sent by the game engine, and analyzes the loading request to obtain at least one identifier of the second virtual scene. Then, the terminal creates at least one loading thread according to the identification of the at least one second virtual scene. The number of the loading threads created by the terminal is the same as the number of the identifiers carried in the loading request. The identification of the second virtual scene may be an ID (Identity Document, identification number) of the second virtual scene. And in the process of creating or dividing the virtual scene for the terminal by the ID of the second virtual scene, generating a unique identification number for the virtual scene. By creating at least one loading thread, the instance data of at least one virtual scene can be loaded in advance by the at least one loading thread, so that the loading efficiency of the instance data is improved.
303. And for any second virtual scene, loading a plurality of instance data from a storage path of the second virtual scene by the terminal through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene.
In the embodiment of the application, in the process of loading the instance data of any second virtual scene, the terminal firstly determines the storage path of the instance data of the second virtual scene. For example, the terminal determines a scene instance of the second virtual scene, and determines a storage path associated with the scene instance as a storage path storing instance data of the second virtual scene. The terminal determines a storage path associated with the scene instance by reading a target field of the scene instance. Then, the terminal loads a plurality of instance data of the second virtual scene from the storage path of the second virtual scene through a loading thread corresponding to the second virtual scene.
In some embodiments, the terminal loads the plurality of instance data of the second virtual scene from the disk by loading the thread. For example, for any second virtual scene, the terminal determines, through the corresponding loading thread, a plurality of instance data stored in a storage path of the second virtual scene according to the storage path in the disk. Then, the terminal loads the plurality of instance data in the storage path from the disk to the memory through the loading thread. By loading the instance data of the second virtual scene from the disk into the memory, the terminal can conveniently read and process the instance data in the memory directly, and the efficiency of reading the instance data and the efficiency of processing the instance data are improved.
It should be noted that, different loading threads are independent and do not affect each other. The terminal can load a plurality of instance data of the at least one second virtual scene into the memory from at least one storage path of the disk through at least one loading thread in parallel.
304. And the terminal processes the plurality of instance data of the second virtual scene according to the operation logic associated with the second virtual scene to generate the second virtual scene, wherein the operation logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
In the embodiment of the application, for any second virtual scene, the terminal determines the operation logic associated with the second virtual scene. Wherein the execution logic is capable of instructing the terminal to execute a plurality of operations in the process of processing the instance data of the second virtual scene and an execution order in which the terminal executes the plurality of operations. After the terminal loads the plurality of instance data of the second virtual scene into the memory through the corresponding loading thread, the terminal executes the plurality of operations on the plurality of instance data of the second virtual scene in the memory according to the execution sequence of the plurality of operations indicated by the operation logic so as to generate the second virtual scene. The operations include an operation of editing instance data, an operation of checking the integrity of the instance data, an operation of rendering the instance data, and the like.
In some embodiments, the load request also carries the type of each second virtual scene. The terminal can determine the associated operation logic of the second virtual scene according to the type of the second virtual scene. And for any second virtual scene, the terminal determines the type of the second virtual scene according to the loading request. Wherein the types include edit type, play type, and test type. The editing type virtual scene is used for a technician to create a virtual scene and edit a virtual object in the virtual scene; the game type virtual scene is used for a player to explore and play in the virtual scene; the virtual scene of the test type is used for a technician to test the virtual scene and instance data in the virtual scene. And under the condition that the type of the second virtual scene is the editing type, the terminal determines that the second virtual scene is associated with the first running logic. Wherein the first execution logic indicates that the performed operation includes an edit operation on the instance data. And in the case that the type of the second virtual scene is a play type, the terminal determines that the second virtual scene is associated with the second running logic. Wherein the second execution logic indicates that the performed operation includes an interaction with an instance object represented by the instance data. And under the condition that the type of the second virtual scene is the test type, the terminal determines that the second virtual scene is associated with the third running logic. Wherein the third execution logic indicates that the operations performed include an edit operation on the instance data, an interactive operation with the instance object represented by the instance data, and a test operation on the instance data. Therefore, the running logic containing different operations is determined through the type of the second virtual scene, so that a player or a technician can conveniently execute different operations on the instance data in the virtual scene through different running logic, and the editing requirement, playing requirement, performance test requirement and the like of the player or the technician on the virtual scene are met.
In some embodiments, the terminal may also query the scene instance of the second virtual scene for the type of the second virtual scene by calling getworld type (a function for querying the type of World) under the World class. Illustratively, the scene instance includes a WorldTYPE m_world_type field for recording the type of the second virtual scene. In the case where the types of the second scene are the edit type, the play type, and the test type, respectively, the fields are Editor World, name World, and PIE World, respectively. In the case where the type of world is an edit type, the execution logic associated with the world contains all edit logic and no gameplay logic. Thus, the first execution logic indicates that the operations performed include all editing operations on the instance data, but do not include interaction with the instance object represented by the instance data. In the case where the type of world is a play type, the execution logic associated with the world contains all gameplay logic and no editing logic. Thus, the second execution logic indicates that the operations performed include all interactions with the instance object represented by the instance data, but not editing operations on the instance data. In the case where the type of world is a test type, the execution logic associated with the world includes simple edit logic, performance test logic, and gameplay logic. Thus, the third execution logic indicates that the operations performed include a portion of editing operations on the instance data, a portion of testing operations on the instance data, and all interactions with the instance object represented by the instance data.
It should be noted that the types of the virtual scenes may also include other types, such as a preview type, an automatic operation type, and the like. The user can create other types of virtual scenes through the terminal according to the actual requirements of the user. In some embodiments, in the process of creating a virtual scene by a terminal, the terminal may create any type of virtual scene by calling a series of creation functions under the World Manager class. For example, a creation function such as createIEWord (creating a virtual scene of a test type), createEditorWord (creating a virtual scene of an edit type), createGameWord (creating a virtual scene of a play type), and the like.
The following describes a process of processing and rendering instance data of a second virtual scene by a terminal by performing a plurality of operations to generate the second virtual scene. For any second virtual scene, firstly, the terminal reads a plurality of instance data of the second virtual scene in the memory. Then, the terminal executes a plurality of operations according to the execution sequence of the operations indicated by the operation logic through a data processing module in the game engine according to the operation logic associated with the second virtual scene, so as to process a plurality of instance data of the second virtual scene. Wherein the plurality of operations belong to at least one of an editing operation on the instance data, an interactive operation with the instance object represented by the instance data, and a testing operation on the instance data. And then, the terminal renders the plurality of instance data through a rendering module in the game engine to generate a second virtual scene. By processing the instance data of the second virtual scene according to the operation logic, at least one second virtual scene can be generated in advance, so that when a player switches game scenes, the terminal can directly operate the loaded second virtual scene, seamless switching of game scenes is realized, and game experience of the player is improved.
In some embodiments, editing operations on instance data include operations of adding instance data, deleting instance data, adjusting a shape of instance data (e.g., adjusting a shape of an instance object represented by instance data), and adjusting properties of instance data (e.g., adjusting a visual range, an audible range, an attack range, etc. of an instance object represented by instance data). The interaction operations with the instance object represented by the instance data include triggering operations (such as opening, closing, throwing Dan Toudeng) on the instance object, attacking the instance object, treating the instance object, and the like. The test operation on the instance data comprises operations such as whether the instance object represented by the test instance data can be normally displayed, whether the test instance object can be normally interacted with, whether the test instance data can be normally rendered and the like.
In some embodiments, the terminal is further capable of switching the state of the second virtual scene during the execution of the steps 303-304, and determining the timing of executing the step 304 according to the state of the second virtual scene. For example, for any second virtual scene, in response to the terminal beginning to load multiple instance data of the second virtual scene through the loading thread, the terminal switches the state of the second virtual scene to an initialized state. And responding to the terminal to successfully load the plurality of instance data of the second virtual scene, and switching the state of the second virtual scene into an initialization completion state by the terminal. And responding to the state switching of the second virtual scene to an initialization completion state, processing a plurality of instance data of the second virtual scene by the terminal according to the running logic associated with the second virtual scene, and switching the state of the second virtual scene to a loading state. And responding to the successful generation of the second virtual scene by the terminal, and switching the state of the second virtual scene into a loading completion state by the terminal. The loading completion state is used for indicating that the first virtual scene can be switched to the second virtual scene currently. By switching different states for the second virtual scene in the process of loading the second virtual scene, the terminal can directly switch the first virtual scene running currently into any second virtual scene in the loading completion state in the scene switching process, and the scene switching efficiency is improved.
For example, the terminal may query the scene instance of the second virtual scene for the type of the second virtual scene. Illustratively, the WorldState m_world_State field of the scene instance is used to record the state of the second virtual scene. The terminal can also change the written state in the field to realize the switching of the state of the second virtual scene.
In some embodiments, in the process of switching virtual scenes by the terminal, the terminal may obtain at least one virtual scene that has been loaded currently in the Map < ui, world > m_world instance by calling the getworld function under the World Manager class. The Map < ui > m_words instance is used for storing the virtual scene which is loaded currently and the ID of the virtual scene. The uint field in the < uint, world > is the ID of the virtual scene; the World field is the virtual scene where loading is completed.
It should be noted that the above embodiment describes a process of loading at least one virtual scene in parallel by the terminal multithreading. In some embodiments, the terminal is also capable of multithreading to offload at least one virtual scene in parallel. For example, in the case that the terminal runs at least one second virtual scene, the terminal parses the offload request in response to receiving the offload request. And under the condition that the unloading request carries the identification of at least one third virtual scene, the terminal creates at least one unloading thread. The unloading threads are used for unloading instance data of the corresponding virtual scenes. The third virtual scene is the virtual scene to be offloaded. The third virtual scene may be at least one of the first virtual scene and the at least one second virtual scene. Then, for any third virtual scene, the terminal deletes the instance data of the third virtual scene in the memory through the corresponding unloading thread. By creating at least one unloading thread, the terminal can conveniently and parallelly unload the instance data of at least one virtual scene in advance through the at least one unloading thread, so that the efficiency of deleting the instance data in the memory is improved.
In some embodiments, in the process that the terminal uninstalls the virtual scene through the uninstall thread, the uninstall thread can uninstall all the virtual scenes currently running by calling the UnloadWords function under the World Manager class. Or, the unloading thread unloads the virtual scene of the corresponding ID by calling UnloadWorldyID function under the World Manager class.
In some embodiments, the terminal is also capable of synchronizing instance data between different types of virtual scenes. And under the condition that the terminal runs a plurality of fourth virtual scenes, the terminal determines at least two fifth virtual scenes in the fourth virtual scenes according to the identifiers of the fourth virtual scenes. The fourth virtual scene is the virtual scene of the current operation of the terminal. The fifth virtual scene is a virtual scene generated from the same plurality of instance data, which is identical in identification, different in type. Thus, the number, location, and type of instance objects within the at least two fifth virtual scenes are all the same. And the terminal responds to the adjustment operation of the instance data in any fifth virtual scene, and synchronously executes the same adjustment operation in other fifth virtual scenes. Wherein the adjusting operation includes at least one of an operation of adding instance data, an operation of deleting instance data, a shape adjusting operation for an instance object represented by the instance data, and an attribute adjusting operation for an instance object represented by the instance data. By realizing the synchronization of instance data between the same virtual scenes in different types, the editing, playing and performance testing of the same virtual scenes can be synchronized in real time, so that the editing requirements, playing requirements and performance testing requirements of players and technicians on the virtual scenes are met simultaneously.
In some embodiments, the terminal may also determine at least two fifth virtual scenes among the plurality of fourth virtual scenes according to the identification of the asset. For any virtual scene, the assets of the virtual scene include a plurality of instance data for generating the virtual scene. Thus, in the case where a plurality of virtual scenes are generated from the same plurality of instance data, the assets of the plurality of virtual scenes are the same, and the identifications of the assets are also the same. And under the condition that the terminal runs a plurality of fourth virtual scenes, the terminal can determine at least two fifth virtual scenes in the plurality of fourth virtual scenes according to the identification of the asset of each fourth virtual scene. Wherein the identities of the assets of the at least two fifth virtual scenes are the same. For example, the terminal determines at least two fourth virtual scenes having the same ID of the asset as the fifth virtual scene among the plurality of fourth virtual scenes.
In order to more clearly illustrate the process of loading and unloading virtual scenes by the terminal through the loading thread and the unloading thread, the process of loading and unloading virtual scenes by the terminal through the game engine in one cycle will be described with reference to the flowchart of data processing shown in fig. 4.
As shown in fig. 4, in response to the game engine starting a main loop, the game engine determines a virtual scene to be loaded and a virtual scene to be unloaded, and sends a loading request and an unloading request to the terminal to request the terminal to load and unload the virtual scene. The terminal responds to the unloading request, analyzes the unloading request, determines at least one virtual scene to be unloaded, and creates at least one unloading thread. The terminal uninstalls at least one virtual scene in parallel through at least one uninstalling thread. The terminal responds to the loading request, analyzes the loading request, determines at least one virtual scene to be loaded, and creates at least one loading thread. And then, loading the instance data of the corresponding virtual scene by the terminal through the loading thread, and acquiring the associated operation logic of the virtual scene. The world (world) initialization process includes loading a scene instance of a virtual scene, analyzing the scene instance, determining a type and a storage path of the virtual scene, determining operation logic associated with the virtual scene according to the type of the virtual scene, loading instance data of the virtual scene according to the storage path of the virtual scene, and the like. The level initialization process includes acquiring a plurality of levels included in the virtual scene, acquiring a storage path of each level, loading instance data of the level in the storage path, and the like. And responding to the terminal loading to finish any virtual scene, and returning a loading completion response carrying the ID of the virtual scene to the game engine by the terminal. Then, the game engine responds to the loading completion response, and processes a plurality of instance data of the virtual scene according to the operation logic associated with the virtual scene through the data processing module; and rendering the plurality of instance data of the virtual scene by a rendering module until the virtual scene is generated. The game engine then starts the next main cycle and performs a similar data processing flow during the next main cycle.
In some embodiments, in performing the checkpoint initialization, the loading thread may perform initialization of multiple levels by reading and writing instances included in the Level class or calling functions included in the Level class. For example, the Level class includes an m_level_url field, a Level id field, and an m_actor_array field. Wherein the m_level_url field is used to record a storage path storing level instance data. The level ID field is used to record the ID of the level. The m_actor_array field is used for recording instance data such as illumination in level, static grid body and interactable instance objects. The Level class includes functions such as getLevelID, initialize and clear. Wherein, the getLevelID function is used to obtain the level ID. initialization is used to perform level initialization. The clear function is used to offload level instance data.
The embodiment of the application provides a data processing method, which can load a plurality of virtual scenes in parallel through a plurality of loading threads. Since a plurality of instance data of the virtual scene is stored in the storage path of the virtual scene. Therefore, in the process of generating any virtual scene, a plurality of instance data of the virtual scene can be acquired in the corresponding storage path and processed, and the instance data of other virtual scenes cannot be affected. By adopting the method, a plurality of virtual scenes can be loaded in parallel, and the instance data among the virtual scenes can not be mutually influenced, so that the loading efficiency of the virtual scenes is improved. In addition, when the virtual scene is switched in the game, the virtual scene can be directly switched to be generated, waiting for loading is not needed, and therefore the user can obtain the game experience of seamlessly switching the virtual scene.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein in detail.
Fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. Referring to fig. 5, the apparatus includes: a creation module 501, a loading module 502 and a processing module 503.
A creating module 501, configured to, under a condition of running a first virtual scene, create at least one loading thread in response to a loading request for at least one second virtual scene, where the loading request is used to request loading of the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used to load multiple instance data of the corresponding second virtual scene, and the multiple instance data is used to generate the second virtual scene;
the loading module 502 is configured to load, for any second virtual scene, a plurality of instance data from a storage path of the second virtual scene through a corresponding loading thread, where the storage path is used to store the plurality of instance data of the second virtual scene;
a processing module 503, configured to process the plurality of instance data of the second virtual scene according to the execution logic associated with the second virtual scene to generate the second virtual scene, where the execution logic is configured to instruct a plurality of operations performed during processing of the plurality of instance data and an execution sequence of the plurality of operations.
In some embodiments, the loading module 502 is configured to determine, for any second virtual scene, a plurality of instance data stored in a storage path of the second virtual scene in a disk through a corresponding loading thread; multiple instance data are loaded from disk into memory by a loading thread.
In some embodiments, the creating module 501 is configured to determine, by the game engine, at least one second virtual scene, where the second virtual scene is a virtual scene adjacent to the first virtual scene, where the game engine is configured to generate the loading request based on the at least one second virtual scene; responding to a loading request sent by a game engine, and analyzing the loading request to obtain at least one identifier of a second virtual scene; at least one loading thread is created based on the identification of the at least one second virtual scene.
In some embodiments, fig. 6 is a schematic structural diagram of another data processing apparatus provided in an embodiment of the present application, referring to fig. 6, where the apparatus further includes:
the first determining module 504 is configured to determine, for any second virtual scene, a type of the second virtual scene based on a loading request, where the loading request further carries a type of each second virtual scene in at least one second virtual scene, and the types include an edit type, a play type, and a test type;
A second determining module 505, configured to determine that the second virtual scene is associated with the first running logic when the type of the second virtual scene is an editing type, where the first running logic indicates that the performed operation includes an editing operation on the instance data; in the case that the type of the second virtual scene is a play type, determining that the second virtual scene is associated with second execution logic, the second execution logic indicating that the performed operation includes an interaction with an instance object represented by instance data; in the case that the type of the second virtual scene is a test type, determining that the second virtual scene is associated with third execution logic, the third execution logic indicating that the executed operations include an editing operation on the instance data, an interaction operation with the instance object represented by the instance data, and a test operation on the instance data.
In some embodiments, the processing module 503 is configured to read, in the memory, a plurality of instance data of the second virtual scene; based on the operation logic associated with the second virtual scene, processing a plurality of instance data according to a plurality of operations and an execution sequence of the plurality of operations, which are instructed to be executed by the operation logic, wherein the plurality of operations belong to at least one operation of editing operation of the instance data, interaction operation of the instance object represented by the instance data and test operation of the instance data; rendering the plurality of instance data to generate a second virtual scene.
In some embodiments, the apparatus further comprises:
a state switching module 506, configured to switch, for any second virtual scene, a state of the second virtual scene to an initialized state in response to starting loading of a plurality of instance data of the second virtual scene; switching the state of the second virtual scene to an initialization completion state in response to successfully loading the plurality of instance data of the second virtual scene; responding to the state of the second virtual scene as an initialization completion state, processing a plurality of instance data of the second virtual scene according to the running logic associated with the second virtual scene, and switching the state of the second virtual scene into a loading state; and in response to successful generation of the second virtual scene, switching the state of the second virtual scene to a loading completion state, wherein the loading completion state is used for indicating that the first virtual scene can be switched to the second virtual scene currently.
In some embodiments, the apparatus further comprises:
the creation module 501 is further configured to, in response to receiving an offload request when the at least one second virtual scene is running, create at least one offload thread when the offload request carries an identifier of at least one third virtual scene, where the at least one offload thread corresponds to the at least one third virtual scene one by one, and the offload thread is configured to offload instance data of the corresponding virtual scene, and the third virtual scene is at least one of the first virtual scene and the at least one second virtual scene;
And the deleting module 507 is configured to delete, for any third virtual scene, instance data of the third virtual scene in the memory through the corresponding offload thread.
In some embodiments, the apparatus further comprises:
a third determining module 508, configured to determine, in the case of running the plurality of fourth virtual scenes, at least two fifth virtual scenes from the plurality of fourth virtual scenes based on the identifiers of the plurality of fourth virtual scenes, the identifiers of the at least two fifth virtual scenes being the same, the at least two fifth virtual scenes being different in type, the at least two fifth virtual scenes being generated from the same instance data;
an adjustment module 509, configured to perform an adjustment operation in the other fifth virtual scenes in response to an adjustment operation on the instance data in any of the fifth virtual scenes, where the adjustment operation includes at least one of an addition operation, a deletion operation, a shape adjustment operation, and an attribute adjustment operation.
In some embodiments, the apparatus further comprises:
a dividing module 510, configured to divide the target virtual scene into a plurality of virtual scenes if the number of target instance data is greater than the number threshold, where the target instance data is used to generate the target virtual scene;
a fourth determining module 511 for determining, for any virtual scene, a plurality of instance data for generating the virtual scene among the target instance data;
The establishing module 512 is configured to establish an association relationship between a scene instance of the virtual scene and a storage path of the plurality of instance data.
The embodiment of the application provides a data processing device capable of loading a plurality of virtual scenes in parallel through a plurality of loading threads. Since a plurality of instance data of the virtual scene is stored in the storage path of the virtual scene. Therefore, in the process of generating any virtual scene, a plurality of instance data of the virtual scene can be acquired in the corresponding storage path and processed, and the instance data of other virtual scenes cannot be affected. By adopting the method, a plurality of virtual scenes can be loaded in parallel, and the instance data among the virtual scenes can not be mutually influenced, so that the loading efficiency of the virtual scenes is improved. In addition, when the virtual scene is switched in the game, the virtual scene can be directly switched to be generated, waiting for loading is not needed, and therefore the user can obtain the game experience of seamlessly switching the virtual scene.
It should be noted that, in the data processing apparatus provided in the foregoing embodiment, when implementing the functions thereof, only the division of the foregoing functional modules is illustrated, and in an actual application program, the foregoing functional allocation may be implemented by different functional modules, that is, the internal structure of the terminal is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the data processing apparatus and the data processing method embodiment provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the data processing apparatus and the data processing method embodiment are detailed in the method embodiment, which is not described herein again.
In the embodiment of the present application, the computer device may be configured as a terminal or a server, and when the computer device is configured as a terminal, the technical solution provided in the embodiment of the present application may be implemented by the terminal as an execution body, and when the computer device is configured as a server, the technical solution provided in the embodiment of the present application may be implemented by the server as an execution body, and also the technical solution provided in the present application may be implemented by interaction between the terminal and the server, which is not limited in this embodiment of the present application.
Fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application.
The terminal 700 includes: a processor 701 and a memory 702.
Processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 701 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processing interactor) for responsible for rendering and rendering of the content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 702 is used to store at least one computer program for presentation by processor 701 to implement the methods of representing multimedia data provided by the method embodiments of the present application, or to implement the data processing methods provided by the method embodiments of the present application.
In some embodiments, the terminal 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 703 via buses, signal lines or a circuit board. Optionally, the peripheral device comprises: at least one of radio frequency circuitry 704, a display 705, a camera assembly 706, audio circuitry 707, and a power supply 708.
A peripheral interface 703 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 701 and memory 702. In some embodiments, the processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 704 is configured to receive and transmit RF (Radio Frequency) signals, also referred to as electromagnetic signals. The radio frequency circuitry 704 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 704 may communicate with other devices via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 704 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 705 is a touch display, the display 705 also has the ability to collect touch signals at or above the surface of the display 705. The touch signal may be input to the processor 701 as a control signal for processing. At this time, the display 705 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 705 may be one and disposed on the front panel of the terminal 700; in other embodiments, the display 705 may be at least two, respectively disposed on different surfaces of the terminal 700 or in a folded design; in other embodiments, the display 705 may be a flexible display disposed on a curved surface or a folded surface of the terminal 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 705 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 706 is used to capture images or video. Optionally, the camera assembly 706 includes a front camera and a rear camera. The front camera is disposed on the front panel of the terminal 700, and the rear camera is disposed on the rear surface of the terminal 700. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing, or inputting the electric signals to the radio frequency circuit 704 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 700. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 707 may also include a headphone jack.
The power supply 708 is used to power the various components in the terminal 700. The power source 708 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power source 708 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 700 further includes one or more sensors 709. The one or more sensors 709 include, but are not limited to: acceleration sensor 170, gyro sensor 711, pressure sensor 712, optical sensor 713, and proximity sensor 714.
The acceleration sensor 170 may detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 700. For example, the acceleration sensor 170 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 701 may control the display screen 705 to display a user interface in a landscape view or a portrait view based on the gravitational acceleration signal acquired by the acceleration sensor 170. The acceleration sensor 170 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 711 may detect a body direction and a rotation angle of the terminal 700, and the gyro sensor 711 may collect a 3D motion of the user on the terminal 700 in cooperation with the acceleration sensor 170. The processor 701 may implement the following functions according to the data collected by the gyro sensor 711: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 712 may be disposed at a side frame of the terminal 700 and/or at a lower layer of the display screen 705. When the pressure sensor 712 is disposed at a side frame of the terminal 700, a grip signal of the user to the terminal 700 may be detected, and the processor 701 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 712. When the pressure sensor 712 is disposed at the lower layer of the display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The optical sensor 713 is used to collect the intensity of ambient light. In one embodiment, the processor 701 may control the display brightness of the display screen 705 based on the ambient light intensity collected by the optical sensor 713. Optionally, when the ambient light intensity is high, the display brightness of the display screen 705 is turned up; when the ambient light intensity is low, the display brightness of the display screen 705 is turned down. In another embodiment, the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 713.
A proximity sensor 714, also known as a distance sensor, is provided on the front panel of the terminal 700. The proximity sensor 714 is used to collect the distance between the user and the front of the terminal 700. In one embodiment, when the proximity sensor 714 detects that the distance between the user and the front of the terminal 700 gradually decreases, the processor 701 controls the display 705 to switch from the bright screen state to the off screen state; when the proximity sensor 714 detects that the distance between the user and the front surface of the terminal 700 gradually increases, the processor 701 controls the display screen 705 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 7 is not limiting of the terminal 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 8 is a schematic structural diagram of a server provided in the embodiments of the present application, where the server 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 and one or more memories 802, where at least one computer program is stored in the memories 802, and the at least one computer program is loaded and executed by the processor 801 to implement the data processing methods provided in the foregoing method embodiments. Of course, the server 800 may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The present application also provides a computer-readable storage medium storing at least one program code loaded and executed by the processor to implement the data processing method as shown in the various embodiments above.
The present application also provides a chip comprising programmable logic circuits and/or program instructions for implementing the data processing method as shown in the various embodiments above when the chip is run on a computer device.
The present application also provides a computer program product storing at least one program code for execution by a processor to implement the data processing method as shown in the various embodiments above.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It will be appreciated by those skilled in the art that all or part of the steps in the data processing method implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read only memory, a magnetic disk, an optical disk, or the like. The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention.

Claims (10)

1. A method of data processing, the method comprising:
under the condition of running a first virtual scene, responding to a loading request of at least one second virtual scene, and creating at least one loading thread, wherein the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data is used for generating the second virtual scene;
for any second virtual scene, loading a plurality of instance data from a storage path of the second virtual scene through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene;
and processing a plurality of instance data of the second virtual scene according to the operation logic associated with the second virtual scene to generate the second virtual scene, wherein the operation logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
2. The method of claim 1, wherein for any second virtual scene, loading, by a corresponding loading thread, a plurality of instance data from a storage path of the second virtual scene comprises:
For any second virtual scene, determining a plurality of instance data stored in a storage path of the second virtual scene in a disk through a corresponding loading thread;
and loading the plurality of instance data from the disk to a memory through the loading thread.
3. The method of claim 1, wherein the creating at least one load thread in response to a load request for at least one second virtual scene while the first virtual scene is running, comprises:
determining, by a game engine, at least one second virtual scene that is a virtual scene adjacent to the first virtual scene, with the first virtual scene being run, the game engine being configured to generate a load request based on the at least one second virtual scene;
responding to a loading request sent by the game engine, and analyzing the loading request to obtain at least one identifier of a second virtual scene;
at least one loading thread is created based on the identification of the at least one second virtual scene.
4. The method according to claim 1, wherein the method further comprises:
For any second virtual scene, determining the type of the second virtual scene based on the loading request, wherein the loading request also carries the type of each second virtual scene in the at least one second virtual scene, and the types comprise an editing type, a play type and a test type;
determining that the second virtual scene is associated with first running logic when the type of the second virtual scene is an editing type, wherein the first running logic indicates that the executed operation comprises an editing operation on instance data;
determining that the second virtual scene is associated with second execution logic, wherein the second execution logic indicates that the executed operation comprises an interaction operation with an instance object represented by instance data, in the case that the type of the second virtual scene is a play type;
and in the case that the type of the second virtual scene is a test type, determining that the second virtual scene is associated with third running logic, wherein the third running logic indicates that the executed operation comprises an editing operation on instance data, an interaction operation with an instance object represented by the instance data and a test operation on the instance data.
5. The method of claim 1, wherein the processing the plurality of instance data of the second virtual scene in accordance with the execution logic associated with the second virtual scene to generate the second virtual scene comprises:
Reading a plurality of instance data of the second virtual scene in a memory;
processing the plurality of instance data according to a plurality of operations and an execution sequence of the plurality of operations, which are instructed to be executed by the operation logic, based on the operation logic associated with the second virtual scene, wherein the plurality of operations belong to at least one operation of editing operation of the instance data, interaction operation with an instance object represented by the instance data and test operation of the instance data;
rendering the plurality of instance data to generate the second virtual scene.
6. The method according to claim 1, wherein the method further comprises:
for any second virtual scene, switching the state of the second virtual scene to an initialized state in response to starting loading of a plurality of instance data of the second virtual scene;
switching the state of the second virtual scene to an initialization completion state in response to successfully loading the plurality of instance data of the second virtual scene;
responding to the state of the second virtual scene as an initialization completion state, processing a plurality of instance data of the second virtual scene according to the running logic associated with the second virtual scene, and switching the state of the second virtual scene into a loading state;
And responding to the successful generation of the second virtual scene, and switching the state of the second virtual scene into a loading completion state, wherein the loading completion state is used for indicating that the first virtual scene can be switched into the second virtual scene currently.
7. The method according to claim 1, wherein the method further comprises:
under the condition of running at least one second virtual scene, responding to a received unloading request, and under the condition that the unloading request carries the identification of at least one third virtual scene, creating at least one unloading thread, wherein the at least one unloading thread corresponds to the at least one third virtual scene one by one, the unloading thread is used for unloading the instance data of the corresponding virtual scene, and the third virtual scene is at least one of the first virtual scene and the at least one second virtual scene;
and deleting the instance data of any third virtual scene in the memory through the corresponding unloading thread.
8. A data processing apparatus, the apparatus comprising:
the system comprises a creation module, a processing module and a processing module, wherein the creation module is used for responding to a loading request of at least one second virtual scene under the condition of running a first virtual scene, wherein the loading request is used for requesting to load the at least one second virtual scene, the at least one loading thread corresponds to the at least one second virtual scene one by one, the loading thread is used for loading a plurality of instance data of the corresponding second virtual scene, and the plurality of instance data are used for generating the second virtual scene;
The loading module is used for loading a plurality of instance data from a storage path of any second virtual scene through a corresponding loading thread, wherein the storage path is used for storing the plurality of instance data of the second virtual scene;
and the processing module is used for processing a plurality of instance data of the second virtual scene according to the running logic associated with the second virtual scene so as to generate the second virtual scene, and the running logic is used for indicating a plurality of operations executed in the process of processing the plurality of instance data and the execution sequence of the plurality of operations.
9. A computer device, the computer device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the data processing method of any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that the storage medium stores at least one program code for execution by a processor to implement the data processing method of any one of claims 1 to 7.
CN202311639922.2A 2023-12-01 2023-12-01 Data processing method, device, computer equipment and storage medium Pending CN117732054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311639922.2A CN117732054A (en) 2023-12-01 2023-12-01 Data processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311639922.2A CN117732054A (en) 2023-12-01 2023-12-01 Data processing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117732054A true CN117732054A (en) 2024-03-22

Family

ID=90280339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311639922.2A Pending CN117732054A (en) 2023-12-01 2023-12-01 Data processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117732054A (en)

Similar Documents

Publication Publication Date Title
CN110147231B (en) Combined special effect generation method and device and storage medium
CN109754454B (en) Object model rendering method and device, storage medium and equipment
CN110141859B (en) Virtual object control method, device, terminal and storage medium
CN111013142B (en) Interactive effect display method and device, computer equipment and storage medium
CN111701238A (en) Virtual picture volume display method, device, equipment and storage medium
CN111603771B (en) Animation generation method, device, equipment and medium
CN112156464B (en) Two-dimensional image display method, device and equipment of virtual object and storage medium
WO2021244307A1 (en) Method and apparatus for selecting virtual object, and device and storage medium
CN112843679A (en) Skill release method, device, equipment and medium for virtual object
US20230082928A1 (en) Virtual aiming control
US20220291791A1 (en) Method and apparatus for determining selected target, device, and storage medium
CN110833695B (en) Service processing method, device, equipment and storage medium based on virtual scene
CN111760281A (en) Method and device for playing cut-scene animation, computer equipment and storage medium
CN112274936B (en) Method, device, equipment and storage medium for supplementing sub-props of virtual props
CN111651693B (en) Data display method, data sorting method, device, equipment and medium
CN111589143A (en) Animation playing method, device, equipment and storage medium
CN112717393B (en) Virtual object display method, device, equipment and storage medium in virtual scene
CN113018865B (en) Climbing line generation method and device, computer equipment and storage medium
CN112188268B (en) Virtual scene display method, virtual scene introduction video generation method and device
CN117732054A (en) Data processing method, device, computer equipment and storage medium
CN111672107B (en) Virtual scene display method and device, computer equipment and storage medium
CN113144595A (en) Virtual road generation method, device, terminal and storage medium
CN112316419B (en) Application program running method, device and equipment and readable storage medium
US20220161137A1 (en) Method and apparatus for adding map element, terminal, and storage medium
CN112619131B (en) Method, device and equipment for switching states of virtual props and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination