Running performance acquisition method and device, equipment, storage medium and program product

By displaying the component's running code and its performance information in the code editing interface, the problem of code creators being unable to accurately locate performance issues is solved, improving code adjustment efficiency and the driving stability of virtual components.

CN121560412APending Publication Date: 2026-02-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511735082.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In existing technologies, code creators cannot accurately locate problems in script code based on the running frame rate, resulting in low efficiency in code adjustment and repair, and affecting the driving stability of virtual components in virtual scenes.

Method used

By displaying the running code of a virtual component in the code editing interface and showing component performance information during execution, including the execution status of the operation code, code creators can accurately locate the operation code with performance problems.

Benefits of technology

It improves the targeting and efficiency of code adjustments, ensures the driving stability of virtual components in virtual scenes, and enhances the writing experience for code creators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121560412A_ABST
    Figure CN121560412A_ABST
Patent Text Reader

Abstract

The application of the invention is a divisional application of the Chinese application 202411758168.9. The invention discloses an operation performance obtaining method and device, equipment, a storage medium and a program product. The method comprises the following steps: displaying a virtual component in a virtual scene; in response to the received component editing operation for the virtual component, displaying a component operation code corresponding to the virtual component; under the condition that the execution component operation code drives the virtual component, component performance information corresponding to the virtual component is displayed; the component performance information comprises operation execution information used for representing the execution condition of the ith operation code in the at least one operation code, and i is a positive integer. The execution condition of the operation code in the component operation code is displayed in a targeted manner through the operation execution information, so that the operation code with a performance problem can be efficiently positioned, and the code adjustment efficiency is improved. The method can be applied to various scenes supporting code creation, such as social media scenes, game content creation scenes and programming learning scenes.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese application No. 202411758168.9, filed on December 3, 2024, entitled "Method, Apparatus, Device, Storage Medium and Program Product for Obtaining Operating Performance". Technical Field

[0002] This application relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for obtaining operating performance. Background Technology

[0003] With the development of online games, user-generated content (UGC) has become increasingly popular as a model of mass innovation, allowing players to participate in the creation process by writing code.

[0004] In related technologies, in order to statistically analyze the execution status of written code, code creators can write additional frame rate statistics code while writing script code based on UGC to detect the running frame rate when the script code is executed on the local side, and use the running frame rate as the running status of the script code.

[0005] However, the above methods can only reflect the general situation of code execution. If there are problems such as script code writing errors or poor code execution performance, the code creator cannot determine the location of the problematic code in the script based on the running frame rate, which affects the efficiency of code adjustment and repair. Summary of the Invention

[0006] This application provides a method, apparatus, device, storage medium, and program product for acquiring runtime performance. It can more specifically display the execution status of operation code within component runtime code through operation execution information, thereby helping to efficiently locate operation code with performance problems, improve code adjustment efficiency, and ensure the driving stability of virtual components in virtual scenarios. The technical solution is as follows.

[0007] On the one hand, a method for obtaining runtime performance is provided, the method comprising: Display virtual components in a virtual scene; Receive a component trigger operation for the virtual component and display a code editing interface, which is used to edit the information driving the virtual component in the form of code writing; The code editing interface displays the component execution code corresponding to the virtual component, and the component execution code includes at least one operation code for driving the state transformation of the virtual component in the virtual scene; When the component execution code drives the virtual component, the component performance information corresponding to the virtual component is displayed; the component performance information includes operation execution information used to characterize the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

[0008] On the other hand, an apparatus for acquiring operational performance is provided, the apparatus comprising: The display module is used to display virtual components in the virtual scene; The display module is also used to receive component triggering operations for the virtual component, display a code editing interface, the code editing interface is used to edit information driving the virtual component in the form of code writing; and display component running code corresponding to the virtual component on the code editing interface, the component running code including at least one operation code for driving the state transformation of the virtual component in the virtual scene; The display module is further configured to display component performance information corresponding to the virtual component when the component execution code drives the virtual component; the component performance information includes operation execution information used to characterize the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

[0009] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the performance acquisition method as described in any of the embodiments of this application above.

[0010] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the performance acquisition method as described in any of the embodiments of this application above.

[0011] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the performance acquisition methods described in the above embodiments.

[0012] The beneficial effects of the technical solutions provided in this application include at least the following: Based on component editing operations on virtual components in a virtual scene, the system displays the component's runtime code corresponding to the virtual component. This allows for the display of component performance information, including operation execution information, while the virtual component is driven by the runtime code. By leveraging this component performance information, the system can more specifically showcase the execution of specific operations within the runtime code, avoiding the problem of inefficient code adjustments due to only having a general understanding of virtual component execution. This also facilitates efficient location of performance-critical operations, improving code adjustment efficiency and enabling code creators to more effectively improve the runtime code, thus ensuring the stability of the virtual component's operation within the virtual scene. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a structural block diagram of an acquisition system provided in an exemplary embodiment of this application; Figure 2 This is a flowchart of a method for obtaining runtime performance provided in an exemplary embodiment of this application; Figure 3 This is a flowchart of a method for obtaining runtime performance provided in another exemplary embodiment of this application; Figure 4 This is a flowchart of a method for obtaining runtime performance provided in another exemplary embodiment of this application; Figure 5 This is a schematic diagram of the interface of a virtual scene provided in an exemplary embodiment of this application; Figure 6 This is a schematic diagram of the interface of a component editing panel provided in an exemplary embodiment of this application; Figure 7 This is a flowchart illustrating a virtual scene based on a virtual map, provided in an exemplary embodiment of this application. Figure 8 This is a schematic diagram showing the correspondence between a virtual component and its runtime code provided in an exemplary embodiment of this application; Figure 9 This is an event callback flowchart provided by an exemplary embodiment of this application; Figure 10 This is a schematic diagram of the frame rate curve of the related technology provided in an exemplary embodiment of this application; Figure 11 This is a structural block diagram of an operational performance acquisition apparatus provided in an exemplary embodiment of this application; Figure 12 This is a structural block diagram of a terminal provided in an exemplary embodiment of this application. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0016] First, a brief introduction to the terms used in the embodiments of this application will be given.

[0017] Virtual scene: A virtual scene is a scene displayed (or provided) by an application when it runs on a terminal. This virtual scene can be a simulation of a real scene, a semi-simulated / semi-fictional scene, or a purely fictional scene. A virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene; this application does not limit it to any particular type. The following embodiments use a three-dimensional virtual scene as an example.

[0018] Virtual components are elements in a virtual scene used to mimic real-world scenes. For example, a virtual component occupies a certain volume within the virtual scene. Examples of virtual components include: virtual terrain, virtual buildings, virtual flora and fauna, virtual props, virtual vehicles, and virtual objects. For instance, virtual terrain includes: ground, mountains, rivers, rocks, steps, etc.; virtual buildings include: houses, walls, containers, and fixed facilities inside buildings: tables, chairs, cabinets, beds, etc.; virtual flora and fauna include: trees, flowers, birds, etc.; virtual props include: virtual attack tools, first-aid kits, airdrops, etc.; virtual vehicles include: cars, ships, helicopters, etc.; and virtual objects include: people, animals, anime characters, etc.

[0019] In related technologies, to monitor code execution, code creators can write additional frame rate statistics code alongside their UGC-based script code to detect the frame rate during script execution on their local machine, using this frame rate as a measure of script performance. However, this method only reflects a general overview of code execution. If there are errors in the script code or poor execution performance, the code creator cannot pinpoint the location of the problematic code based on the frame rate, impacting the efficiency of code adjustment and repair.

[0020] This application presents a method for acquiring runtime performance, which can more specifically display the execution status of operation code in the component's runtime code through operation execution information. This helps to efficiently locate operation code with performance problems, improve code adjustment efficiency, and ensure the driving stability of virtual components in virtual scenes. The runtime performance acquisition method proposed in this application can be applied to various scenarios that support code creation, such as social media scenarios, game content creation scenarios, programming learning scenarios, and multimedia sharing scenarios, and is not limited here.

[0021] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user data. These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their data is being collected. This ensures that the application only begins the steps for collecting user data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without user confirmation), the steps for collecting user data end, meaning no user data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of related user data must comply with the relevant laws, regulations, and standards of the relevant regions.

[0022] Secondly, the acquisition system involved in the embodiments of this application will be described. The runtime performance acquisition method provided in the embodiments of this application can be implemented by the terminal alone, by the server, or by the terminal and the server through data interaction. The embodiments of this application do not limit this. Optionally, the runtime performance acquisition method is described using the interaction between the terminal and the server.

[0023] This is illustrative; please refer to it. Figure 1 The acquisition system involves a terminal 110 and a server 120, which are connected via a communication network 130.

[0024] In some embodiments, terminal 110 displays virtual components in a virtual scene.

[0025] In illustration, virtual components are components within a virtual scene that need to be driven through code editing. Virtual components include virtual objects, virtual vehicles, etc.

[0026] Optionally, a game client is installed on terminal 110, and a virtual scene is displayed while the game client is running. The virtual scene includes virtual components; or, in response to receiving a component deployment operation, terminal 110 displays the deployed virtual components in the virtual scene, etc.

[0027] In some embodiments, in response to receiving a component editing operation for a virtual component, the terminal 110 displays the component execution code corresponding to the virtual component.

[0028] In illustrative terms, a virtual component is a component to be driven by code editing. Performing a component editing operation on a virtual component means that the code creator using terminal 110 writes component execution code to drive the virtual component to change its state.

[0029] Optionally, a long press operation on a virtual component can be used as a component editing operation; or, a position-triggered operation on a preset component position within a virtual component can be used as a component editing operation.

[0030] The component execution code includes at least one operation code used to drive the state transformation of virtual components in the virtual scene.

[0031] Indicatively, the component's execution code consists of at least one operation code. An operation code is the smallest unit of operation that a computer's Central Processing Unit (CPU) can execute. Typically, an operation code is used to indicate a specific calculation or control operation, such as data processing operations (addition, subtraction, multiplication, division, etc.), data movement operations (such as copying data from one register to another), control flow operations (such as jumps, branches, loops, etc.). At least one operation code is combined to drive the virtual component to achieve state transitions in the virtual scene.

[0032] State transitions include changes in motion state (such as from standing to running), changes in component posture (such as from standing to crouching), and changes in component position (such as teleporting from point A to point B). Here, the state transitions of virtual components in the virtual scene are not limited.

[0033] In some embodiments, when the execution component runs code to drive the virtual component, the terminal 110 displays the component performance information corresponding to the virtual component.

[0034] The component performance information includes operation execution information, where i is a positive integer, used to characterize the execution status of the i-th operation code among at least one operation code. The i-th operation code is any one of the at least one operation code.

[0035] Optionally, when the terminal 110 executes the component running code to drive the virtual component, the terminal 110 detects the code running status of the component running code with the operation code as the analysis dimension, thereby analyzing the execution status of the operation code and obtaining the operation execution information of the operation code; and uses the finer-grained operation execution information as component performance information, thereby presenting a more detailed code running status to the code creator.

[0036] Optionally, the terminal 110 sends the component execution code written by the code creator to the server 120 through the communication network. The server 120 executes the component execution code to simulate and drive the virtual component in the virtual scene, thereby obtaining component performance information including operation execution information corresponding to the operation code. The server 120 then sends the component performance information to the terminal 110 through the communication network 130, so that the terminal 110 can render and display the component performance information of the virtual component on the terminal screen.

[0037] In some embodiments, the code creator of the operating terminal 110 can determine the operation code that may have a high consumption problem when executing the component running code based on the operation execution information of the i-th operation code in the displayed component performance information. This helps to achieve the purpose of accurate positioning of at least one operation code in the component running code, improve the pertinence and efficiency of code adjustment, ensure the writing experience of the component running code for the code creator, and also help to ensure the running stability of the virtual component in the virtual scene.

[0038] It is worth noting that the aforementioned terminals include, but are not limited to, mobile terminals such as mobile phones, tablets, portable laptops, smart voice interaction devices, smart home appliances, and in-vehicle terminals, and can also be desktop computers, etc.; the aforementioned servers can be independent physical servers, dedicated servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers.

[0039] Based on the above-described terms and application scenarios, the method for obtaining runtime performance provided in this application will be explained, taking the application of this method to a terminal as an example. Figure 2 As shown, the method includes the following steps 210 to 230.

[0040] Step 210: Display the virtual components in the virtual scene.

[0041] In illustrative terms, a virtual scene is a scene created in a computer-generated virtual environment or simulated space; virtual scenes are typically digitized.

[0042] Optionally, the virtual scene is a scene displayed on the terminal. For example, a client is installed on the terminal, which is an application running on the terminal, responsible for processing user input and implementing functions such as rendering graphics and playing sound effects; the virtual scene is displayed while the client is running on the terminal.

[0043] Optionally, a virtual scene is a scene displayed based on Virtual Reality (VR) technology. Users can observe and interact with the virtual scene through VR devices (such as head-mounted displays, controllers, motion capture devices, etc.), thereby isolating the virtual scene from the real world.

[0044] Optionally, the virtual scene is a scene displayed based on Augmented Reality (AR) technology. Augmented Reality technology is a technology that overlays virtual elements (such as images, text, 3D models, etc.) onto a view of the real world. Unlike Virtual Reality technology, AR technology does not require the user to fully enter the virtual world. Instead, it enhances the user's perception of the real world and displays a virtual view in the real world as a virtual scene through a screen (such as a smartphone, AR glasses, etc.).

[0045] In a schematic representation, virtual components are elements, objects, etc., that make up a virtual scene. Virtual components are typically implemented as digital objects such as graphics, virtual objects, and virtual objects. Virtual components exist in the virtual scene, and users can see and interact with them.

[0046] In some embodiments, virtual components are elements that are pre-displayed in a virtual scene.

[0047] In illustrative terms, when constructing a virtual scene, at least one virtual component is pre-defined. For example, at least one virtual component includes virtual object A1, virtual object A2, virtual building B1, virtual pet P1, virtual pet P2, etc. A virtual component is any one of the at least one virtual components.

[0048] In some embodiments, virtual components are elements displayed based on component creation operations.

[0049] For illustrative purposes, if a virtual scene is constructed without pre-defined virtual components or with pre-defined virtual components, the component creation operation is used to create virtual components specifically within the virtual scene. If a component creation operation is received while the virtual scene is being displayed, the created virtual components can be displayed within the virtual scene based on the component creation operation.

[0050] Optionally, the component creation operation is a gesture-triggered operation for a specified area created in the virtual scene (such as a long press operation, a double-click operation, etc.), or the component creation operation is a control-triggered operation for adding controls to the component (such as a click operation, a long press operation, etc.).

[0051] Step 220: In response to receiving a component editing operation for the virtual component, display the component running code corresponding to the virtual component.

[0052] Optionally, a virtual component is a component within a virtual scene that needs to be driven through code editing; receiving a component editing operation for a virtual component means that the code for the virtual component needs to be edited specifically to drive the virtual component to achieve state transformation in the virtual scene.

[0053] To illustrate, when a virtual component is initially displayed in a virtual scene, it cannot undergo state changes. For example, if the displayed virtual component is virtual object A, virtual object A is only in a static, blurred state before receiving component editing operations. The skin, expression, posture, and actions of virtual object A all need to be configured based on the code editing process, that is, the virtual component needs to be configured through component editing operations.

[0054] Optionally, a virtual component is a component within a virtual scene that needs to be flexibly driven through code supplementation; receiving a component editing operation for a virtual component means that code needs to be supplemented specifically for the virtual component to drive the virtual component to achieve more flexible state changes in the virtual scene.

[0055] To illustrate, when a virtual component is initially displayed in a virtual scene, it can perform basic state changes, but not very flexible ones. For example, if the displayed virtual component is virtual object A, before receiving a component editing operation, virtual object A only has a static state and a forward walking state. To give virtual object A richer skin states and action states (such as running forward, running in different directions, etc.), the virtual component needs to be configured more comprehensively based on the component editing operation.

[0056] Among them, the component editing operation is used to edit the component execution code that drives the virtual component.

[0057] Optionally, a code editing function is provided within a client application. This function provides a channel for users to create code. Users can trigger the code editing function to create custom script code for virtual components or even virtual maps. The custom script code created by users can be called User Generated Content (UGC).

[0058] For example, during the operation of a game client, a virtual scene is displayed. Using an object, a custom code editing process can be performed on at least one virtual component within the virtual scene to obtain the component running code corresponding to each virtual component. The component running code is the script code created using the object.

[0059] In some embodiments, code editing operations in the code editor corresponding to the virtual component are treated as component editing operations for the virtual component.

[0060] As an illustration, a code editing area corresponding to the virtual component is pre-displayed around the virtual component. The code editing operation is the operation of entering code in the code editing area.

[0061] In some embodiments, a code editing area corresponding to the virtual component is displayed based on a component triggering operation on the virtual component, and code input operations within the code editing area are received to determine the component's execution code. The component editing operation includes both a component triggering operation and a code input operation.

[0062] The component execution code includes at least one operation code used to drive the state transformation of virtual components in the virtual scene.

[0063] In illustrative terms, state transitions include at least one of several forms, such as action changes, style changes, and state amplitude changes. The implementation of state transitions is usually closely related to the virtual component itself. For example, taking a virtual component as a virtual object, state transitions may include changing from a static state to a running state, or from white skin to yellow skin, etc., without limitation.

[0064] Indicatively, the component execution code is used to drive virtual components to achieve state transitions in a virtual scene, and the component execution code includes at least one operation code to achieve the purpose of state transition through at least one operation code.

[0065] In illustrative terms, an operation code (OpCode) is a binary code representing the basic type of operation to be performed (such as data processing or data transfer). An opcode, together with operands, is called a code instruction. Operands are the parts that work with the opcode, representing the data that the opcode operates on or the storage location of that data. A code instruction typically includes at least one opcode and at least one operand executed by each opcode.

[0066] Step 230: When the execution component runs the code to drive the virtual component, display the component performance information corresponding to the virtual component.

[0067] To illustrate, after obtaining the component's runtime code, the virtual component can be driven to change states in the virtual scene by executing the runtime code. During the execution of the runtime code, the code execution status can be detected, and the corresponding component performance information can be obtained for rendering and display.

[0068] Optionally, when the code creator writes the component execution code, the component execution code is executed through the terminal corresponding to the code creator to drive the virtual component. The terminal obtains the component performance information of the virtual component and renders and displays it.

[0069] Optionally, the terminal corresponding to the code creator sends the component execution code to the server, which executes the component execution code to drive the virtual component. After obtaining the component performance information of the virtual component, the server sends it to the terminal corresponding to the code creator, thereby rendering and displaying the component performance information on the terminal.

[0070] The component performance information includes operation execution information used to characterize the execution status of the i-th operation code in at least one operation code, where i is a positive integer.

[0071] To illustrate, component performance information can not only show the overall execution status of the component's running code, but also the execution information of at least one operation code in the component's running code. The operation execution information can show the execution status of the component's running code in a more granular way, such as showing the line number of the operation code and the corresponding operation execution information. This helps code creators to accurately locate operation code with large operation execution information (such as representing high performance consumption) based on component performance information, and improve their overall understanding of the component's running code.

[0072] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0073] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0074] In an optional embodiment, taking the analysis of the i-th operation code as an example, the execution cost corresponding to the i-th operation code is obtained, and the line number of the code execution corresponding to the i-th operation code is determined. Then, the component performance information to be displayed is determined by combining the execution cost and the line number. (Illustrative example, such as...) Figure 3 As shown above, Figure 2 Step 230 shown can also be implemented as steps 310 to 330.

[0075] Step 310: During the process of traversing at least one operation code in the execution component's running code, obtain the operation execution cost for the i-th operation code.

[0076] The operation execution cost is used to characterize the sum of resource consumption of the first i operation codes.

[0077] Indicatively, the i-th operation code is any one of at least one operation code. During the process of traversing and executing at least one operation code, each operation code corresponds to a code execution cost. The code execution cost represents the CPU resources consumed in executing the operation code. That is, the code execution cost is used to describe the consumption of at least one of the various resources such as time resources, cache resources, and register resources.

[0078] The operation execution cost corresponding to at least one operation code is obtained by accumulating the code execution cost; optionally, the operation execution cost can be simply referred to as Cost.

[0079] For example, the component's runtime code contains three operation codes: operation code 1, operation code 2, and operation code 3. The execution cost of operation code 1 and operation code 2 is 1 (meaning executing operation code 1 requires 1 resource), and the execution cost of operation code 3 is 2 (meaning executing operation code 3 requires 2 resources). Therefore, the execution cost of operation code 1 is 1 (the execution cost of operation code 1); the execution cost of operation code 2 is 2 (the sum of the execution costs of operation code 1 and operation code 2); and the execution cost of operation code 3 is 4 (the sum of the execution costs of operation code 1, operation code 2, and operation code 3).

[0080] Step 320: Determine the line number of the code execution corresponding to the i-th operation code from the component's running code.

[0081] To illustrate, the component's execution code includes at least one line of code. Each line of code may contain one operation code, multiple operation codes, or no operation code (e.g., a line of code is empty, referred to as null, which means that there is "no value" or an "invalid value" in the operation execution line, such as string name = null; which means that the name variable has no value and does not point to any valid object or string).

[0082] To illustrate, each line of code corresponds to a line number, which is used to uniquely identify the line of code. For example, the line number of the first line of code is 1, the line number of the second line of code is 2, and so on.

[0083] The code execution line number is the sequence number of the code line currently being executed from the component's running code. It can also be understood as the code line number of the currently executing operation code.

[0084] Indicatively, the line number corresponding to the i-th operation code is used to represent the line of code where the i-th operation code is located. During the execution of the component's code, the line number will change in real time. For example, it may change from 1 to 2 to 3, representing the current line of code being processed when the component is executing its code.

[0085] Step 330: Display component performance information based on operation execution cost and code execution line number.

[0086] To illustrate, the operation execution cost corresponding to the i-th operation code and the line number of the code execution corresponding to the i-th operation code are combined to display the operation execution information corresponding to the i-th operation code as component performance information.

[0087] In some embodiments, the correspondence between the operation execution cost corresponding to the i-th operation code and the code execution line number is used as component performance information.

[0088] For example, if the execution cost of the i-th operation code is 23 and the line number of the code execution is 16, then the displayed component performance information will be: 16-23, which means that executing the 16th line of code consumes 16 CPU resources, etc.

[0089] In an optional embodiment, when the operation execution cost reaches a preset cost threshold, the statistical baseline row number corresponding to the i-th operation code and the statistical baseline time corresponding to the i-th operation code are obtained.

[0090] For illustrative purposes, the cost threshold is a pre-set cost value, such as 20 or 50. The cost threshold is used to evaluate the cost of performing an operation.

[0091] Optionally, when accumulating the code execution cost corresponding to at least one operation code and obtaining the operation execution cost corresponding to at least one operation code in real time, the real-time accumulated operation execution cost is compared with a cost threshold to determine whether the operation execution cost has reached the cost threshold.

[0092] In some embodiments, if the execution cost of the operation corresponding to the i-th operation code does not reach the cost threshold, other operation codes after the i-th operation code are executed, and the code execution cost of the operation codes is accumulated during the execution process, thereby updating the value of the operation execution cost in real time.

[0093] In some embodiments, if the execution cost of the operation corresponding to the i-th operation code does not reach the cost threshold, the line number of the code execution corresponding to the i-th operation code is determined, a correspondence between the line number of the code execution and the execution cost is established, and it is used as the component performance information of the virtual component at the execution time so as to be displayed on the terminal screen of the code creator.

[0094] In some embodiments, if the operation execution cost corresponding to the i-th operation code reaches the cost threshold, a preset hook function is called to evaluate the currently acquired operation execution cost, thereby facilitating the extraction of component performance information for display on the terminal screen.

[0095] Indicatively, the pre-defined hook function is a function that obtains additional information based on the i-th operation code to evaluate the operation execution cost. When the operation execution cost corresponding to the i-th operation code reaches the cost threshold, it obtains the statistical baseline row number and the statistical baseline time corresponding to the i-th operation code. The statistical baseline row number and the statistical baseline time are the information that needs to be analyzed when the hook function is called.

[0096] Among them, the statistical baseline line number is used to represent the end line number of the code line that most recently reached the cost threshold, and the statistical baseline time is used to represent the end time of the code line that most recently reached the cost threshold.

[0097] For illustration, the statistical baseline line number is the line number of code determined from the component's running code and used as the benchmark for code line comparison. The statistical baseline line number is less than the code execution line number and usually remains unchanged unless certain conditions are met (these conditions are related to the zeroing process of operation execution cost, which will be introduced below) (distinguishing it from the real-time changes of the code execution line number); the statistical baseline time is the time used as the benchmark for time comparison. The statistical baseline time is less than the execution time and usually remains unchanged unless certain conditions are met (these conditions are also related to the zeroing process of operation execution cost, which will be introduced below) (distinguishing it from the real-time changes of the execution time).

[0098] For illustrative purposes, if the current accumulated operation execution cost has not been zeroed before, the statistical baseline time is usually the start time of the execution of the component running code corresponding to the current virtual component, and the statistical baseline line number is usually the first line of the component running code corresponding to the current virtual component (i.e., 1). If the current accumulated operation execution cost has been zeroed before, the statistical baseline time is the most recent execution time of the component running code when the operation execution cost was zeroed most recently, and the statistical baseline line number is the last line of the code of the operation in the component running code when the operation execution cost was zeroed most recently. The zeroing process will be explained later.

[0099] In an optional embodiment, the cumulative time consumed is obtained based on the statistical baseline time corresponding to the i-th operation code and the execution time corresponding to the i-th operation code.

[0100] For illustration, the difference between the execution time corresponding to the i-th operation code and the statistical baseline time corresponding to the i-th operation code is taken as the cumulative consumption time. The cumulative consumption time represents the time consumed in the process of the cumulative operation execution cost reaching the cost threshold. For example, the cumulative consumption time represents the time consumed in the process of the operation execution cost accumulating from zero to the cost threshold.

[0101] In an optional embodiment, the cumulative number of executed lines is obtained based on the statistical baseline line number and the line number of code execution corresponding to the i-th operation code.

[0102] The cumulative number of executed lines is used to represent the number of lines of code involved in determining the execution cost of at least one operation.

[0103] For illustration, the difference between the code execution line number and the statistical baseline line number is incremented by one to obtain the cumulative execution line number (the reason for incrementing by one is to avoid losing the operation execution code line indicated by the calculation of the statistical baseline line number, and to avoid modifying the operation execution code line indicated by the calculation of the code execution line number). The cumulative execution line number represents the number of operation execution code lines traversed in the process of the cumulative operation execution cost reaching the cost threshold. For example, the cumulative execution line number represents the number of operation execution code lines traversed in the process of the operation execution cost accumulating from zero to the cost threshold.

[0104] In an optional embodiment, based on the cumulative consumption time and the cumulative number of executed lines, the code line execution cost corresponding to at least one operation execution code line is obtained, and component performance information representing the correspondence between the operation execution code line and the code line execution cost is displayed.

[0105] In some embodiments, the quotient of the cumulative time consumed and the cumulative number of lines executed is used as the line execution cost.

[0106] Among them, the line execution cost is used to characterize the average resource consumption of the code that represents the execution operation.

[0107] To illustrate, the quotient between the cumulative time consumed and the cumulative number of lines executed is obtained as the line execution cost. The line execution cost is obtained by accumulating the line execution cost and obtaining the line execution cost corresponding to each of the at least one operation execution code. The line execution cost represents the time resources (such as clock cycles) consumed by each operation execution code line during the execution of the cumulative number of operation execution codes, which are treated as CPU resources. Using the quotient as the line execution cost means that the average value of the consumed CPU resources is used as the consumption situation for each operation code line.

[0108] In some embodiments, for the nth operation execution code line in at least one operation execution code line, the code line execution cost corresponding to the nth operation execution code line is obtained, and the code line execution cost corresponding to each of the at least one operation execution code line is obtained.

[0109] The execution cost of the code line corresponding to the nth operation is used to represent the sum of resource consumption of the first n operation execution lines, where n is a positive integer.

[0110] Indicatively, the nth operation execution line is any one of the at least one operation execution lines. The line execution costs corresponding to each operation execution line are accumulated using a cumulative calculation method to calculate the line execution cost corresponding to the nth operation execution line. Thus, this cumulative calculation method determines the line execution costs corresponding to each of the at least one operation execution lines.

[0111] For example: at least one operation execution code line includes operation execution code line 1, operation execution code line 2, and operation execution code line 3; if the calculated line execution cost is 1, then based on the cumulative calculation process, the line execution cost corresponding to operation execution code line 1 is determined to be 1, the line execution cost corresponding to operation execution code line 2 is 2 (1 is added to 1 in the cumulative process), the line execution cost corresponding to operation execution code line 3 is 3 (2 is added to 1 in the cumulative process), and so on, thereby determining the line execution cost corresponding to at least one operation execution code line.

[0112] As an illustration, considering that in the process of accumulating the execution cost of code lines, at least one operation execution code line may have empty content, which means that there is no opcode in the operation execution code line. It is meaningless to assign a line execution cost to the operation execution code line for cumulative calculation. Therefore, 0 is used as the value for cumulative calculation for operation execution code lines with empty content; the calculated line execution cost is used as the value for cumulative calculation for operation execution code lines with non-empty content.

[0113] For example: at least one line of code for operation execution includes line 1, line 2, line 3, and line 4; wherein the contents of line 1, line 3, and line 4 are not empty, and the contents of line 2 are empty; if the calculated line execution cost is 1, then based on the cumulative calculation process, the line execution cost corresponding to line 1 is determined to be 1, the line execution cost corresponding to line 2 is determined to be 1 (0 is added to 1 during the cumulative process), the line execution cost corresponding to line 3 is determined to be 2 (1 is added to 1 during the cumulative process), the line execution cost corresponding to line 4 is determined to be 3 (2 is added to 1 during the cumulative process), and so on, thereby determining the line execution cost corresponding to each line of code.

[0114] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0115] Optionally, obtain the correspondence between at least one operation execution code line and the code line execution cost; based on the correspondence, obtain component performance information representing the code line execution cost corresponding to at least one operation execution code line respectively, and display the component performance information representing the correspondence between the operation execution code line and the code line execution cost.

[0116] This is illustrative; the correspondence represents a one-to-one relationship between operation execution code lines and their execution costs. For example, after determining the execution cost of at least one operation execution code line based on the above, the component performance information represents the execution cost of that at least one operation execution code line by establishing this correspondence. For instance, component performance information could be: line 35 (operation execution code line) – 38, meaning that the cumulative resource consumption up to line 35 is 38 CPU resources, etc. This is not further specified here.

[0117] In some embodiments, in response to obtaining the code line execution cost corresponding to at least one operation execution code line, the operation execution cost is set to zero, the execution time is updated to the next statistical baseline time, and the code execution line number is updated to the next statistical baseline line number.

[0118] Indicatively, after the operation execution cost reaches the preset cost threshold and the above process is performed, since the correspondence between the operation execution code line and the code line execution cost has been displayed on the terminal interface as component performance information, the operation execution cost can be set to zero to avoid continuous accumulation based on the operation execution cost that has already reached the cost threshold. At the same time, to avoid continuing to use the previous statistical baseline line number and statistical baseline time when executing operation code after the i-th operation code, the execution time and code execution line number collected this time are used as the updated information, so that the execution time is updated to the next statistical baseline time, and the code execution line number is updated to the next statistical baseline line number, thereby facilitating the continued accumulation of a new round of operation execution cost.

[0119] In some embodiments, the execution component runs the (i+1)th operation code in the code.

[0120] To illustrate, after setting the operation execution cost to zero, updating the execution time to the next statistical baseline time, and updating the code execution line number to the next statistical baseline line number, the execution continues with the (i+1)th operation code following the i-th operation code in the component's running code, until all operation code in the component's running code is executed simultaneously with the above performance evaluation.

[0121] For example: In a certain round of code execution evaluation process for the component running code of a virtual component (such as the first round of code execution evaluation process), the current statistical operation execution cost is 21, reaching the cost threshold of 20; the current time is determined to be 15, the code execution line number is 20, the statistical baseline line number is 1, and the statistical baseline time is 0; after obtaining the code line execution cost corresponding to at least one operation execution code line based on the above process, the operation execution cost 23 is set to zero, the statistical baseline line number is updated to the code execution line number 20, the statistical baseline time is updated to the current time 15, and the next round of code execution evaluation process begins; if the accumulated operation execution cost reaches the cost threshold again in the next round of code execution evaluation process, the process can be re-executed until all operation code in the component running code is executed.

[0122] In illustrative terms, by using the process of zeroing out the operation execution cost and updating the statistical baseline time and the number of statistical baseline rows, it is possible to avoid the problem of large computational resource consumption caused by the continuous accumulation of operation execution cost, so as to maintain continuous performance monitoring and improve monitoring efficiency.

[0123] Optionally, the cost threshold may be set to the same value or a different value in each round of code execution evaluation; the cost threshold value may also be adjusted in real time during a code execution evaluation, which is not limited here.

[0124] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0125] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0126] This application describes a method for displaying component performance information by combining operation execution cost and code execution line number. When statistically analyzing the performance information of virtual components, the execution status of operation code within the component's runtime code is specifically considered. By establishing a relationship between code execution line number and operation execution cost to display component performance information, code creators can effectively locate code lines with high operation execution costs based on component performance information. Furthermore, when the operation execution cost reaches a cost threshold, a more targeted correspondence is established between the operation execution code line and its execution cost. This allows code creators to more efficiently locate operation execution code lines with high execution costs, facilitating more efficient modification of the code content at those lines, improving code adjustment efficiency, and motivating code creators to create better code.

[0127] In an optional embodiment, a virtual machine can be used to execute component code and obtain component performance information. The virtual machine can be deployed on a server so that the server runs the component code and obtains component performance information; the virtual machine can also be deployed on a first terminal corresponding to the code creator so that the first terminal runs the component code and obtains component performance information; the virtual machine can also be deployed on a second terminal corresponding to other users so that the second terminal runs the component code and obtains component performance information. (Illustrative example, such as...) Figure 4 As shown, taking the first terminal as the executing entity as an example, the above Figure 2 The illustrated embodiment can also be implemented as follows: steps 410 to 433; wherein, step 431 introduces the content of the server obtaining component performance information, step 432 introduces the content of the first terminal obtaining component performance information, and step 433 introduces the content of the second terminal obtaining component performance information.

[0128] Step 410: Display the virtual components in the virtual scene.

[0129] like Figure 5The image shown is a schematic diagram of the interface for displaying virtual components in a virtual scene.

[0130] In some embodiments, the code creator enters the UGC mode of the game client, clicks to create a new virtual map, creates a virtual component 510 in the virtual map, and then displays the virtual component 510 in the virtual scene corresponding to the virtual map.

[0131] This is illustrative of the concept. Newly created virtual maps contain some pre-defined virtual elements (also called virtual components, but for clarity and to distinguish them from virtual components requiring code editing, we use the term "virtual elements"), such as virtual terrain, virtual buildings, and a main virtual object. Optionally, the pre-defined virtual elements displayed may differ depending on the virtual map created by the code creator. For example, the pre-defined virtual element displayed in a plains virtual map might be virtual grassland, while the basic virtual element displayed in a snow scene virtual map might be virtual snow, etc. This is not a limitation.

[0132] like Figure 5 As shown, unlike the virtual object 520 (preset virtual element) that exists in the virtual map, the virtual component 510 displayed in the virtual map is a virtual object in a blurred state. This virtual state can serve as a prompt for the code creator to perform the code editing process for the virtual component 510, so as to write the corresponding component running code for the virtual component 510.

[0133] Step 420: In response to receiving a component editing operation for the virtual component, display the component running code corresponding to the virtual component.

[0134] In an optional embodiment, a component triggering operation for a virtual component is received, and a code editing interface is displayed; in response to receiving a code input operation on the code editing interface as a component editing operation, the component running code corresponding to the virtual component is displayed.

[0135] The code editing interface is used to edit information about the driving virtual components in the form of code.

[0136] In some embodiments, code creators can open a component editing panel for virtual components and select the code editing function to add component running code to the virtual components, that is: receive component editing operations to display the process of component running code.

[0137] Optionally, the code creator performs a first trigger operation on any area of ​​the virtual component to open the component editing panel. The first trigger operation may include a click operation, a long press operation, a swipe operation, etc. Alternatively, the code creator performs a second trigger operation on a preset trigger area of ​​the virtual component to open the component editing panel. The second trigger operation is a trigger operation performed on the preset trigger area, such as a click operation, a long press operation, a swipe operation, etc., performed on the preset trigger area.

[0138] like Figure 5 As shown, the virtual component 510 displays a preset trigger area 511. If the click operation received on the preset trigger area 511 is taken as a component editing operation, the component editing panel corresponding to the virtual component can be displayed.

[0139] like Figure 6 The diagram shows the interface of the component editing panel, which includes multiple editing functions. These functions can achieve different editing effects; for example, the code editing function is used to edit the code for running the virtual component, and the component style adjustment function is used to configure the component style (color, size, etc.) for the virtual component.

[0140] If you receive a selection for the code editing function in the component editing panel, you can add component execution code to the virtual component in the code editing area of ​​the component editing panel. For example... Figure 6 As shown, the selection operation of the code editing function 610 in the component editing panel is received as a component trigger operation (such as a click operation, long press operation, etc.), and the code editing area 620 corresponding to the virtual component is displayed as a code editing interface; the code input operation of the code editing area 620 is used as a component editing operation to obtain the component running code configured for the virtual component.

[0141] In some embodiments, the code editing interface for editing code for virtual components can also be implemented as a block building interface.

[0142] In a schematic representation, the block-based interface is a visual programming interface achieved by editing blocks. Programming blocks are the basic units used to represent programming logic in visual programming.

[0143] In a schematic way, the block building interface is used to hold the programming blocks selected by the user in visual programming, so that the user can drag, drop, combine, configure and adjust the layout of the programming blocks within the block building interface; programming blocks are graphical elements in visual programming, and different programming blocks represent different concepts and operations in programming, used to implement different logical functions.

[0144] In some embodiments, multiple programming blocks correspond to different block types, where a block type is the type of logical function implemented in visual programming. A programming block can be understood as a data block encapsulating data execution logic; therefore, applying a programming block in the block building interface is the process of adopting that data execution logic. Illustratively, the block type corresponding to a programming block is the logical function type corresponding to the data execution logic, such as: mathematical operation logic function corresponding to a programming block of mathematical operation type, conditional judgment logic function corresponding to a programming block of conditional judgment type, string operation logic function corresponding to a programming block of string operation type, etc.

[0145] The building process based on programming blocks allows for the visual editing of virtual component execution code, reducing the difficulty of editing component execution code. In other words, component execution code can be implemented not only as... Figure 6 The text code shown can also be implemented as a block code based on programming block components; this is not a limitation here.

[0146] The component execution code includes at least one operation code used to drive the state transformation of virtual components in the virtual scene.

[0147] For illustrative purposes, the operation code is abbreviated as opcode. The opcode is a binary code that represents the basic operation type to be performed (such as data processing operation or data transmission operation). Optionally, during the process of traversing and executing at least one operation code by the virtual machine, each operation code will consume CPU resources.

[0148] In an optional embodiment, in response to receiving a code confirmation operation for the component runtime code, a first binding relationship is established between the component runtime code and the virtual component, and a second binding relationship is established between the component runtime code and the first code identifier.

[0149] The first code identifier is used to uniquely identify the component's running code.

[0150] As an illustration, the code confirmation operation is used to confirm the execution code of the currently edited virtual component. For example... Figure 6 As shown, the control trigger operation for the saved control 630 is used as a code confirmation operation, thereby making the code currently displayed in the code editing area 620 the component execution code corresponding to the virtual component.

[0151] In illustrative terms, a virtual component is a component to be edited with code. The virtual scene includes at least one virtual component. For each virtual component, code editing operations can be performed to edit the code of the virtual component, thereby determining the component execution code corresponding to at least one virtual component based on the code confirmation operation.

[0152] Optionally, based on the code confirmation operation, the component execution code written for at least one virtual component is determined, and a first binding relationship is established between the code and the corresponding virtual component. Thus, the unique component execution code corresponding to the virtual component can be determined through the first binding relationship.

[0153] Similarly, the code identifier is used to uniquely represent the component running code edited for the virtual component; a second binding relationship is established between the component running code and the first code identifier, so that the unique first code identifier corresponding to the virtual component can be determined through the first binding relationship.

[0154] For example: after editing the code for virtual component A and receiving a code confirmation operation, determine the component execution code a corresponding to virtual component A; establish a first binding relationship between component execution code a and virtual component A; and establish a second binding relationship between component execution code a and first code identifier 1.

[0155] Virtual components can be uniquely identified using code identifiers, and the corresponding component execution code can be determined using these uniquely identified virtual components. For example, code identifier 1 can uniquely identify virtual component A, and the corresponding component execution code 'a' can be determined using the uniquely identified virtual component A, so that the component execution code can be executed in a targeted manner.

[0156] Step 431: Receive component performance information sent by the server and display the component performance information.

[0157] The server collects component performance information while executing the component's runtime code.

[0158] To illustrate, if the component execution code is executed through the server, the first terminal can send the written component execution code to the server (such as sending it to the backend server corresponding to the first client through the installed first client). Then, the server executes the component execution code to simulate driving the virtual component, and analyzes the code execution performance during the execution process of the component execution code through pre-written performance detection code to obtain component performance information.

[0159] Optionally, the component performance information includes at least one of the following: average frame rate, at least one minimum frame rate, code execution consumption data, and code execution consumption data corresponding to at least one minimum frame rate.

[0160] Indicatively, the average frame rate is used to represent the average frame rate of the virtual component when it implements state changes within a preset time period of the executing component's code. The frame rate represents the number of state screen frames of the virtual component in the virtual scene during state changes within a unit of time (e.g., within 1 second) of the executing component's code. For example, a frame rate of 24 FPS (Frames Per Second) means that 24 state screen frames are displayed within 1 second. The higher the frame rate, the more data the code execution consumes, and the lower the frame rate, the less data the code execution consumes.

[0161] At least one minimum frame rate is used to represent at least one minimum frame rate that is statistically recorded when the virtual component implements state transitions within a preset time period of the execution component's running code; such as the minimum frame rate or the minimum three frame rates, etc., without limitation here.

[0162] Among them, code execution consumption data reflects the resource consumption during code execution; code execution consumption data includes at least one of operation execution cost and code line execution cost, and the methods for obtaining operation execution cost and code line execution cost are detailed in [the relevant section]. Figure 3 The embodiments shown are described in detail and will not be repeated here. When displaying the execution cost of a line of code, the operation execution code line that corresponds to the code line is usually displayed together (i.e., combined as component performance information), which makes it easier for code creators to locate the operation execution code line in a targeted manner.

[0163] The code execution cost data corresponding to at least one minimum frame rate represents the code execution cost data under at least one minimum frame rate, that is, the operation execution cost and / or code line execution cost under at least one minimum frame rate, which will not be elaborated here.

[0164] In addition, various forms of component performance information, such as median cost and average cost, can be displayed based on code execution consumption data, without limitation here.

[0165] The server is also used to run the program logic of the first client and send the logic information generated based on the program logic to the first terminal for rendering and display. The logic information includes at least one of component performance information and screen information.

[0166] In illustrative terms, program logic is the logical part in the first client responsible for executing data processing. The logical information generated based on the program logic is sent to the first terminal for rendering and display to reduce the amount of data processing on the first terminal. For example, the processing of the execution component's running code is executed by the server, so that the server can collect component performance information and send it to the terminal for rendering and display. Similarly, screen information refers to other information that needs to be displayed on the terminal interface, such as the position information of virtual objects, etc., which are not limited here.

[0167] Optionally, the server can be implemented as a physical server or a cloud server. Taking a cloud server as an example and a cloud gaming application as the first client, the following explanation is provided. Since the first client is a cloud gaming application, the first terminal only needs to receive the logical information sent by the cloud server and render and display it. The first terminal does not need to participate in the data processing process, which includes executing component code through the cloud server and collecting component performance information during code execution.

[0168] Step 432: When the virtual component is driven by the execution code of the component on the first terminal, collect component performance information and display the component performance information.

[0169] To illustrate, if the component execution code is executed through the first terminal, the server can send performance testing code for evaluating performance information to the first terminal. The first terminal can execute the component execution code to drive the virtual component, and analyze the code execution performance during the execution process of the component execution code through the performance testing code to obtain component performance information.

[0170] Optionally, the component performance information includes at least one of the following: average frame rate, at least one minimum frame rate, code execution cost data, and code execution cost values ​​corresponding to at least one minimum frame rate.

[0171] Step 433: When the virtual component is driven by the running code of the component on the second terminal, receive the component performance information collected by the second terminal and forwarded by the server, and display the component performance information.

[0172] The second terminal is a terminal other than the first terminal, and the first client is installed on the second terminal. The first terminal can send the component execution code to the server, and the server forwards the component execution code and performance detection code to the second terminal. When the second terminal executes the component execution code to drive the virtual component, it analyzes the code execution performance during the execution process of the component execution code through the performance detection code to obtain component performance information.

[0173] The second terminal can then send the component performance information to the server, which will then forward the information to the first terminal, whereby the component performance information will be rendered and displayed.

[0174] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0175] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0176] This application describes methods for obtaining component performance information through statistics from different entities. Statistical analysis of component performance information via a server helps improve the accuracy of information acquisition; statistical analysis of component performance information via a first terminal can improve the efficiency of information acquisition; and statistical analysis of component performance information via a second terminal helps to obtain more targeted component performance information by focusing on the production environments of other users. Using at least one of the above methods to obtain component performance information (such as using one method or averaging or weighting component performance information obtained from multiple methods to obtain more dimensional information) improves the comprehensiveness and relevance of information display, making it easier for code creators to better edit and adjust the component's running code.

[0177] In an optional embodiment, the virtual scene corresponds to a virtual map. After the code creator writes the component execution code corresponding to at least one of the virtual components, the virtual map is published to the server based on the code confirmation operation, thereby facilitating users to enter the virtual map and play the virtual scene. (Illustrative example, such as...) Figure 7 As shown above, Figure 2 The step 230 shown may be followed by the following step 710.

[0178] Step 710: In response to receiving a code confirmation operation for the component's running code, send a virtual map corresponding to the virtual scene to the server corresponding to the first client.

[0179] The virtual map is used to enter a virtual scene that includes virtual components, and the first client is used to display the virtual scene.

[0180] In some embodiments, the virtual map is a map created by the code creator. The virtual scene corresponding to the virtual map contains at least one virtual component. Based on the process of performing component editing operations on the virtual component, each virtual component corresponds to a component running code. Therefore, if a virtual scene includes multiple virtual components, then a virtual scene corresponds to multiple component running codes.

[0181] like Figure 8As shown, the virtual scene includes multiple virtual components, at least one of which corresponds to a component execution code, such as component execution code 811 of virtual component 810; there may also be virtual components with unedited component execution code, such as virtual component 820, etc., which are not limited here.

[0182] In some embodiments, in response to receiving a code confirmation operation, the correspondence between the virtual component and the component's runtime code is determined; in response to receiving a map construction completion operation, the virtual map is published.

[0183] To illustrate, if a virtual map includes multiple virtual components, a correspondence is established between each virtual component and its corresponding component execution code, thereby determining the component execution code corresponding to each of the multiple virtual components. A map construction completion operation is executed for the virtual scene. If a map save control exists, the trigger operation for the map save control is taken as the map construction completion operation, which represents determining the component execution code of the virtual components contained in the virtual scene corresponding to the virtual map. Based on the map construction completion operation, the virtual map is published so that multiple users under the first client can play the virtual map created by the code creator.

[0184] For example, after the virtual map is successfully published, multiple game users under the first client can find the virtual map they developed themselves based on code editing operations in code development mode, and then play the virtual scene corresponding to the virtual map by clicking on the virtual map.

[0185] In addition, the terminal corresponding to the code creator displays a work management interface, which includes at least one virtual map created by the code creator. This allows the code creator to trigger the virtual map to play the virtual scene corresponding to the virtual map. Furthermore, the code creator can also trigger the virtual map to adjust the component running code of the virtual component within the virtual scene corresponding to the virtual map, so as to improve the operation of the virtual map (i.e., the component running of at least one virtual component).

[0186] In some embodiments, in response to receiving a code confirmation operation, the server receives the component execution code corresponding to the virtual component sent by the terminal, and executes the component execution code to obtain component performance information.

[0187] For example, code verification involves sending the component's execution code to the server for simulated execution and performance evaluation. This helps improve the server's efficiency in obtaining component performance information and also helps to display component performance information on the code creator's terminal more promptly.

[0188] In some embodiments, the server executes code based on a virtual map to simulate driving virtual components and obtain component performance information.

[0189] Optionally, in response to receiving a map construction completion operation, the server receives the component execution code corresponding to the virtual component sent by the terminal, and executes the component execution code to obtain component performance information.

[0190] For example, after determining the component execution code corresponding to at least one virtual component based on the map construction operation, a code set consisting of at least one component execution code is sent to the server. The code set corresponds to the virtual map. The server simulates the execution of at least one component execution code based on the code set and evaluates the component performance information corresponding to each of the at least one component execution code. This helps to avoid the problem of low efficiency caused by interruptions and multiple data transmissions to the server. It also helps the server to simulate the code execution process more realistically based on the virtual map as a whole. Afterwards, the component performance information sent by the server can be displayed on the code creator's terminal, so that the code creator can achieve the purpose of performance evaluation based on the component performance information.

[0191] The component performance information analysis is very comprehensive. It can not only reflect the overall operation of the component's running code, but also reflect the code consumption cost corresponding to at least one line of code in the component's running code through the operation execution information of at least one operation line of code. The server can send the component performance information to the terminal of the code creator, so that the code creator can locate the code with high performance consumption in the component's running code based on the code lines in the component performance information rendered and displayed on the terminal, thereby helping to adjust the component's running code more efficiently.

[0192] In an optional embodiment, in response to receiving a map entry operation for a virtual map, the virtual scene corresponding to the virtual map is displayed; and when executing component running code corresponding to at least one virtual component in the virtual scene, component performance information corresponding to at least one virtual component is displayed.

[0193] In illustrative terms, the map entry operation is the operation of entering a virtual map. Based on the map entry operation, a virtual scene corresponding to the virtual map is displayed. The virtual scene includes at least one virtual component, and each virtual component corresponds to a component execution code. When executing the component execution code corresponding to at least one virtual component, the component performance information corresponding to at least one virtual component is obtained, or the component performance information of any one or more virtual components is selected and rendered and displayed on the screen.

[0194] In an optional embodiment, component execution code corresponding to at least one virtual component in the virtual scene is determined; during the execution of the component execution code to drive at least one virtual component, component performance information corresponding to at least one virtual component is obtained; when the first virtual component in at least one virtual component is displayed in a first style, the first component performance information corresponding to the first virtual component is displayed.

[0195] In illustrative terms, virtual components correspond to component execution code, and component execution code corresponds to code identifiers (or virtual components correspond to code identifiers). If the first terminal monitors performance in real time during the execution of the first client, when executing the component execution code corresponding to at least one virtual component, if the execution reaches the component execution code b corresponding to virtual component B, virtual component B (the first virtual component) can be displayed in a first style, along with the performance information of the first component corresponding to the first virtual component. The first style is different from the second style of other virtual components (virtual components that are not currently being monitored for performance), such as the first style being a highlight style and the second style being a normal style, thereby better displaying the interface effect on the interface of the code creator's first terminal.

[0196] The process of displaying virtual components through the first style can establish a relationship between code execution and interface performance, which helps to strengthen the directionality of component performance information, making it easier for code creators to more specifically determine the virtual components that need code adjustments, and improving code adjustment efficiency.

[0197] In addition, during the execution of the component's running code, at least one of the following event triggering conditions may occur based on the content of the component's running code.

[0198] (1) It is executed when the virtual component is initialized and will be executed after the game ends in the current frame.

[0199] Indicative, such as Figure 9 As shown, in the code execution process of the game client as an example, if the game logic is executed after the current frame starts, it is determined whether there is an event callback; if yes, then step 910 is executed; if not, then steps 920 to 930 are executed.

[0200] Step 910 represents executing the component's execution code after the current frame of the game ends. For example, if the execution code in the virtual component instructs fireworks to bloom, then the fireworks effect will be played after the current frame of the game ends.

[0201] (2) If the component code registers to detect in-game events (such as player death, player being attacked, etc.), it will be executed when the event is triggered.

[0202] Among them, such as Figure 9Steps 920 to 930 shown represent executing the component execution code of the virtual component when a triggering event exists, such as executing the component execution code to play the player's homecoming effect when the player dies.

[0203] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0204] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0205] In an optional embodiment, under the relevant technology, if the client is configured with a UGC code editing function, the user of the terminal that has installed the game client can use the UGC code editing function to achieve the purpose of running code by custom editing components. The user who runs code based on the UGC editing components can also be called a code creator.

[0206] To quantify the performance of custom component code, code creators typically write their own monitoring code. This monitoring code is used to detect the frame rate during the execution of the component's code, in order to evaluate the quality of the code's editing.

[0207] The code creator can execute the component's code execution process on their local device (e.g., if the code creator uses terminal 1 to edit and run the component, then the local device is terminal 1). By detecting the frame rate during the code execution process, a frame rate curve can be displayed on the local device. For example... Figure 10 The diagram shows the frame rate curve, which includes a suggested frame rate baseline of 1010, a non-recommended frame rate baseline of 1020, and a frame rate curve of 1030. If the frame rate curve is near the suggested frame rate baseline of 1010, it means that the current component is running code with a high frame rate and the code execution is good. If the frame rate curve is near the non-recommended frame rate baseline of 1020, it means that the current component is running code with a low frame rate and the code execution is poor.

[0208] However, the detection code created by the code creator can only be executed on the local device to detect the frame rate during the execution of the component's code on the local device, thereby evaluating the quality of the code editing.

[0209] However, the testing environment provided by this client and the production environment executed on other terminals (such as when code creators want the process of running virtual components based on component-based code to be displayed on other terminals) are usually different. Therefore, evaluating the frame rate solely based on the testing environment to determine the execution status of the component-based code involves a significant degree of randomness and is not conducive to code creators' targeted analysis and adjustment of the code. In addition, the frame rate collected by this client can only roughly reflect the overall execution status of the component-based code, and code creators cannot rely solely on it for more accurate results. Figure 7 The frame rate curve shown points to code with low performance (such as low frame rate), which makes it difficult for code creators to efficiently adjust the component's running code, affecting their creative enthusiasm and making it difficult to obtain better component running code to stably drive the virtual component.

[0210] In an optional embodiment, based on the technical problems of the above-mentioned related technologies, a method is provided to include operation execution information for characterizing the execution status of operation code in the detected component performance information, and display the component performance information on the code creator's terminal. This helps the code creator to locate the operation code with problems in the component's running code based on the operation execution information, thereby improving the efficiency of code analysis and adjustment.

[0211] Optionally, taking a game client with a UGC code editing function as an example, if the game client is installed on the terminal, the user of the terminal can use the UGC code editing function to customize and edit the running code of the component. The user who uses the UGC code editing function to run the component can also be called the code creator. The game client communicates with the server, which is usually implemented as the backend server of the game client. The game client can send the running code of the component edited by the code creator to the server. If the server executes the running code of the component to simulate driving the virtual component, the above-mentioned method of obtaining running performance can also be called "a CPU performance evaluation scheme for UGC component running code executing on the server".

[0212] Optionally, the game platform corresponding to the game client can also pre-configure performance detection code; during the execution of the component running code on the server, the server detects the component performance information of the virtual component when driving the virtual component through the performance detection code; or, the terminal of the code creator can detect the component running code to obtain the component performance information, and then render and display the component performance information on its own terminal; or the terminal operated by other terminal users (non-code creators but users of the client) can detect the component running code to obtain the component performance information, and send it to the terminal of the code creator through the server to display the component performance information. This is only an illustrative example, and the subject of obtaining the component performance information is not limited.

[0213] In an optional embodiment, the performance detection process during the execution of component runtime code based on UGC functionality is described as follows.

[0214] like Figure 5 The image shown is a schematic diagram of the interface for displaying virtual components in a virtual scene.

[0215] In some embodiments, the code creator enters the UGC mode of the game client, clicks to create a new virtual map, creates a virtual component 510 in the virtual map, and then displays the virtual component 510 in the virtual scene corresponding to the virtual map.

[0216] In some embodiments, code creators can open a component editing panel for virtual components and select the code editing function to add component running code to the virtual components, that is: receive component editing operations to display the process of component running code.

[0217] Optionally, the code creator performs a first trigger operation on any area of ​​the virtual component to open the component editing panel. The first trigger operation may include a click operation, a long press operation, a swipe operation, etc. Alternatively, the code creator performs a second trigger operation on a preset trigger area of ​​the virtual component to open the component editing panel. The second trigger operation is a trigger operation performed on the preset trigger area, such as a click operation, a long press operation, a swipe operation, etc., performed on the preset trigger area.

[0218] like Figure 5 As shown, the virtual component 510 displays a preset trigger area 511. If the click operation received on the preset trigger area 511 is taken as a component editing operation, the component editing panel corresponding to the virtual component can be displayed.

[0219] like Figure 6 The diagram shows the interface of the component editing panel. It receives selection operations (such as click operations, long press operations, etc.) for the code editing function 610 in the component editing panel, and displays the code editing area 620 corresponding to the virtual component. The code input operation for the code editing area 620 is used as the component editing operation to obtain the component running code configured for the virtual component.

[0220] In some embodiments, the virtual scene corresponding to the newly created virtual map contains at least one virtual component. Based on the process of performing component editing operations on the virtual component, each virtual component corresponds to a component running code. Therefore, if a virtual scene includes multiple virtual components, then a virtual scene corresponds to multiple component running codes.

[0221] Optionally, in response to receiving a code confirmation operation, the correspondence between the virtual object and the component's runtime code is determined; in response to receiving a map construction completion operation, the virtual map is published.

[0222] In some embodiments, in response to receiving a code confirmation operation, the server receives the component execution code corresponding to the virtual component sent by the terminal, and executes the component execution code to obtain component performance information.

[0223] In some embodiments, in response to receiving a map construction completion operation, the server receives the component execution code corresponding to the virtual component sent by the terminal, and executes the component execution code to obtain component performance information.

[0224] The component performance information analysis is very comprehensive. It can not only reflect the overall operation of the component's running code, but also reflect the code consumption cost corresponding to at least one line of code in the component's running code through the operation execution information of at least one operation line of code. The server can send the component performance information to the terminal of the code creator, so that the code creator can locate the code with high performance consumption in the component's running code based on the code lines in the component performance information rendered and displayed on the terminal, thereby helping to adjust the component's running code more efficiently.

[0225] In some embodiments, component performance information includes at least one of various types of information such as average frame rate, minimum frame rate, component code consumption value during global gameplay, and component code consumption value at minimum frame rate.

[0226] In an optional embodiment, taking the execution of component running code by the server as an example, a virtual machine is deployed in the server (e.g., if the component running code is Lua language script code, a Lua virtual machine is used, etc.). The component running code is loaded into the virtual machine, and then the component running code is executed through the virtual machine.

[0227] In some embodiments, at least one operation code included in the execution component's running code is traversed by a virtual machine.

[0228] For illustrative purposes, the operation code, or opcode for short, is a binary code representing the basic operation type to be performed. Optionally, during the process of executing at least one operation code through the virtual machine, each operation code consumes CPU resources.

[0229] CPU resources include various resources such as time resources, cache resources, and register resources. Time resources represent the time consumed by the CPU when executing opcodes. Cache resources are determined based on whether the operands are cached. If the operands are cached, cache resources are consumed less; if the operands are not cached, cache resources are consumed more. Register resources represent the number of register accesses when the opcode executes the operands. More accesses result in more register resources consumed, and fewer accesses result in less register resources consumed.

[0230] Optionally, for any i-th operation code in at least one operation code in the component's running code, the operation execution cost is obtained, whereby the operation execution cost is used to characterize the sum of resource consumption of the first i operation codes.

[0231] In other words, during the process of traversing and executing at least one operation code, each operation code corresponds to a code execution cost. The code execution cost represents the CPU resources consumed in executing the operation code. That is, the code execution cost is used to describe the consumption of at least one of the various resources such as time resources, cache resources, and register resources. The code execution cost is accumulated to obtain the operation execution cost corresponding to the operation code. The operation execution cost can be simply referred to as Cost.

[0232] Optionally, in the simplified performance evaluation mode, "Cost+1" can be used to represent that executing a certain opcode will consume 1 unit of CPU resources. One unit of CPU resources can be a clock cycle or a unit of consumption of other hardware resources. That is, the concept of Cost+1 is actually a hypothetical unit set for the convenience of analyzing and calculating CPU performance overhead. It usually refers to the basic consumption of an opcode, that is, the basic CPU resources required to execute the opcode.

[0233] In illustrative terms, in CPU design or performance evaluation, the execution of code can be measured by the time cycle taken to execute the opcode. Thus, "Cost+1" can be understood as the execution of a certain opcode consuming 1 clock cycle.

[0234] For example, pseudocode represents each OpCode pair as Cost+1: CurrentCost+=1; CurrentCost represents the operation execution cost obtained through the cumulative code execution cost. Each execution of an opcode consumes 1 CPU resource by default. The "1" here is only an illustrative example. The actual CPU resource consumption of the code is more complex and will not be limited here.

[0235] This is illustrative; opcodes for complex operations may consume more CPU resources. If CPU resources are expressed in clock cycles, it means that opcodes for complex operations will consume more clock cycles (requiring more time).

[0236] For example, executing an addition instruction (ADD) might take one clock cycle, so its execution cost is Cost+1. Complex operations (such as multiplication and division) might take multiple clock cycles or more resources, so their execution cost might be Cost+2 or higher.

[0237] Therefore, complex opcodes correspond to larger code execution codes, resulting in a greater cumulative operation execution cost. Thus, it is necessary to determine the operation execution cost more specifically based on complex opcodes.

[0238] For example, the pseudocode representation of a complex opcode with an additional configured execution cost is: ifIsSpecialOpCode(OpCode). { CurrentCost+=GetSpecialOpCodeCost(OpCode) } / / For OpCode OP_CALL, add the function's configuration Cost value. if OpCode==OP_CALL { CurrentCost+=GetFunctionCallCost() } SpecialOpCode represents a special opcode among complex opcodes. Special opcodes are instructions used to identify specific functions. The operation performed by a special opcode may not be a regular processor operation, but rather designed for a special purpose. Ordinary opcodes typically correspond to regular arithmetic, logical, and data transfer operations, while special opcodes are usually used for less common tasks, such as system calls, special control flow operations (such as jumps and exception handling), data encryption, data flow control, and exception management. For special opcodes, GetSpecialOpCodeCost(OpCode) is used to obtain the additional execution cost corresponding to the special opcode. The additional execution cost is the difference between the code execution cost and the default execution cost (e.g., 1). Alternatively, the execution cost corresponding to the special opcode can be directly accumulated; in this case, the default execution cost is not included in the accumulation. This is not a limitation here.

[0239] OP_CALL represents a call opcode (also known as a function call instruction) within a complex opcode set. The call opcode is an instruction used to transfer control flow. In most computer architectures, CALL is a crucial instruction that transfers the execution flow of the current program to the address of a specified function (subroutine), and typically stores the return address (the address of the instruction following the call instruction) on the stack so that it can return after the function finishes execution. For the call opcode, GetFunctionCallCost() is used to obtain the additional execution cost corresponding to the call opcode. The additional execution cost is the difference between the code execution cost and the default execution cost (e.g., 1). Alternatively, the corresponding code execution cost can be directly accumulated for the call opcode; in this case, the default execution cost is not included in the accumulation, and this is not restricted here.

[0240] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0241] In an optional embodiment, during the execution of the component's code, after obtaining the operation execution cost for any i-th operation code, the operation execution cost is compared with a preset cost threshold.

[0242] For illustrative purposes, the cost threshold is a pre-set cost value, such as 20, 50, etc. The cost threshold can be represented as "IntervalCheckCost". The cost threshold is used to evaluate the operation execution cost obtained by accumulating the code execution cost.

[0243] In some embodiments, if the operation execution cost does not reach the cost threshold, the execution of other operation codes after the i-th operation code continues, and the code execution cost of the operation codes is accumulated during the execution process, thereby updating the value of the operation execution cost.

[0244] In some embodiments, if the operation execution cost does not reach the cost threshold, the code execution line number corresponding to the i-th operation code is determined, a correspondence between the code execution line number and the operation execution cost is established, and it is used as the component performance information of the virtual component at the execution time so as to be displayed on the terminal screen of the code creator.

[0245] In some embodiments, if the operation execution cost reaches a cost threshold, a preset hook function is invoked to evaluate the currently acquired operation execution cost, thereby facilitating the extraction of component performance information for display on the terminal screen.

[0246] Optionally, the execution time of the component's running code can be obtained, as well as the line number of the code execution in the component's running code, the statistical baseline line number corresponding to the component's running code, and the statistical baseline time corresponding to the component's running code.

[0247] Here, the execution time is the current time when the execution cost of the operation obtained after executing the i-th operation code reaches the cost threshold, and therefore corresponds to the i-th operation code; the code execution line number is the code line number of the currently executing code determined from the component's running code when the execution cost of the operation obtained after executing the i-th operation code reaches the cost threshold, and therefore corresponds to the i-th operation code, and changes in real time during the execution of the component's running code; the statistical baseline line number is the code line number determined from the component's running code as the benchmark for code line comparison, the statistical baseline line number is less than the code execution line number, and usually remains unchanged unless certain conditions are met (described below, which are related to hook functions); the statistical baseline time is the time used as the benchmark for time comparison, the statistical baseline time is less than the execution time, and usually remains unchanged unless certain conditions are met (described below, which are related to hook functions).

[0248] For illustration purposes, the current time can be represented as CurTime, the line number of code execution can be represented as CurLine, the baseline line number can be represented as StartLine, and the baseline time can be represented as StartTime.

[0249] Optionally, the cumulative time consumed can be obtained based on the execution time and the statistical baseline time.

[0250] For illustrative purposes, the difference between the execution time and the statistical baseline time is used as the cumulative consumption time. The cumulative consumption time represents the time consumed in the process of the cumulative operation execution cost reaching the cost threshold. For example, the cumulative consumption time represents the time consumed in the process of the operation execution cost accumulating from zero to the cost threshold.

[0251] For example, the cumulative time consumed can be expressed as DeltaTime = CurTime - StartTime.

[0252] Optionally, the cumulative number of executed lines can be obtained based on the code execution line number and the statistical baseline line number.

[0253] For illustration, the difference between the code execution line number and the statistical baseline line number is incremented by one to obtain the cumulative execution line number. The cumulative execution line number represents the number of operation execution code lines that have passed through the process of the cumulative operation execution cost reaching the cost threshold. For example, the cumulative execution line number represents the number of operation execution code lines that have passed through the process of the operation execution cost accumulating from zero to the cost threshold.

[0254] For example, the cumulative number of lines executed can be represented as CurLine - StartLine + 1.

[0255] Indicatively, the line of code executed represents the lines of code between the baseline line number and the line number of code executed. Therefore, there are a total of a certain number of lines of code executed between the baseline line number and the line number of code executed. For example: if the baseline line number is 1, it means execution starts from the first line of the component's running code; if the line number of code executed is 5, it means the statistical analysis begins from the fifth line of the component's running code; then the total number of lines of code executed is 5 = (5 - 1 + 1).

[0256] In some embodiments, the code line execution cost corresponding to at least one operation execution code line is obtained based on the cumulative consumption time and the cumulative number of executed lines.

[0257] To illustrate, the quotient between the cumulative time consumed and the cumulative number of lines executed is obtained as the line execution cost. The line execution cost is obtained by accumulating the line execution cost and obtaining the line execution cost corresponding to each of the at least one operation execution code. The line execution cost represents the time resources (such as clock cycles) consumed by each operation execution code line during the execution of the cumulative number of operation execution codes, which are treated as CPU resources. Using the quotient as the line execution cost means that the average value of the consumed CPU resources is used as the consumption situation for each operation code line.

[0258] For example, the line execution cost can be expressed as AvgCost = DeltaTime / (CurLine - StartLine + 1). For example, if the cumulative time DeltaTime is 5ms and the cumulative number of lines executed (CurLine - StartLine + 1) is 5, then the line execution cost for each line of code is 1ms.

[0259] Optionally, the line execution cost corresponding to at least one operation execution line can be obtained by accumulating the line execution cost.

[0260] As an illustration, considering that in the process of accumulating the execution cost of code lines, at least one operation execution code line may have empty content, which means that there is no opcode in the operation execution code line. It is meaningless to assign a line execution cost to the operation execution code line for cumulative calculation. Therefore, 0 is used as the value for cumulative calculation for operation execution code lines with empty content; the calculated line execution cost is used as the value for cumulative calculation for operation execution code lines with non-empty content.

[0261] For example, this process can be represented in pseudocode as follows.

[0262] for line=StartLine to CurLine { if CodeRecord[CurrentCodeId].Line[line]==null { CodeRecord[CurrentCodeId].Line[line]=0 } CodeRecord[CurrentCodeId].Line[line]+=AvgCost } Here, `CodeRecord[CurrentCodeId].Line[line] == null` means that the content of the code line to be executed is empty. In this case, `CodeRecord[CurrentCodeId].Line[line] = 0` is used as the cumulative calculation value for the code line to be executed when the content is empty. If the content of the code line to be executed is not empty, `CodeRecord[CurrentCodeId].Line[line] += AvgCost` is used as the cumulative calculation value for the code line to be executed when the content is not empty.

[0263] In an optional embodiment, a correspondence is obtained between at least one line of code for determining the operation execution cost and the code line execution cost; based on the correspondence, component performance information characterizing the code line execution cost corresponding to each of the at least one line of code for determining the operation execution cost is obtained.

[0264] In illustrative terms, the correspondence represents a one-to-one correspondence between the lines of code executed by an operation and the execution cost of those lines. For example, after determining the execution cost of at least one line of code executed by an operation based on the above content, the component performance information can represent the execution cost of at least one line of code executed by an operation by establishing a correspondence.

[0265] In some embodiments, after obtaining the execution cost of the code line corresponding to at least one operation execution code line, the execution time is updated to the next statistical baseline time, the code execution line number is updated to the next statistical baseline line number, the operation execution cost is set to zero, and the subsequent operation code is executed.

[0266] Indicative, expressed in the following form.

[0267] / / Set StartTime=CurTime: StartTime=CurTime; / / Set StartLine=CurLine: StartLine=CurLine; / / Reset Cost to 0: CurrentCost=0.

[0268] In some embodiments, an initialization process is usually required before performing the above process; the component running code corresponding to each virtual component can be distinguished by a unique code identifier (CodeId). The initialization pseudocode is shown below for illustration.

[0269] / / 1. Initialization function Initialize() { / / Initialize the code record body structure CodeRecord={ CodeId={ Line = Total Cost } } } CodeRecord represents the execution log data of the component's running code; Line is used to indicate that the cost is obtained in an incremental manner.

[0270] As an illustration, the component's code execution process is implemented based on the code identifier CodeId corresponding to the component's code execution, represented as function ExecuteComponentCode(CodeId); the pseudocode of the component's code execution process is shown below.

[0271] / / Record the CodeId of the code to be executed (the code identifier of the component currently being analyzed). CurrentCodeId=CodeId / / Record the current system high-precision time StartTime (statistical baseline time) StartTime=GetHighPrecisionTime() / / Set the check value IntervalCheckCost (cost threshold) for the hook function. IntervalCheckCost=GetIntervalCheckCost() / / Set the current Cost CurrentCost=0 / / Set the current line number of code being executed (StartLine) StartLine = GetCurrentLine() The pseudocode above is merely an illustrative example. The content on running code through a virtual machine and obtaining performance based on the pseudocode above has already been introduced and will not be repeated here.

[0272] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.

[0273] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0274] In the embodiments of this application, in scenarios where server cost and performance are balanced, game players can receive real performance feedback, accurate to the number of lines of code and performance consumption. This allows code creators to improve the game experience of component execution and code writing more effectively based on this feedback. In addition, product development scenarios can also obtain real-time performance data, which makes it easier for game development platforms to accurately locate defects and improve products.

[0275] Figure 11 This is a structural block diagram of an operational performance acquisition apparatus provided in an exemplary embodiment of this application, such as... Figure 11 As shown, the device includes the following parts: Display module 1110 is used to display virtual components in a virtual scene; The display module 1110 is further configured to, in response to receiving a component editing operation for the virtual component, display component running code corresponding to the virtual component, the component running code including at least one operation code for driving the state transformation of the virtual component in the virtual scene; The display module 1110 is further configured to display component performance information corresponding to the virtual component when the component running code is executed to drive the virtual component; the component performance information includes operation execution information used to characterize the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

[0276] In an optional embodiment, the display module 1110 is further configured to, during the process of traversing and executing at least one operation code in the component running code, obtain the operation execution cost for the i-th operation code, the operation execution cost being used to characterize the sum of resource consumption of the first i operation codes; determine the code execution line number corresponding to the i-th operation code from the component running code, the code execution line number being used to characterize the code line where the i-th operation code is located; and display the component performance information based on the operation execution cost and the code execution line number.

[0277] In an optional embodiment, the display module 1110 is further configured to, when the operation execution cost reaches a preset cost threshold, obtain the statistical baseline line number corresponding to the i-th operation code and the statistical baseline time corresponding to the i-th operation code; the statistical baseline line number is used to characterize the end line number of the code line that most recently reached the cost threshold, and the statistical baseline time is used to characterize the end time of the code line that most recently reached the cost threshold; based on the statistical baseline time corresponding to the i-th operation code and the execution time corresponding to the i-th operation code, obtain the cumulative consumption time; take the difference between the statistical baseline line number corresponding to the i-th operation code and the code execution line number as the cumulative execution line number, the cumulative execution line number is used to characterize the number of code lines of at least one operation execution code line participating in determining the operation execution cost; based on the cumulative consumption time and the cumulative execution line number, obtain the code line execution cost corresponding to the at least one operation execution code line respectively, and display the component performance information characterizing the correspondence between the operation execution code line and the code line execution cost.

[0278] In an optional embodiment, the display module 1110 is further configured to obtain a line execution cost based on the cumulative consumption time and the cumulative number of executed lines, wherein the line execution cost is used to characterize the average resource consumption representing the execution of the operation execution code; for the nth operation execution code line in the at least one operation execution code line, obtain the line execution cost corresponding to the nth operation execution code line, and obtain the line execution cost corresponding to each of the at least one operation execution code lines; the line execution cost corresponding to the nth operation execution code line is used to characterize the sum of resource consumption of the first n operation execution code lines, where n is a positive integer.

[0279] In an optional embodiment, the display module 1110 is further configured to, in response to obtaining the code line execution cost corresponding to the at least one operation execution code line respectively, set the operation execution cost to zero; update the execution time to the next statistical baseline time; update the code execution line number to the next statistical baseline line number; and execute the (i+1)th operation code in the component running code.

[0280] In an optional embodiment, the display module 1110 is further configured to obtain component performance information when executing the component running code to drive the virtual component; the component performance information includes at least one of average frame rate, at least one minimum frame rate, code running consumption data, and code running consumption data corresponding to the at least one minimum frame rate, wherein the code running consumption data includes at least one of operation execution cost and code line execution cost; and display the component performance information corresponding to the virtual component.

[0281] In an optional embodiment, the display module 1110 is further configured to, when the first terminal executes the component running code to drive the virtual component, collect the component performance information and display the component performance information corresponding to the virtual component; or, when the second terminal executes the component running code to drive the virtual component, receive the component performance information collected by the second terminal and forwarded by the server, and display the component performance information corresponding to the virtual component; the second terminal is a terminal other than the first terminal, and the first client is installed on the second terminal.

[0282] In an optional embodiment, the server receives component performance information sent by the server, which collects the component performance information while executing the component's running code; the server is used to run the program logic of the first client and send logic information generated based on the program logic to the first terminal for rendering and display, the logic information including at least one of the component performance information and screen information; and displays the component performance information corresponding to the virtual component.

[0283] In an optional embodiment, the display module 1110 is further configured to, in response to receiving a code confirmation operation for the code running the component, send the virtual map corresponding to the virtual scene to the server corresponding to the first client, the virtual map being used to enter the virtual scene including the virtual component.

[0284] In an optional embodiment, the display module 1110 is further configured to, in response to receiving a map entry operation for the virtual map, display the virtual scene corresponding to the virtual map; and, when executing component running code corresponding to at least one virtual component in the virtual scene, display component performance information corresponding to the at least one virtual component.

[0285] In an optional embodiment, the display module 1110 is further configured to determine the component running code corresponding to at least one virtual component in the virtual scene; when the component running code is executed to drive the at least one virtual component, obtain the component performance information corresponding to the at least one virtual component; and when the first virtual component among the at least one virtual components is displayed in a first style, display the first component performance information corresponding to the first virtual component.

[0286] In an optional embodiment, the display module 1110 is further configured to receive a component triggering operation for the virtual component, display a code editing interface, the code editing interface being used to edit information driving the virtual component in the form of code writing; in response to receiving the code input operation on the code editing interface as the component editing operation, displaying the component running code corresponding to the virtual component.

[0287] In an optional embodiment, the display module 1110 is further configured to, in response to receiving a code confirmation operation for the component running code, establish a first binding relationship between the component running code and the virtual component, and establish a second binding relationship between the component running code and a first code identifier; the first code identifier is used to uniquely identify the component running code.

[0288] In summary, by leveraging component performance information, the overall execution status of component code can be displayed. Furthermore, by providing specific operation execution information, the execution status of individual operation code within the component's runtime code can be revealed more effectively. This avoids the problem of only having a general understanding of virtual component execution, which can lead to inefficient adjustments when modifying component runtime code. It also facilitates the efficient location of operation code with performance issues through operation execution information, improving code adjustment efficiency and ultimately enabling code creators to more effectively improve component runtime code, thereby ensuring the driving stability of virtual components in virtual scenarios.

[0289] It should be noted that the operating performance acquisition device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the operating performance acquisition device and the operating performance acquisition method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0290] Figure 12 A structural block diagram of an electronic device 1200 provided in an exemplary embodiment of this application is shown. The electronic device 1200 may be a portable mobile terminal, such as a smartphone, in-vehicle terminal, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The electronic device 1200 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0291] Typically, electronic device 1200 includes a processor 1201 and a memory 1202.

[0292] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0293] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 are used to store at least one instruction, which is executed by the processor 1201 to implement the performance acquisition method provided in the method embodiments of this application.

[0294] In some embodiments, the electronic device 1200 further includes one or more sensors. These sensors include, but are not limited to, proximity sensors, gyroscope sensors, and pressure sensors.

[0295] A proximity sensor, also known as a distance sensor, is typically located on the front panel of an electronic device 1200. The proximity sensor is used to detect the distance between the user and the front of the electronic device 1200.

[0296] The gyroscope sensor can detect the orientation and rotation angle of the electronic device 1200. The gyroscope sensor can work in conjunction with the accelerometer sensor to acquire 3D motion data from the user on the electronic device 1200. Based on the data acquired by the gyroscope sensor, the processor 1201 can perform the following functions: motion sensing (e.g., changing the user interface (UI) based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0297] A pressure sensor can be installed on the side bezel and / or the lower layer of the display screen of the electronic device 1200. When the pressure sensor is installed on the side bezel of the electronic device 1200, it can detect the user's grip signal on the electronic device 1200, and the processor 1201 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor. When the pressure sensor is installed on the lower layer of the display screen, the processor 1201 can control the operable controls on the UI interface based on the user's pressure operation on the display screen. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0298] In some embodiments, the electronic device 1200 also includes other component parts, as those skilled in the art will understand. Figure 12 The structure shown does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0299] Embodiments of this application also provide a computer device, which can be implemented as a terminal or a server. The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the performance acquisition method provided in the above-described method embodiments.

[0300] The embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the runtime performance acquisition method provided in the above-described method embodiments.

[0301] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the performance acquisition methods described in the above embodiments.

[0302] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0303] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk. The above descriptions are merely optional embodiments of this application and are not intended to limit the application. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for obtaining runtime performance, characterized in that, The method includes: Display virtual components in a virtual scene; Receive a component trigger operation for the virtual component and display a code editing interface, which is used to edit the information driving the virtual component in the form of code writing; The code editing interface displays the component execution code corresponding to the virtual component, and the component execution code includes at least one operation code for driving the state transformation of the virtual component in the virtual scene; When the component execution code drives the virtual component, the component performance information corresponding to the virtual component is displayed; the component performance information includes operation execution information used to characterize the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

2. The method according to claim 1, characterized in that, The step of displaying the component execution code corresponding to the virtual component on the code editing interface includes: In response to receiving a component editing operation for the virtual component on the code editing interface, the component running code corresponding to the virtual component is displayed.

3. The method according to claim 2, characterized in that, The response to receiving a component editing operation for the virtual component on the code editing interface, and displaying the component execution code corresponding to the virtual component, includes: In response to receiving a code input operation on the code editing interface as a component editing operation, the component's running code in text code form corresponding to the virtual component is displayed.

4. The method according to claim 2, characterized in that, The step of receiving a component-triggered operation for the virtual component and displaying a code editing interface includes: Receive the component trigger operation for the virtual component, and display the block building interface as the code editing interface. The block building interface is an interface for visual programming implemented through programming blocks. The programming blocks are the basic units used to represent programming logic in visual programming. The response to receiving a component editing operation for the virtual component on the code editing interface, and displaying the component execution code corresponding to the virtual component, includes: In response to receiving a layout adjustment operation of the programming blocks within the block building interface as a component editing operation, the component running code in the form of block code corresponding to the virtual component is displayed.

5. The method according to any one of claims 1 to 4, characterized in that, When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: When the virtual component is driven by the execution of the component running code, the virtual component is displayed to perform the state transformation in the virtual scene, and the component performance information corresponding to the virtual component is displayed. The state transformation includes at least one of a variety of forms such as action change, style change, and state amplitude change.

6. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Display the work management interface, which includes at least one virtual map created by the code creator; In response to receiving a map entry operation for the virtual map, the virtual scene corresponding to the virtual map is displayed.

7. The method according to claim 6, characterized in that, When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: When executing the component execution code corresponding to at least one virtual component in the virtual scene, display the component performance information corresponding to the at least one virtual component.

8. The method according to claim 6, characterized in that, The virtual components displayed in the virtual scene include: The virtual map displays virtual elements in their physical state and virtual elements in their blurred state. The blurred state is used to prompt the code creator to perform code editing for the virtual component. The step of receiving a component-triggered operation for the virtual component and displaying a code editing interface includes: Receive the component trigger operation for the virtual component in the virtual state, and display the code editing interface.

9. The method according to claim 6, characterized in that, The method further includes: The system receives a code adjustment operation on the component's running code, the code adjustment operation being used to adjust the component running status of at least one virtual component in the virtual map.

10. The method according to any one of claims 1 to 4, characterized in that, When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: During the process of traversing and executing at least one operation code in the component's running code, for the i-th operation code, the operation execution cost is obtained, and the operation execution cost is used to characterize the sum of resource consumption of the first i operation codes; The code execution line number corresponding to the i-th operation code is determined from the component's running code, and the code execution line number is used to represent the code line where the i-th operation code is located; The component performance information is displayed based on the operation execution cost and the code execution line number.

11. The method according to claim 10, characterized in that, The method of displaying component performance information based on the operation execution cost and the code execution line number includes: When the cost of the operation reaches a preset cost threshold, obtain the statistical baseline line number corresponding to the i-th operation code and the statistical baseline time corresponding to the i-th operation code; the statistical baseline line number is used to represent the end line number of the code line that most recently reached the cost threshold, and the statistical baseline time is used to represent the end time of the code line that most recently reached the cost threshold. Based on the statistical baseline time corresponding to the i-th operation code and the execution time corresponding to the i-th operation code, the cumulative consumption time is obtained; The difference between the statistical baseline line number corresponding to the i-th operation code and the code execution line number is used as the cumulative execution line number, which is used to characterize the number of code lines of at least one operation execution code line involved in determining the operation execution cost; Based on the cumulative consumption time and the cumulative number of executed lines, obtain the line execution cost corresponding to each of the at least one operation execution line, and display the component performance information representing the correspondence between the operation execution line and the line execution cost.

12. The method according to claim 11, characterized in that, The step of obtaining the code line execution cost corresponding to each of the at least one operation execution code line based on the cumulative consumption time and the cumulative number of executed lines includes: Based on the cumulative consumption time and the cumulative number of lines executed, the line execution cost is obtained, which is used to characterize the average resource consumption of executing the operation code; For the nth operation execution code line in the at least one operation execution code line, obtain the code line execution cost corresponding to the nth operation execution code line, and obtain the code line execution cost corresponding to each of the at least one operation execution code lines; the code line execution cost corresponding to the nth operation execution code line is used to characterize the sum of resource consumption of the first n operation execution code lines, where n is a positive integer.

13. The method according to claim 10, characterized in that, The method further includes: In response to obtaining the code line execution cost corresponding to the at least one operation execution code line, the operation execution cost is set to zero; and the execution time is updated to the next statistical baseline time, and the code execution line number is updated to the next statistical baseline line number; Execute the (i+1)th operation code in the component's runtime code.

14. The method according to any one of claims 1 to 4, characterized in that, When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: When the component execution code drives the virtual component, the component performance information is obtained; the component performance information includes at least one of average frame rate, at least one minimum frame rate, code execution consumption data, and code execution consumption data corresponding to the at least one minimum frame rate, and the code execution consumption data includes at least one of operation execution cost and code line execution cost. Displays the component performance information corresponding to the virtual component.

15. The method according to any one of claims 1 to 4, characterized in that, The method is executed by a first terminal, and a first client installed on the first terminal communicates with the server. When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: When the first terminal executes the component running code to drive the virtual component, the component performance information is collected and the component performance information corresponding to the virtual component is displayed. or, When the second terminal executes the component running code to drive the virtual component, it receives the component performance information collected by the second terminal and forwarded by the server, and displays the component performance information corresponding to the virtual component; the second terminal is a terminal other than the first terminal, and the first client is installed on the second terminal.

16. The method according to any one of claims 1 to 4, characterized in that, The method is executed by a first terminal, and a first client installed on the first terminal communicates with the server. When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: The server receives component performance information sent by the server, and the server collects the component performance information while executing the component's running code; the server is used to run the program logic of the first client and send the logic information generated based on the program logic to the first terminal for rendering and display, and the logic information includes at least one of the component performance information and screen information; Displays the component performance information corresponding to the virtual component.

17. The method according to any one of claims 1 to 4, characterized in that, After displaying the component execution code corresponding to the virtual component on the code editing interface, the process further includes: In response to receiving a code confirmation operation for the code running the component, a virtual map corresponding to the virtual scene is sent to the server corresponding to the first client. The virtual map is used to enter the virtual scene including the virtual component.

18. The method according to any one of claims 1 to 4, characterized in that, When the virtual component is driven by the execution code of the component, the display of component performance information corresponding to the virtual component includes: Determine the component execution code corresponding to at least one virtual component in the virtual scene; When the component execution code drives the at least one virtual component, the component performance information corresponding to the at least one virtual component is obtained respectively; When the first virtual component among the at least one virtual components is displayed in a first style, the performance information of the first component corresponding to the first virtual component is displayed.

19. The method according to any one of claims 1 to 4, characterized in that, The method further includes: In response to receiving a code confirmation operation for the component's running code, a first binding relationship is established between the component's running code and the virtual component, and a second binding relationship is established between the component's running code and a first code identifier; the first code identifier is used to uniquely identify the component's running code.

20. A device for acquiring operational performance, characterized in that, The device includes: The display module is used to display virtual components in the virtual scene; The display module is further configured to receive component triggering operations for the virtual component, display a code editing interface, the code editing interface being used to edit information driving the virtual component in the form of code writing; and display component running code corresponding to the virtual component on the code editing interface, the component running code including at least one operation code for driving the state transformation of the virtual component in the virtual scene; The display module is further configured to display component performance information corresponding to the virtual component when the component execution code drives the virtual component; the component performance information includes operation execution information used to characterize the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

21. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the performance acquisition method as described in any one of claims 1 to 19.

22. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the runtime performance acquisition method as described in any one of claims 1 to 19.

23. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the performance acquisition method as described in any one of claims 1 to 19.