Data processing method, device and equipment of virtual scene, and storage medium
By sharing service processes within the game server and utilizing resource masks to achieve static resource sharing and dynamic resource isolation, the problem of excessive static resource consumption is solved, and server data redundancy and CPU load are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-02-18
- Publication Date
- 2026-06-12
Smart Images

Figure CN116650946B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud technology, and in particular to a data processing method, apparatus, device, and computer-readable storage medium for virtual scenes. Background Technology
[0002] With the development of gaming technology, servers need to provide resource services to a large number of game clients at the same time. Different game clients will access different game sessions, and the service process provides resource services to each game client in each session.
[0003] In related technologies, each game session requires a corresponding service process to be launched, with different service processes for different sessions, thus achieving dynamic resource isolation between different sessions. This results in the number of service processes equaling the number of game sessions. Consequently, a large number of game sessions will launch the same number of service processes. Since the memory occupied by static resources is positively correlated with the number of service processes, a surge in the number of service processes will lead to a significant increase in the memory usage of static resources, resulting in a large amount of data redundancy on the server.
[0004] There is currently no effective solution in terms of how to reduce data redundancy in servers. Summary of the Invention
[0005] This application provides a data processing method, apparatus, computer-readable storage medium, and computer program product for virtual scenes, which can effectively reduce server data redundancy by achieving dynamic resource isolation and static resource sharing between different servers.
[0006] The technical solution of this application embodiment is implemented as follows:
[0007] This application provides a data processing method for a virtual scene, including:
[0008] Multiple clients are connected to multiple single-site servers, wherein the multiple single-site servers share a service process, and the service process includes the static resources and dynamic resources of the virtual scene;
[0009] A static resource mask corresponding to the static resource is assigned to each of the plurality of clients, wherein the static resource masks assigned to the plurality of clients are the same;
[0010] Dynamic resource masks corresponding to the dynamic resources are assigned to the multiple clients respectively, wherein the dynamic resource masks assigned to clients accessing the same single network are the same, and the dynamic resource masks assigned to clients accessing different single networks are different;
[0011] Based on the static resource mask that is assigned to the corresponding static resources to the multiple clients respectively, the static resources are shared among the multiple single bureaus;
[0012] Based on the dynamic resource mask that allocates the corresponding dynamic resources to the multiple clients respectively, the dynamic resources are isolated between different single servers.
[0013] This application provides a data processing method for a virtual scene, including:
[0014] The first client in the terminal device connects to the server's service process and, in response to the opening command sent by the server, accesses one of the multiple single-game sessions created by the server for multiple clients. The multiple single-game sessions share the service process, and the service process includes the static and dynamic resources of the virtual scene. The multiple clients include the first client.
[0015] Receive the static resource mask sent by the server for the static resource, wherein the static resource mask sent by the server to different clients is the same;
[0016] The server receives a dynamic resource mask for the dynamic resource, wherein the dynamic resource mask sent by the server to the client accessing the same single network is the same, and the dynamic resource mask sent to the client accessing different single networks is different.
[0017] The static resource mask is used to share the static resources among the multiple single-site offices, and the dynamic resource mask is used to isolate the dynamic resources among different single-site offices.
[0018] This application provides a data processing device for a virtual scene, including:
[0019] An access module is used to connect multiple clients to multiple single-site environments, wherein the multiple single-site environments share a service process, and the service process includes the static resources and dynamic resources of the virtual scene;
[0020] The first allocation module is used to allocate static resource masks corresponding to the static resources to the plurality of clients respectively, wherein the static resource masks allocated to the plurality of clients are the same;
[0021] The second allocation module is used to allocate dynamic resource masks corresponding to the dynamic resources to the multiple clients respectively, wherein the dynamic resource masks allocated to the clients accessing the same single network are the same, and the dynamic resource masks allocated to the clients accessing different single networks are different.
[0022] A sharing module is used to share the static resources among the multiple single servers based on the static resource mask that is allocated to the multiple clients respectively.
[0023] An isolation module is used to isolate the dynamic resources between different single servers based on the dynamic resource mask that is allocated to the multiple clients respectively.
[0024] This application provides a data processing device for a virtual scene, including:
[0025] The access module is used to connect to the service process of the server through the first client in the terminal device, and in response to the opening command sent by the server, access one of the multiple single sessions created by the server for multiple clients, wherein the multiple single sessions share the service process, and the service process includes the static resources and dynamic resources of the virtual scene, and the multiple clients include the first client.
[0026] The first receiving module is configured to receive a static resource mask sent by the server for the static resource, wherein the static resource mask sent by the server to different clients is the same;
[0027] The second receiving module receives the dynamic resource mask sent by the server for the dynamic resource, wherein the dynamic resource mask sent by the server to the clients accessing the same single network is the same, and the dynamic resource mask sent to the clients accessing different single networks is different.
[0028] The static resource mask is used to share the static resources among the multiple single-site offices, and the dynamic resource mask is used to isolate the dynamic resources among different single-site offices.
[0029] This application provides an electronic device, including:
[0030] Memory, used to store executable instructions;
[0031] The processor, when executing executable instructions stored in the memory, implements the data processing method for the virtual scene provided in the embodiments of this application.
[0032] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the data processing method for a virtual scene provided in this application.
[0033] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the virtual scene data processing method described above in this application.
[0034] The embodiments of this application have the following beneficial effects:
[0035] By allowing multiple clients to access multiple servers and sharing a single service process across them, and by assigning corresponding static and dynamic resource masks to clients in different servers, static resource sharing and dynamic resource isolation are achieved between multiple servers. This significantly reduces the number of service processes. Since the memory occupied by static resources is positively correlated with the number of service processes, the significant reduction in the number of service processes leads to a significant reduction in the memory space occupied by static resources, thereby effectively reducing server data redundancy. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the architecture of the virtual scene data processing system provided in the embodiments of this application;
[0037] Figures 2A to 2B This is a schematic diagram of the structure of the data processing device for a virtual scene provided in the embodiments of this application;
[0038] Figures 3A to 3G This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application;
[0039] Figures 4A to 4D This is a schematic diagram illustrating the principle of the data processing method for virtual scenes provided in the embodiments of this application;
[0040] Figures 5A to 5J This is a schematic diagram illustrating the effect of the virtual scene data processing method provided in the embodiments of this application;
[0041] Figures 5K to 5M This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application;
[0042] Figure 5N This is a schematic diagram illustrating the principle of the virtual scene data processing method provided in the embodiments of this application;
[0043] Figure 5O This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application;
[0044] Figure 5P This is a schematic diagram illustrating the principles of the relevant technologies;
[0045] Figure 5Q This is a schematic diagram illustrating the principle of the virtual scene data processing method provided in the embodiments of this application;
[0046] Figures 5R to 5S This is a schematic diagram illustrating the principles of the relevant technologies. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0049] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0051] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0052] 1) Virtual Scene: This refers to the scene displayed when a game program runs on a terminal device. The scene can be a simulation of the real world, a semi-simulated / semi-fictional environment, or a purely fictional virtual environment. A virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, and ocean, and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.
[0053] 2) Static resources: These are non-interactive resources in a virtual scene, meaning resources whose state cannot be changed during the game process. For example, static resources can be buildings, road scenes, mountains, oceans, etc. in online games.
[0054] 3) Dynamic resources: Interactive resources in a virtual scene, that is, resources whose state may change during the game process. For example, dynamic resources can be the player-controlled character, destructible walls, bullets, etc.
[0055] 4) Responding to: used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0056] 5) Cloud gaming: This is a gaming method based on cloud computing. In cloud gaming, all games run on the server side, and the rendered game screen is compressed and transmitted to the user over the network. On the client side, the user's gaming device does not need any high-end processors or graphics cards; only basic video decompression capabilities are required.
[0057] 6) Single game: This can be a single match in an online game. A single game refers to a single battle session in which characters controlled by at least two online game players are assigned to each other after participating in matchmaking.
[0058] 7) Dedicated Server (DS): A dedicated server operates without a user interface (UI). It doesn't display any visual effects, and players don't run the game locally on the server. This allows the dedicated server to focus on game logic and manage incoming information from clients, thus fully utilizing its resources to host the game. The processes running on the server that provide services for displaying the virtual scene to clients are called service processes, or simply processes.
[0059] 8) Client: The game application running in the terminal.
[0060] During the implementation of the embodiments of this application, the applicant discovered the following problems with the related technology:
[0061] See Figure 5P , Figure 5PThis is a schematic diagram illustrating the principles of the relevant technology. In this technology, each game session requires a corresponding process to run the online game; that is, game session 01 corresponds to process 011, game session 02 corresponds to process 012, and game session 03 corresponds to process 013. Therefore, in this technology, the number of processes equals the number of game sessions. When dealing with a massive number of game sessions, this technology needs to ensure that the same number of processes are running. Since the lifecycle of a process is consistent with the running time of a game session, processes are created when a game session is created and destroyed when a game session is destroyed. The memory occupied by static resources is linearly related to the number of processes; for example, the static resources occupied by two processes are twice the static resources occupied by one process.
[0062] In related technologies, when faced with a massive number of processes running simultaneously and a massive number of processes being destroyed simultaneously, the following problems arise:
[0063] (1) Increased memory usage: As analyzed above, the memory occupied by static resources is positively correlated with the number of processes. The static resources occupied by two processes are twice that occupied by one process. When multiple processes contain the same static resource, it will cause the static resource to be loaded repeatedly, thus increasing memory usage. For example, if multiple processes run the same game level, the same level will be loaded repeatedly in multiple processes. Large maps include area copies, and different area copies use the same static resource, so the static resource will be loaded repeatedly in multiple processes.
[0064] (2) Increased Central Processing Unit (CPU) Load: Since the memory occupied by static resources is positively correlated with the number of processes, an increase in the number of games per session leads to increased CPU load, limiting the physical server's capacity. For example, if four clients can play in the same session, then 100 clients would require 25 processes to be launched. The increase in processes leads to an increase in L3 cache misses; see [link to relevant documentation]. Figure 5R , Figure 5R This is a schematic diagram of the relevant technology. The increase in L3 cache loss is manifested as a CPU load growth rate greater than the linear growth rate. When the number of processes increases, the CPU usage of a single process will increase accordingly.
[0065] (3) The process is repeatedly restarted: See Figure 5S , Figure 5S This is a schematic diagram illustrating the principles of the relevant technology. Since the process lifecycle follows the single session, the process starts when the single session begins and terminates when the single session closes. This means that during the operation of a single session, a large amount of redundant overhead from resource loading, unloading, and construction is generated. See [link / reference needed]. Figure 5S CPU load fluctuations occur during each process creation process.
[0066] This application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for virtual scenes. It effectively reduces server data redundancy by achieving dynamic resource isolation and static resource sharing between different servers. The following describes exemplary applications of the virtual scene data processing device provided in this application. This device can be implemented as various types of user terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or as a server. One of multiple terminals can be used as the server, for example, a desktop computer with strong computing power can be used as the server, and the other user terminals can be used as clients. The following describes exemplary applications when the device is implemented as a server.
[0067] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of a virtual scene data processing system 100 provided in an embodiment of this application. In order to realize the application scenario of processing online games (e.g., multiple terminals obtain static and dynamic resources from a network server), the terminals (terminals 400-1, 400-2 and 400-3 are shown as examples) connect to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of both.
[0068] Terminal 400-1 runs online game client 410-1, terminal 400-2 runs online game client 410-2, and terminal 400-3 runs online game client 410-3. Terminals 400-1, 400-2, and 400-3 and server 200 are interconnected via wired or wireless network.
[0069] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal 400 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, etc., but is not limited to these. Terminals and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0070] In some embodiments, the present application embodiments can also be implemented with the aid of cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computation, storage, processing, and sharing of data.
[0071] Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, allowing for on-demand use with flexibility and convenience. Cloud computing technology will become a crucial support. The backend services of cloud computing systems require substantial computing and storage resources.
[0072] See Figure 2A , Figure 2A This is a schematic diagram of the structure of a server 200 for a virtual scene data processing method provided in this application embodiment. Figure 2A The server 200 shown includes at least one processor 210, memory 250, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2A The general labeled all buses as Bus System 240.
[0073] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0074] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.
[0075] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.
[0076] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0077] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, for implementing various basic business functions and handling hardware-based tasks.
[0078] The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0079] In some embodiments, the virtual scene data processing device provided in this application can be implemented in software. The virtual scene data processing device can be a functional entity in server 200, and can implement the functions of service processes in server 200. Multiple service processes serve different clients, and the service processes in server 200 can be written in software code environments of different programming languages. Figure 2A A data processing device 255 for a virtual scene stored in memory 250 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: an access module 2551, a first allocation module 2552, a second allocation module 2553, a sharing module 2554, and an isolation module 2555. These modules are logically connected and can therefore be arbitrarily combined or further split according to their implemented functions. The functions of each module will be described below.
[0080] In some embodiments, see Figure 2B , Figure 2B This is a schematic diagram of the structure of the terminal 400 provided in the embodiment of this application. Figure 2B The terminal 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2B The general labeled all buses as Bus System 440.
[0081] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0082] Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430;
[0083] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.
[0084] In some embodiments, the data processing device for virtual scenes provided in this application can be implemented in software. Figure 2B A data processing device 455 for a virtual scene stored in memory 450 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: an access module 4551, a first receiving module 4552, and a second receiving module 4553. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.
[0085] The data processing method for virtual scenes provided in this application will be described in conjunction with exemplary applications and implementations of the servers or terminals provided in the embodiments of this application.
[0086] See Figure 3A , Figure 3A This is a flowchart illustrating the data processing method for a virtual scene provided in this application embodiment, which will be combined with... Figure 3A The steps 101 to 105 shown are explained below. The execution subject of steps 101 to 105 can be the aforementioned server. Steps 101 to 105 can be executed through the server's service processes. The server can have multiple service processes, each serving a different client.
[0087] In step 101, multiple clients are connected to multiple single-site connections.
[0088] In some embodiments, multiple sessions share a service process, and the service process includes static and dynamic resources of the virtual scene, meaning that at least two sessions share one service process. A session can be a single match in an online game, where a single match refers to a single battle session in which characters controlled by at least two online game players are assigned after participating in matchmaking.
[0089] As an example, see Figure 4D , Figure 4D This is a schematic diagram illustrating the principle of the data processing method for a virtual scene provided in this application embodiment. Service process 11 connects clients 131, 132, and 133 to single-site office 13; service process 11 connects clients 141, 142, and 143 to single-site office 14; service process 12 connects clients 151, 152, and 153 to single-site office 15; service process 16 connects client 161 to single-site office 16. Single-site office 13 and single-site office 14 share service process 11, and single-site office 15 and single-site office 16 share service process 12.
[0090] In some embodiments, see Figure 3B , Figure 3B This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3B Step 101 shown can be implemented through step 1011, which will be explained below.
[0091] In step 1011, in response to multiple clients connecting to the service process, multiple single-site processes are run, and an opening command is sent to multiple clients to enable multiple clients to connect to multiple single-site processes.
[0092] Each client connects to a single exchange. The number of connections in each single exchange is greater than or equal to the opening threshold and less than or equal to the closing threshold. The closing threshold represents the maximum number of clients that can connect to a single exchange, while the opening threshold represents the minimum number of clients that need to connect to a single exchange.
[0093] As an example, see Figure 4A , Figure 4A This is a schematic diagram illustrating the principle of the data processing method for a virtual scene provided in this application embodiment. In response to clients 421, 422, 431, 432, 441, and 442 connecting to the service process, service process 41 runs single-site 42, single-site 43, and single-site 44, and sends an initiation command to clients 421, 422, 431, 432, 441, and 442, so that clients 421 and 422 connect to single-site 42, clients 431 and 432 connect to single-site 43, and clients 441 and 442 connect to single-site 44.
[0094] As an example, see Figure 4A The number of accesses in each single station is greater than or equal to the opening threshold and less than or equal to the closing threshold. The number of accesses in a single station 42 is 2. The opening threshold can be 1 and the closing threshold can be 2. That is, the number of accesses in a single station 42 is greater than the opening threshold and equal to the closing threshold.
[0095] As an example, see Figure 4C , Figure 4C This is a schematic diagram illustrating the principle of the data processing method for a virtual scene provided in this application embodiment. In response to clients 311, 312, 313, 321, 322, 323, and 331 connecting to the service process 49, the service process 49 runs single-site 31, single-site 32, and single-site 33, and sends an initiation command to clients 311, 312, 313, 321, 322, 323, and 331, so that clients 311, 312, and 313 connect to single-site 31, clients 321, 322, and 323 connect to single-site 32, and client 331 connects to single-site 33.
[0096] In some embodiments, see Figure 3C , Figure 3C This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3C Step 1011 shown can be implemented through steps 10111 to 10112, which will be explained below.
[0097] In step 10111, in response to multiple clients connecting to the service process and the number of multiple clients being greater than or equal to the start threshold, the first single session is started, and a start instruction is sent to the first number of clients to enable multiple clients to access the first single session.
[0098] As an example, see Figure 4B , Figure 4B This is a schematic diagram illustrating the principle of the virtual scene data processing method provided in this application embodiment. When the opening threshold is set to 2 and the closing threshold is set to 3, the service process responds to the connection of clients 461, 462, 463, 471, 472, 473, 481, and 482 to the service process 45, and the number of clients (8) is greater than the opening threshold (2), and starts running the first single session 46. The service process sends an opening instruction to the first number (3) of clients (clients 461, 462, and 463) to enable clients 461, 462, and 463 to access the first single session 46.
[0099] In step 10112, in response to the number of clients accessing the t-th session being equal to the closing threshold and the number of clients not yet accessing the 1st to t-th sessions being greater than or equal to the opening threshold, the t+1-th session is started, and at least some of the clients not yet accessing the 1st to t-th sessions are accessed to the t+1-th session.
[0100] As an example, see Figure 4B When the opening threshold is set to 2 and the closing threshold is set to 3, the service process responds to the fact that the number of clients accessing the second single station 47 (which is 3) is equal to the closing threshold 3, and the number of clients (client 481 and client 482) that have not yet accessed the first to second single stations is greater than or equal to the opening threshold 2, and starts running the third single station 48, connecting clients 481 and client 482 that have not yet accessed the first single station 46 and the second single station 47 to the third single station.
[0101] In some embodiments, steps 10112 above are executed iteratively by incrementing t, where 1≤t≤T, and T is the upper limit of the number of single sessions that the service process can run.
[0102] Thus, by setting opening and closing thresholds, when multiple clients access multiple games, a certain number of clients are ensured to access each game. This allows multiple clients to connect to multiple games. By connecting multiple clients to multiple games, and having multiple games share a single service process, the number of service processes is significantly reduced compared to the number of games. Since the memory occupied by static resources is positively correlated with the number of service processes, the significant reduction in the number of service processes leads to a significant reduction in the memory space occupied by static resources, thereby effectively reducing data redundancy on the server.
[0103] In step 102, static resource masks corresponding to static resources are assigned to multiple clients respectively.
[0104] In some embodiments, static resource masks are used to share static resources across multiple single servers. The service process ensures the sharing of static resources across different single servers by assigning the same static resource mask to multiple clients, and the static resource masks assigned to multiple clients are identical.
[0105] As an example, see Figure 4A The service process allocates static resource masks for the corresponding static resources to clients 421, 422, 431, 432, 441, and 442 respectively.
[0106] As an example, see Figure 4BThe service process allocates static resource masks for the corresponding static resources to clients 461, 462, 463, 471, 472, 473, 481, and 482 respectively.
[0107] In some embodiments, step 102 above can be implemented by allocating a static resource mask with a value of 0 to multiple clients. That is, the value of the static resource mask can be 0.
[0108] In step 103, dynamic resource masks corresponding to the dynamic resources are allocated to multiple clients respectively.
[0109] In some embodiments, dynamic resource masks are used to isolate dynamic resources across multiple single-site environments. The service process assigns different dynamic resource masks corresponding to different dynamic resources to multiple clients, thereby ensuring that dynamic resources are complementary and visible across different single-site environments, thus achieving isolation. Specifically, clients accessing the same single-site environment are assigned the same dynamic resource mask, while clients accessing different single-site environments are assigned different dynamic resource masks.
[0110] As an example, see Figure 4A A first dynamic resource mask corresponding to the dynamic resources is allocated to clients 421 and 422 respectively. The first dynamic resource mask is the same as the dynamic resource mask corresponding to single-site 42. A second dynamic resource mask corresponding to the dynamic resources is allocated to clients 431 and 432 respectively. The second dynamic resource mask is the same as the dynamic resource mask corresponding to single-site 43. The first dynamic resource mask and the second dynamic resource mask are different.
[0111] As an example, see Figure 4B A third dynamic resource mask is assigned to clients 461, 462, and 463 respectively, corresponding to the dynamic resources. This third dynamic resource mask is the same as the dynamic resource mask corresponding to single-site 46. The same third dynamic resource mask is assigned to clients 471, 472, and 473. A fourth dynamic resource mask is assigned to clients 471, 472, and 473 respectively, corresponding to the dynamic resources. This fourth dynamic resource mask is the same as the dynamic resource mask corresponding to single-site 47. The third and fourth dynamic resource masks are different.
[0112] In some embodiments, step 103 above can be implemented in the following way: assigning a dynamic resource mask with a value of m to the client accessing the m-th single station; wherein the value of m is in the range of 1≤m≤M, and M is the upper limit of the number of single stations that the service process can run.
[0113] Among them, the dynamic resource mask allocated to clients accessing the same single bureau is the same, while the dynamic resource mask allocated to clients accessing different single bureaus is different.
[0114] As an example, see Figure 4A A dynamic resource mask with a value of 1 is assigned to clients 421 and 422 that access the first single station 42; a dynamic resource mask with a value of 2 is assigned to clients 431 and 432 that access the second single station 43; and a dynamic resource mask with a value of 3 is assigned to clients 441 and 442 that access the third single station 44.
[0115] As an example, see Figure 4B A dynamic resource mask with a value of 1 is assigned to clients 421 and 422 that access the first single station 42; a dynamic resource mask with a value of 2 is assigned to clients 431 and 432 that access the second single station 43; and a dynamic resource mask with a value of 3 is assigned to clients 441 and 442 that access the third single station 44.
[0116] In step 104, static resources are shared among multiple single servers based on the static resource mask that allocates corresponding static resources to multiple clients respectively.
[0117] In some embodiments, since the static resource mask is the same when allocating corresponding static resources to multiple clients, static resources can be shared between different servers using the same static resource mask. Clients across different servers share the same static resource; that is, the service process sends the same static resource to each client.
[0118] In this way, by assigning the same static resource mask to each client, the static resources sent by the service process to each client are the same, thereby enabling all clients in different servers to share the same static resources and effectively avoiding redundant loading of static resources.
[0119] In some embodiments, see Figure 3B , Figure 3B This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3B Step 104 shown can be implemented through steps 1041 to 1042, which will be explained below.
[0120] In step 1041, a static resource request is received from any one of the multiple clients.
[0121] As an example, see Figure 4A Service process 41 receives static resource requests sent by client 421 from multiple clients, wherein the static resource requests carry a static resource mask.
[0122] As an example, see Figure 4B Service process 45 receives static resource requests from client 471 among multiple clients, wherein the static resource requests carry a static resource mask.
[0123] In step 1042, based on the static resource mask carried in the static resource request, it is found that other clients among the multiple clients are assigned the same static resource mask, it is determined that multiple clients share static resources, and the same static resource is sent to any one of the multiple clients.
[0124] As an example, see Figure 4A Service process 41, based on the static resource mask carried in the static resource request sent by client 421, queries the static resource masks allocated to clients 422, 431, 432, 441, and 442. If the static resource mask is the same as the one carried in the static resource request sent by client 421, it determines that any one of clients 421, 422, 431, 432, 441, and 442 sends the same static resource. This enables static resource sharing among multiple clients in different servers, saving memory space occupied by static resources.
[0125] In step 105, dynamic resources are isolated between different single servers based on the dynamic resource mask that allocates corresponding dynamic resources to multiple clients respectively.
[0126] Isolation includes physical isolation and visual isolation. Physical isolation assigns the same horizontal, vertical, and horizontal coordinates to dynamic resources within the visual range of clients in any two different sessions. Visual isolation makes dynamic resources in two clients in different sessions invisible to each other.
[0127] In some embodiments, see Figure 3B , Figure 3B This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3B Step 105 shown can be implemented through steps 1051 to 1053, which will be explained below.
[0128] In step 1051, a dynamic resource update request is received from the first client among multiple clients.
[0129] The dynamic resource update request carries the operation information of the first client on the dynamic resource, as well as the dynamic resource mask allocated to the first client.
[0130] As an example, see Figure 4A Service process 41 receives a dynamic resource update request from a first client 431 among multiple clients. The dynamic resource update request carries the first client 431's operation information regarding the dynamic resource. For example, when the dynamic resource is a bullet, the first client 431 responds to a user's control operation to trigger the equipment to fire the bullet. This control operation is used to trigger the equipment to fire the bullet. The service process 41 then determines the first client 431's operation information regarding the dynamic resource (bullet) and generates the dynamic resource update request based on this operation information. Thus, the dynamic resource update request received by service process 41 carries the first client 431's operation information regarding the dynamic resource, as well as the dynamic resource mask allocated to the first client 431.
[0131] As an example, see Figure 4B Service process 45 receives a dynamic resource update request from a first client 472 among multiple clients. The dynamic resource update request carries operation information from the first client 472 regarding the dynamic resource. For example, when the dynamic resource is a character controlled by a player, the first client 431 responds to the player's control operation on the character, which changes the character's state (e.g., the character moves). The service process 45 then determines the operation information of the first client 431 regarding the dynamic resource (character) (e.g., triggering the character to move), and generates a dynamic resource update request based on this operation information. Thus, the dynamic resource update request received by service process 45 carries the operation information of the first client 431 regarding the dynamic resource, as well as the dynamic resource mask allocated to the first client 431.
[0132] In step 1052, the dynamic resources are updated based on the operation information to obtain the updated dynamic resources.
[0133] As an example, when the dynamic resource is a character controlled by a player, the first client 431 responds to the control operation of triggering the equipment to fire bullets, changes the state of the character (e.g., the character moves), determines the operation information of the first client 431 on the dynamic resource (character) (e.g., the character moves), updates the dynamic resource (character) based on the operation information (the character moves), and obtains the updated dynamic resource. Then, the position coordinates of the updated character have changed compared to the character before the update.
[0134] As an example, when the dynamic resource is a bullet, the first client 431 responds to the user's control operation to fire the bullet. The control operation is used to change the state of the bullet (e.g., from a non-fired state to a fired state). The first client 431 determines the operation information (e.g., fire the bullet) of the dynamic resource (bullet), and updates the dynamic resource (bullet) based on the operation information (bullet firing) to obtain the updated dynamic resource. Then, the updated bullet has changed position coordinates and firing state compared to the bullet before the update.
[0135] In step 1053, based on the dynamic resource mask allocated to the first client, at least one second client is identified that accesses the same single network as the first client and has at least partially the same field of view.
[0136] As an example, "same field of view" means that characters in two clients within the same game can see each other. "Same field of view" can mean the field of view is completely identical or partially identical. See also... Figure 5D , Figure 5D This is a schematic diagram illustrating the effect of the data processing method for a virtual scene provided in this application embodiment. From the perspective of role 2, role 1 can be observed, so the field of view of the client corresponding to role 1 and the client corresponding to role 2 is the same.
[0137] As an example, see Figure 4A Based on the dynamic resource mask allocated to the first client 431, the client 432 that accesses the same single network as the first client 431 is determined, and it is determined whether the field of view of the client 432 and the first client 431 is the same. When the field of view of the first client 431 and the client 432 is the same, the client 432 is determined as the second client.
[0138] As an example, see Figure 4B Based on the dynamic resource mask allocated to the first client 472, clients 471 and 473 that access the same single network as the first client 472 are identified, and it is determined whether the field of view of clients 471 and 473 is the same as that of the first client 472. When the field of view of the first client 472, client 473 and client 471 is the same, clients 471 and 473 are identified as the second client.
[0139] In some embodiments, when the virtual scene can be fully displayed in multiple clients at once, step 1053 above can be implemented in the following way: based on the dynamic resource mask allocated to the first client, query at least one client that is allocated the same dynamic resource mask as the first client from among the multiple clients, and use it as the second client.
[0140] In this way, since clients accessing the same single network have the same dynamic resource mask, the target client with the same dynamic resource mask as the first client can be identified based on the dynamic resource mask allocated to the first client. The target client is then identified as a client accessing the same single network as the first client. Thus, the dynamic resource mask can be used to query clients accessing the same single network, which facilitates the subsequent visual and physical isolation of dynamic resources for clients in different single networks.
[0141] In some embodiments, when a portion of a virtual scene is displayed simultaneously across multiple clients, see [link to relevant documentation]. Figure 3D , Figure 3D This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3D Step 1053 shown can be implemented through steps 10531 to 10533, which will be explained below.
[0142] In step 10531, based on the dynamic resource mask allocated to the first client, at least one client that has been allocated the same dynamic resource mask as the first client is queried from among multiple clients.
[0143] As an example, see Figure 4A Service process 41 queries from clients 421, 422, 432, 441 and 442 for the client that has been allocated the same dynamic resource mask as the first client, namely client 431, based on the dynamic resource mask allocated to the first client 431.
[0144] As an example, see Figure 4B Service process 45 queries clients 461, 462, 463, 471, 473, 481, and 482 that have the same dynamic resource mask as the first client 472, namely clients 471 and 473.
[0145] In step 10532, the distance between the currently displayed dynamic resource in the first client and the dynamic resources corresponding to at least one client in the virtual scene is determined.
[0146] As an example, see Figure 5D and Figure 4A Determine the distance between the currently displayed dynamic resource 7 in the first client 431 and the corresponding dynamic resource 8 in the virtual scene, that is, the distance between dynamic resource 7 and dynamic resource 8 in the virtual scene. Figure 5D The distance in the virtual scene shown.
[0147] As an example, see Figure 4BThe distance between the dynamic resource currently displayed in the first client 472 and the dynamic resource corresponding to the client 471 in the virtual scene is determined, as well as the distance between the dynamic resource currently displayed in the first client 472 and the dynamic resource corresponding to the client 473 in the virtual scene.
[0148] In step 10533, at least one client whose distance is less than the field of view distance threshold is designated as the second client.
[0149] In some embodiments, the field-of-view distance threshold is the minimum distance required to ensure that dynamic resources currently displayed in two clients within the same session are not visible to each other. When the distance between the dynamic resources currently displayed in two clients within the same session is less than the field-of-view distance threshold, the dynamic resources currently displayed in the two clients within the same session are visible to each other; when the distance between the dynamic resources currently displayed in two clients within the same session is greater than or equal to the field-of-view distance threshold, the dynamic resources currently displayed in the two clients within the same session are not visible to each other.
[0150] As an example, see Figure 4A and Figure 5D When at least one client assigned the same dynamic resource mask as the first client 431 is client 432, and the distance between the currently displayed dynamic resource 2 in the first client 431 and the currently displayed dynamic resource 1 in client 432 in the virtual scene is less than the field-of-view distance threshold, then client 432 is identified as the second client. If the distance between the currently displayed dynamic resource 2 in the first client 431 and the corresponding dynamic resource 1 in client 432 in the virtual scene is greater than or equal to the field-of-view distance threshold, then client 432 is not identified as the second client.
[0151] As an example, see Figure 4BWhen at least one client assigned the same dynamic resource mask as the first client 472 is client 471 and client 473, if the distance between the currently displayed dynamic resource in the first client 472 and the currently displayed dynamic resource in client 471 in the virtual scene is less than the field of view distance threshold, client 471 is identified as the second client. If the distance between the currently displayed dynamic resource in the first client 472 and the currently displayed dynamic resource in client 473 in the virtual scene is less than the field of view distance threshold, client 473 is identified as the second client. If the distance between the currently displayed dynamic resource in the first client 472 and the currently displayed dynamic resource in client 471 in the virtual scene is greater than or equal to the field of view distance threshold, client 471 is not identified as the second client. If the distance between the currently displayed dynamic resource in the first client 472 and the currently displayed dynamic resource in client 473 in the virtual scene is greater than or equal to the field of view distance threshold, client 473 is not identified as the second client.
[0152] In some embodiments, when there is no second client among the multiple clients accessing the same single-site environment as the first client, the updated dynamic resources are sent to the first client. When there is at least one client among the multiple clients accessing the same single-site environment as the first client, and the field of view of at least one client is different from that of the first client, the updated dynamic resources are sent to the first client.
[0153] As an example, see Figure 4C When there is no second client among the multiple clients (client 311, client 312, client 313, client 321, client 322, client 323) that is connected to the same single site (single site 33) as the first client 331, the updated dynamic resources are sent to the first client 331.
[0154] As an example, see Figure 4B When at least one client (client 471 and client 473) among multiple clients accesses the same single game as the first client 472, and the field of view of clients 471 and client 473 is different from that of the first client, the updated dynamic resources are sent to the first client 472.
[0155] In this way, at least one second client with the same single-site access and the same field of view as the first client is determined from two dimensions: the field of view distance threshold and the dynamic resource threshold. When there is no second client that meets the conditions, the updated dynamic resources are sent only to the first client, thereby achieving isolation of dynamic resources between the first client and other clients.
[0156] In step 1054, the updated dynamic resources are sent to the first client and at least one second client.
[0157] In this way, at least one second client with the same single-site access and the same field of view as the first client is identified from two dimensions: the field of view distance threshold and the dynamic resource threshold. This enables the sharing of dynamic resources between the first client and the second client, and the isolation of dynamic resources between the first client and clients other than the second client.
[0158] In some embodiments, see Figure 3E , Figure 3E This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Figure 3E Step 105 shown can be implemented through steps 1055 to 1056, which will be explained below.
[0159] In step 1055, when the position of the dynamic resource within the field of view of the first client in the virtual scene coincides with the position of the dynamic resource within the field of view of the second client in the virtual scene, the relationship between the single-site accessed by the first client and the second client is determined based on the dynamic resource masks allocated to the first client and the second client respectively.
[0160] The first client and the second client are any two of the multiple clients.
[0161] In some embodiments, prior to step 1055 above, the location of dynamic resources within the field of view of the first client in the virtual scene, and whether it overlaps with the location of dynamic resources within the field of view of the second client in the virtual scene, can be determined by the following methods: receiving a dynamic resource update request sent by the first client among multiple clients, wherein the dynamic resource update request sent by the first client carries operation information of the first client on the dynamic resource, and a dynamic resource mask allocated to the first client; receiving a dynamic resource update request sent by the second client among multiple clients, wherein the dynamic resource update request sent by the second client carries operation information of the second client on the dynamic resource, and a dynamic resource mask allocated to the second client; and determining, based on the operation information of the second client on the dynamic resource and the operation information of the first client on the dynamic resource, whether the location of dynamic resources within the field of view of the first client in the virtual scene overlaps with the location of dynamic resources within the field of view of the second client in the virtual scene.
[0162] In some embodiments, position overlap means that the dynamic resources within the field of view of any two clients have the same two-dimensional coordinates in the virtual scene, that is, the dynamic resources within the field of view of any two clients meet in the virtual scene.
[0163] In some embodiments, the relationship between the single-site connections accessed by the first client and the second client indicates whether the single-site connections accessed by the first client and the second client are different. That is, the relationship between the single-site connections accessed by the first client and the second client can indicate that the single-site connections accessed by the first client and the second client are the same, or the relationship can indicate that the single-site connections accessed by the first client and the second client are different.
[0164] In some embodiments, the determination of the relationship between the single-site accessed by the first client and the second client based on the dynamic resource masks allocated to the first client and the second client in step 1055 above can be achieved in the following way: when the dynamic resource masks allocated to the first client and the second client are the same, it is determined that the first client and the second client access the same single-site; when the dynamic resource masks allocated to the first client and the second client are different, it is determined that the first client and the second client access different single-sites.
[0165] As an example, see Figure 4A When the first client is client 421 in single-site 42 and the second client is client 431 in single-site 43, that is, the dynamic resource masks allocated to the first client and the second client are different, it is determined that the first client and the second client are accessing different single-sites.
[0166] As an example, see Figure 4C When the first client is client 331 in single-site 33 and the second client is client 321 in single-site 32, that is, the dynamic resource masks allocated to the first client and the second client are different, it is determined that the first client and the second client are accessing different single-sites.
[0167] In step 1056, when the single-site accessed by the first client and the second client are different single-site accesses, the dynamic resources corresponding to the first client and the second client are physically isolated respectively.
[0168] Physical isolation is used to assign the same horizontal, vertical, and axial coordinates to dynamic resources within the field of view of the first client and the second client.
[0169] As an example, see Figure 4AWhen the first client is client 421 in single-site 42 and the second client is client 431 in single-site 43, the relationship indicates that the single-sites accessed by the first client and the second client are different single-sites. Physical isolation is applied to the dynamic resources corresponding to the first client and the second client respectively; that is, the same horizontal, vertical, and triangular coordinates are assigned to the dynamic resources within the field of view of both the first client and the second client. If the single-sites accessed by the first client and the second client are different, it indicates that the networks of the first client and the second client are unrelated. If the single-sites accessed by the first client and the second client are the same, it indicates that the networks of the first client and the second client are related.
[0170] As an example, see Figure 5F The physical isolation between characters 6 and 7 is manifested in that characters 6 and 7 are not visible to each other, but can pass through each other. Characters 6 and 7 are assigned the same horizontal axis coordinates, vertical axis coordinates, and vertical axis coordinates.
[0171] In this way, by assigning the same horizontal, vertical, and axial coordinates to the dynamic resources within the field of view of the first client and the second client, the dynamic resources within the field of view of the first client and the second client can completely overlap, thereby achieving physical isolation of the dynamic resources corresponding to the first client and the second client respectively.
[0172] In some embodiments, when the relationship characterizes the first client and the second client as accessing the same single network, the same horizontal and vertical coordinates are assigned to the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client, and different vertical coordinates are assigned.
[0173] As an example, see Figure 5E The lack of physical isolation between characters 4 and 5 means that characters 4 and 5 can see each other but cannot pass through each other. Characters 4 and 5 are assigned the same horizontal and vertical coordinates but different vertical coordinates.
[0174] In some embodiments, after physically isolating the dynamic resources corresponding to the first client and the second client respectively, the physically isolated dynamic resources corresponding to the first client can be sent to the first client; and the physically isolated dynamic resources corresponding to the second client can be sent to the second client.
[0175] As an example, see Figure 4AWhen the first client is client 421 and the second client is client 431, after physically isolating the dynamic resources corresponding to client 421 and client 431 respectively, the physically isolated dynamic resources corresponding to client 421 can be sent to client 421; and the physically isolated dynamic resources corresponding to client 431 can be sent to client 431.
[0176] As an example, see Figure 4B When the first client is client 462 and the second client is client 471, after physically isolating the dynamic resources corresponding to client 462 and client 471 respectively, the physically isolated dynamic resources corresponding to client 462 can be sent to client 462; and the physically isolated dynamic resources corresponding to client 471 can be sent to client 471.
[0177] See Figure 3F , Figure 3F This is a flowchart illustrating the data processing method for a virtual scene provided in this application embodiment, which will be combined with... Figure 3F Steps 201 to 210 are described below. The entity executing steps 201 to 210 can be the aforementioned server or terminal.
[0178] In step 201, the server responds to multiple client connections to the service process, running multiple single sessions.
[0179] In step 202, the server sends start-up instructions to multiple clients.
[0180] In step 203, the server assigns static resource masks corresponding to the static resources to multiple clients respectively.
[0181] In step 204, the server assigns dynamic resource masks corresponding to the dynamic resources to multiple clients respectively.
[0182] In step 205, the server receives a static resource request from any one of the multiple clients.
[0183] In step 206, the server queries other clients among multiple clients that are assigned the same static resource mask based on the static resource mask carried in the static resource request, and determines that multiple clients share static resources.
[0184] In step 207, the server sends the same static resource to any one of the multiple clients.
[0185] In step 208, the server receives a dynamic resource update request from the first client among multiple clients.
[0186] In step 209, the server updates the dynamic resources based on the operation information to obtain the updated dynamic resources.
[0187] In step 210, the server sends the updated dynamic resources to the first client and at least one second client.
[0188] In some embodiments, see Figure 3G , Figure 3G This is a flowchart illustrating the data processing method for a virtual scene provided in this application embodiment, which will be combined with... Figure 3G Steps 301 to 303 are described below. The entity executing steps 301 to 303 may be the aforementioned terminal device.
[0189] In step 301, the first client in the terminal device connects to the server's service process and, in response to the server's opening command, accesses one of the multiple single-servers created by the server for multiple clients.
[0190] In this process, multiple single-site servers share a service process, which includes both static and dynamic resources of the virtual scene, and multiple clients include the first client.
[0191] In step 302, the first client receives the static resource mask sent by the server for the static resource.
[0192] In this case, the static resource mask sent by the server to different clients is the same.
[0193] In step 303, the first client receives the dynamic resource mask sent by the server for the dynamic resource.
[0194] Specifically, the server sends the same dynamic resource mask to clients accessing the same single network, but sends different dynamic resource masks to clients accessing different single networks.
[0195] Among them, static resource masks are used to share static resources among multiple single bureaus, while dynamic resource masks are used to isolate dynamic resources between different single bureaus.
[0196] In some embodiments, isolation includes field-of-view isolation. After step 303 above, field-of-view isolation can be achieved by: sending a dynamic resource update request to the server, wherein the dynamic resource update request carries the operation information of the first client on the dynamic resource and the dynamic resource mask allocated to the first client; receiving the updated dynamic resource sent by the server; wherein the server sends the updated dynamic resource to at least one client that has accessed the same single network as the first client and has the same field of view, and to the first client.
[0197] In this way, by sending updated dynamic resources to at least one client that is connected to the same game and has the same field of view as the first client, as well as to the first client, the first client and at least one client that is connected to the same game and has the same field of view can see each other, while the first client and clients connected to different games cannot see each other, thus achieving field of view isolation between the first client and clients connected to different games.
[0198] In some embodiments, isolation includes physical isolation. After the first client sends a dynamic resource update request to the server, physical isolation can be achieved by receiving the horizontal, vertical, and axial coordinates allocated by the server for the dynamic resources within the first client's field of view. Specifically, when the position of the dynamic resources within the first client's field of view in the virtual scene coincides with the position of the dynamic resources within the second client's field of view in the virtual scene, and the first client and the second client are connected to different sessions, the server allocates the same horizontal, vertical, and axial coordinates for the dynamic resources within the field of view of both the first client and the second client.
[0199] Thus, when the positions of dynamic resources within the field of view of the first client and the positions of dynamic resources within the field of view of the second client overlap in the virtual scene, and the first client and the second client are connected to different servers, the server assigns the same horizontal, vertical, and horizontal axis coordinates to the dynamic resources within the field of view of both the first client and the second client, thereby achieving physical isolation between the first client and the second client.
[0200] Thus, on the one hand, by connecting multiple clients to multiple game sessions, and having these game sessions share a single service process, the number of service processes is significantly reduced compared to the number of game sessions. Since the memory footprint of static resources is positively correlated with the number of service processes, this significant reduction in service processes leads to a significant decrease in the memory usage of static resources, effectively reducing data redundancy. On the other hand, because multiple game sessions share a single service process, by assigning corresponding static and dynamic resource masks to clients in different game sessions, static resource sharing and dynamic resource isolation are achieved across multiple game sessions. In this way, data redundancy on the server can be effectively reduced while achieving dynamic resource isolation and static resource sharing between different game sessions.
[0201] See Figure 5Q , Figure 5QThis is a schematic diagram illustrating the principle of the virtual scene data processing method provided in this application embodiment. The virtual scene data processing method provided in this application embodiment can achieve multi-site process reuse, for example, site 04, site 05, and site 06 reuse process 014. Thus, by reusing the same process across multiple sites, the following beneficial effects can be achieved:
[0202] (1) Reduced memory usage: Multiple single-site systems share the same static resource, effectively reducing redundant loading of static resources.
[0203] (2) Reduced CPU load: Compared with related technologies, the number of processes is significantly reduced, which effectively saves the physical and rendering computational overhead of processes. On the other hand, it effectively reduces L3 cache loss and reduces cache overhead.
[0204] (3) Multiple single-site rolling reuse process: The process supports multiple single-site rolling reuse, avoiding the redundant overhead of loading and unloading a large number of resources.
[0205] The following will describe an exemplary application of the embodiments of this application in a real-world online game scenario.
[0206] The embodiments of this application can have the following application scenarios, for example, in a real-world online game application scenario, see [link to relevant documentation]. Figures 5A to 5D , Figures 5A to 5D This is a schematic diagram illustrating the effect of the data processing method for a virtual scene provided in an embodiment of this application. See also... Figure 5A ,exist Figure 5A In the virtual scene of the online game shown, virtual character 1 controlled by player A and virtual character 2 controlled by player B are in the same game session, while character 3 controlled by player C belongs to a different game session than characters 1 and 2. Characters in different game sessions are not visible to each other; for example, character 1 cannot see character 3 but can see character 2, and character 3 cannot see characters 1 and 2. See details... Figure 5B ,exist Figure 5B In the virtual scene shown from the perspective of character 4, character 4 cannot see characters 1 and 2. (See also...) Figure 5C ,exist Figure 5C In the virtual scene shown from the perspective of character 5, character 5 can see character 6 but cannot see character 3. (See also...) Figure 5D ,exist Figure 5DIn the virtual scene shown from the perspective of character 8, character 8 can see character 7 but cannot see character 3. That is, characters are invisible to each other in different sessions, but are visible to each other within the same session. Through the virtual scene data processing method provided in this application embodiment, clients in different sessions share the service process of the network server. The service process allocates the same session mask (i.e., the dynamic resource mask described above) to dynamic resources within each session, and different session masks to dynamic resources in different sessions. Through the allocation of session masks, visual and physical isolation of dynamic resources in different sessions is achieved. This frees up a large amount of capacity for the network server, effectively improving its carrying capacity.
[0207] As an example, see Figure 5E , Figure 5E This is a schematic diagram illustrating the effect of the data processing method for a virtual scene provided in this application embodiment. The single-scene mask of character 9 (i.e., the dynamic resource mask described above) is the same as the single-scene mask of character 10, meaning that character 9 and character 10 are in the same single scene. When character 9 and character 10 overlap in position (same two-dimensional coordinates), that is, there is a physical collision between character 9 and character 10. Character 9 and character 10 mutually determine their existence. Spatially, this manifests as character 9 and character 10 being stacked vertically on the same two-dimensional coordinate. That is, when character 9 and character 10 are in the same two-dimensional coordinate, they will collide and cannot pass through each other. In other words, characters in the same single scene can perceive each other's existence.
[0208] As an example, see Figure 5F , Figure 5F This is a schematic diagram illustrating the effect of the virtual scene data processing method provided in this application embodiment. The single-scene mask of character 11 and the single-scene mask of character 12 are different, that is, character 11 and character 12 are in different single scenes. When character 11 and character 12 overlap in position (same two-dimensional coordinates), that is, there is no physical collision between character 11 and character 12, and character 11 and character 12 determine that they do not exist. Spatially, this means that character 11 and character 12 can overlap in the same two-dimensional coordinates. That is, when character 11 and character 12 are in the same two-dimensional coordinates, they will not collide and can pass through each other. That is, characters in different single scenes cannot perceive each other's existence.
[0209] See Figures 5G to 5J , Figures 5G to 5J This is a schematic diagram illustrating the effect of the virtual scene data processing method provided in this application embodiment. Static resources refer to resources shared by different clients; static resources can be shared by different clients. In online games, static resources are non-interactive resources, that is, resources whose state cannot be changed during the game process. For example, static resources can be such as... Figure 5GThe building structure 51 shown in the online game can also be a static resource such as... Figure 5H The example shown is a city landscape in a network game, such as 52. Dynamic resources refer to resources that are unique to each client and can be exclusive to each client. In network games, dynamic resources are interactive resources, that is, resources whose state may change during the game process. For example, dynamic resources can be like... Figure 5I The player-controlled character shown is 53. Dynamic resources can also be like... Figure 5J The example shown is a bullet, such as the 54, in an online game.
[0210] Thus, characters in different games are not visible to each other, while characters in the same game are visible to each other. Dynamically, this manifests as physical isolation between characters in different games, while physical detection exists between characters in the same game. That is, characters within the same game can perceive each other, but characters in different games cannot perceive each other, thereby reusing the same process to allow multiple games to run simultaneously.
[0211] The following describes the specific implementation process of the virtual scene data processing method provided in the embodiments of this application.
[0212] First, the specific generation methods for single-site masks (i.e., the dynamic resource masks and static resource masks described above) are explained. See [link to documentation]. Figure 5K , Figure 5K This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Below, in conjunction with... Figure 5K Steps 501 to 509 shown illustrate the method for generating a single-site mask.
[0213] In step 501, the server process is initialized.
[0214] In step 502, the first client connects to the process.
[0215] In step 503, the second client connects to the process.
[0216] In step 504, the server process generates a single-site mask.
[0217] Within this framework, the dynamic resources of each session share the same session mask (i.e., the dynamic resource mask described above), while the dynamic resources of different sessions have different session masks. In other words, all dynamic resources within a single session are assigned the same session mask, and the role is a subset of the dynamic resources.
[0218] The single-site mask for each dynamic resource is recorded in the variables of each dynamic resource. The maximum value of the single-site mask can be 256. The expression for the single-site mask generation rule can be:
[0219] view_mask_id=battle_count (1)
[0220] Here, view_mask_id represents the single-round mask of dynamic resources, and battle_count represents the number of single rounds that the process has created.
[0221] In step 505, the server process returns the single-site mask to the second client.
[0222] In step 506, the server process returns the single-site mask to the first client.
[0223] In step 507, the server process starts a single session.
[0224] The process starts a new game when the starting conditions are met. The starting conditions can be that the number of characters in a single game is greater than or equal to 2, meaning the number of players in a single game is greater than or equal to the minimum player count threshold. The process sends a start command to the client to start the first game. When the number of characters in the first game reaches the maximum player count threshold, preparations are made to start the next game, and the next game starts when the starting conditions are met.
[0225] In step 508, the server process sends an opening command to the first client.
[0226] In step 509, the server process sends an opening command to the second client.
[0227] See Figure 5L , Figure 5L This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Below, in conjunction with... Figure 5L Steps 510 to 514 shown illustrate the method of process attribute synchronization.
[0228] In step 510, the server process enters the main loop.
[0229] As an example, once a process enters the main loop, it continues running forward.
[0230] In step 511, the server process receives uplink network packets from the client.
[0231] As an example, the process receives uplink network packets sent by each client. The uplink network packets carry the client's operation information for dynamic resources. The client's operation information for dynamic resources can be operations such as moving a character's position, shooting bullets, or releasing character skills.
[0232] In step 512, the server process performs logical processing.
[0233] As an example, after receiving an uplink network packet, the process performs logical calculations on the collected operation information. For example, the logical calculations could be: based on the position movement operation for a role, determine whether two different roles are within each other's field of vision.
[0234] In step 513, the server process performs network correlation calculations.
[0235] As an example, network correlation calculation can be used to determine whether two characters within the field of view have network correlation, that is, whether two characters within the field of view belong to the same game.
[0236] As an example, see Figure 5M , Figure 5M This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Below, in conjunction with... Figure 5M Steps 5131 to 5134 shown illustrate the calculation process of network correlation from the perspective of Role A.
[0237] In step 5131, the server process determines whether the single-game mask of any resource within the field of view of role A is 0.
[0238] As an example, any resource within the field of view of role A includes all dynamic and static resources within that field of view. The process can iterate through all resources within the field of view of role A to determine if the single-site mask of any resource within that field of view is 0. When the single-site mask of any resource within the field of view of role A is 0, it indicates that the resource with a single-site mask of 0 is a static resource. Since static resources are shared by all single sites, regardless of which single site role A is in, role A and all static resources have network dependency. When the single-site mask of any resource within the field of view of role A is 0, proceed to step 5133; when the single-site mask of any resource within the field of view of role A is not 0, proceed to step 5132.
[0239] In step 5132, the server process determines whether the single-site mask of role A is equal to the single-site mask of any resource.
[0240] As an example, when the single-site mask of any resource within the field of view of role A is not 0, the process determines whether the single-site mask of role A and the single-site mask of any resource are the same. When the single-site mask of role A and the single-site mask of any resource are equal, it indicates that the single-site to which the resource belongs and the single-site to which role A belongs are the same single-site, and proceeds to step 5133; when the single-site mask of role A and the single-site mask of any resource are different, it indicates that the single-site to which the resource belongs and the single-site to which role A belongs are different single-sites, and proceeds to step 5134.
[0241] In step 5133, network correlation is determined.
[0242] As an example, determine the resources within character A's field of vision and their relevance to character A's network.
[0243] In step 5134, it is determined that the network is unrelated.
[0244] As an example, it is determined that the resources within the field of view of character A are not related to the network of character A.
[0245] In this way, by determining network correlation based on single-site masks, the dynamic resource asynchrony attribute between different single sites is realized, thereby achieving vision isolation between single sites.
[0246] In step 514, the server process performs attribute synchronization.
[0247] As an example, when two roles have network dependencies, processes synchronize each other's attribute information and dynamic resources to the other role.
[0248] See Figure 5N , Figure 5N This is a schematic diagram illustrating the principle of the virtual scene data processing method provided in this application embodiment. During a single session, collisions may occur between dynamic resources. The process determines whether dynamic resource A and dynamic resource B have collided by judging whether their single-session masks are the same. When the single-session masks of dynamic resource A and dynamic resource B are the same, a collision occurs between them; when their single-session masks are different, no collision occurs.
[0249] As an example, when dynamic resource A is the player-controlled character and dynamic resource B is the bullet, when the bullet fires at the character, the system determines whether a collision occurs by comparing the character's round mask with the bullet's round mask. If the round mask is the same, the character and bullet are in the same round, and a collision occurs when the bullet fires at the character. If the round mask is different, the character and bullet are in different rounds, and no collision occurs when the bullet fires at the character.
[0250] See Figure 5O , Figure 5O This is a flowchart illustrating the data processing method for a virtual scene provided in an embodiment of this application. Below, in conjunction with... Figure 5O Steps 520 to 523 shown are explained from the perspective of character A, illustrating the process of determining whether to calculate a collision.
[0251] In step 520, the server determines whether the single-game mask of any resource within the field of view of character A is 0.
[0252] As an example, when the single-round mask of any resource within character A's field of view is 0, proceed to step 522. When the single-round mask of any resource within character A's field of view is not 0, proceed to step 521. Resources with a single-round mask of 0 are static resources. Since static resources are shared by all single rounds, any static resource may collide with other resources (other resources can be static or dynamic). Therefore, collision calculations must be performed for all resources with a single-round mask of 0.
[0253] In step 521, the server determines whether the single-game mask of role A is equal to the single-game mask of any resource.
[0254] As an example, when the single-round mask of role A is equal to the single-round mask of any resource, proceed to step 522. When the single-round mask of role A is not equal to the single-round mask of any resource, proceed to step 523.
[0255] In step 522, the server calculates the collision between role A and any resource.
[0256] In step 523, the server does not calculate collisions between role A and any resource.
[0257] In this way, collision detection filtering is performed using a single-game mask, and since collision calculations are only performed on players within the same single game, physical isolation between single games is achieved.
[0258] Since the memory occupied by static resources is positively correlated with the number of processes, the static resources occupied by two processes are twice that occupied by one process. When multiple processes contain the same static resource, it will lead to duplicate loading of the static resource, thereby increasing the memory occupied by the static resource. The data processing method for virtual scenes provided in this application embodiment can realize the reuse of multiple processes, thereby saving the number of processes and realizing the reuse of static resources.
[0259] Because multiple single instances share the same static resource, redundant static resource recording is effectively reduced. The reduced number of processes saves on physical and rendering computational overhead, significantly reducing L3 cache misses and thus minimizing cache overhead. Furthermore, the ability for multiple instances to reuse the resource on a rolling basis effectively avoids the loading and unloading of numerous resources and the redundant overhead of resource construction.
[0260] It is understood that the embodiments of this application involve data related to static resources and dynamic resources. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0261] The following description continues to illustrate the exemplary structure of the virtual scene data processing device 255 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2A As shown, the software modules in the data processing device 255 storing the virtual scene in the memory 250 may include: an access module 2551, used to connect multiple clients to multiple single-site servers, wherein the multiple single-site servers share a service process, and the service process includes static resources and dynamic resources of the virtual scene; a first allocation module 2552, used to allocate static resource masks corresponding to the static resources to the multiple clients respectively, wherein the static resource masks allocated to the multiple clients are the same; a second allocation module 2553, used to allocate dynamic resource masks corresponding to the dynamic resources to the multiple clients respectively, wherein the dynamic resource masks allocated to clients accessing the same single-site server are the same, and the dynamic resource masks allocated to clients accessing different single-site servers are different; a sharing module 2554, used to share static resources among the multiple single-site servers based on the static resource masks allocated to the multiple clients respectively; and an isolation module 2555, used to isolate dynamic resources among different single-site servers based on the dynamic resource masks allocated to the multiple clients respectively.
[0262] In some embodiments, the access module 2551 is further configured to respond to multiple clients connecting to the service process, run multiple single-site connections, and send an opening command to multiple clients to enable multiple clients to connect to multiple single-site connections; wherein each client connects to one single-site connection, and the number of accesses to each single-site connection is greater than or equal to the opening threshold and less than or equal to the closing threshold.
[0263] In some embodiments, the access module 2551 is further configured to, in response to multiple clients connecting to the service process and the number of multiple clients being greater than or equal to the opening threshold, start running the first single session, send an opening instruction to a first number of clients to enable multiple clients to access the first single session; and iterate t in an incremental manner to perform the following processing: in response to the number of clients accessing the t-th single session being equal to the closing threshold and the number of clients not yet accessing the first to t-th single sessions being greater than or equal to the opening threshold, start running the (t+1)-th single session, and access at least some of the clients not yet accessing the first to t-th single sessions to the (t+1)-th single session; wherein, 1≤t≤T, and T is the upper limit of the number of single sessions that the service process can run.
[0264] In some embodiments, the first allocation module 2552 is further configured to allocate a static resource mask with a value of 0 to multiple clients. The second allocation module 2552 is further configured to iteratively perform the following process in an incremental manner: allocate a dynamic resource mask with a value of m to the client accessing the m-th single station; wherein the value of m is in the range of 1≤m≤M, and M is the upper limit of the number of single stations that the service process can run.
[0265] In some embodiments, the isolation includes field-of-view isolation. The isolation module 2555 is further configured to receive a dynamic resource update request sent by a first client among a plurality of clients, wherein the dynamic resource update request carries operation information of the first client for dynamic resources and a dynamic resource mask allocated to the first client; update the dynamic resources based on the operation information to obtain the updated dynamic resources; determine at least one second client that accesses the same single network and has the same field of view as the first client based on the dynamic resource mask allocated to the first client; and send the updated dynamic resources to the first client and at least one second client.
[0266] In some embodiments, when the virtual scene can be fully displayed on multiple clients at once, the isolation module 2555 is further configured to query at least one client that has been allocated the same dynamic resource mask as the first client from among the multiple clients, based on the dynamic resource mask allocated to the first client, and to serve as the second client.
[0267] In some embodiments, when a portion of the virtual scene is displayed at once among multiple clients, the isolation module 2555 is further configured to query at least one client among the multiple clients that has been allocated the same dynamic resource mask as the first client, based on the dynamic resource mask allocated to the first client; determine the distance between the currently displayed dynamic resource in the first client and the dynamic resource corresponding to the at least one client in the virtual scene; and designate at least one client whose distance is less than the field of view distance threshold as the second client.
[0268] In some embodiments, the data processing device 255 for the virtual scene further includes: a first sending module, configured to send updated dynamic resources to the first client when there is no second client among the multiple clients that accesses the same single room as the first client; and to send updated dynamic resources to the first client when there is at least one client among the multiple clients that accesses the same single room as the first client, and the field of view of at least one client is different from that of the first client.
[0269] In some embodiments, isolation includes physical isolation; the isolation module 2555 is further configured to determine the relationship between the single-site accessed by the first client and the second client based on the dynamic resource masks allocated to the first client and the second client respectively when the positions of dynamic resources within the field of view of the first client and the second client in the virtual scene overlap with the positions of dynamic resources within the field of view of the second client in the virtual scene; wherein the first client and the second client are any two of a plurality of clients; when the relationship indicates that the single-site accessed by the first client and the second client are different single-sites, physical isolation is performed on the dynamic resources corresponding to the first client and the second client respectively; wherein physical isolation is used to allocate the same horizontal axis coordinate, vertical axis coordinate and vertical axis coordinate for the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client.
[0270] In some embodiments, the data processing device 255 for the virtual scene further includes: a second sending module, configured to send physically isolated dynamic resources corresponding to the first client to the first client; and send physically isolated dynamic resources corresponding to the second client to the second client.
[0271] In some embodiments, the isolation module 2555 is further configured to determine that the first client and the second client access the same single network when the dynamic resource masks allocated to the first client and the second client are the same; and to determine that the first client and the second client access different single networks when the dynamic resource masks allocated to the first client and the second client are different.
[0272] In some embodiments, the data processing device 255 for the virtual scene further includes: a third allocation module, configured to allocate the same horizontal axis coordinates and vertical axis coordinates, and allocate different vertical axis coordinates, for the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client when the relationship characterizes the first client and the second client accessing the same single session.
[0273] In some embodiments, the sharing module 2554 is further configured to receive a static resource request sent by any one of the multiple clients, wherein the static resource request carries a static resource mask; based on the static resource mask carried in the static resource request, query other clients among the multiple clients that have been allocated the same static resource mask, determine that the multiple clients share the static resource, and send the same static resource to any one of the multiple clients.
[0274] The following description continues to illustrate the exemplary structure of the virtual scene data processing device 455 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2BAs shown, the software modules in the virtual scene data processing device 455 stored in the memory 450 may include: an access module 4551, used to connect to the server's service process through a first client in a terminal device, and in response to an opening command sent by the server, access one of multiple single-sites created by the server for multiple clients, wherein multiple single-sites share the service process, and the service process includes static and dynamic resources of the virtual scene, and the multiple clients include the first client; a first receiving module 4552, used to receive a static resource mask sent by the server for static resources, wherein the static resource mask sent by the server to different clients is the same; a second receiving module 4553, used to receive a dynamic resource mask sent by the server for dynamic resources, wherein the dynamic resource mask sent by the server to clients accessing the same single-site is the same, and the dynamic resource mask sent to clients accessing different single-sites is different; wherein the static resource mask is used for sharing static resources among multiple single-sites, and the dynamic resource mask is used for isolating dynamic resources among different single-sites.
[0275] In some embodiments, isolation includes field-of-view isolation. The data processing device 455 for the virtual scene further includes: a request module, configured to send a dynamic resource update request to the server, wherein the dynamic resource update request carries operation information of the first client on the dynamic resource and a dynamic resource mask allocated to the first client; and a third receiving module, configured to receive the updated dynamic resource sent by the server; wherein the server sends the updated dynamic resource to at least one client that is connected to the same single network as the first client and has the same field of view, and to the first client.
[0276] In some embodiments, isolation includes physical isolation, and the data processing device 455 for the virtual scene further includes: a fourth receiving module, used by the server to allocate horizontal, vertical, and axial coordinates for dynamic resources within the field of view of the first client; wherein, when the position of dynamic resources within the field of view of the first client in the virtual scene coincides with the position of dynamic resources within the field of view of the second client in the virtual scene, and the single-server accessed by the first client and the second client are different single-servers, the server allocates the same horizontal, vertical, and axial coordinates for dynamic resources within the field of view of the first client and dynamic resources within the field of view of the second client.
[0277] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the virtual scene data processing method described above in this application.
[0278] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the data processing method for a virtual scene provided in this application. For example, ... Figure 3A The data processing method for the virtual scene is shown.
[0279] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEP ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0280] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0281] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0282] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0283] In summary, the embodiments of this application have the following beneficial effects:
[0284] (1) On the one hand, by connecting multiple clients to multiple game sessions, and having multiple game sessions share a single service process, the number of service processes is significantly reduced compared to the number of game sessions. Since the memory occupied by static resources is positively correlated with the number of service processes, the significant reduction in the number of service processes leads to a significant reduction in the memory space occupied by static resources, thus effectively reducing data redundancy. On the other hand, since multiple game sessions share a single service process, by assigning corresponding static resource masks and dynamic resource masks to clients in different game sessions, the sharing of static resources and the isolation of dynamic resources can be achieved between multiple game sessions. Thus, while effectively reducing data redundancy on the server, it is possible to achieve the isolation of dynamic resources and the sharing of static resources between different game sessions.
[0285] (2) By setting opening and closing thresholds, when multiple clients access multiple games, a certain number of clients are ensured to access each game, thus enabling multiple clients to connect to multiple games. By connecting multiple clients to multiple games and having multiple games share a single service process, the number of service processes is significantly less than the number of games, which significantly reduces the number of service processes. Since the memory occupied by static resources is positively correlated with the number of service processes, the significant reduction in the number of service processes significantly reduces the memory space occupied by static resources, thereby effectively reducing data redundancy in the server.
[0286] (3) By assigning the same static resource mask to each client, the static resources sent by the service process to each client are the same, thus realizing that all clients in different servers share the same static resources, effectively avoiding redundant loading of static resources.
[0287] (4) Since clients accessing the same single bureau have the same dynamic resource mask, the target client with the same dynamic resource mask as the first client can be identified by the dynamic resource mask allocated to the first client. The target client is identified as the client accessing the same single bureau as the first client. Thus, the dynamic resource mask can be used to query the clients accessing the same single bureau, which facilitates the visual isolation and physical isolation of dynamic resources for clients in different single bureaus in the future.
[0288] (5) Determine at least one second client that has access to the same single site and has the same field of view as the first client from the two dimensions of field distance threshold and dynamic resource threshold, so as to realize the sharing of dynamic resources between the first client and the second client, and to realize the isolation of dynamic resources between the first client and clients other than the second client.
[0289] (6) Determine at least one second client that has accessed the same single site and has the same field of view as the first client from two dimensions: field distance threshold and dynamic resource threshold. When there is no second client that meets the conditions, only the updated dynamic resources are sent to the first client, thereby achieving isolation of dynamic resources between the first client and other clients.
[0290] (7) By assigning the same horizontal axis coordinate, vertical axis coordinate and vertical axis coordinate to the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client, the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client can completely overlap, thereby achieving physical isolation of the dynamic resources corresponding to the first client and the second client respectively.
[0291] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A data processing method for a virtual scene, characterized in that, Applied to a server, the method includes: Multiple clients are connected to multiple single servers, wherein the multiple single servers share a service process, and the service process includes the static resources and dynamic resources of the virtual scene. The service process is a process running in the server, which is used to provide services for displaying the virtual scene to the multiple clients. A static resource mask corresponding to the static resource is assigned to each of the plurality of clients, wherein the static resource masks assigned to the plurality of clients are the same; Dynamic resource masks corresponding to the dynamic resources are assigned to the multiple clients respectively, wherein the dynamic resource masks assigned to clients accessing the same single network are the same, and the dynamic resource masks assigned to clients accessing different single networks are different; Based on the static resource mask that is assigned to the corresponding static resources to the multiple clients respectively, the static resources are shared among the multiple single bureaus; Based on dynamic resource masks that are assigned to the multiple clients respectively, the dynamic resources are isolated between different single-server environments; wherein, the isolation includes physical isolation and field-of-view isolation; the physical isolation is used to assign the same coordinates to the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client in different single-server environments; the field-of-view isolation is used to make the dynamic resources of the first client and the dynamic resources of the second client in different single-server environments invisible to each other; the first client and the second client are any two of the multiple clients.
2. The method according to claim 1, characterized in that, The method of connecting multiple clients to multiple single-site environments includes: In response to multiple clients connecting to the service process, multiple single-server operations are run, and an initiation command is sent to the multiple clients to enable the multiple clients to connect to the multiple single-server operations; Each client connects to one of the single bureaus, and the number of accesses to each single bureau is greater than or equal to the opening threshold and less than or equal to the closing threshold.
3. The method according to claim 2, characterized in that, The response to multiple clients connecting to the service process, running multiple single-game sessions, and sending start-up instructions to the multiple clients includes: In response to multiple clients connecting to the service process, and the number of the multiple clients being greater than or equal to the start threshold, the first single game is started, and a start command is sent to a first number of clients to enable the multiple clients to access the first single game; Iterate over t in an incremental manner and perform the following processing: In response to the number of clients accessing the t-th single-site being equal to the closing threshold, and the number of clients not yet accessing the 1st to t-th single-site being greater than or equal to the opening threshold, the t+1-th single-site is started, and at least a portion of the clients not yet accessing the 1st to t-th single-site are accessed to the t+1-th single-site. in, T is the maximum number of single-site applications that the service process can run.
4. The method according to claim 1, characterized in that, The step of allocating static resource masks corresponding to the static resources to the plurality of clients includes: Assign a static resource mask with a value of 0 to the multiple clients; The step of allocating dynamic resource masks corresponding to the dynamic resources to the plurality of clients includes: Iterate through m in an incremental manner and perform the following processing: Assign a dynamic resource mask with a value of m to the client accessing the m-th single-site connection; where the value of m ranges from... m M is the maximum number of single-site applications that the service process can run.
5. The method according to claim 1, characterized in that, The method of isolating dynamic resources between different single servers based on dynamic resource masks that allocate corresponding dynamic resources to the multiple clients includes: Receive a dynamic resource update request sent by a first client among the plurality of clients, wherein the dynamic resource update request carries the operation information of the first client on the dynamic resource, and the dynamic resource mask allocated to the first client; The dynamic resource is updated based on the operation information to obtain the updated dynamic resource; Based on the dynamic resource mask allocated to the first client, at least one second client is identified that accesses the same single-site environment as the first client and has the same field of view. The updated dynamic resources are sent to the first client and the at least one second client.
6. The method according to claim 5, characterized in that, When the virtual scene can be fully displayed in all of the multiple clients at once, determining at least one second client with the same single-game access and the same field of view as the first client, based on the dynamic resource mask allocated to the first client, includes: Based on the dynamic resource mask assigned to the first client, at least one client with the same dynamic resource mask as the first client is queried from the plurality of clients and designated as the second client.
7. The method according to claim 5, characterized in that, When a portion of the virtual scene is displayed simultaneously among the multiple clients, determining at least one second client with the same access to the same single-game environment and the same field of view, based on the dynamic resource mask allocated to the first client, includes: Based on the dynamic resource mask assigned to the first client, query from the plurality of clients at least one client that is assigned the same dynamic resource mask as the first client; Determine the distance in the virtual scene between the dynamic resource currently displayed in the first client and the dynamic resource corresponding to each of the at least one client; At least one client whose distance is less than the field of view distance threshold is designated as the second client.
8. The method according to claim 5, characterized in that, The method further includes: When there is no second client among the multiple clients that is connected to the same single-site environment as the first client, the updated dynamic resources are sent to the first client. When at least one of the multiple clients accesses the same single-site environment as the first client, and the field of view of the at least one client is different from that of the first client, the updated dynamic resources are sent to the first client.
9. The method according to claim 1, characterized in that, The method of isolating dynamic resources between different single servers based on dynamic resource masks that allocate corresponding dynamic resources to the multiple clients includes: When the position of the dynamic resource within the field of view of the first client in the virtual scene coincides with the position of the dynamic resource within the field of view of the second client in the virtual scene, the relationship between the single-site accessed by the first client and the second client is determined based on the dynamic resource mask allocated to the first client and the second client respectively. When the relationship indicates that the first client and the second client are connected to different single-site exchanges, the dynamic resources corresponding to the first client and the second client are physically isolated respectively; The physical isolation is used to assign the same horizontal, vertical, and axial coordinates to the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client.
10. The method according to claim 9, characterized in that, The method further includes: Send the physically isolated dynamic resources corresponding to the first client to the first client; Send the physically isolated dynamic resources corresponding to the second client to the second client.
11. The method according to claim 9, characterized in that, Determining the relationship between the single-site connections accessed by the first client and the second client based on the dynamic resource masks allocated to the first client and the second client respectively includes: When the dynamic resource mask assigned to the first client and the second client is the same, it is determined that the first client and the second client are connected to the same single network. When the dynamic resource masks assigned to the first client and the second client are different, it is determined that the first client and the second client are accessing different single-site connections.
12. The method according to claim 9, characterized in that, The method further includes: When the relationship indicates that the accessed single network of the first client and the second client is the same single network, the same horizontal axis coordinates and vertical axis coordinates are assigned to the dynamic resources within the field of view of the first client and the dynamic resources within the field of view of the second client, and different vertical axis coordinates are assigned.
13. The method according to claim 1, characterized in that, The sharing of static resources among the multiple single-site servers based on static resource masks that are allocated to the multiple clients respectively includes: Receive a static resource request sent by any one of the plurality of clients, wherein the static resource request carries the static resource mask; Based on the static resource mask carried in the static resource request, it is found that other clients among the multiple clients are assigned the same static resource mask, it is determined that the multiple clients share the static resource, and the same static resource is sent to any one of the multiple clients.
14. A data processing method for a virtual scene, characterized in that, Applied to a terminal device, the method includes: The first client in the terminal device connects to the server's service process and, in response to the opening command sent by the server, accesses one of the multiple single-game sessions created by the server for multiple clients. The multiple single-game sessions share the service process, and the service process includes the static and dynamic resources of the virtual scene. The multiple clients include the first client. Receive the static resource mask sent by the server for the static resource, wherein the static resource mask sent by the server to different clients is the same; The server receives a dynamic resource mask for the dynamic resource, wherein the dynamic resource mask sent by the server to the client accessing the same single network is the same, and the dynamic resource mask sent to the client accessing different single networks is different. The static resource mask is used to share the static resources among the multiple single-site offices, and the dynamic resource mask is used to isolate the dynamic resources among different single-site offices.
15. The method according to claim 14, characterized in that, The isolation includes field-of-view isolation, and the method further includes: Send a dynamic resource update request to the server, wherein the dynamic resource update request carries the operation information of the first client on the dynamic resource, and the dynamic resource mask allocated to the first client; Receive updated dynamic resources sent by the server; The server sends the updated dynamic resources to at least one client that has accessed the same single game and has the same field of view as the first client, as well as to the first client.
16. The method according to claim 15, characterized in that, The isolation includes physical isolation, and after sending a dynamic resource update request to the server, the method further includes: Receive the horizontal, vertical, and axial coordinates of the dynamic resource allocation within the field of view of the first client from the server; Wherein, when the position of the dynamic resource within the field of view of the first client in the virtual scene coincides with the position of the dynamic resource within the field of view of the second client in the virtual scene, and the single session accessed by the first client and the second client are different single sessions, the server assigns the same horizontal axis coordinate, vertical axis coordinate and vertical axis coordinate to the dynamic resource within the field of view of the first client and the dynamic resource within the field of view of the second client.
17. A data processing device for a virtual scene, characterized in that, The device includes: An access module is used to connect multiple clients to multiple single-site servers, wherein the multiple single-site servers share a service process, and the service process includes static and dynamic resources of the virtual scene. The service process is a process running on a server and is used to provide services for displaying the virtual scene to the multiple clients. The first allocation module is used to allocate static resource masks corresponding to the static resources to the plurality of clients respectively, wherein the static resource masks allocated to the plurality of clients are the same; The second allocation module is used to allocate dynamic resource masks corresponding to the dynamic resources to the multiple clients respectively, wherein the dynamic resource masks allocated to the clients accessing the same single network are the same, and the dynamic resource masks allocated to the clients accessing different single networks are different. A sharing module is used to share the static resources among the multiple single servers based on the static resource mask that is allocated to the multiple clients respectively. An isolation module is used to isolate the dynamic resources between different single-server environments based on dynamic resource masks that are assigned to the multiple clients respectively. The isolation includes physical isolation and field-of-view isolation. Physical isolation assigns the same coordinates to the dynamic resources within the field of view of a first client and a second client in different single-server environments. Field-of-view isolation makes the dynamic resources of the first client and the second client in different single-server environments mutually invisible. The first client and the second client are any two of the multiple clients.
18. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions or computer programs stored in the memory, implements the data processing method for the virtual scene according to any one of claims 1 to 16.
19. A computer-readable storage medium storing executable instructions or a computer program, characterized in that, When the executable instructions are executed by the processor, they implement the data processing method for the virtual scene according to any one of claims 1 to 16.
20. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the data processing method for the virtual scene according to any one of claims 1 to 16.