Virtual scene updating method and device, electronic equipment, storage medium and program product

By classifying and combining the update functions of virtual scenes, the problem of low efficiency in updating virtual scene content is solved, and a more efficient update process is achieved.

CN122097955APending Publication Date: 2026-05-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the efficiency of updating virtual scene content is low because different types of update functions correspond to completely different content, which causes the cache of stored content to be frequently adjusted when switching update functions.

Method used

By classifying multiple update functions of the virtual scene into at least one update function group, the update functions in the target update function group are called sequentially to update the specified scene part. The scene parts corresponding to the functions in the update function group have at least partial overlap, which reduces the amount of cache adjustment.

Benefits of technology

It effectively improves the efficiency of updating virtual scene content and reduces the amount of adjustment required when switching update functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122097955A_ABST
    Figure CN122097955A_ABST
Patent Text Reader

Abstract

The application provides a virtual scene updating method and device, electronic equipment, a storage medium and a program product; the method comprises the following steps: obtaining a plurality of update functions of a virtual scene, wherein the plurality of update functions are respectively used for updating different scene parts in the virtual scene; classifying the plurality of update functions based on the scene parts corresponding to the plurality of update functions, to obtain at least one update function group; wherein the update function group comprises a plurality of update functions, and the scene parts corresponding to different update functions at least partially overlap; determining a target update function group corresponding to a specified scene part in the virtual scene from the at least one update function group; and sequentially calling the update functions in the target update function group to update the specified scene part. Through the application, the content updating efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, storage medium, and program product for updating a virtual scene. Background Technology

[0002] Update functions, also known as timer-triggered code, are a type of code that executes periodically in a program. In game engines, they are typically executed every frame and are generally used for object state control and state synchronization between different objects. Different classes may have different update functions to implement specific functionalities.

[0003] In related technologies, for updating content in a virtual scene, update functions are usually called directly in the order of their execution to update the content in the virtual scene. Since different types of update functions often correspond to completely different content, calling update functions directly in the order of their execution will cause the cache used to store content to be frequently adjusted when switching update functions, resulting in low efficiency of content updates. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating virtual scenes, which can effectively improve the efficiency of content updates.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a method for updating a virtual scene, including:

[0007] Obtain multiple update functions for the virtual scene, each of which is used to update different parts of the virtual scene.

[0008] Based on the scene parts corresponding to the multiple update functions, the multiple update functions are classified to obtain at least one group of update functions;

[0009] The update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap.

[0010] Based on a specified scene portion in the virtual scene, determine the target update function group corresponding to the specified scene portion from the at least one update function group;

[0011] The update functions in the target update function group are called sequentially to update the specified scene portion.

[0012] This application provides a method for updating a virtual scene, including:

[0013] Send an update request for the specified scene portion, and receive the target update function group corresponding to the specified scene portion;

[0014] The target update function group includes multiple update functions, which are used to update different parts of the virtual scene. The target update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap.

[0015] The update functions in the target update function group are called sequentially to update the specified scene portion.

[0016] This application provides a method for updating a virtual scene, including:

[0017] Obtain multiple update functions for the virtual scene, each of which is used to update different parts of the virtual scene.

[0018] Based on the scene parts corresponding to the multiple update functions, the multiple update functions are classified to obtain at least one group of update functions;

[0019] The update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap.

[0020] In response to an update request for a specified scene portion, based on the specified scene portion, a target update function group corresponding to the specified scene portion is determined from the at least one update function group, and the update function in the update function group corresponding to the specified scene portion is sent.

[0021] The update functions in the target update function group update the specified scene portion by calling them sequentially.

[0022] This application provides a virtual scene updating device, including:

[0023] The acquisition module is used to acquire multiple update functions of the virtual scene, and the multiple update functions are used to update different scene parts in the virtual scene respectively;

[0024] A classification module is used to classify the multiple update functions based on the scene parts corresponding to the multiple update functions respectively, to obtain at least one update function group; wherein, the update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap;

[0025] An update module is used to determine a target update function group corresponding to a specified scene part from the at least one update function group based on a specified scene part in the virtual scene, and sequentially call the update functions in the target update function group to update the specified scene part.

[0026] In the above scheme, the classification module is further configured to construct a first indicator vector for each update function based on the function variables in each update function, wherein the first indicator vector indicates whether a first function variable exists in the function variables; classify the plurality of update functions based on the first indicator vectors of each update function to obtain at least one initial update function group, wherein the first indicator vectors of different update functions in the initial update function group are the same; and classify the update functions in the initial update function group based on the scene part corresponding to the update function in the initial update function group to obtain at least one update function group.

[0027] In the above scheme, the classification module is further configured to obtain a first preset vector for each of the update functions, wherein the first preset vector includes at least one vector element and the vector element corresponds one-to-one with the first function variable; to detect the function variables of each of the update functions and obtain a detection result, wherein the detection result is used to indicate whether the first function variable exists in the function variable; and to update the first preset vector of each of the update functions based on the detection result to obtain a first indicator vector for each of the update functions.

[0028] In the above scheme, the classification module is further used to determine the scene part corresponding to each update function by simulating the call of each update function; determine the similarity between the contents of different update functions; and cluster the update functions with similarity greater than a similarity threshold to obtain at least one update function group.

[0029] In the above scheme, the classification module is further used to determine the scene part corresponding to the first update function by simulating the invocation of the first update function, wherein the first update function is any update function and the second update function is any update function other than the first update function; for each second update function, the scene part corresponding to the second update function is determined by simulating the invocation of the first update function and the second update function in sequence, or the scene part corresponding to the second update function is determined by simulating the invocation of the second update function.

[0030] In the above scheme, the classification module is further configured to determine the similarity between the scene portion corresponding to the first update function and the scene portions corresponding to each of the second update functions; the classification module is further configured to, when there is a similarity between the first update function and the second update function greater than a similarity threshold, determine the second update function with a similarity greater than the similarity threshold and the first update function as the update function group corresponding to the first update function; when there is no similarity between the first update function and the second update function greater than the similarity threshold, determine the first update function as the update function group corresponding to the first update function.

[0031] In the above scheme, the classification module is also used to generate a new update function, and based on the new update function, update the at least one update function group to obtain at least one updated update function group; the update module is also used to sequentially call the update functions in the updated update function group to update the specified scene part when the target update function group is the updated update function group.

[0032] In the above scheme, the method further includes determining the content similarity between each of the update function groups and the new update function; when there is an update function group with a content similarity greater than a similarity threshold, the update function group with the highest content similarity is determined as the function group to be updated; the new update function is inserted into the function group to be updated to obtain the updated update function group; when there is no update function group with a similarity greater than a similarity threshold, the new update function and the at least one update function group are respectively determined as the updated update function group.

[0033] In the above scheme, the update functions in the function group to be updated have an execution order, which is obtained by sorting the update functions in the function group to be updated based on their call times. The classification module is also used to obtain the call time of the new update function and determine the position of the new update function in the function group to be updated based on the call time of the new update function and the execution order. Based on the position, the new update function is inserted into the function group to be updated.

[0034] In the above scheme, the update module is further configured to determine, based on the specified scene part, at least one update function associated with the specified scene part from the target update function group; sequentially call at least one update function associated with the specified scene part, and sequentially update the specified scene part based on the update content corresponding to the corresponding update function.

[0035] In the above scheme, the update module is further configured to sequentially perform the following processing on the update functions associated with the specified scene part: when there is an already called update function in the target update function group, determine the content difference between the update function and the already called update function, call the update function, and update the specified scene part based on the content difference; when there is no already called update function in the target update function group, call the update function, and update the specified scene part based on the update content corresponding to the update function.

[0036] This application provides a virtual scene updating device, including:

[0037] The sending module sends an update request for the specified scene portion and receives an update function group corresponding to the specified scene portion; the update function group includes multiple update functions, which are used to update different scene portions in the virtual scene, and the scene portions corresponding to different update functions in the update function group have at least partial overlap;

[0038] The calling module sequentially calls the update functions in the target update function group to update the specified scene portion.

[0039] In the above scheme, the calling module is further configured to, for each update function in the target update function group corresponding to the specified scenario, determine the changed content in the content cache when the update function is called, and if the amount of the changed content is greater than the content amount threshold, determine the update function as a reference update function; the calling module is further configured to count the number of reference update functions and the total number of update functions that have been called in the target update function group; divide the number by the total number to obtain the cache replacement rate of the target update function group, and send the cache replacement rate, which is used to calibrate the target update function group.

[0040] This application provides a virtual scene updating device, including:

[0041] The acquisition module acquires multiple update functions for the virtual scene, and the multiple update functions are used to update different scene parts in the virtual scene respectively;

[0042] The classification module classifies the multiple update functions based on the scene portions corresponding to each of the multiple update functions, thereby obtaining at least one update function group; wherein, the update function group includes multiple update functions, and the scene portions corresponding to different update functions have at least partial overlap;

[0043] The sending module, in response to an update request for a specified scene portion, determines a target update function group corresponding to the specified scene portion from the at least one update function group, and sends the update functions in the target update function group; wherein the update functions in the target update function group update the specified scene portion by sequentially calling them.

[0044] In the above scheme, the classification module is further configured to construct a first indicator vector for each update function based on the function variables in each update function, wherein the first indicator vector is used to indicate whether a first function variable exists in the function variables; classify the plurality of update functions based on the first indicator vectors of each update function to obtain at least one initial update function group, wherein the indicator variables of different update functions in the initial update function group are the same; and classify the update functions in the initial update function group based on the scene part corresponding to the update function in the initial update function group to obtain at least one update function group.

[0045] In the above scheme, the classification module is further configured to receive the cache replacement rate of the target update function group; when the cache replacement rate is greater than the replacement rate threshold, construct a second indicator vector for each update function based on the function variables of each update function; wherein, the second indicator vector is used to indicate whether there is a second function variable among the function variables of the update function, and the second function variable is different from the first function variable; classify the multiple update functions based on the first indicator vector and the second indicator vector to obtain at least one first update function group, wherein the indicator variables of different update functions in the first update function group are the same as the second indicator vector; classify the update functions in the first update function group based on the scene part corresponding to the update function in the first update function group to obtain at least one second update function group.

[0046] This application provides an electronic device, including:

[0047] Memory is used to store executable instructions or computer programs.

[0048] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the virtual scene update method provided in the embodiments of this application.

[0049] This application provides a computer-readable storage medium storing computer-executable instructions for inducing a processor to execute and implement the virtual scene update method provided in this application.

[0050] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene update method described above in this application.

[0051] The embodiments of this application have the following beneficial effects:

[0052] By acquiring multiple update functions for updating content in a virtual scene, and classifying them based on the scene portions corresponding to each function, at least one update function group is obtained. The update functions in the target update function group are then called sequentially to update the specified scene portion. In this way, by classifying multiple update functions to obtain at least one update function group, and since each update function group contains multiple update functions with at least partial overlap in the scene portions corresponding to different functions, when the specified scene portion in the virtual scene meets the update conditions, the sequential calling of the update functions in the target update function group ensures that the updated content corresponding to the called update functions is at least partially identical. Therefore, the cache used to store content does not need to be fully adjusted when switching update functions, effectively reducing the amount of content adjustment required when switching update functions and thus significantly improving content update efficiency. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the architecture of the content update system provided in the embodiments of this application;

[0054] Figure 2 This is a schematic diagram of the structure of an electronic device for content updating provided in an embodiment of this application. Figure 1 ;

[0055] Figure 3 This is a schematic diagram of the structure of an electronic device for content updating provided in an embodiment of this application. Figure 2 ;

[0056] Figure 4 This is a schematic diagram of the structure of an electronic device for content updating provided in an embodiment of this application. Figure 3 ;

[0057] Figure 5 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 1 ;

[0058] Figure 6 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 2 ;

[0059] Figure 7 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 3 ;

[0060] Figure 8 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 4 ;

[0061] Figure 9 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 5 ;

[0062] Figure 10 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 6 ;

[0063] Figure 11 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 7 ;

[0064] Figure 12 This is a schematic diagram of the effect of the game object provided in the embodiment of this application. Figure 1 ;

[0065] Figure 13 This is a schematic diagram of the effect of the game object provided in the embodiment of this application. Figure 2 ;

[0066] Figure 14 This is an interactive schematic diagram of the virtual scene update method according to an embodiment of this application;

[0067] Figure 15 This is a schematic diagram illustrating the classification principle of the update function provided in the embodiments of this application;

[0068] Figure 16 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 8 ;

[0069] Figure 17 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 9 ;

[0070] Figure 18 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 10 . Detailed Implementation

[0071] 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.

[0072] 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.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 1) Virtual Scene: This refers to a virtual scene displayed (or provided) by an application while it is running on a terminal. The virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The 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, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.

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

[0078] 3) Games: Also known as game programs, these can be any of the following: Massive Multiplayer Online Role-Playing Games (MMORPGs), First-Person Shooter (FPS) games, Third-Person Shooter games, Multiplayer Online Battle Arena (MOBA) games, Virtual Reality Applications, 3D Mapping Programs, Simulation Programs, or Multiplayer Shooter Survival Games.

[0079] 4) Virtual Engine: A virtual engine refers to the core components of some pre-written, editable computer virtual systems or interactive real-time graphics applications. These systems provide designers of virtual scenes with various tools needed to create virtual scenes, with the aim of enabling designers to easily and quickly write programs. Virtual engines include rendering engines (including 2D rendering engines and 3D rendering engines), physics engines, collision detection engines, sound effects engines, script engines, animation engines, artificial intelligence engines, network engines, and scene management engines, etc.

[0080] 5) Update Function: Also known as a timer-triggered code (Tick), this is a type of code that executes periodically in a program. In game engines, it typically executes every frame and is generally used for object state control and state synchronization between different objects. Different classes will have different update functions to implement specific functionalities. In programming, a Tick usually refers to a periodically executed action or event that is repeatedly triggered within a certain time interval. The Tick mechanism allows a program to execute specific code segments at fixed time intervals, which is very common in game development, real-time systems, and embedded systems. In game development, Ticks are usually closely related to the game loop, which is the main loop in the game's runtime and is responsible for handling game state updates, rendering, user input, etc. Each Tick represents one iteration of the game loop, usually executed once per frame. The execution of Ticks is usually managed by the game engine, such as the BeginPlay, Tick, and EndPlay functions in the game engine. The code executed in a Tick typically includes logic for updating the game state, processing input, updating the physics engine, and rendering graphics. In some systems, Ticks may also involve asynchronous or multi-threaded processing to ensure that the main thread is not blocked. In game engines, "tick" is typically referred to as a heartbeat or frame update. In Unreal Engine programming and documentation, a tick refers to a series of update functions executed by the engine each frame. These functions handle tasks such as game logic, physics simulation, and animation updates. Therefore, when developers talk about ticks, they are usually referring to frame update functions or functions called every frame. It can also be called a timed update or periodic update. In game engines, tick functions are called periodically to perform a series of update operations, such as controlling object state and synchronizing the state between different objects. Each frame calls a corresponding tick function to ensure that the game or application state is updated in real time. Different types of objects have their own specific tick functions to implement the required functionality.

[0081] During the implementation of the embodiments of this application, the applicant discovered the following problems with the related technology:

[0082] In related technologies, for updating content in a virtual scene, update functions are usually called directly in the order of their execution to update the content in the virtual scene. Since different types of update functions often correspond to completely different content, calling update functions directly in the order of their execution will cause the cache used to store content to be frequently adjusted when switching update functions, resulting in low efficiency of content updates.

[0083] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating virtual scenes, which can effectively improve the efficiency of content updates. The following describes an exemplary application of the content update system provided in this application.

[0084] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the content update system 100 provided in the embodiments of this application. The terminal (terminal 400 is shown as an example) connects 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 the two.

[0085] Terminal 400 is used by users to access client 410 and display a virtual scene on a graphical interface 410-1 (graphical interface 410-1 is shown as an example). Terminal 400 and server 200 are interconnected via wired or wireless network.

[0086] In some embodiments, server 200 can be a standalone physical server, a server cluster or business 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, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminal 400 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart TV, smartwatch, in-vehicle terminal, etc., but is not limited to these. The electronic device provided in this application embodiment can be implemented as a terminal or a server. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application embodiment.

[0087] In some embodiments, server 200 obtains multiple update functions of the virtual scene, classifies the multiple update functions according to the scene parts corresponding to each update function, obtains at least one update function group, and sends the update function group to terminal 400. Terminal 400 sequentially calls the update functions in the target update function group to update the specified scene parts.

[0088] In other embodiments, terminal 400 obtains multiple update functions of the virtual scene, classifies the multiple update functions according to the scene parts corresponding to each update function, obtains at least one update function group, and sends the update function group to server 200. Server 200 sequentially calls the update functions in the target update function group to update the specified scene parts.

[0089] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device 500 for content updating provided in the embodiments of this application. Figure 1 ,in, Figure 2 The electronic device 500 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 2 The illustrated electronic device 500 includes at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 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 2 The general labeled all buses as Bus System 440.

[0090] Processor 430 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.

[0091] The memory 450 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 450 may optionally include one or more storage devices physically located away from the processor 430.

[0092] The memory 450 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 450 described in this application embodiment is intended to include any suitable type of memory.

[0093] In some embodiments, memory 450 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.

[0094] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0095] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, such as Bluetooth, WiFi, and Universal Serial Bus (USB).

[0096] In some embodiments, the virtual scene updating device provided in this application can be implemented in software. Figure 2 An updating device 455 for a virtual scene stored in memory 450 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: an acquisition module 4551, a classification module 4552, and an update module 4553. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0097] See Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device for content updating provided in an embodiment of this application. Figure 2 ,in, Figure 3 The electronic device 600 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 3 The illustrated electronic device 600 includes at least one processor 530, a memory 550, and at least one network interface 520. The various components in the electronic device 600 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3 The general labeled all buses as Bus System 540.

[0098] Processor 530 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.

[0099] The memory 550 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 550 may optionally include one or more storage devices physically located away from the processor 530.

[0100] The memory 550 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 550 described in this application embodiment is intended to include any suitable type of memory.

[0101] In some embodiments, memory 550 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.

[0102] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0103] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, such as Bluetooth, WiFi, and Universal Serial Bus (USB).

[0104] In some embodiments, the virtual scene updating device provided in this application can be implemented in software. Figure 3 An update device 555 for a virtual scene stored in memory 550 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: a sending module 5551 and a calling module 5552. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0105] See Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device for content updating provided in an embodiment of this application. Figure 3 ,in, Figure 4 The electronic device 700 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 4The illustrated electronic device 700 includes at least one processor 630, a memory 660, and at least one network interface 620. The various components in the electronic device 700 are coupled together via a bus system 640. It is understood that the bus system 640 is used to implement communication between these components. In addition to a data bus, the bus system 640 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 4 The general labeled all buses as Bus System 640.

[0106] The processor 630 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.

[0107] The memory 660 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 660 may optionally include one or more storage devices physically located away from the processor 630.

[0108] The memory 660 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 660 described in this application embodiment is intended to include any suitable type of memory.

[0109] In some embodiments, memory 660 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.

[0110] Operating system 651 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0111] The network communication module 652 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 620, exemplary network interfaces 620 including Bluetooth, WiFi, and Universal Serial Bus (USB).

[0112] In some embodiments, the virtual scene updating device provided in this application can be implemented in software. Figure 4 An updating device 666 for a virtual scene stored in memory 660 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: an acquisition module 6661, a classification module 6662, and a sending module 6663. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

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

[0114] In some embodiments, the terminal or server can implement the virtual scene update method provided in this application by running a computer program or computer-executable instructions. For example, the computer program can be a native program in the operating system (e.g., a dedicated content update program) or a software module, such as a content update module that can be embedded in any program (e.g., an instant messaging client, a photo album program, an electronic map client, a navigation client); or it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run. In summary, the above-mentioned computer program can be any form of application, module, or plugin.

[0115] The method for updating 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.

[0116] See Figure 5 , Figure 5 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 1 , will combine Figure 5Steps 101 to 104 are described below. The virtual scene update method provided in this application embodiment can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following description will take the implementation by the server alone as an example.

[0117] In step 101, multiple update functions for the virtual scene are obtained.

[0118] In some embodiments, multiple update functions are used to update different parts of the virtual scene. Update functions, also known as timer-triggered code (Tick), are a type of code that executes periodically in a program. In game engines, they are typically executed every frame and are generally used for object state control and state synchronization between different objects. Different classes may have different update functions to implement specific functionalities. In programming, a Tick usually refers to a periodically executed action or event that is repeatedly triggered within a certain time interval. The Tick mechanism allows a program to execute specific code segments at fixed time intervals. In game development, Ticks are usually closely related to the game loop, the main loop in the game's runtime, which is responsible for handling game state updates, rendering, user input, etc. The code executed in a Tick typically includes logic for updating game state, processing input, updating the physics engine, and rendering graphics. In some systems, Ticks may also involve asynchronous or multi-threaded processing to ensure that the main thread is not blocked. In game engines, Ticks are often referred to as heartbeats or frame updates. In Unreal Engine programming and documentation, a Tick refers to a series of update functions executed by the engine in each frame. These functions are responsible for tasks such as game logic, physics simulation, and animation updates.

[0119] In some embodiments, update functions for different virtual scenes can be customized. These update functions are created based on the virtual scene and are used to update scene components within the virtual scene. In other words, the update functions are generated custom-based on the corresponding scene components. The specific process of obtaining update functions based on a virtual scene is described below: First, it is necessary to clarify which different parts the virtual scene contains, such as terrain, buildings, characters, vegetation, etc., and their respective update requirements. A generic update function interface is created, defining the methods that all update functions must implement, such as the `update()` method. For each unique part of the virtual scene, a specific update function is designed and implemented. These update functions should inherit from the generic interface and implement update logic according to the specific requirements of the scene component. An update function mapping mechanism is created to map the identifiers (such as string names) of different parts in the virtual scene to corresponding update function instances. The configuration information of the virtual scene is analyzed, which may include the type, attributes, and status of the scene components. Based on the results of the scene configuration analysis, the update function mapping mechanism is used to dynamically obtain update function instances corresponding to the scene components. The obtained update function is applied to the corresponding part of the scene, and its `update()` method is called to perform the necessary update operations. The periodicity of the update is determined, such as whether an update is needed in every frame, or whether there are specific triggering conditions for execution. The update state is maintained to ensure the consistency and accuracy of the updates, and the state information is updated as needed to reflect the latest changes in the scene. The update function is ensured to correctly handle any errors or exceptions that may occur during execution, thereby ensuring that each part of the virtual scene is appropriately updated according to its specific needs.

[0120] In some embodiments, a scene portion is an area or component in a virtual scene that can be independently identified and manipulated. A scene portion can be terrain, buildings, characters, vegetation, water, etc. Each scene portion has its unique attributes and behaviors that may require independent updates.

[0121] In some embodiments, an update function group can be a collection of related update functions, each responsible for updating a specific part of the virtual scene. For example, there might be one update function group dedicated to handling terrain, and another group dedicated to handling characters.

[0122] As an example, when a player presses a key or moves a joystick, the update function is used to update the player character's position, orientation, and action state. For instance, if the player moves to the right, the update function will adjust the player character's position so that it moves to the right on the screen.

[0123] As an example, non-player characters in the game will update their behavior in the update function according to the AI ​​script. For example, a non-player character may update its path every frame, move closer to the player character, or perform an attack action.

[0124] As an example, in the update function, the game calculates and updates the physical state of all objects in the scene, including collision detection, gravity effects, and interactions between objects. The update function also handles game logic, such as increasing or decreasing health points, updating the scoring system, and advancing the game. Game UI elements, such as menus, buttons, and other interactive components, check user input in the update function and update their states accordingly.

[0125] As an example, the game includes player-controlled objects such as spaceships and vehicles. The update function checks the position and status of the player's spaceship every frame. If the player presses a direction key, the update function will change the spaceship's position. Similarly, if the player presses the fire button, the update function will create new bullet objects and add them to the game scene. The update function also checks the overall game state, such as the player's score, health, and whether the game has ended. Depending on the game state, the update function may trigger a new game phase or display a game-ending screen. In each frame, the update function also calls rendering-related functions to update the image display on the screen, ensuring the player sees the latest game objects.

[0126] In step 102, based on the scene parts corresponding to the multiple update functions, the multiple update functions are classified to obtain at least one update function group.

[0127] In some embodiments, the update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap. The update function group includes at least one update function. The similarity between the update content corresponding to the update functions in different update function groups is less than the similarity threshold, and the similarity between the update content corresponding to the update functions in different update function groups is greater than the similarity threshold.

[0128] In some embodiments, since different processors have different parameters for content caching, various types of processors can perform step 102 above to classify the update functions and obtain update function groups corresponding to each processor.

[0129] As an example, update functions A, B, and C are classified to obtain update function group A1: {update function A, update function B} and update function group A2: {update function C}.

[0130] In some embodiments, see Figure 6 , Figure 6This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 2 , Figure 5 Step 102 shown can be achieved through Figure 6 Steps 1021A to 1023A shown are implemented.

[0131] In step 1021A, a first indicator vector for each update function is constructed based on the function variables in each update function.

[0132] In some embodiments, a first indicator vector is used to indicate whether a first function variable exists among the function variables.

[0133] In some embodiments, the first indicator vector is a mathematical vector used to indicate (mark) the existence of a specific first function variable in the function variables of the update function. Each element typically corresponds to a specific parameter or attribute in the function variable. If the parameter or attribute exists (i.e., satisfies a specific condition or is designated as the "first function variable"), the element is 1 (or another value indicating existence); otherwise, it is 0 (or another value indicating non-existence).

[0134] As an example, the expression for updating the first indicator vector of function A can be:

[0135] Z={z1,z2,z3}={1,0,1} (1)

[0136] Where Z is used to indicate the first indicator vector of the update function A, z1, z2, and z3 respectively indicate the vector elements in the first indicator vector. Element z1 corresponds to the first function variable A1, element z2 corresponds to the first function variable A2, and element z3 corresponds to the first function variable A3. z1 is used to indicate whether the first function variable A1 exists in the update function A, z2 is used to indicate whether the first function variable A2 exists in the update function A, and z3 is used to indicate whether the first function variable A3 exists in the update function A.

[0137] In some embodiments, step 1021A above can be implemented as follows: obtain the first preset vector of each update function, the first preset vector including at least one vector element, the vector element corresponding one-to-one with the first function variable; detect the function variable of each update function respectively, and obtain the detection result, the detection result being used to indicate whether the first function variable exists in the function variable; based on the detection result, update the first preset vector of each update function to obtain the first indicator vector of each update function.

[0138] In some embodiments, the function variables of each update function are detected separately to obtain the detection results. This can be achieved as follows: For each update function, the following processing is performed: Each function variable in the update function is compared with the first function variable. When there is a function variable that is the same as the first function variable, the detection result is determined to be that the function variables of the update function contain a preset function variable; when there is no function variable that is the same as the first function variable, the detection result is determined to be that the function variables of the update function do not contain the preset function variable.

[0139] In some embodiments, the above-mentioned updating of the first preset vector of each update function based on the detection result to obtain the first indicator vector of each update function can be achieved in the following way: Perform the following processing on each vector element in the first preset vector to obtain the indicator vector of the update function: when the detection result indicates that the function variable of the update function does not contain a preset function variable, update the vector element in the first preset vector to a first vector element; when the detection result indicates that the function variable of the update function contains a preset function variable, update the vector element in the first preset vector to a second vector element, wherein the first vector element and the second vector element are different.

[0140] In some embodiments, the first preset vector is an initial vector, where each element represents whether a corresponding function variable in the update function is preset as a specific important variable. The indication result is obtained by detecting the function variables of the update function, and is used to determine whether each variable actually satisfies the conditions of a preset important variable. The first vector element and the second vector element are used to update the first preset vector with different values, so as to clearly distinguish whether the function variable satisfies the preset conditions in the indication vector.

[0141] As an example, the element value of the first vector element can be 0, and the element value of the second vector element can be 1.

[0142] In this way, the update strategy can dynamically adjust the vector elements based on the detection results, ensuring that the function variables of the update function remain consistent with the preset function variables. When the preset function variables are not detected in the function variables of the update function, updating the vector elements in the first preset vector with the first vector element effectively avoids calculation errors or anomalies caused by variable inconsistency. Conversely, when the preset function variables are detected in the function variables of the update function, updating the vector elements in the first preset vector with the second vector element helps maintain the stability and accuracy of the function. This differentiated processing not only improves flexibility and adaptability but also ensures the correct operation of the function in different scenarios, thereby improving overall performance and reliability.

[0143] This ensures that each update function operates based on its specific first preset vector, making the updates of function variables more accurate and targeted. Detecting the function variables of each update function and obtaining the detection result of the existence of the first function variable provides a clear basis for subsequent vector element updates. The application of this detection result allows for dynamic adjustment of the preset vector according to actual needs, avoiding unnecessary calculation errors and resource waste. Updating the first preset vector based on the detection result yields the first indicator vector for each update function, enhancing the flexibility and adaptability of the functions and ensuring that the update function remains consistent with the preset target throughout the processing, thereby improving overall stability and accuracy.

[0144] In step 1022A, based on the first indicator vector of each update function, multiple update functions are classified to obtain at least one initial update function group.

[0145] In some embodiments, the first indicator vectors of different update functions in the initial update function group are the same, while the first indicator vectors of update functions in different initial update function groups are different.

[0146] In some embodiments, certain features of update functions (such as variable states, parameter configurations, etc.) are transformed into comparable vector forms. This vectorized representation makes it easier to identify and group similar or identical update functions. When multiple update functions have the same first indicator vector, it means that these update functions are similar in one or more key dimensions. These similarities may stem from the data types they handle, the variables they depend on, the types of operations they perform, etc. This similarity identification helps to understand the relationships between functions and the repetition of content. By grouping update functions with the same first indicator vector into an initial update function group, the function set can be effectively organized and simplified.

[0147] In some embodiments, the above-mentioned classification of multiple update functions based on the first indicator vector of each update function to obtain at least one initial update function group can be implemented in the following manner: Perform the following processing on each update function: determine the update function as the target update function; when there is a first indicator vector that is the same as the first indicator vector of the target update function, construct the update function with the same first indicator vector as the target update function and the target update function as the initial update function group; when there is no first indicator vector that is the same as the first indicator vector of the target update function, determine the target update function as the initial update function group.

[0148] In some embodiments, identifying each update function as the target update function is a strategy of evaluation one by one. This ensures that each function is considered and examined individually, and no function is missed in the initial screening. When a vector exists that is identical to the first indicator vector of the target update function, these functions are clustered into an initial update function group. By clustering similar functions, the same processing logic and optimization strategies can be applied in batches, reducing redundant work. The same update function group can share resources, such as memory cache and execution threads, improving resource utilization. For update functions that do not share the same first indicator vector, they are identified as independent initial update function groups.

[0149] In this way, by effectively identifying and clustering update functions with the same characteristics, and by constructing an initial update function group, the efficiency of function management and modularity are improved. When update functions with the same first indicator vector are found, they can be grouped together to share the same optimization strategy and maintenance process, reduce duplication of work, and improve resource utilization.

[0150] In step 1023A, for each initial update function group, based on the scene portion corresponding to the update function in the initial update function group, the update functions in the initial update function group are classified to obtain at least one update function group.

[0151] In some embodiments, after initially classifying update functions into initial update function groups based on a first indicator vector, further classification of update functions within these update function groups reflects a deeper analysis and understanding of function characteristics. This in-depth classification helps to more precisely identify and manage the similarity of functions. Unlike the first indicator vector, this classification is based on the specific scene portion corresponding to the update function. When update functions in the initial update function group have at least partial similarities in scene portion, these functions are further clustered into at least one update function group.

[0152] In some embodiments, multiple update functions are classified based on the first indicator vector of each update function to obtain at least one initial update function group. For each initial update function group, the update functions in the initial update function group are classified based on the scene part corresponding to the update function in the initial update function group to obtain at least one update function group. Since the information content corresponding to the update function is significantly greater than the information content of the first indicator vector, the computational efficiency of classification based on the first indicator vector is much higher than that of classification based on content. By performing preliminary classification of multiple update functions based on the first indicator vector of each update function, the computational amount of subsequent classification based on content can be significantly reduced (no computation is required between update functions in different initial update function groups), thereby effectively improving the classification efficiency of update functions.

[0153] In some embodiments, step 1043A above can be implemented as follows: by simulating the invocation of each update function in the initial update function group, the scene part corresponding to each update function is determined; the similarity between the contents of different update functions in the initial update function group is determined; and update functions with similarity greater than a similarity threshold are clustered to obtain at least one update function group.

[0154] In some embodiments, a simulation environment is built that can safely execute update functions and capture their execution results. Within this simulation environment, each update function in the initial update function group is called sequentially. During the call, information such as the function's behavior, state changes, and output results is recorded. This information is used for subsequent content analysis and similarity calculation. Based on the results of the simulated calls, content features of the update functions are extracted, and the extracted content is analyzed and converted into a comparable representation. For example, the code structure can be converted into an abstract syntax tree, or the processed data can be converted into feature vectors.

[0155] In some embodiments, simulated calls are used to describe a virtual execution of an update function during program development or testing. For a first update function: the program executes a virtual call to the function to determine its corresponding scenario portion or result. For a second update function: the program simulates calls to the first and second update functions sequentially. This simulated sequential call is used to understand or test what results are produced when the two functions are executed in this order. Alternatively, the second update function can be simulated independently to understand its output when independent of the first update function.

[0156] In some embodiments, the above-mentioned method of determining the scene portion corresponding to each update function by simulating calls to each update function in the initial update function group can be implemented as follows: For each update function in the initial update function group, the following processing is performed: When an update function is not classified, it is identified as the first update function, and all update functions in the initial update function group other than the first update function and the already classified update functions are identified as second update functions; when the number of second update functions is greater than one, the scene portion corresponding to the first update function is determined by simulating calls to the first update function; for each second update function, the scene portion corresponding to the second update function is determined by sequentially simulating calls to the first and second update functions, or by simulating calls to the second update function. When the number of second update functions is zero, the first update function is directly identified as part of the update function group.

[0157] In some embodiments, in the initial stage, all update functions are unclassified. From these unclassified update functions, one update function is selected as the first update function, and the remaining update functions are marked as the second update functions. The simulated call of the first update function is executed, and through this call process, the scene part corresponding to the first update function is determined.

[0158] As an example, the initial update function group includes update function A, update function B, and update function C. At this time, update function A, update function B, and update function C are all unclassified update functions. For update function A in the initial update function group, update function A is determined as the first update function. The update functions in the initial update function group other than the first update function A and the already classified update functions are determined as the second update functions (update function B and update function C). By simulating the call to the first update function (update function A), the scene part corresponding to the first update function (update function A) is determined. For each second update function (update function B and update function C), the scene part corresponding to the second update function (update function B and update function C) is determined by simulating the call to the first update function and the second update function in sequence, or by simulating the call to the second update function (update function B and update function C).

[0159] Continuing the previous example, for update function B in the initial update function group, both update function B and update function C are unclassified update functions. Update function B is identified as the first update function, and all update functions in the initial update function group other than the first update function B and the classified update function (update function A) are identified as the second update functions (update function C). By simulating the call to the first update function (update function B), the scene part corresponding to the first update function (update function B) is determined. For each second update function (update function C), the scene part corresponding to the second update function (update function C) is determined by simulating the call to the first update function and the second update function in sequence, or by simulating the call to the second update function (update function C).

[0160] Continuing from the previous example, for update function C in the initial update function group, only update function C is an unclassified update function. Update function C is determined as the first update function. By simulating the call to the first update function (update function C), the scene part corresponding to the first update function (update function C) is determined.

[0161] Thus, by classifying the update functions in the initial update function group, firstly establishing the first update function helps clarify the core logic and priority, providing clear guidance for subsequent processing. Furthermore, by classifying other unclassified update functions as second update functions, hierarchical management of functions can be effectively achieved. Simulating calls to the first and second update functions not only identifies their respective corresponding scenario parts but also examines the mutual influence and synergy between functions. This approach helps optimize program structure, improve code maintainability and extensibility, and reduce the possibility of program errors.

[0162] In some embodiments, the determination of the similarity between the contents of different update functions in the initial update function group can be achieved by determining the similarity between the scene portion corresponding to the first update function and the scene portion corresponding to each of the second update functions.

[0163] In some embodiments, the determination of the similarity between the scene portion corresponding to the first update function and the scene portions corresponding to each of the second update functions can be achieved as follows: Using static code analysis tools, the number of lines of code, code complexity, variable usage, etc., of the functions are analyzed to preliminarily determine the similarity between the functions. The first and second update functions are actually run, and their execution paths, processed datasets, and generated results are recorded. These dynamic behaviors are then compared to determine the similarity. Quantitative metrics, such as edit distance (Levenshtein distance) and cosine similarity, are used to perform mathematical similarity calculations on the function code or execution results.

[0164] Continuing with the previous example, when update function A is the first update function and update functions B and C are the second update functions, the similarity between the scene part corresponding to update function A and the scene parts corresponding to update functions B and C is determined.

[0165] Continuing from the previous example, when update function B is the first update function and update function C is the second update function, the similarity between the scene part corresponding to update function B and the scene part corresponding to update function C is determined.

[0166] Continuing from the previous example, when the update function C is an update function, and only the update function C is an unclassified update function, then the update function C is directly identified as a separate update function group.

[0167] In some embodiments, the above-mentioned clustering of update functions with similarity greater than a similarity threshold to obtain at least one update function group can be implemented as follows: when there is a similarity greater than a similarity threshold between the first update function and the second update function, the second update function with a similarity greater than the similarity threshold and the first update function are determined as the update function group corresponding to the first update function; when there is no similarity greater than a similarity threshold between the first update function and the second update function, the first update function is determined as the update function group corresponding to the first update function.

[0168] In some embodiments, a similarity threshold is a key criterion for determining whether a first update function and a second update function are similar. The setting of the similarity threshold needs to be based on the actual application scenario and requirements. If the threshold is set too low, too many functions may be incorrectly classified as similar, increasing the risk of misclassification; if the threshold is set too high, it may fail to identify actually similar functions, leading to missed classifications. A similarity threshold is a parameter used when comparing the similarity of two or more entities (such as functions, code snippets, datasets, etc.). It is a predefined standard or threshold value used to determine whether the similarity between the first update function and the second update function is high enough to group them together. As a filtering tool, the similarity threshold helps developers or automation tools distinguish whether functions have sufficient similarity for grouping. It is a critical parameter because its setting directly affects the results of similarity analysis, and consequently, subsequent code organization, optimization, and maintenance.

[0169] In some embodiments, the scene content updated by the first update function and each second update function is described in detail, and key information such as scene elements, states, behaviors, rules and goals is recorded. The updated content corresponding to the first update function and the second update function are compared using quantitative methods (such as similarity calculation) to evaluate the degree of similarity between them. Based on the evaluation results, it is analyzed which aspects lead to the increase or decrease in similarity, and the impact of these similarities or differences on the virtual scene is explored. This allows for a better understanding of the interaction between different update functions, optimization of scene management and function design, and improvement of the realism of the virtual scene.

[0170] Continuing the previous example, when the first update function is update function A, update functions B and C are the second update functions. When the similarity between the first update function (update function A) and the second update function (update function B) is greater than the similarity threshold, the second update function (update function B) with the similarity greater than the similarity threshold and the first update function (update function A) are determined as the update function group corresponding to the first update function (update function A). At this time, update functions A and B are both update functions that have been classified, and only update function C is not classified. Therefore, update function C is directly determined as the update function group alone.

[0171] Thus, the strategy of initially classifying multiple update functions based on their first indicator vectors, and then further classifying them in detail based on the content of the update functions in the initial update function group, is far more computationally efficient than the latter, since the first indicator vector contains the key features of the update function and the content-based classification involves more detailed information. This phased classification method first reduces the computational burden of subsequent content-based classification by efficiently classifying based on the first indicator vector, because further comparison of content is only needed when the first indicator vectors are similar, thereby avoiding unnecessary calculations between different initial update function groups. This not only optimizes the calculation process and reduces resource consumption, but also significantly improves the overall efficiency of update function classification.

[0172] In some embodiments, see Figure 7 , Figure 7 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 3 , Figure 5 Step 102 shown can be achieved through Figure 7 Steps 1021B to 1023B shown are implemented.

[0173] In step 1021B, the scene portion corresponding to each update function is determined by simulating the invocation of each update function.

[0174] In some embodiments, a simulation environment needs to be set up that can safely execute update functions and capture their execution results. Within this simulation environment, each update function in the initial update function group is called sequentially. During the call, information such as the function's behavior, state changes, and output results is recorded. This information will be used for subsequent content analysis and similarity calculation. Based on the results of the simulated calls, the content features of the update functions are extracted, and the extracted content is analyzed and converted into a comparable representation. For example, the code structure can be converted into an abstract syntax tree, or the processed data can be converted into feature vectors.

[0175] In some embodiments, simulated invocation refers to the process of executing an update function in a controlled environment. The purpose is to simulate the behavior and effects of the update function in a real-world scenario without affecting the actual virtual scene. By simulating invocations of each update function, the aim is to determine the role and impact of each function, i.e., the specific changes and results they produce in the virtual scene. The update content corresponding to the update function refers to the state of the virtual scene after the update function is executed, including object attributes, layout, logical state, etc., which are direct results of the update function's operations and modifications. The update function is responsible for operating on the virtual scene, which may include adding, modifying, or deleting elements in the scene, changing the scene's configuration or state, etc. Through simulated invocations, the impact of the update function on the virtual scene can be previewed and tested, ensuring that the function works as expected, and verifying the function's logic and effects without affecting the actual system.

[0176] In some embodiments, step 1021B above can be implemented in the following way: by simulating the invocation of the first update function, the scene part corresponding to the first update function is determined, wherein the first update function is any update function and the second update function is an update function other than the first update function; for each second update function, by simulating the invocation of the first update function and the second update function in sequence, the scene part corresponding to the second update function is determined, or by simulating the invocation of the second update function, the scene part corresponding to the second update function is determined.

[0177] In some embodiments, determining the scene part corresponding to the first update function by simulating the call to the first update function can be achieved in the following way: obtain an initial virtual scene, simulate the call to the first update function, simulate the update of the initial virtual scene to obtain a first virtual scene, and determine the scene part in the initial virtual scene that is different from the first virtual scene as the scene part corresponding to the first update function.

[0178] In some embodiments, the states of the initial virtual scene and the first virtual scene are compared to identify the differences between them, i.e., the parts affected by the first update function. These differences may include object movement, attribute changes, the addition of new objects, etc. The effect of the first update function is analyzed to evaluate whether the changes in the virtual scene meet the expected requirements. If necessary, the design of the update function or the virtual scene can be further adjusted to understand how the update function affects the virtual scene and determine which specific parts of the scene are affected by the update function.

[0179] As an example, the initial virtual scene consists of circular objects on a plane. Their positions, sizes, and colors are recorded. The first update function can update the positions of the circular objects based on the provided movement distance. The first virtual scene can be a scene where the positions of the circular objects change. The differences in the scene can be the changes in the positions of the circular objects, i.e., the part affected by the update function, which is the scene part corresponding to the first update function.

[0180] In some embodiments, the above-mentioned method of determining the scene part corresponding to the second update function by sequentially simulating the invocation of the first update function and the second update function can be implemented as follows: obtain an initial virtual scene, and simulate the invocation of the first update function and the second update function to perform simulated updates on the initial virtual scene to obtain a second virtual scene. The scene part in the initial virtual scene that is different from the second virtual scene is determined as the scene part corresponding to the second update function.

[0181] In some embodiments, the above-mentioned determination of the scene part corresponding to the second update function by simulating the call to the second update function can be achieved in the following way: obtain an initial virtual scene, and simulate the call to the second update function to simulate the update of the initial virtual scene to obtain a third virtual scene, and determine the scene part in the initial virtual scene that is not the same as the third virtual scene as the scene part corresponding to the second update function.

[0182] In some embodiments, the states of the initial virtual scene and the second virtual scene are compared to identify the differences between them, i.e., the parts affected by the second update function. These differences may include object movement, attribute changes, the addition of new objects, etc. The effect of the second update function is analyzed to evaluate whether the changes in the virtual scene meet the expected requirements. If necessary, the design of the update function or the virtual scene can be further adjusted to understand how the update function affects the virtual scene and determine which specific parts of the scene are affected by the update function.

[0183] As an example, the initial virtual scene consists of circular objects on a plane, whose positions, sizes, and colors are recorded. The second update function can update the positions of the circular objects based on a provided movement distance. The second virtual scene can be a scene where the positions of the circular objects change. The difference in the scene can be the change in the positions of the circular objects, i.e., the part affected by the update function, which is the scene part corresponding to the second update function.

[0184] As an example, the update functions include update function A, update function B, and update function C. In this case, update functions A, B, and C are all unclassified update functions. For update function A, update function A is identified as the first update function. Update functions other than the first update function A and the already classified update functions are identified as the second update functions (update functions B and C). By simulating the invocation of the first update function (update function A), the scene portion corresponding to the first update function (update function A) is determined. For each second update function (update function B and update function C), the scene portion corresponding to the second update function (update function B and update function C) is determined by sequentially simulating the invocation of the first and second update functions, or by simulating the invocation of the second update function (update function B and update function C).

[0185] Continuing the previous example, for update function B, both update function B and update function C are unclassified update functions. Update function B is identified as the first update function, and all update functions other than the first update function B and the already classified update function (update function A) are identified as the second update functions (update function C). By simulating the call to the first update function (update function B), the scene part corresponding to the first update function (update function B) is determined. For each second update function (update function C), the scene part corresponding to the second update function (update function C) is determined by simulating the call to the first update function and the second update function in sequence, or by simulating the call to the second update function (update function C).

[0186] Continuing from the previous example, regarding update function C, since only update function C is an unclassified update function, update function C is determined as the first update function. By simulating the call to the first update function (update function C), the scene part corresponding to the first update function (update function C) is determined.

[0187] In step 1022B, the similarity between the contents of different update functions is determined.

[0188] In some embodiments, similarity is calculated through feature-based comparison, statistical measures (such as cosine similarity, Jaccard similarity), machine learning models, etc. By encoding the content of the update function, content features are obtained, and the similarity between the content features of different update functions is determined as the similarity between the contents of the update functions.

[0189] In some embodiments, step 1022B above can be implemented by determining the similarity between the scene portion corresponding to the first update function and the scene portion corresponding to each of the second update functions.

[0190] As an example, when update function A is the first update function and update functions B and C are the second update functions, the similarity between the scene part corresponding to update function A and the scene parts corresponding to update functions B and C is determined.

[0191] Continuing from the previous example, when update function B is the first update function and update function C is the second update function, the similarity between the scene part corresponding to update function B and the scene part corresponding to update function C is determined.

[0192] Continuing from the previous example, when the update function C is an update function, and only the update function C is an unclassified update function, then the update function C is directly identified as a separate update function group.

[0193] In step 1023B, update functions with similarity greater than a similarity threshold are clustered to obtain at least one group of update functions.

[0194] In some embodiments, a similarity threshold is a key criterion for determining whether a first update function and a second update function are similar. The setting of the similarity threshold needs to be based on the actual application scenario and requirements. A similarity threshold is a parameter used when comparing the similarity of two or more entities (such as functions, code snippets, datasets, etc.). It is a predefined standard or threshold value used to determine whether the similarity between the first update function and the second update function is high enough to group them together. As a filtering tool, the similarity threshold helps developers or automation tools distinguish whether functions have sufficient similarity for grouping. It is a critical parameter because its setting directly affects the results of similarity analysis, and consequently, subsequent code organization, optimization, and maintenance.

[0195] In some embodiments, step 1023B above can be implemented as follows: when there is a similarity between the first update function and the second update function that is greater than the similarity threshold, the second update function with a similarity greater than the similarity threshold and the first update function are determined as the update function group corresponding to the first update function; when there is no similarity between the first update function and the second update function that is greater than the similarity threshold, the first update function is determined as the update function group corresponding to the first update function.

[0196] Continuing the previous example, when the first update function is update function A, update functions B and C are the second update functions. When the similarity between the first update function (update function A) and the second update function (update function B) is greater than the similarity threshold, the second update function (update function B) with the similarity greater than the similarity threshold and the first update function (update function A) are determined as the update function group corresponding to the first update function (update function A). At this time, update functions A and B are both update functions that have been classified, and only update function C is not classified. Therefore, update function C is directly determined as the update function group alone.

[0197] Therefore, using a similarity threshold to determine the similarity between the first and second update functions, and grouping functions according to this criterion, helps identify and integrate similar update operations when the similarity exceeds the threshold, reducing code redundancy and improving code maintainability and readability. This promotes modularity, making subsequent development and maintenance more efficient. Conversely, when no highly similar functions are found, independently determining the update function group for the first update function helps maintain functional independence and clarity, avoiding unnecessary inter-module dependencies.

[0198] In some embodiments, after performing step 102 above, the following processing may also be performed: generating a new update function, and updating at least one update function group based on the new update function to obtain at least one updated update function group.

[0199] In some embodiments, new update functions may be created in response to game client requests to update virtual scene content. This implies that the game's runtime environment or user interaction may have changed, requiring update functions to adapt to these changes. Generating new update functions demonstrates the system's good adaptability and scalability, enabling dynamic adjustment and optimization of functionality based on actual needs. Updating at least one update function group means integrating new update functions into existing update function groups. During the update process, it is necessary to ensure that the new update functions are consistent with or compatible with existing update functions in the update function group in terms of functionality, performance, and behavior, in order to maintain the overall stability and reliability of the update function group. The updated update function group will contain the new update functions, thereby enhancing the functionality of the original update function group, providing new interaction methods, or optimizing the user experience.

[0200] In some embodiments, the above-mentioned updating of at least one set of update functions based on the new update function to obtain at least one updated set of update functions can be achieved in the following manner: determining the content similarity between each set of update functions and the new update function; when there is a set of update functions with a content similarity greater than a similarity threshold, determining the set of update functions with the highest content similarity as the set of functions to be updated; inserting the new update function into the set of functions to be updated to obtain the updated set of update functions; when there is no set of update functions with a similarity greater than a similarity threshold, determining the new update function and at least one set of update functions as the updated set of update functions.

[0201] In some embodiments, the content similarity between each update function group and the new update function can be determined as follows: for each update function group, the similarity between the content of any update function in the update function group and the content of the new update function is determined as the content similarity between the update function group and the new update function.

[0202] In some embodiments, the similarity between the new update function and existing update function groups is determined by comparing their contents. A similarity threshold is set to determine which update function groups are sufficiently similar to the new update function and worthy of further consideration. The update function group with the highest content similarity is selected as the update function group to be updated. This is based on the principle of highest similarity, aiming to maximize code reuse and reduce development workload. The new update function is integrated into the selected update function group to be updated. The updated update function group will contain the new update function and possibly other auxiliary functions to jointly complete a specific function. If no update function group meets the similarity threshold, the new update function will be considered an independent update function group. The new update function can be combined into one or more existing update function groups to form a new updated update function group.

[0203] Thus, by determining the content similarity between each update function group and the new update function, and updating the update function groups according to the similarity threshold, efficient code management and maintenance can be achieved. When there are update function groups with content similarity greater than the similarity threshold, selecting the update function group with the highest similarity as the function group to be updated and inserting the new update function into it helps reduce code redundancy, improve development efficiency, and maintain code consistency and maintainability. Meanwhile, when there are no update function groups with similarity greater than the similarity threshold, determining the new update function and at least one update function group as the updated update function group helps maintain functional independence.

[0204] In some embodiments, the update functions in the above-mentioned group of functions to be updated may have an execution order, which is obtained by sorting the update functions in the group of functions to be updated based on their call times.

[0205] In some embodiments, within a group of functions to be updated, the execution order refers to either the actual time when a function or method is called or a predetermined logical order. The update functions in the update function group are sorted according to their call times to determine their execution order during program execution.

[0206] In some embodiments, when the update functions in the function group to be updated have an execution order, the above-mentioned insertion of the new update function into the function group to be updated to obtain the updated function group can be achieved in the following way: obtain the call time of the new update function, and determine the position of the new update function in the function group to be updated based on the call time and execution order of the new update function; insert the new update function into the function group to be updated based on the position.

[0207] In some embodiments, the exact time or timing condition at which the new update function should be called is determined. This could be a specific moment, the time an event triggers, or a time related to the state of the game scene. Based on the call time of the new update function, it is analyzed whether it should execute before, after, or concurrently with other update functions. This typically involves understanding the dependencies between functions, such as whether some update functions may need to run only after other functions have finished executing. The exact position of the new update function within the group of functions to be updated is determined. This can be done by comparing the call time of the new update function with the call times of other functions. Call points are added or modified in the group of update functions to ensure that the new update function is called in the determined execution order. The new execution order is tested in a real game environment to ensure that the new update function is called at the correct time and that its interaction with other functions works as expected.

[0208] As an example, the game has a player leveling system where a level-up update function is triggered whenever a player reaches a certain experience threshold. Now, we want to add a new update function that automatically allocates extra skill points to the player upon leveling up. This new update function is called at the exact moment the player levels up, specifically when their experience reaches a certain threshold. When a player levels up, their level and experience are updated first, and then skill points are allocated. Therefore, the new update function should execute after other level-up related functions. Since the new update function should execute after a level up, it should be after the level and experience update function, but before any functions unrelated to player attribute updates. In the group of functions to be updated, locate the level and experience update function and insert the new update function after it. After inserting the new update function, the execution order of the group of functions to be updated might be: check player experience (trigger level up), update player level and experience, allocate skill points (new update function), update player attributes (if any), ensuring the new update function is called at the correct time and works correctly with other level-up related functions, providing a smooth gaming experience.

[0209] In some embodiments, when the update functions in the function group to be updated do not have an execution order, a new update function is added to any position in the function group to be updated, resulting in at least one update function group.

[0210] In some embodiments, the above-mentioned insertion of a new update function into a group of functions to be updated based on position can be implemented as follows: when there is an execution order between the corresponding update function and the new update function, the update functions in the group of functions to be updated and the new update function are simulated and sorted according to each execution order to obtain a simulated sorting result; when the simulated sorting result indicates that the update functions in the group of functions to be updated and the newly generated update function can satisfy each execution order, the group of functions to be updated and the new update function with the highest similarity are arranged according to each execution order and position to obtain a candidate update function group; when the simulated sorting result indicates that the update functions in the group of functions to be updated and the new update function cannot satisfy at least part of the sequential execution relationship, the group of functions to be updated is split to obtain multiple split update function groups, and the new update function is updated into any split update function group.

[0211] In some embodiments, the purpose of simulated sorting is to predict the execution order of a new update function relative to the functions in an existing update function group without actual execution. Each update function has its specific execution order, which may be determined by dependencies, triggering conditions, or business logic. By simulating the sorting of the function group to be updated and the new update function, a sorting result conforming to the execution order is obtained. The simulated sorting result is checked to ensure it satisfies all predetermined execution orders. If the simulated sorting result shows that all functions can be executed in the specified order, the next step can be performed. When the simulated sorting result satisfies the execution order, similar function groups to be updated and the new update function are arranged according to their execution order and position. During the arrangement, the similarity between update function groups is considered, and the update function group with the highest similarity is selected to insert the new update function. If the simulated sorting result shows that at least a partial execution order cannot be satisfied, the function group to be updated needs to be split. Based on the execution order requirements, the function group to be updated is split into multiple independent subgroups, and the functions within each subgroup can be executed relatively independently. The new update function is then updated into any of the split update function groups, ensuring that it conforms to the execution order.

[0212] Thus, simulated sorting ensures that the new update functions meet the predetermined execution order requirements. This helps maintain the consistency of the system's internal logic and prevents program errors or logical conflicts caused by incorrect execution order. The simulated sorting process can pre-verify whether the execution order of the updated functions is correct, thereby avoiding costly rollback or correction work after the update is implemented. When new update functions are properly integrated into the group of functions to be updated, code redundancy and complexity can be reduced. This will make future maintenance easier and reduce the error rate. After determining the group of functions to be updated with the highest similarity, the new update functions can reuse the logic and structure of this part of the code, avoiding the rewriting of the same code and improving code reusability. When the simulated sorting results show that the execution order cannot be directly met, the update function group can be split to adapt to the new update functions. This flexibility allows for adaptation to more complex business logic and technical requirements. By simulating sorting and splitting the update function group, potential problems can be predicted before actual code changes, reducing the amount of testing work after the code is actually deployed.

[0213] Thus, when the update functions in the function group to be updated have an execution order, by obtaining the call time of the new update function and determining the position of the new function in the function group based on its call time and execution order, it can be ensured that the insertion of the new function will not disrupt the original execution flow, while ensuring the smooth integration of new functions. Through this orderly update strategy, it is possible to better adapt to changes in requirements and accelerate the development and deployment of new update functions.

[0214] In step 103, based on a specified scene portion in the virtual scene, a target update function group corresponding to the specified scene portion is determined from at least one update function group.

[0215] In some embodiments, a designated scene portion refers to a specific part of a virtual scene that needs to be updated. For example, in a game, if a player selects a specific building in the game world to interact with or modify, then that building is a designated scene portion. A designated scene portion is a specifically designated part of a virtual scene that needs to be updated or modified. For example, if the developer decides to update a specific building in the scene, then that building is a designated scene portion. A designated scene portion is a scene element or area in a virtual scene that the developer or system determines based on specific needs or operational purposes. This scene portion is a specific one among many components within the scene; it may be selected for special processing or updating due to certain reasons (such as user interaction, scene logic requirements, or external event triggers). A designated scene portion is a specific object or area in a virtual scene that needs to be updated, and the target update function group is a set of specialized functions selected from the update function group to handle the update of this specific portion.

[0216] In some embodiments, step 103 above can be implemented as follows: for each update function group, when the content of an update function in the update function group is the same as that of a specified scenario, the update function group is determined as the target update function group.

[0217] In some embodiments, it is necessary to define and identify the conditions that trigger updates. These conditions can be player actions, time changes, resource loading completion, game events, etc. The specified scene portion in the virtual scene refers to game objects or elements whose state needs to be updated or checked, such as the player's position, health, or the state of items in the game. An update function group is a set of related functions responsible for handling specific tasks or updating specific content. For example, there might be a dedicated update function group for handling player state, including functions for updating position, updating health, etc.

[0218] As an example, in a time-update application scenario, the update condition is a specific event or state that triggers an update to a designated part of the game's virtual scene. For instance, the update condition might be that time in the game has elapsed within a preset time interval (e.g., every second or every minute), and the designated scene part could be a game clock, character status (such as health or hunger), or environmental effects (such as weather changes). In a trigger-activated application scenario, the update condition could be that a player triggers a trigger in the game, such as reaching a specific location or interacting with a specific object. The designated scene part could be the game's event log, unlockable content, task status, or environmental changes.

[0219] In step 104, the update functions in the target update function group are called sequentially to update the specified scene parts.

[0220] In some embodiments, update conditions refer to specific states or events that trigger updates to a specified scene portion in a virtual scene. When a specified scene portion in a virtual scene meets the update conditions, the corresponding update function is called to perform modification or refresh operations on the specified scene portion. Update conditions may include time intervals reaching a duration threshold, user interaction triggers, event triggers, data changes, etc. Update conditions ensure the accuracy and timeliness of update operations and are a key element in virtual scene content management.

[0221] In some embodiments, step 104 above can be implemented as follows: sequentially calling the update functions in the updated function group after the target update to update the specified scene part.

[0222] In some embodiments, a designated scene portion refers to the part of the virtual scene that needs to be updated or modified. This could be a character's state, environmental elements, user interface, etc., in the game. Update conditions are specific conditions or events that trigger the update of the designated scene portion. These conditions may include time intervals (e.g., updating once per second), user actions (e.g., a player pressing a specific button), system events (e.g., a change in server state), or other dynamic factors. The updated function group contains functions related to updating the designated scene portion. These update functions can include operations such as data updates, state changes, and interface refreshes. When the designated scene portion meets the update conditions, the update functions in the updated function group are called sequentially. This sequential calling ensures the correct handling of the order and dependencies of update operations. After the update functions are called, they perform update operations on the designated scene portion, which may include reading new data, modifying existing data, redrawing interface elements, etc. By updating the designated scene portion, the virtual scene can maintain real-time performance and responsiveness, ensuring that the content seen by the user is up-to-date and consistent with the current game state.

[0223] As an example, in an online role-playing game, the player character's status needs to be updated based on player actions and in-game events. Players explore the game, and their status needs to be updated whenever they move to a new area or complete a quest. The specified scene portion contains the player character's status information, including their location, experience points, and equipment. Updates are triggered when the player character's location changes or when they complete a quest. The update function group contains the following update functions: Update Function A: Updates the player character's location information. Update Function B: Updates the player character's experience points. Update Function C: Updates the player character's equipment. Update Function D: Saves the player character's latest status to the database. The update condition is met when the player character moves to a new area or completes a quest. First, Update Function A is called to update the player character's location in the game world. If the quest is completed, Update Function B is called next to update the player character's experience points based on the quest reward. If the quest rewards new equipment, Update Function C is called to update the player character's equipment list. With the player character's location, experience, and equipment information updated, the game will display the player character's status based on this latest information, potentially affecting other in-game systems and interactions. The update functions in the update function group are called sequentially as needed to maintain the consistency and accuracy of the player character's state. Here, at least some (but not all) of the update functions are used in response to specific update conditions. This update strategy ensures the dynamism of the game world and the continuity of the player experience.

[0224] In some embodiments, see Figure 8 , Figure 8 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 4 , Figure 5 Step 104 shown can be achieved through Figure 8 Steps 1041 to 1042 shown are implemented.

[0225] In step 1041, based on the specified scene portion, at least one update function associated with the specified scene portion is determined from the target update function group.

[0226] In some embodiments, step 1041 above can be implemented as follows: for each update function in the update function group, the update content corresponding to the update function is compared with the specified scene part. When the update content corresponding to the update function is the same as the specified scene part, the update function is determined as the update function associated with the specified scene part.

[0227] As an example, the update function group includes update function A, update function B, and update function C. The update content corresponding to update function A is the same as the specified scene part, the update content corresponding to update function B is different from the specified scene part, and the update content corresponding to update function C is different from the specified scene part. Therefore, in the update function group, update function A is the update function associated with the specified scene part.

[0228] In step 1042, at least one update function associated with the specified scene part is called sequentially, and the specified scene part is updated sequentially based on the update content corresponding to the update function.

[0229] In some embodiments, the update content corresponding to the update function refers to the specific data and state of the specified scene part designed by the update function to change or refresh it. The update content refers to the operation and effect performed by the update function. The update content corresponding to the update function mainly involves the following aspects: (1) Attribute update: The update function may modify the attributes of the scene part, such as position, color, size, texture, transparency, etc. (2) State change: The update function can change the state of the virtual scene part. For example, a character may change from a static state to a moving state, or the opening / closing state of a door. (3) Animation playback: For scene parts that need to be dynamically displayed, the update function may be responsible for controlling the playback of the animation, including start, end, pause, continue, etc. (4) Interactive response: If the scene part can interact with the user, the update function may need to handle input events, such as click, drag, collision detection, etc. (5) Environmental effects: The update function may also be responsible for applying environmental effects, such as changes in lighting, weather effects, particle effects, etc.

[0230] In some embodiments, a specified scene portion includes sub-scene portions of each update function associated with the specified scene portion. The above-mentioned sequential invocation of at least one update function associated with the specified scene portion and sequential updates of the specified scene portion based on the update content corresponding to the corresponding update function can be implemented in the following manner: Perform the following processing sequentially on each update function associated with the specified scene portion to update the corresponding sub-scene portion in the specified scene portion: Invoke the update function, read the update content corresponding to the update function, and superimpose the update content corresponding to the update function onto the corresponding sub-scene portion to obtain the updated sub-scene portion corresponding to the sub-scene portion.

[0231] In some embodiments, a designated scene portion is a specific area or object in a virtual scene that serves as the focus of updates. In complex scenes, a designated scene portion may consist of multiple sub-scene portions. Sub-scene portions are components of a designated scene portion; they are more granular scene elements. Each sub-scene portion may be updated independently by one or more update functions. An update function is a logical unit responsible for updating a specific scene or sub-scene portion. Each update function knows how to read, modify, and overlay the update content of the scene portion it is responsible for. For each update function associated with a designated scene portion, the update logic is executed sequentially. The update function reads its corresponding update content, which may include new attribute values, state changes, or animation frames. The read update content is then overlaid onto the corresponding sub-scene portion. This overlay process can be achieved through operations such as merging data, replacing old values, and calculating new values. By overlaying the update content onto the sub-scene portion, the updated sub-scene portion is obtained, ensuring that each sub-scene portion reflects the latest state. The update function is called to retrieve its corresponding update content. Reading the update content may include obtaining data from the function's return value, an external data source, or the function's internal state. The read update content is applied to the corresponding sub-scene part. This can be achieved by modifying the attributes of the sub-scene part, updating its state, or updating its animation. Each sub-scene part is updated according to the output of its associated update function, ultimately forming a complete and updated specified scene part.

[0232] As an example, in the application scenario of character updates in a role-playing game (RPG), the designated scene part is the protagonist in the game. The sub-scene parts include the protagonist's equipment, status (such as health and mana), position, and animations. The update functions are: Equipment Update Function: updates the appearance and attributes based on the protagonist's currently equipped items. Status Update Function: updates the status bar based on the protagonist's health, mana, etc. Position Update Function: updates the protagonist's position in the game world based on their movement. Animation Update Function: plays the corresponding animation based on the protagonist's actions. The update process is as follows: First, the equipment update function is called to update the protagonist's appearance and attributes. Next, the status update function is called to update the status bar display. Then, the position update function is called to update the protagonist's position. Finally, the animation update function is called to ensure smooth protagonist movements.

[0233] As an example, the update functions associated with the specified scene are update function A, update function E, and update function F. Update function A, update function E, and update function F are called in sequence, and the specified scene is updated in sequence based on the update content corresponding to the respective update function.

[0234] As an example, the update function group contains multiple update functions, each responsible for updating a specific state of the player character. Update function A updates the player's position information. Update function E updates the player's health. Update function F updates the player's experience points. The specified scene portion represents the player's state information, represented as an object containing position, health, and experience points. Update functions A, E, and F are called sequentially in a predetermined order, updating the specified scene portion based on their corresponding update values. Update function A reads the position information of the specified scene portion and updates it according to the game logic. Update function E reads the health information of the specified scene portion and updates it according to the game logic. Update function F reads the experience point information of the specified scene portion and updates it according to the game logic.

[0235] Thus, by identifying the target update function group from at least one set of update functions, we can efficiently manage and update specified scene segments. Further identifying at least one update function associated with the specified scene segment ensures the targeting and accuracy of the update operations. Sequentially calling these update functions and updating the specified scene segment based on their corresponding update content guarantees the real-time performance and consistency of the virtual scene. This approach optimizes the update process, improves system performance and responsiveness, and reduces resource consumption. It helps enhance the user experience and ensures the stability and reliability of games or applications.

[0236] In some embodiments, step 1042 above can be implemented as follows: sequentially perform the following processing on the update functions associated with the specified scene part: when there is an update function that has been called in the target update function group, determine the content difference between the update function and the called update function, call the update function, and update the specified scene part based on the content difference; when there is no update function that has been called in the target update function group, call the update function, and update the specified scene part based on the update content corresponding to the update function.

[0237] In some embodiments, a history is invoked to determine which update functions have been called. This is typically a log or status list containing function identifiers or names. When an update function has been called in the target update function group, the differences between the current update function's content and the called function's content are compared. This involves comparing data structures, values, states, etc., to determine which attributes need to be updated. Based on the determined differences, the appropriate update function is invoked to update the specified scene section. The update function will adjust the attributes or states of the specified scene section based on these differences. For example, if the player's health has decreased, the update function will correspondingly decrease the health attribute in the specified scene section. When no update function has been called in the target update function group, the update function is directly invoked to update the specified scene section. In this case, the update function will update the specified scene section based on its defined content, such as setting the initial position or loading initial health. This ensures that the specified scene section in the virtual scene remains consistent with the game state. Changes to each attribute are reflected accordingly in the specified scene section, ensuring the correctness and stability of the game logic. Unnecessary duplicate updates are avoided because update functions are only called when content changes.

[0238] As an example, consider a multiplayer online shooter game with player characters and a game environment (such as walls and obstacles). Suppose we want to update the status of a player character, including their position, health, and equipment. The update function group contains the following functions: Update Function A: Updates the player character's position based on the player's movement command. Update Function B: Updates the player character's health based on the damage the player has taken. Update Function C: Updates the player character's ammo based on the player's shooting action. Update Function D: Saves the player's latest status information to the server. The update condition is that the player character has moved in the game world and may have taken damage. Handling update functions: If update function B has already been called, and the player character has taken new damage, we need to determine the differences between the latest call to update function B and the previous call. For example, if health has decreased by 5 points, the new update function B will be called, updating the player character's health based on this 5-point decrease. If update function A is being called for the first time, or update function C needs to update ammunition based on the player's shooting action, then these update functions will be invoked to update the specified scene based on their corresponding update content. For example, update function A might move the player character from position (x1, y1) to position (x2, y2) due to player movement, and update function C might reduce the corresponding ammunition quantity due to player shooting. This approach ensures that the player character's state is always up-to-date. If the player takes damage, only the actual damage taken is calculated and updated. If the player moves, only the actual positional change is reflected. This avoids unnecessary data processing and resource consumption while maintaining game performance.

[0239] In this way, by sequentially performing specific processing on the update functions associated with the specified scene portion, the specified scene portion can be effectively updated in the virtual scene, ensuring that it always reflects the latest game state. When an update function has already been called, by determining the differences between the current update function and the called update function, calling the update function, and updating the specified scene portion based on these differences, more accurate and effective updates can be achieved, avoiding unnecessary duplicate operations. When no update function has already been called, the update function is directly called and updated based on its corresponding update content, ensuring the integrity and consistency of the update operation. This approach optimizes the update process, reduces computational resource consumption, and improves update efficiency, thereby enhancing the response speed of the virtual scene and the user experience. Simultaneously, it also helps maintain the consistency between the specified scene portion in the virtual scene and the game state, avoiding information asynchrony issues.

[0240] Thus, by obtaining multiple update functions for updating content in the virtual scene, and classifying the update functions based on the scene parts they correspond to, at least one update function group is obtained. The update functions in the target update function group are then called sequentially to update the specified scene part. Because each update function group contains multiple update functions, and the scene parts corresponding to different update functions overlap to at least partially, when the specified scene part in the virtual scene meets the update conditions, the update functions in the target update function group are called sequentially. This ensures that the updated content corresponding to the called update functions is at least partially the same. Therefore, the cache used to store content does not need to be fully adjusted when switching update functions, effectively reducing the amount of content adjustment required when switching update functions and thus significantly improving content update efficiency.

[0241] See Figure 9 , Figure 9 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 5 , will combine Figure 9 The steps 201 to 202 shown will be explained. The virtual scene update method provided in this application embodiment can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following will be explained with the terminal alone as an example.

[0242] In step 201, an update request for a specified scene part is sent, and the target update function group corresponding to the specified scene part is received.

[0243] In some embodiments, the target update function group includes at least one update function, and multiple update functions are used to update different scene parts in the virtual scene respectively. The target update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap.

[0244] In some embodiments, update conditions refer to specific states or events that trigger updates to a specified scene portion in a virtual scene. When a specified scene portion in a virtual scene meets the update conditions, the corresponding update function is called to perform modification or refresh operations on the specified scene portion. Update conditions may include time intervals reaching a duration threshold, user interaction triggers, event triggers, data changes, etc. Update conditions ensure the accuracy and timeliness of update operations and are a key element in virtual scene content management.

[0245] In some embodiments, the terminal sends an update request for a specified scene portion to the server and receives an update function group corresponding to the specified scene portion returned by the server in response to the update request.

[0246] As an example, in an online strategy game, players need to build and develop their own cities, competing with other players for resources and territory. One goal in city building is to unlock new building types. Unlocking requires reaching a certain city level and possessing specific resources. By continuously completing tasks and collecting resources, players eventually reach the required city level to unlock new buildings and have sufficient resources. The player clicks the "Unlock New Building" button in the city building menu. The game client detects that the unlocking conditions have been met and sends an update request to the server, containing the player's city ID, current level, resources, etc. Upon receiving the request, the server verifies whether the player's city level and resources meet the unlocking conditions for the new building. If the player meets the conditions, the server constructs an update function group containing at least one update function to update content in the virtual scene. This update function group includes update function A and update function B. Update function A unlocks the new building type in the game's virtual scene. It accepts the building ID, name, and description as parameters, and the client adds the new building option to the game based on these parameters. Update function B updates the player's resource balance. It accepts an object containing resource changes as a parameter. The client updates the resource display based on this object and synchronizes it to the server. After these functions are executed, the player's game interface will update accordingly, new building types will appear in the building list, and the resource balance will also be updated to reflect the resources consumed to unlock the new building. In this way, players can use the new buildings in the game to further enhance their city's strength.

[0247] In this way, the real-time feedback mechanism ensures that the content in the virtual scene remains synchronized with the server, enhancing the system's dynamism and interactivity. The server returns a set of update functions corresponding to the specified scene portion, containing at least one specially designed update function. These functions are highly targeted and can efficiently and accurately update the corresponding content in the virtual scene.

[0248] In step 202, the update functions in the target update function group are called sequentially to update the specified scene parts.

[0249] In some embodiments, a designated scene portion refers to the part of the virtual scene that needs to be updated or modified. This could be a character's state, environmental elements, user interface, etc., in the game. Update conditions are specific conditions or events that trigger the update of the designated scene portion. These conditions may include time intervals (e.g., updating once per second), user actions (e.g., a player pressing a specific button), system events (e.g., a change in server state), or other dynamic factors. The updated function group contains functions related to updating the designated scene portion. These update functions can include operations such as data updates, state changes, and interface refreshes. When the designated scene portion meets the update conditions, the update functions in the updated function group are called sequentially. This sequential calling ensures the correct handling of the order and dependencies of update operations. After the update functions are called, they perform update operations on the designated scene portion, which may include reading new data, modifying existing data, redrawing interface elements, etc. By updating the designated scene portion, the virtual scene can maintain real-time performance and responsiveness, ensuring that the content seen by the user is up-to-date and consistent with the current game state.

[0250] As an example, in an online role-playing game, the player character's status needs to be updated based on player actions and in-game events. Players explore the game, and their status needs to be updated whenever they move to a new area or complete a quest. The specified scene portion contains the player character's status information, including their location, experience points, and equipment. Updates are triggered when the player character's location changes or when they complete a quest. The update function group contains the following update functions: Update Function A: Updates the player character's location information. Update Function B: Updates the player character's experience points. Update Function C: Updates the player character's equipment. Update Function D: Saves the player character's latest status to the database. The update condition is met when the player character moves to a new area or completes a quest. First, Update Function A is called to update the player character's location in the game world. If the quest is completed, Update Function B is called next to update the player character's experience points based on the quest reward. If the quest rewards new equipment, Update Function C is called to update the player character's equipment list. With the player character's location, experience, and equipment information updated, the game will display the player character's status based on this latest information, potentially affecting other in-game systems and interactions. The update functions in the update function group are called sequentially as needed to maintain the consistency and accuracy of the player character's state. Here, at least some (but not all) of the update functions are used in response to specific update conditions; this update strategy ensures the dynamism of the game world and the continuity of the player experience.

[0251] In some embodiments, step 202 above can be implemented as follows: based on a specified scene part, determine at least one update function associated with the specified scene part from the update function group; sequentially call at least one update function associated with the specified scene part, and sequentially update the specified scene part based on the update content corresponding to the corresponding update function.

[0252] As an example, the update functions associated with the specified scene are update function A, update function E, and update function F. Update function A, update function E, and update function F are called in sequence, and the specified scene is updated in sequence based on the update content corresponding to the respective update function.

[0253] As an example, the update function group contains multiple update functions, each responsible for updating a specific state of the player character. Update function A updates the player's position information. Update function E updates the player's health. Update function F updates the player's experience points. The specified scene portion represents the player's state information, represented as an object containing position, health, and experience points. Update functions A, E, and F are called sequentially in a predetermined order, updating the specified scene portion based on their corresponding update values. Update function A reads the position information of the specified scene portion and updates it according to the game logic. Update function E reads the health information of the specified scene portion and updates it according to the game logic. Update function F reads the experience point information of the specified scene portion and updates it according to the game logic.

[0254] In this way, based on the specified scenario, at least one update function associated with the specified scenario is determined from the update function group, and these update functions are called in sequence, ensuring the relevance and accuracy of the update. Each called update function is carefully designed for the specific needs of the specified scenario and can update the specified scenario in an orderly manner according to its corresponding update content.

[0255] In some embodiments, when performing step 202 above, the following processing may also be performed: for each update function in the target update function group corresponding to the specified scenario part, when the update function is called, the changed content in the content cache when the update function is called is determined, and when the content amount of the changed content is greater than the content amount threshold, the update function is determined as the reference update function.

[0256] In some embodiments, by detecting the impact of update functions on the content cache in real time, dynamic control of the update process is ensured, facilitating timely response and adjustment. By setting a content volume threshold, update functions with a significant impact on the content cache can be selected and designated as reference update functions. This avoids performing the same processing on every update function, thereby improving processing efficiency. When an update function is called, changes in the content cache are detected. By comparing the cached data before and after, it is possible to identify which data has changed. The content volume threshold, as a filtering mechanism, helps determine which update operations have a significant impact on the content cache. If the changed content exceeds this threshold, then the update function is considered critical, and its operation result requires special attention. Designating update functions with a significant impact (update functions whose changed content volume exceeds the content volume threshold) as reference update functions means prioritizing the update results of these functions, ensuring the consistency and accuracy of critical data, especially for data that has a significant impact on the virtual scene.

[0257] As an example, in a massively multiplayer online role-playing game (MMORPG), the game world contains many player characters and NPCs (non-player characters). When a player character performs an important action in the game, such as defeating a high-level opponent, a set of target update functions is associated with this event. This set of target update functions might include functions that update the player's experience points, update the items in the player's inventory, and update the player's achievement system status. When the player successfully defeats the opponent, the relevant update functions are triggered. The system detects changes to the content cache when these function calls are made. The content cache includes the player's status data, such as experience points, inventory item list, achievement status, etc. A content threshold is set; for example, a change in experience points exceeding 1000 points or a change in the number of items in the inventory exceeding 5. If the player gains 1200 experience points after defeating an opponent, exceeding the 1000-point threshold, then the function that updates the experience points will be identified as the reference update function. If no new items are added to the player's inventory, or only 2 items are added, not reaching the 5-item threshold, then the function that updates the inventory will not be identified as the reference update function.

[0258] In some embodiments, after sequentially calling the update functions in the target update function group to update the specified scene part, the following processing can also be performed: count the number of reference update functions and the total number of update functions that have been called in the target update function group; divide the number by the total number to obtain the cache replacement rate of the target update function group, and send the cache replacement rate, which is used to calibrate at least one target update function group.

[0259] In some embodiments, update functions in the target update function group are called sequentially to update specified scene parts. These update functions may be used to update player position, health, experience points, etc. After the update function calls, the total number of reference update functions is counted. Simultaneously, the total number of update functions called in the target update function group is counted. The cache turnover rate is obtained by dividing the number of reference update functions by the total number of update functions called in the target update function group. The cache turnover rate is a metric that measures the update frequency of an update function group. Based on the cache turnover rate, at least one update function group is calibrated. This may involve adjusting the priority, update frequency, and resource allocation of the update function groups. By calibrating the update function groups, game performance and resource utilization can be optimized. If some update function groups are rarely called, their update frequency can be reduced, freeing up resources for more critical update function groups.

[0260] In some embodiments, cache turnover rate is a performance metric used to measure the frequency with which update function groups corresponding to a specified scene portion of a virtual scene are invoked over a period of time. This metric helps developers understand which update function groups are frequently used to update the specified scene portion, allowing for optimization and tuning. Before updating the specified scene portion, the number of reference update functions in the update function groups is counted. After updating the specified scene portion, the total number of update functions invoked in the update function groups corresponding to the specified scene portion is counted. The cache turnover rate is obtained by dividing the number of reference update functions by the total number of update functions invoked in the update function groups corresponding to the specified scene portion. The cache turnover rate is a ratio representing the proportion of reference update functions among all invoked update functions.

[0261] As an example, in a massively multiplayer online strategy game, each player controls a base where they can construct various buildings to increase resource production, improve defenses, or conduct research. Whenever a player constructs or upgrades a building, a series of update functions are called to reflect the impact of this operation on the game state. When a player builds a mine, a set of update functions is associated with it, including functions to update resource storage, the building list, and the player's tech tree. When the mine construction operation is executed, the relevant update functions are called. It is detected that resource storage has increased by 500 gold, a new mine object has been added to the building list, and the tech tree state remains unchanged. The following thresholds are set: a change in resource storage exceeding 300 gold, and a change in the building list exceeding 1 unit. The function updating resource storage, because it increased by 500 gold, exceeding the 300 gold threshold, is identified as a reference update function. The function updating the building list, because it added a mine object, exceeding the 1 unit threshold, is also identified as a reference update function. The number of reference update functions is counted as 2 (the resource storage and building list update functions). The total number of update functions called in the update function group corresponding to the specified scene is 3 (including update functions for resource storage, building list, and technology tree). The cache turnover rate is calculated as: 2 / 3 ≈ 0.67 (or 67%). The calculated cache turnover rate is sent to the server. Based on the cache turnover rate, the update function group can be calibrated. For example, if the cache turnover rate is consistently higher than a certain value (such as 80%), it may indicate that updates to resource storage and building list are too frequent and optimization is needed to reduce unnecessary update operations, or the threshold may need to be adjusted to reduce server resource consumption.

[0262] Thus, by implementing content cache change detection for update functions within the update function group corresponding to specific scenarios, and determining the strategy for reference update functions based on the amount of changed content, the cache replacement rate becomes a key performance indicator by real-time detection and statistical analysis of the number of reference update functions and their proportion within the update function group. This allows for accurate identification and priority processing of updates that have the greatest impact on the game state, improving resource utilization efficiency. Detecting the cache replacement rate enables timely discovery and adjustment of update strategies, maintaining system balance and responsiveness. It provides a quantitative basis for calibrating the update function group, allowing developers to dynamically optimize system configuration based on actual operational conditions, thereby improving overall game performance and player experience.

[0263] In this way, calculating and sending the cache replacement rate helps to deeply analyze the usage frequency and update efficiency of the update function group, thereby achieving precise calibration of at least one update function group. This can optimize game performance, reduce unnecessary resource consumption, improve the player's gaming experience, and ensure the response speed and accuracy of key update function groups, ultimately improving the smoothness and stability of the game.

[0264] See Figure 10 , Figure 10 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 6 , will combine Figure 10 Steps 301 to 303 are described below. The virtual scene update method provided in this application embodiment can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following description will take the implementation by the server alone as an example.

[0265] In step 301, multiple update functions for the virtual scene are obtained, and these multiple update functions are used to update different parts of the virtual scene.

[0266] In some embodiments, update functions are also called timer-triggered code (Tick), a type of code that executes periodically in a program. In game engines, this is typically executed every frame, and is generally used for object state control, state synchronization between different objects, etc. Different classes may have different update functions to implement specific functionalities. In programming, an update function usually refers to a periodically executed action or event that is repeatedly triggered within a certain time interval.

[0267] As an example, in game applications, update functions are typically used to reflect the impact of player actions or game events on the virtual environment. Here are some examples of update functions that can be grouped together to update game content. When a player moves in the game, their position in the game world needs to be updated. This function calculates the new coordinates based on the player's movement input and updates the player object's position attributes. When the player's state changes, such as increasing or decreasing health, changing equipment, or leveling up, this function updates the player's state accordingly and reflects these changes in the user interface. The game environment may change due to player actions or other game events, such as destroying obstacles, building structures, or changes in environmental effects. This function updates the relevant environmental objects in the scene. When a player completes a task or task step in the game, this function updates the task progress, including updating the task log and distributing task rewards. During resource collection and consumption, this function updates the player's or NPC's resource inventory, such as gold, items, and props. When a player interacts with objects in the game world, such as talking to NPCs or using items, this function updates the state of the interacting objects and the game logic related to the interaction. New functions can be grouped into an update function group. For example, update function group A includes functions for updating player position, player status, and environment changes, used to handle player exploration and interaction with the environment. Update function group B includes functions for updating task progress and resource management, used to handle task logic and resource flow.

[0268] In step 302, based on the scene parts corresponding to the multiple update functions, the multiple update functions are classified to obtain at least one update function group.

[0269] In some embodiments, the update function group includes at least one update function, and the multiple update functions are used to update different scene parts in the virtual scene respectively. The update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap.

[0270] In some embodiments, see Figure 11 , Figure 11 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 7 , Figure 10 Step 302 shown can be achieved through Figure 11 Steps 3021 to 3023 shown are implemented.

[0271] In step 3021, a first indicator vector for each update function is constructed based on the function variables in each update function.

[0272] In some embodiments, a first indicator vector is used to indicate whether a first function variable exists among the function variables.

[0273] In some embodiments, the first indicator vector is a mathematical vector used to indicate (mark) the existence of a specific first function variable in the function variables of the update function. Each element typically corresponds to a specific parameter or attribute in the function variable. If the parameter or attribute exists (i.e., satisfies a specific condition or is designated as the "first function variable"), the element is 1 (or another value indicating existence); otherwise, it is 0 (or another value indicating non-existence).

[0274] In some embodiments, step 1021A above can be implemented as follows: obtain the first preset vector of each update function, the first preset vector including at least one vector element, the vector element corresponding one-to-one with the first function variable; detect the function variable of each update function respectively, and obtain the detection result, the detection result being used to indicate whether the first function variable exists in the function variable; based on the detection result, update the first preset vector of each update function to obtain the first indicator vector of each update function.

[0275] In some embodiments, the function variables of each update function are detected separately to obtain the detection results. This can be achieved as follows: For each update function, the following processing is performed: Each function variable in the update function is compared with the first function variable. When there is a function variable that is the same as the first function variable, the detection result is determined to be that the function variables of the update function contain a preset function variable; when there is no function variable that is the same as the first function variable, the detection result is determined to be that the function variables of the update function do not contain the preset function variable.

[0276] In some embodiments, the above-mentioned updating of the first preset vector of each update function based on the detection result to obtain the first indicator vector of each update function can be achieved in the following way: Perform the following processing on each vector element in the first preset vector to obtain the indicator vector of the update function: when the detection result indicates that the function variable of the update function does not contain a preset function variable, update the vector element in the first preset vector to a first vector element; when the detection result indicates that the function variable of the update function contains a preset function variable, update the vector element in the first preset vector to a second vector element, wherein the first vector element and the second vector element are different.

[0277] In some embodiments, the first preset vector is an initial vector, where each element represents whether a corresponding function variable in the update function is preset as a specific important variable. The indication result is obtained by detecting the function variables of the update function, and is used to determine whether each variable actually satisfies the conditions of a preset important variable. The first vector element and the second vector element are used to update the first preset vector with different values, so as to clearly distinguish whether the function variable satisfies the preset conditions in the indication vector.

[0278] As an example, the element value of the first vector element can be 0, and the element value of the second vector element can be 1.

[0279] In this way, the update strategy can dynamically adjust the vector elements based on the detection results, ensuring that the function variables of the update function remain consistent with the preset function variables. When the preset function variables are not detected in the function variables of the update function, updating the vector elements in the first preset vector with the first vector element effectively avoids calculation errors or anomalies caused by variable inconsistency. Conversely, when the preset function variables are detected in the function variables of the update function, updating the vector elements in the first preset vector with the second vector element helps maintain the stability and accuracy of the function. This differentiated processing not only improves flexibility and adaptability but also ensures the correct operation of the function in different scenarios, thereby improving overall performance and reliability.

[0280] In step 3022, based on the first indicator vector of each update function, multiple update functions are classified to obtain at least one initial update function group.

[0281] In some embodiments, the indicator variables for different update functions in the initial update function group are the same.

[0282] In some embodiments, the first indicator vectors of different update functions in the initial update function group are the same, while the first indicator vectors of update functions in different initial update function groups are different.

[0283] In some embodiments, certain features of update functions (such as variable states, parameter configurations, etc.) are transformed into comparable vector forms. This vectorized representation makes it easier to identify and group similar or identical update functions. When multiple update functions have the same first indicator vector, it means that these update functions are similar in one or more key dimensions. These similarities may stem from the data types they handle, the variables they depend on, the types of operations they perform, etc. This similarity identification helps to understand the relationships between functions and the repetition of content. By grouping update functions with the same first indicator vector into an initial update function group, the function set can be effectively organized and simplified.

[0284] In some embodiments, the above-mentioned classification of multiple update functions based on the first indicator vector of each update function to obtain at least one initial update function group can be implemented in the following manner: Perform the following processing on each update function: determine the update function as the target update function; when there is a first indicator vector that is the same as the first indicator vector of the target update function, construct the update function with the same first indicator vector as the target update function and the target update function as the initial update function group; when there is no first indicator vector that is the same as the first indicator vector of the target update function, determine the target update function as the initial update function group.

[0285] In some embodiments, identifying each update function as the target update function is a strategy of evaluation one by one. This ensures that each function is considered and examined individually, and no function is missed in the initial screening. When a vector exists that is identical to the first indicator vector of the target update function, these functions are clustered into an initial update function group. By clustering similar functions, the same processing logic and optimization strategies can be applied in batches, reducing redundant work. The same update function group can share resources, such as memory cache and execution threads, improving resource utilization. For update functions that do not share the same first indicator vector, they are identified as independent initial update function groups.

[0286] In this way, by effectively identifying and clustering update functions with the same characteristics, and by constructing an initial update function group, the efficiency of function management and modularity are improved. When update functions with the same first indicator vector are found, they can be grouped together to share the same optimization strategy and maintenance process, reduce duplication of work, and improve resource utilization.

[0287] In step 3023, for each initial update function group, based on the scene part corresponding to the update function in the initial update function group, the update functions in the initial update function group are classified to obtain at least one update function group.

[0288] In some embodiments, after initially classifying update functions into initial update function groups based on a first indicator vector, further classification of update functions within these update function groups reflects a deeper analysis and understanding of function characteristics. This in-depth classification helps to more precisely identify and manage the similarity of functions. Unlike the first indicator vector, this classification is based on the specific content corresponding to the update functions. When update functions in the initial update function groups have at least partial similarities in content, these functions are further clustered into at least one update function group.

[0289] In some embodiments, multiple update functions are classified based on the first indicator vector of each update function to obtain at least one initial update function group. For each initial update function group, the update functions in the initial update function group are classified based on the scene part corresponding to the update function in the initial update function group to obtain at least one update function group. Since the information content corresponding to the update function is significantly greater than the information content of the first indicator vector, the computational efficiency of classification based on the first indicator vector is much higher than that of classification based on content. By performing preliminary classification of multiple update functions based on the first indicator vector of each update function, the computational amount of subsequent classification based on content can be significantly reduced (no computation is required between update functions in different initial update function groups), thereby effectively improving the classification efficiency of update functions.

[0290] In some embodiments, step 3023 above can be implemented as follows: by simulating the invocation of each update function in the initial update function group, the scene part corresponding to each update function is determined; the similarity between the contents of different update functions in the initial update function group is determined; and update functions with similarity greater than a similarity threshold are clustered to obtain at least one update function group.

[0291] In some embodiments, a simulation environment needs to be set up that can safely execute update functions and capture their execution results. Within this simulation environment, each update function in the initial update function group is called sequentially. During the call, information such as the function's behavior, state changes, and output results is recorded. This information will be used for subsequent content analysis and similarity calculation. Based on the results of the simulated calls, the content features of the update functions are extracted, and the extracted content is analyzed and converted into a comparable representation. For example, the code structure can be converted into an abstract syntax tree, or the processed data can be converted into feature vectors.

[0292] In some embodiments, simulated calls are used to describe a virtual execution of an update function during program development or testing. For a first update function: the program executes a virtual call to the function to determine its corresponding scenario portion or result. For a second update function: the program simulates calls to the first and second update functions sequentially. This simulated sequential call is used to understand or test what results are produced when the two functions are executed in this order. Alternatively, the second update function can be simulated independently to understand its output when independent of the first update function.

[0293] In some embodiments, the above-mentioned method of determining the scene portion corresponding to each update function by simulating calls to each update function in the initial update function group can be implemented as follows: For each update function in the initial update function group, the following processing is performed: When an update function is not classified, it is identified as the first update function, and all update functions in the initial update function group other than the first update function and the already classified update functions are identified as second update functions; when the number of second update functions is greater than one, the scene portion corresponding to the first update function is determined by simulating calls to the first update function; for each second update function, the scene portion corresponding to the second update function is determined by sequentially simulating calls to the first and second update functions, or by simulating calls to the second update function. When the number of second update functions is zero, the first update function is directly identified as part of the update function group.

[0294] In some embodiments, in the initial stage, all update functions are unclassified. From these unclassified update functions, one update function is selected as the first update function, and the remaining update functions are marked as the second update functions. The simulated call of the first update function is executed, and through this call process, the scene part corresponding to the first update function is determined.

[0295] As an example, the initial update function group includes update function A, update function B, and update function C. At this time, update function A, update function B, and update function C are all unclassified update functions. For update function A in the initial update function group, update function A is determined as the first update function. The update functions in the initial update function group other than the first update function A and the already classified update functions are determined as the second update functions (update function B and update function C). By simulating the call to the first update function (update function A), the scene part corresponding to the first update function (update function A) is determined. For each second update function (update function B and update function C), the scene part corresponding to the second update function (update function B and update function C) is determined by simulating the call to the first update function and the second update function in sequence, or by simulating the call to the second update function (update function B and update function C).

[0296] Continuing the previous example, for update function B in the initial update function group, both update function B and update function C are unclassified update functions. Update function B is identified as the first update function, and all update functions in the initial update function group other than the first update function B and the classified update function (update function A) are identified as the second update functions (update function C). By simulating the call to the first update function (update function B), the scene part corresponding to the first update function (update function B) is determined. For each second update function (update function C), the scene part corresponding to the second update function (update function C) is determined by simulating the call to the first update function and the second update function in sequence, or by simulating the call to the second update function (update function C).

[0297] Continuing from the previous example, for update function C in the initial update function group, only update function C is an unclassified update function. Update function C is determined as the first update function. By simulating the call to the first update function (update function C), the scene part corresponding to the first update function (update function C) is determined.

[0298] Thus, by classifying the update functions in the initial update function group, firstly establishing the first update function helps clarify the core logic and priority, providing clear guidance for subsequent processing. Furthermore, by classifying other unclassified update functions as second update functions, hierarchical management of functions can be effectively achieved. Simulating calls to the first and second update functions not only identifies their respective corresponding scenario parts but also examines the mutual influence and synergy between functions. This approach helps optimize program structure, improve code maintainability and extensibility, and reduce the possibility of program errors.

[0299] In step 303, in response to an update request for a specified scene portion, a target update function group corresponding to the specified scene portion is determined from at least one update function group based on the specified scene portion, and the update function in the target update function group is sent.

[0300] In some embodiments, the update functions in the target update function group update a specified scene portion by calling them sequentially.

[0301] In some embodiments, a designated scene portion refers to the part of the virtual scene that needs to be updated or modified. This could be a character's state, environmental elements, user interface, etc., in the game. Update conditions are specific conditions or events that trigger the update of the designated scene portion. These conditions may include time intervals (e.g., updating once per second), user actions (e.g., a player pressing a specific button), system events (e.g., a change in server state), or other dynamic factors. The updated function group contains functions related to updating the designated scene portion. These update functions can include operations such as data updates, state changes, and interface refreshes. When the designated scene portion meets the update conditions, the update functions in the updated function group are called sequentially. This sequential calling ensures the correct handling of the order and dependencies of update operations. After the update functions are called, they perform update operations on the designated scene portion, which may include reading new data, modifying existing data, redrawing interface elements, etc. By updating the designated scene portion, the virtual scene can maintain real-time performance and responsiveness, ensuring that the content seen by the user is up-to-date and consistent with the current game state.

[0302] As an example, in an online role-playing game, updating the player character's state is a key component of the game's dynamism and interactivity. Here's a concrete example illustrating how to respond to update requests and send update functions from the specified scene's update function group to update the player character's state: A player controls their character to explore the game, moves to an unexplored area, and completes a quest, such as defeating a powerful monster. The game system detects the change in the player character's position and the completion of the quest; both events trigger update conditions. Update function A (Position Update): Called first, this function updates the player character's position information in the game world. This function modifies the player character object's position attributes and may update the character's display on the game map. Update function B (Experience Update): Because the player has completed a quest, this function is called next to update the player character's experience points. Depending on the quest difficulty and rewards, the function increases the corresponding experience points and may trigger a level increase for the player character. Update function C (Equipment Update): If the quest rewards new equipment, this function is called to update the player character's equipment list, adding new equipment and potentially updating the character's appearance. Update Function D (State Saving): Finally, this function is called to save the player character's latest state to the database, ensuring that the player's progress is not lost and can be restored when the player logs back in. The player character's location, experience, and equipment information are updated, and these updates are reflected in the game in real time, such as animations of player character level increases or visual effects of new equipment. Other in-game interactions are also adjusted based on this latest information; for example, new experience points may unlock new skills or quests, and new equipment may improve the character's combat abilities. Not all update functions need to be called; only those that meet specific update conditions are triggered. This strategy ensures the efficiency and specificity of the update process, while maintaining the consistency of the game world and the continuity of the player experience. By updating only the necessary information, the game can also optimize performance and avoid unnecessary data processing and memory usage.

[0303] In some embodiments, after updating the specified scene portion as described above, the following processing can also be performed: receiving the cache replacement rate of the update function group corresponding to the specified scene portion; when the cache replacement rate is greater than the replacement rate threshold, constructing a second indicator vector for each update function based on the function variables of each update function; classifying multiple update functions based on the first indicator vector and the second indicator vector to obtain at least one first update function group, wherein the indicator variables and second indicator vectors of different update functions in the first update function group are the same; classifying the update functions in the first update function group based on the scene portion corresponding to the update functions in the first update function group to obtain at least one second update function group.

[0304] In some embodiments, a second indicator vector is used to indicate whether a second function variable exists among the function variables of the update function, the second function variable being different from the first function variable.

[0305] In some embodiments, the received cache replacement rate is compared with a preset replacement rate threshold. If the cache replacement rate is greater than this threshold, it indicates that the update function group is used frequently. Based on the function variables of each update function, a second indicator vector is constructed for each update function. The second indicator vector is used to indicate whether there are second function variables in the function variables of the update function that are different from the first function variables. Based on the first and second indicator vectors, multiple update functions are classified. The first indicator vector is generally used to indicate the general characteristics of the update function, while the second indicator vector provides more detailed information about the function variables. The classification process aims to find update functions with the same indicator variable and second indicator vector, which can be grouped together. Through classification, at least one first update function group can be obtained, in which different update functions have the same indicator variable and second indicator vector. Based on the scenario portion corresponding to the update functions in the first update function group, the update functions in the first update function group are further classified. This classification process aims to find update functions with the same content, which can be grouped together. Through this classification and optimization strategy, the behavior of update functions can be better understood, and optimization can be performed according to their usage patterns and content. For example, if some update functions are rarely called, you can consider reducing their complexity or merging their functionality to improve overall performance and resource utilization.

[0306] As an example, suppose a role-playing game (RPG) has a complex AI system responsible for controlling the behavior of various non-player characters (NPCs). NPCs can make decisions based on player actions and events in the game world, such as following the player, patrolling, or engaging in dialogue. The specified scene part is the NPC's behavioral state, including their current behavior, location, health, and interactions with other NPCs. An update function group contains multiple update functions, each responsible for updating a specific NPC's behavioral state. After an NPC's behavior is updated, the cache replacement rate of the update function group is calculated. A preset replacement rate threshold, such as 80%, indicates that optimization is triggered when the update function group is frequently called. If the cache replacement rate is greater than 80%, for each update function, a second indicator vector is constructed based on its function variables (such as the NPC's behavior type, goal, etc.). Based on the first and second indicator vectors, the update functions are classified, resulting in at least one first update function group, where the function's indicator variable and second indicator vector are the same. Based on the update content (such as the NPC's behavior type) corresponding to the update functions in the first update function group, these functions are further classified, resulting in at least one second update function group. The second indicator vector might be used to indicate whether certain update functions contain a special second function variable, such as (whether the player has been angered), which differs from the NPC's behavior type (e.g., attack, defend). Some functions have additional indicator variables indicating that they can change the NPC's attack state. Update functions that include all patrol behaviors have the same indicator variable and second indicator vector. Based on the first group of update functions, further subdivisions can be made into functions that include or do not contain variables. This allows identification of frequently called update functions and categorization based on their behavior content and variables. This helps optimize common behaviors, such as improving performance by reducing duplicate code and merging similar functions. It provides finer-grained tuning and control for different types of behavior.

[0307] In some embodiments, the first indicator vector is constructed based on the function variables of the update function, representing the general characteristics and behavior type of the update function. These variables are typically used to describe the basic functionality of the update function, such as whether it is used to update position, state, behavior, etc. The second indicator vector provides more detailed information about the update function; it is used to indicate whether there are specific second function variables among the function variables that are different from the first function variables. The second indicator vector is typically used to distinguish update functions with similar first indicator vectors, although they may differ in certain specific conditions or parameters. The first indicator vector is typically used for preliminary classification, grouping update functions with similar basic functions together. The second indicator vector is used to perform more refined classification based on the first indicator vector classification, further distinguishing the specific behaviors or states of these update functions.

[0308] Therefore, using the first and second indicator vectors to classify and optimize update functions can significantly improve game performance and development efficiency. The first indicator vector provides the basic behavior types of update functions, helping developers quickly identify and group functions with similar functionalities. The second indicator vector further refines the specific behaviors or states of these functions, enabling more accurate adjustment and optimization. In this way, unnecessary function calls can be reduced, function execution efficiency can be improved, thereby reducing resource consumption and enhancing the overall performance of the game. Furthermore, this approach helps developers better understand the game's behavioral patterns, providing strong support for later optimization and expansion, ensuring a smoother and more stable gaming experience.

[0309] Thus, by obtaining multiple update functions for updating content in the virtual scene, and classifying the update functions based on the scene parts they correspond to, at least one update function group is obtained. The update functions in the target update function group are then called sequentially to update the specified scene part. Because each update function group contains multiple update functions, and the scene parts corresponding to different update functions overlap to at least partially, when the specified scene part in the virtual scene meets the update conditions, the update functions in the target update function group are called sequentially. This ensures that the updated content corresponding to the called update functions is at least partially the same. Therefore, the cache used to store content does not need to be fully adjusted when switching update functions, effectively reducing the amount of content adjustment required when switching update functions and thus significantly improving content update efficiency.

[0310] The following will describe an exemplary application of the embodiments of this application in a real game application scenario.

[0311] Update functions are a type of code in a program that executes periodically. In game engines, they typically execute every frame and are generally used for object state control and state synchronization between different objects. Different classes may have different update functions to implement specific functionalities. Update functions are also known as timer-triggered code (Tick). In programming, a Tick usually refers to a periodically executed action or event that is repeatedly triggered within a certain time interval. The Tick mechanism allows a program to execute specific code segments at fixed time intervals, which is very common in game development, real-time systems, and embedded systems. In game development, Ticks are usually closely related to the Game Loop, the main loop in the game's runtime, which is responsible for handling game state updates, rendering, user input, etc.

[0312] In games developed using the Unreal Engine, various ticks are executed very frequently in the implementation. The execution efficiency of these tick functions greatly affects the final performance of the game. To improve game performance, numerous optimizations have been made at both the software and hardware levels. For example, at the software level, more efficient tick logic is designed, and at the hardware level, the operating frequency of the hardware is increased, and faster hardware caching is added. However, due to the large variety and number of ticks in the engine, frequent context switching is required during execution in the hardware, which necessitates updating the hardware cache data accordingly, resulting in low final execution efficiency. This application's embodiment optimizes (classifies) the tick mechanism, allowing similar ticks to be executed sequentially as much as possible, minimizing hardware cache context switching, improving cache hit rate, increasing the overall efficiency of tick execution, and ultimately improving game performance.

[0313] In some embodiments, see Figure 12 , Figure 12 This is a schematic diagram of the effect of the game object provided in the embodiment of this application. Figure 1 , Figure 12 The different game objects shown correspond to different update functions. In actual game execution, these update functions are distributed in an unordered manner. For example, Figure 12The game objects 41, 42, 43, 44, 45, and 46 shown correspond to different update functions. The execution of these update functions relies on a large amount of context data, and the data varies between different update functions. However, the CPU's L1 cache (also known as L1 cache, a high-speed cache memory used to temporarily store frequently accessed information during data processing; it is the first level in the CPU cache hierarchy, directly integrated into the CPU core, and therefore has the fastest access speed) is extremely limited and cannot store too much data. When executing different ticks, cache replacement is required. During cache replacement, the CPU idles, leading to a decrease in overall execution efficiency.

[0314] In some embodiments, see Figure 13 , Figure 13 This is a schematic diagram of the effect of the game object provided in the embodiment of this application. Figure 2 , Figure 13 The different game objects shown correspond to different update functions. In actual game execution, these update functions are distributed in an unordered manner. For example, Figure 13 The game objects 51, 52, 53, 54, 55, and 56 shown correspond to different update functions. Update functions for the same object need to be executed sequentially, meaning that the screen content corresponding to different update functions must be at least partially the same. Here, screen content is just a figurative example; in reality, it refers to various objects within the game. The ticks generated by the same object share the same context. The core of this application is to optimize the execution order of ticks, executing similar update functions sequentially, such as... Figure 13 As shown, this reduces the replacement of L1 cache and improves CPU utilization.

[0315] In some embodiments, see Figure 14 , Figure 14 This is an interactive schematic diagram of the virtual scene update method in this application embodiment. The game server includes: a category management module, which updates the original tick category data when new game content is added or when an anomaly occurs in the game client's tick execution (cached update rate is too high); a strategy calculation module, which simulates the tick execution process based on the original tick category data determined by the category management module, calculates the tick category strategy, and stores it in the database; and a strategy management module, which queries the corresponding CPU model's tick category strategy based on the client's request and sends it to the client, while simultaneously receiving tick execution information (cached replacement data) reported by the game client and storing it in the database for use by the category management module.

[0316] In some embodiments, see Figure 14 The game client's strategy management module queries the update function classification control strategy from the server and caches it locally. Simultaneously, it reports cache replacement data collected by the update function detection module to the game server. Cache replacement data refers to whether the CPU's L1 cache data has changed during the execution of an update function. A change indicates that the two update functions are not of the same type, meaning they require different cached data. The update function management module receives tick requests during gameplay and places them into the appropriate queue according to the classification control strategy. The update function detection module executes all ticks sequentially within a tick cycle, collects cache replacement data during the execution of each tick's category, and notifies the strategy management module to report this to the game server.

[0317] In some embodiments, numerous threads run concurrently during game execution, and each thread contains a large number of objects. These objects generate a large number of ticks, which need to be categorized. This categorization is performed by the game server's strategy calculation module and categorization management module, ensuring that different ticks of the same type are executed sequentially, minimizing L1 cache replacements. Even for the same thread and the same object, the variables and data required for ticks may differ in different scenarios; therefore, we need to simulate all possible situations. The following steps are followed:

[0318] During development, all variables that may affect tick cache replacement are recorded. For example, whether there is a BOSS in the open-world exploration scene, whether the user is in battle, etc., will affect the execution of tick. Therefore, we need to first identify all variables that may affect tick and record them in the following table. Table 1 below is a schematic table of the variables affecting the update function provided in the embodiment of this application:

[0319] Table 1. Schematic diagram of the influence variables of the update function provided in the embodiments of this application.

[0320]

[0321]

[0322] In some embodiments, since different CPU models have different L1 cache sizes and scheduling policies, we need to perform the following steps for each CPU model. We iterate through all game scene IDs recorded in the table above, and perform the following steps for each scene ID (each scene ID has multiple ticks; first, we perform initial classification of the multiple ticks under the scene ID according to variables 1 to n, obtaining at least one tick group; then, we perform the following steps to classify the multiple ticks under the scene for each tick group). For the current scene ID, we find a record in the table with a tick classification of 0. We assign the tick classification of the current record to n, where n is an auto-incrementing sequence of natural numbers, i.e., the first classification is 1, and each subsequent tick classification is incremented by 1. We simulate all ticks with empty classifications in this scene executing after the current tick. If the CPU's L1 cache has not been replaced, we set the current tick classification to n; otherwise, we leave it empty. If all tick classifications in the current scene are not empty, we obtain the next scene and perform the above steps. After all scenarios for this CPU model have been traversed, the calculation process ends.

[0323] In some embodiments, see Figure 15 , Figure 15 This is a schematic diagram illustrating the classification principle of update functions provided in this application embodiment. During game operation, multiple update function queues (i.e., the update function groups described above) are maintained. When a new update function is generated, it is placed into the queue of the same category according to the determined update function category. The number of ticks in each tick category may be different. When the tick triggering condition is met (such as a fixed time per frame), the functions are executed sequentially in the above order to minimize data turnover in the CPU L1 cache. However, in actual game operation, the execution of some update functions may have sequential restrictions. To ensure normal logic, the order of the queues needs to be adjusted to ensure that the ticks are executed in the preset order. Update function category 1, update function category 2 to update function category n, each update function category includes update function 0, update function 1, update function 2 to update function m.

[0324] In some embodiments, the following discusses the logic for inserting a newly generated update function into the queue of original update functions when the terminal generates a new update function during game execution and needs to be inserted into the queue of original update functions:

[0325] When more than one update function in the same category has an order relationship with other update functions, it may not be possible to ensure the correct order of update functions by adjusting the sorting of the entire category. In this case, the update function queue for that category can be split into multiple queues, and the order of update functions can be maintained by adjusting the split queues. For example, if the game terminal generates a new update function E, and there are update functions A, B, C, and D in the same category, the new update function E can be inserted into update functions A, B, C, and D. Since there is an execution order relationship between update function E and update functions A and B, for example, the order is update function a-update function E-update function b, then the sorting of the entire category can be adjusted to obtain update functions A, E, B, C, and D.

[0326] For example, if the game terminal generates a new update function E, and there are update functions A, B, C, and D in the same category, the new update function E can be inserted into these functions. Since there is a sequential execution relationship between update function E and update functions A and B (e.g., B-E, E-A), update functions a and b can no longer be placed in the same queue. They are split into two different queues: Queue 1: Update function A, and Queue 2: Update function B. Update function C, then insert update function E into either queue 1 or queue 2, and adjust the order. For example, inserting into queue 1 results in a new queue: update function E, update function A (at this time, it can be controlled to execute queue 2 first, and then the new queue, thus ensuring that there is an order of execution between update function E, update function A, and update function B); or inserting into queue 2 results in a new queue: update function B, update function E, update function C (at this time, it can be controlled to execute the new queue first, and then queue 1, thus ensuring that there is an order of execution between update function E, update function A, and update function B).

[0327] When an unordered update function needs to be enqueued, if the queue for that category has already been split into multiple queues, the function can be enqueued from the frontmost queue. Continuing the previous example, the split queues are: New queue: Update function E, Update function A and Queue 2: Update function B, Update function C. Queue 2 is executed first, followed by the new queue. At this point, the unordered update function F can be enqueued from any of the split queues, but it is preferred to be inserted into Queue 2 to obtain the new queue: Queue 2: Update function B, Update function C, Update function F.

[0328] In some embodiments, the calibration process of the update function is described below. During the actual execution of a tick, we record whether an L1 cache replacement occurs when the same type of tick is executed. If the same tick category experiences multiple cache replacements in the same execution, these are also recorded as multiple replacements. After all ticks have been executed, the recorded data is reported to the game server. The game server periodically analyzes the data reported by the client and calculates the L1 cache replacement rate for each type of tick, as follows: Ri = sum(Ci) / sum(Si), where Ri is the cache replacement rate of the i-th tick category, sum(Ci) is the total number of cache replacements that occur during the execution of the i-th tick category. Multiple replacements occurring in one execution are also counted according to the actual number of occurrences, so the final calculated Ri may exceed 100%. sum(Si) is the total number of executions of the i-th update function category, specifically referring to the number of executions of the update function category queue (i.e., the update function group described above). Even if there are multiple ticks in the queue, they are only counted once. After calculating the cache turnover rate for all update function categories, the tick categories with a turnover rate higher than 50% are re-reviewed, and more distinguishing variables are added to reduce the cache turnover rate.

[0329] In some embodiments, see Figure 16 , Figure 16 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 8 The virtual scene update method provided in this application embodiment can be achieved through... Figure 16 Steps 401 to 410 shown are implemented.

[0330] In step 401, the game client starts the game.

[0331] In some embodiments, the game client initiates this process when the game starts.

[0332] In step 402, the game client obtains the CPU model.

[0333] In some embodiments, the game client obtains the CPU model, the current terminal's CPU model, and the user requests the corresponding update function classification strategy from the server.

[0334] In step 403, the classification strategy is obtained.

[0335] In some embodiments, the game client obtains a classification strategy from the game server, obtains an update function classification control strategy for the corresponding CPU model from the game server, and the server returns the corresponding strategy to the game client after querying the database.

[0336] In step 404, the game server starts up in the background at regular intervals.

[0337] In some embodiments, the process is started periodically in the background to update the function classification strategy.

[0338] In step 405, it is determined whether to update the strategy table.

[0339] In some embodiments, the strategy table is updated according to the aforementioned rules based on the turnover rate of each tick category. If updated, step 406 is executed; otherwise, step 407 is executed.

[0340] In step 406, the classification strategy is calculated.

[0341] In some embodiments, a classification strategy is calculated, and the tick classification strategy is recalculated based on the new strategy table (new game content or new variables caused by cache replacement rate in the previous step). After the calculation is completed, the strategy is stored in the database for the game client to query.

[0342] In step 407, the replacement rate is calculated.

[0343] In some embodiments, during the actual execution of a tick, we record whether an L1 cache replacement occurs when the same type of tick is executed. If the same tick category undergoes multiple cache replacements in the same execution, it is also recorded as multiple replacements. After all ticks have been executed, the recorded data is reported to the game server.

[0344] In step 408, the policy table is updated.

[0345] In some embodiments, when new content is developed for the game, the strategy table is updated synchronously. For example, if a new scene is added, or new models or characters are added to the scene, the classification strategy needs to be recalculated when the strategy table is updated.

[0346] In step 409, the cache classification strategy is implemented.

[0347] In some embodiments, the game client caches the classification strategy. After receiving the classification control strategy issued by the game server, the game client caches it locally for use during the game.

[0348] In step 410, the update function classification management module is started.

[0349] In some embodiments, the game client starts the tick classification management module. After successful caching, it starts the update function classification management module to detect tick operations during gameplay, classify and manage them, and execute ticks at the designated times. Once the above steps are completed, the process ends.

[0350] In some embodiments, see Figure 17 , Figure 17 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 9 It can be done Figure 17 Steps 501 to 506 shown are implemented.

[0351] In step 501, the update function is detected.

[0352] In some embodiments, the game update function process involves the client performing the following steps when a new update function is generated: enqueuing the new tick, detecting the update function, and starting this process when a new update function operation is detected.

[0353] In step 502, the classification is calculated.

[0354] In some embodiments, a classification is calculated based on the aforementioned rules and the classification strategy control data cached locally to determine the classification to which the current update function belongs.

[0355] In step 503, the queue is enqueued.

[0356] In some embodiments, enqueueing involves adding the current tick to the corresponding tick queue according to the corresponding category.

[0357] In step 504, it is determined whether to execute the order.

[0358] In some embodiments, it is determined whether the current update function has a dependency relationship with the execution order of other ticks. If there is no dependency relationship, no special processing is required, and step 506 is executed. If there is a dependency relationship, step 505 is executed.

[0359] In step 505, the order is adjusted.

[0360] In some embodiments, the order is adjusted, and if there is a sequential dependency, the update function queue (i.e., the update function group described above) is split and sorted according to the aforementioned rules.

[0361] In step 506, the detection continues.

[0362] In some embodiments, the process ends after completing the above steps and continues to detect the next update function request.

[0363] In some embodiments, see Figure 18 , Figure 18 This is a flowchart illustrating the virtual scene update method provided in the embodiments of this application. Figure 10 It can be done Figure 18 Steps 601 to 605 shown are implemented.

[0364] In step 601, the period of the detection function is determined.

[0365] In some embodiments, the game client detects the update function's cycle and execution cycle, and initiates this process when the update function's triggering condition is met (such as a fixed cycle per frame).

[0366] In step 602, the update functions are executed sequentially.

[0367] In some embodiments, the game client sends all update functions in the update function queue to the CPU for execution in order of category.

[0368] In step 603, the execution status of the update function is obtained.

[0369] In some embodiments, the tick execution status is obtained, and during the tick execution process, the CPU L1 cache replacement status is obtained and recorded.

[0370] In step 604, the game client reports its status to the game server.

[0371] In some embodiments, after all update functions for the current cycle have been executed, the game client reports the cache replacement data for each category to the game server.

[0372] In step 605, the detection continues.

[0373] In some embodiments, the process ends after the cache replacement data is reported and the next update function cycle is detected.

[0374] See Table 2 below, which is a comparative table of the effects of this application and related technologies provided in the embodiments of this application.

[0375] Table 2. Comparison of the effects of the present application and related technologies provided in the embodiments of this application.

[0376] Related technologies This application Related technologies This application Update scene Update Scene 1 Update Scene 1 Update Scene 2 Update Scene 2 Performance indicators - - 83.6 88.7 time consuming 1.3ms 0.95ms 11.99ms 11.2ms

[0377] Referring to Table 2 above, actual tests were conducted to compare the update function schemes of this application and related technologies. The update time for scenario 1 decreased from 1.3ms to 0.95ms, representing a 30% performance improvement. The update time for scenario 2 decreased from 11.99ms to approximately 11.2ms, and the performance index (overall frame rate) also improved from 83.6 to 88.7. The actual effect is very significant. Under the same hardware conditions, the embodiments of this application can significantly improve the user experience.

[0378] Thus, by obtaining multiple update functions for updating content in the virtual scene, and classifying the update functions based on the scene parts they correspond to, at least one update function group is obtained. The update functions in the target update function group are then called sequentially to update the specified scene part. Because each update function group contains multiple update functions, and the scene parts corresponding to different update functions overlap to at least partially, when the specified scene part in the virtual scene meets the update conditions, the update functions in the target update function group are called sequentially. This ensures that the updated content corresponding to the called update functions is at least partially the same. Therefore, the cache used to store content does not need to be fully adjusted when switching update functions, effectively reducing the amount of content adjustment required when switching update functions and thus significantly improving content update efficiency.

[0379] It is understood that in the embodiments of this application, data related to update functions is involved. 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.

[0380] The following description continues to illustrate the exemplary structure of the virtual scene updating device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software module in the virtual scene update device 455 stored in the memory 450 may include: an acquisition module, used to acquire multiple update functions of the virtual scene, the multiple update functions being used to update different scene parts in the virtual scene respectively; a classification module, used to classify the multiple update functions based on the scene parts corresponding to the multiple update functions respectively, to obtain at least one update function group; wherein, the update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap; and an update module, used to determine a target update function group corresponding to a specified scene part from the at least one update function group based on a specified scene part in the virtual scene, and sequentially call the update functions in the target update function group to update the specified scene part.

[0381] In some embodiments, the classification module is further configured to: construct a first indicator vector for each update function based on the function variables in each update function, wherein the first indicator vector indicates whether a first function variable exists in the function variables; classify the plurality of update functions based on the first indicator vectors of each update function to obtain at least one initial update function group, wherein the first indicator vectors of different update functions in the initial update function group are the same; and classify the update functions in the initial update function group based on the scene portion corresponding to the update function in the initial update function group for each initial update function group to obtain at least one update function group.

[0382] In some embodiments, the classification module is further configured to obtain a first preset vector for each of the update functions, wherein the first preset vector includes at least one vector element and the vector element corresponds one-to-one with the first function variable; to detect the function variables of each of the update functions to obtain a detection result, wherein the detection result is used to indicate whether the first function variable exists in the function variable; and to update the first preset vector of each of the update functions based on the detection result to obtain a first indicator vector for each of the update functions.

[0383] In some embodiments, the classification module is further configured to determine the scene portion corresponding to each update function by simulating calls to each update function; determine the similarity between the contents of different update functions; and cluster the update functions with similarity greater than a similarity threshold to obtain at least one group of update functions.

[0384] In some embodiments, the classification module is further configured to determine the scene portion corresponding to the first update function by simulating a call to the first update function, wherein the first update function is any update function and the second update function is any update function other than the first update function; for each second update function, the scene portion corresponding to the second update function is determined by simulating a call to the first update function and the second update function in sequence, or the scene portion corresponding to the second update function is determined by simulating a call to the second update function.

[0385] In some embodiments, the classification module is further configured to determine the similarity between the scene portion corresponding to the first update function and the scene portions corresponding to each of the second update functions; the classification module is further configured to, when there is a similarity between the first update function and the second update function greater than a similarity threshold, determine the second update function with a similarity greater than the similarity threshold and the first update function as the update function group corresponding to the first update function; when there is no similarity between the first update function and the second update function greater than the similarity threshold, determine the first update function as the update function group corresponding to the first update function.

[0386] In some embodiments, the classification module is further configured to generate a new update function and update the at least one update function group based on the new update function to obtain at least one updated update function group; the update module is further configured to, when the target update function group is the updated update function group, sequentially call the update functions in the updated update function group to update the specified scene part.

[0387] In some embodiments, the above is further used to determine the content similarity between each of the update function groups and the new update function; when there is an update function group with a content similarity greater than a similarity threshold, the update function group with the largest content similarity is determined as the function group to be updated; the new update function is inserted into the function group to be updated to obtain the updated update function group; when there is no update function group with a similarity greater than a similarity threshold, the new update function and the at least one update function group are respectively determined as the updated update function group.

[0388] In some embodiments, the update functions in the function group to be updated have an execution order, which is obtained by sorting the update functions in the function group to be updated based on their call times; the classification module is further configured to obtain the call time of the new update function, and determine the position of the new update function in the function group to be updated based on the call time of the new update function and the execution order; and insert the new update function into the function group to be updated based on the position.

[0389] In some embodiments, the update module is further configured to, based on the specified scene portion, determine at least one update function associated with the specified scene portion from the target update function group; sequentially call at least one update function associated with the specified scene portion, and sequentially update the specified scene portion based on the update content corresponding to the respective update function.

[0390] In some embodiments, the update module is further configured to sequentially perform the following processing on the update functions associated with the specified scene portion: when there is an already called update function in the target update function group, determine the content difference between the update function and the already called update function, call the update function, and update the specified scene portion based on the content difference; when there is no already called update function in the target update function group, call the update function, and update the specified scene portion based on the update content corresponding to the update function.

[0391] The following description continues to illustrate the exemplary structure of the virtual scene updating device 555 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 3 As shown, the software module in the virtual scene update device 555 stored in the memory 550 may include: a sending module, which sends an update request for the specified scene part and receives an update function group corresponding to the specified scene part; the update function group includes multiple update functions, which are used to update different scene parts in the virtual scene respectively, and the scene parts corresponding to different update functions in the update function group have at least partial overlap; and a calling module, which sequentially calls the update functions in the target update function group to update the specified scene part.

[0392] In some embodiments, the aforementioned calling module is further configured to, for each update function in the target update function group corresponding to the specified scenario portion, when the update function is called, determine the changed content in the content cache at the time the update function is called, and when the content amount of the changed content is greater than the content amount threshold, determine the update function as a reference update function; the aforementioned calling module is further configured to count the number of reference update functions and the total number of update functions that have been called in the target update function group; divide the number by the total number to obtain the cache replacement rate of the target update function group, and send the cache replacement rate, which is used to calibrate the target update function group.

[0393] The following description continues to illustrate the exemplary structure of the virtual scene updating device 666 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 4As shown, the software modules in the virtual scene update device 666 stored in the memory 660 may include: an acquisition module, which acquires multiple update functions of the virtual scene, the multiple update functions being used to update different scene parts in the virtual scene respectively; a classification module, which classifies the multiple update functions based on the scene parts corresponding to the multiple update functions respectively, to obtain at least one update function group; wherein, the update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap; and a sending module, which, in response to an update request for a specified scene part, determines a target update function group corresponding to the specified scene part from the at least one update function group based on the specified scene part, and sends the update functions in the target update function group; wherein, the update functions in the target update function group update the specified scene part by sequentially calling them.

[0394] In some embodiments, the classification module is further configured to: construct a first indicator vector for each update function based on the function variables in each update function, wherein the first indicator vector indicates whether a first function variable exists in the function variables; classify the plurality of update functions based on the first indicator vectors of each update function to obtain at least one initial update function group, wherein the indicator variables of different update functions in the initial update function group are the same; and classify the update functions in the initial update function group based on the scene portion corresponding to the update function in the initial update function group to obtain at least one update function group.

[0395] In some embodiments, the classification module is further configured to receive the cache replacement rate of the target update function group; when the cache replacement rate is greater than a replacement rate threshold, construct a second indicator vector for each update function based on the function variables of each update function; wherein the second indicator vector is used to indicate whether a second function variable exists in the function variables of the update function, and the second function variable is different from the first function variable; classify the plurality of update functions based on the first indicator vector and the second indicator vector to obtain at least one first update function group, wherein the indicator variables of different update functions in the first update function group are the same as the second indicator vector; classify the update functions in the first update function group based on the scene portion corresponding to the update function in the first update function group to obtain at least one second update function group.

[0396] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene update method described above in this application.

[0397] This application provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are executed by a processor, they cause the processor to execute a virtual scene update method provided in this application. For example, ... Figure 5 The method for updating the virtual scene is shown.

[0398] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), flash memory, magnetic surface memory, optical disk, or CD-ROM, etc.; or it may be various electronic devices that include one or any combination of the above-mentioned memories.

[0399] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, 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 stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0400] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0401] As an example, computer-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 HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0402] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0403] In summary, the embodiments of this application have the following beneficial effects:

[0404] (1) By obtaining multiple update functions for updating content in a virtual scene, and classifying the update functions based on the scene parts corresponding to each function, at least one update function group is obtained. The update functions in the target update function group are called sequentially to update the specified scene parts. In this way, by classifying multiple update functions, at least one update function group is obtained. Since the update function group includes multiple update functions and the scene parts corresponding to different update functions overlap to at least part, when the specified scene part in the virtual scene meets the update conditions, by calling the update functions in the target update function group sequentially, the update content corresponding to the called update functions will be at least partially the same. The cache used to store content does not need to be fully adjusted for the at least partially the same content when switching update functions, thus effectively reducing the amount of content adjustment in the cache used to store content when switching update functions, thereby effectively improving the content update efficiency.

[0405] (2) The update strategy can dynamically adjust vector elements based on the detection results, ensuring that the function variables of the update function remain consistent with the preset function variables. When the preset function variables are not detected in the function variables of the update function, updating the vector elements in the first preset vector to the first vector element can effectively avoid calculation errors or anomalies caused by variable inconsistency. When the preset function variables are detected in the function variables of the update function, updating the vector elements in the first preset vector to the second vector element helps maintain the stability and accuracy of the function. This differentiated processing not only improves flexibility and adaptability but also ensures the correct operation of the function in different scenarios, thereby improving overall performance and reliability.

[0406] (3) It ensures that each update function operates based on its specific first preset vector, making the update of function variables more accurate and targeted. The function variables of each update function are checked, and the presence of the first function variable is determined, providing a clear basis for subsequent vector element updates. The application of this check result allows for dynamic adjustment of the preset vector according to actual needs, avoiding unnecessary calculation errors and resource waste. Updating the first preset vector based on the check result yields the first indicator vector for each update function, enhancing the flexibility and adaptability of the function and ensuring that the update function remains consistent with the preset target throughout the processing, thereby improving overall stability and accuracy.

[0407] (4) By effectively identifying and clustering update functions with the same characteristics, and by constructing an initial update function group, the efficiency of function management and modularity are improved. When update functions with the same first indicator vector are found, they are grouped together, and the same optimization strategy and maintenance process can be shared, reducing duplicate work and improving resource utilization.

[0408] (5) By classifying the update functions in the initial update function group, the first update function is established, which helps to clarify the core logic and priority, thus providing clear guidance in subsequent processing. Furthermore, by classifying other unclassified update functions as second update functions, hierarchical management of functions can be effectively achieved. Simulating calls to the first and second update functions not only determines their respective corresponding scenario parts but also verifies the mutual influence and synergy between functions. This approach helps optimize the program structure, improve code maintainability and extensibility, and reduce the possibility of program errors.

[0409] (6) A strategy of initially classifying multiple update functions based on the first indicator vector of each update function, and then further classifying them in detail based on the content of the update functions in the initial update function group. Since the first indicator vector contains the key features of the update function, while the content-based classification involves more detailed information, the former is much more computationally efficient than the latter. This phased classification method first reduces the computational burden of subsequent content-based classification by efficiently classifying the first indicator vector, because further comparison of content is only required when the first indicator vectors are similar, thereby avoiding unnecessary calculations between different initial update function groups. This not only optimizes the calculation process and reduces resource consumption, but also significantly improves the overall efficiency of update function classification.

[0410] (7) A similarity threshold is used to determine the similarity between the first and second update functions, and the functions are grouped according to this standard. When the similarity exceeds the threshold, the related functions are grouped into the same update function group. This helps to identify and integrate update operations with similar functions, reduce code redundancy, and improve code maintainability and readability. It can promote the modularization of functions, making subsequent development and maintenance work more efficient. When no highly similar functions are found, independently determining the update function group of the first update function helps to maintain the independence and clarity of functions and avoid unnecessary inter-module dependencies.

[0411] (8) By determining the content similarity between each update function group and the new update function, and updating the update function groups according to the similarity threshold, efficient code management and maintenance can be achieved. When there are update function groups with content similarity greater than the similarity threshold, the update function group with the highest similarity is selected as the function group to be updated, and the new update function is inserted into it. This helps reduce code redundancy, improve development efficiency, and maintain code consistency and maintainability. At the same time, when there are no update function groups with similarity greater than the similarity threshold, determining the new update function and at least one update function group as the updated update function group helps maintain functional independence.

[0412] (9) Simulated sorting ensures that the new update functions meet the predetermined execution order requirements. This helps maintain the consistency of the system's internal logic and prevents program errors or logical conflicts caused by incorrect execution order. The simulated sorting process can pre-verify whether the execution order of the updated functions is correct, thereby avoiding costly rollback or correction work after the update is implemented. When the new update functions are properly integrated into the group of functions to be updated, code redundancy and complexity can be reduced. This will make future maintenance easier and reduce the error rate. After determining the group of functions to be updated with the highest similarity, the new update functions can reuse the logic and structure of this part of the code, avoiding the rewriting of the same code and improving code reusability. When the simulated sorting results show that the execution order cannot be directly met, the update function group is split to adapt to the new update functions. This flexibility allows for adaptation to more complex business logic and technical requirements. By simulating sorting and splitting the update function group, potential problems can be predicted before actual code changes, reducing the testing workload after the code is actually deployed.

[0413] (10) When the update functions in the function group to be updated have an execution order, by obtaining the call time of the new update function and determining the position of the new function in the function group to be updated based on its call time and execution order, it can be ensured that the insertion of the new function will not disrupt the original execution flow, and at the same time, the smooth integration of the new function is guaranteed. Through this orderly update strategy, it is possible to better adapt to changes in requirements and accelerate the development and deployment of new update functions.

[0414] (11) By identifying the target update function group from at least one set of update functions, we can efficiently manage and update specified scene parts. Further identifying at least one update function associated with the specified scene part ensures the targeting and accuracy of the update operation. Calling these update functions sequentially and updating the specified scene part based on their corresponding update content guarantees the real-time performance and consistency of the virtual scene. This approach optimizes the update process, improves system performance and response speed, and reduces resource consumption. It helps improve the user experience and ensures the stability and reliability of the game or application.

[0415] (12) By sequentially performing specific processing on the update functions associated with the specified scene parts, the specified scene parts can be effectively updated in the virtual scene, ensuring that they always reflect the latest game state. When an update function has already been called, by determining the differences between the update function and the called update function, calling the update function, and updating the specified scene part based on these differences, more accurate and effective updates can be achieved, avoiding unnecessary repetitive operations. When no update function has already been called, the update function is directly called and updated based on its corresponding update content, ensuring the integrity and consistency of the update operation. This approach can optimize the update process, reduce computational resource consumption, and improve update efficiency, thereby improving the response speed of the virtual scene and the user experience. At the same time, it also helps to maintain the consistency between the specified scene parts in the virtual scene and the game state, avoiding the problem of information asynchrony.

[0416] (13) Calculating and sending the cache replacement rate helps developers to deeply analyze the usage frequency and update efficiency of the update function group, thereby achieving accurate calibration of at least one update function group, which can optimize game performance, reduce unnecessary resource consumption, improve the player's game experience, and ensure the response speed and accuracy of key update function groups, ultimately improving the smoothness and stability of the game.

[0417] (14) The real-time feedback mechanism ensures that the content in the virtual scene is synchronized with the server, improving the system's dynamism and interactivity. The server returns a set of update functions corresponding to the specified scene, which includes at least one specially designed update function. These functions are highly targeted and can efficiently and accurately update the corresponding content in the virtual scene.

[0418] (15) Based on the specified scene part, at least one update function associated with the specified scene part is determined from the update function group, and these update functions are called in sequence to ensure the relevance and accuracy of the update. Each called update function is carefully designed for the specific needs of the specified scene part and can update the specified scene part in an orderly manner according to its corresponding update content.

[0419] (16) Implement content cache change detection for update functions in the update function group corresponding to a specified scene, and determine the strategy for reference update functions based on the amount of changed content. By real-time detection and statistics of the number of reference update functions and their proportion in the update function group, the calculated cache replacement rate becomes a key performance indicator, which can accurately identify and prioritize updates that have the greatest impact on the game state, thereby improving resource utilization efficiency. By detecting the cache replacement rate, update strategies can be discovered and adjusted in a timely manner to maintain system balance and response speed, providing a quantitative basis for the calibration of the update function group, enabling developers to dynamically optimize system configuration based on actual operation, thereby improving the overall performance of the game and the player experience.

[0420] (17) Calculating and sending the cache replacement rate helps to analyze the usage frequency and update efficiency of the update function group in depth, thereby achieving accurate calibration of at least one update function group, which can optimize game performance, reduce unnecessary resource consumption, improve the player's game experience, and ensure the response speed and accuracy of key update function groups, ultimately improving the smoothness and stability of the game.

[0421] (18) The update strategy can dynamically adjust vector elements based on the detection results, ensuring that the function variables of the update function remain consistent with the preset function variables. When the preset function variables are not detected in the function variables of the update function, updating the vector elements in the first preset vector to the first vector element can effectively avoid calculation errors or anomalies caused by variable inconsistency. When the preset function variables are detected in the function variables of the update function, updating the vector elements in the first preset vector to the second vector element helps maintain the stability and accuracy of the function. This differentiated processing not only improves flexibility and adaptability but also ensures the correct operation of the function in different scenarios, thereby improving overall performance and reliability.

[0422] (19) By effectively identifying and clustering update functions with the same characteristics, and by constructing an initial update function group, the efficiency of function management and modularity are improved. When update functions with the same first indicator vector are found, they are grouped together, and the same optimization strategy and maintenance process can be shared, reducing duplicate work and improving resource utilization.

[0423] (20) By classifying the update functions in the initial update function group, the first update function is established, which helps to clarify the core logic and priority, thus providing clear guidance in subsequent processing. Furthermore, by classifying other unclassified update functions as second update functions, hierarchical management of functions can be effectively achieved. Simulating calls to the first and second update functions not only determines their respective corresponding scenario parts but also verifies the mutual influence and synergistic effects between functions. This approach helps optimize the program structure, improve code maintainability and extensibility, and reduce the possibility of program errors.

[0424] (21) Using the first and second indicator vectors to classify and optimize update functions can significantly improve game performance and development efficiency. The first indicator vector provides the basic behavior types of update functions, helping developers quickly identify and group functions with similar functions. The second indicator vector further refines the specific behaviors or states of these functions, enabling more accurate adjustment and optimization. In this way, unnecessary function calls can be reduced, function execution efficiency can be improved, thereby reducing resource consumption and improving the overall performance of the game. In addition, this approach helps developers better understand the game's behavior patterns, providing strong support for later optimization and expansion of the game, ensuring that the game can provide a smoother and more stable gaming experience.

[0425] The above description is merely an embodiment of this application and is 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 method for updating a virtual scene, characterized in that, The method includes: Obtain multiple update functions for the virtual scene, each of which is used to update different parts of the virtual scene. Based on the scene portions corresponding to the plurality of update functions, the plurality of update functions are classified to obtain at least one update function group, wherein the update function group includes a plurality of update functions, and the scene portions corresponding to different update functions at least partially overlap. Based on a specified scene portion in the virtual scene, determine the target update function group corresponding to the specified scene portion from the at least one update function group; The update functions in the target update function group are called sequentially to update the specified scene portion.

2. The method according to claim 1, characterized in that, The step involves classifying the multiple update functions based on the scene portions corresponding to each of the multiple update functions, resulting in at least one group of update functions, including: Based on the function variables in each of the update functions, a first indicator vector is constructed for each of the update functions. The first indicator vector is used to indicate whether a first function variable exists in the function variables. Based on the first indicator vector of each update function, the plurality of update functions are classified to obtain at least one initial update function group, wherein the first indicator vectors of different update functions in the initial update function group are the same; For each of the initial update function groups, based on the scene portion corresponding to the update function in the initial update function group, the update functions in the initial update function group are classified to obtain at least one update function group.

3. The method according to claim 1 or 2, characterized in that, The step of constructing a first indicator vector for each update function based on the function variables in each update function includes: Each of the update functions is obtained as a first preset vector, the first preset vector including at least one vector element, and the vector element corresponds one-to-one with the first function variable; The function variables of each of the update functions are detected to obtain detection results, which are used to indicate whether the first function variable exists among the function variables; Based on the detection results, the first preset vector of each of the update functions is updated to obtain the first indicator vector of each of the update functions.

4. The method according to any one of claims 1 to 3, characterized in that, The step of classifying the multiple update functions based on the scene portions corresponding to each of the multiple update functions to obtain at least one group of update functions includes: By simulating the invocation of each update function, the scene portion corresponding to each update function is determined; Determine the similarity between the contents of the different update functions; Cluster the update functions whose similarity is greater than the similarity threshold to obtain at least one group of update functions.

5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the scene portion corresponding to each update function by simulating the invocation of each update function includes: By simulating the invocation of the first update function, the scene part corresponding to the first update function is determined. The first update function is any update function, and the second update function is any update function other than the first update function. For each of the second update functions, the scene portion corresponding to the second update function is determined by sequentially simulating calls to the first update function and the second update function, or By simulating the invocation of the second update function, the scene portion corresponding to the second update function is determined.

6. The method according to any one of claims 1 to 5, characterized in that, Determining the similarity between the contents of different update functions includes: Determine the similarity between the scene portion corresponding to the first update function and the scene portion corresponding to each of the second update functions; The step of clustering the update functions with similarity greater than a similarity threshold to obtain at least one group of update functions includes: When the similarity between the first update function and the second update function is greater than a similarity threshold, the second update function with a similarity greater than the similarity threshold and the first update function are determined as the update function group corresponding to the first update function; When there is no similarity between the first update function and the second update function greater than the similarity threshold, the first update function is determined as the update function group corresponding to the first update function.

7. The method according to any one of claims 1 to 6, characterized in that, After classifying the multiple update functions based on the scene portions corresponding to each of the multiple update functions to obtain at least one group of update functions, the method further includes: Generate a new update function, and based on the new update function, update the at least one update function group to obtain at least one updated update function group; The step of sequentially calling the update functions in the target update function group to update the specified scene portion includes: When the target update function group is the updated update function group, the update functions in the updated update function group are called sequentially to update the specified scene part.

8. The method according to any one of claims 1 to 7, characterized in that, The step of updating the at least one set of update functions based on the new update function to obtain at least one updated set of update functions includes: Determine the content similarity between each of the aforementioned update function groups and the new update function; When there exists an update function group whose content similarity is greater than the similarity threshold, the update function group with the highest content similarity is determined as the function group to be updated; The new update function is inserted into the group of functions to be updated to obtain the updated update function group; When there is no update function group with a similarity greater than the similarity threshold, the new update function and the at least one update function group are respectively determined as the updated update function group.

9. The method according to any one of claims 1 to 8, characterized in that, The update functions in the group of functions to be updated have an execution order, which is obtained by sorting the update functions in the group of functions to be updated based on their call times. The step of inserting the new update function into the group of functions to be updated to obtain the updated update function group includes: Obtain the call time of the new update function, and determine the position of the new update function in the group of functions to be updated based on the call time of the new update function and the execution order; Based on the stated position, the new update function is inserted into the group of functions to be updated.

10. The method according to any one of claims 1 to 9, characterized in that, The step of sequentially calling the update functions in the target update function group to update the specified scene portion includes: Based on the specified scenario portion, at least one update function associated with the specified scenario portion is determined from the target update function group; At least one update function associated with the specified scene portion is called sequentially, and the specified scene portion is updated sequentially based on the update content corresponding to the respective update function.

11. The method according to any one of claims 1 to 10, characterized in that, The step of sequentially calling at least one update function associated with the specified scene portion, and sequentially updating the specified scene portion based on the update content corresponding to the respective update function, includes: The following processing is performed sequentially for each update function associated with the specified scene portion: When there is an already called update function in the target update function group, determine the content difference between the update function and the already called update function, call the update function, and update the specified scene part based on the content difference; When there is no already invoked update function in the target update function group, the update function is invoked, and the specified scene part is updated based on the update content corresponding to the update function.

12. A method for updating a virtual scene, characterized in that, The method includes: Send an update request for a specified scene portion, and receive the target update function group corresponding to the specified scene portion; The target update function group includes multiple update functions, which are used to update different parts of the virtual scene. The scene parts corresponding to different update functions in the target update function group have at least partial overlap. The update functions in the target update function group are called sequentially to update the specified scene portion.

13. The method according to claim 12, characterized in that, When sequentially calling the update functions in the target update function group to update the specified scene portion, the method further includes: For each update function in the target update function group corresponding to the specified scenario, when the update function is called, the changed content in the content cache is determined when the update function is called. When the content amount of the changed content is greater than the content amount threshold, the update function is determined as the reference update function. After sequentially calling the update functions in the target update function group to update the specified scene portion, the method further includes: Count the number of reference update functions and the total number of update functions that have been called in the target update function group; Divide the quantity by the total quantity to obtain the cache replacement rate of the target update function group, and send the cache replacement rate, which is used to calibrate the target update function group.

14. A method for updating a virtual scene, characterized in that, The method includes: Obtain multiple update functions for the virtual scene, each of which is used to update different parts of the virtual scene. Based on the scene parts corresponding to the multiple update functions, the multiple update functions are classified to obtain at least one group of update functions; The update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap. In response to an update request for a specified scene portion, based on the specified scene portion, a target update function group corresponding to the specified scene portion is determined from the at least one update function group, and the update function in the target update function group is sent. The update functions in the target update function group update the specified scene portion by calling them sequentially.

15. The method according to claim 14, characterized in that, The step involves classifying the multiple update functions based on the scene portions corresponding to each of the multiple update functions, resulting in at least one group of update functions, including: Based on the function variables in each of the update functions, a first indicator vector is constructed for each of the update functions. The first indicator vector is used to indicate whether a first function variable exists in the function variables. Based on the first indicator vector of each of the update functions, the plurality of update functions are classified to obtain at least one initial update function group, wherein the indicator variables of different update functions in the initial update function group are the same; For each of the initial update function groups, based on the scene portion corresponding to the update function in the initial update function group, the update functions in the initial update function group are classified to obtain at least one update function group.

16. The method according to claim 14 or 15, characterized in that, After updating the specified scene portion, the method further includes: Receive the cache replacement rate of the target update function group. When the cache replacement rate is greater than the replacement rate threshold, construct a second indicator vector for each update function based on the function variables of each update function. The second indicator vector is used to indicate whether there is a second function variable among the function variables of the update function, and the second function variable is different from the first function variable; Based on the first indicator vector and the second indicator vector, the plurality of update functions are classified to obtain at least one first update function group, wherein the indicator variables of different update functions in the first update function group are the same as the second indicator vector; Based on the scenario portion corresponding to the update function in the first update function group, the update functions in the first update function group are classified to obtain at least one second update function group.

17. A device for updating a virtual scene, characterized in that, The device includes: The acquisition module is used to acquire multiple update functions of the virtual scene, and the multiple update functions are used to update different scene parts in the virtual scene respectively; A classification module is used to classify the multiple update functions based on the scene parts corresponding to the multiple update functions respectively, to obtain at least one update function group; wherein, the update function group includes multiple update functions, and the scene parts corresponding to different update functions have at least partial overlap; An update module is used to determine a target update function group corresponding to a specified scene part from the at least one update function group based on a specified scene part in the virtual scene, and sequentially call the update functions in the target update function group to update the specified scene part.

18. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the virtual scene update method according to any one of claims 1 to 16.

19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the virtual scene update method according to any one of claims 1 to 16.

20. A computer program product comprising a computer program or computer-executable instructions, characterized in that, When the computer program or computer-executable instructions are executed by a processor, the method for updating the virtual scene according to any one of claims 1 to 16 is implemented.