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

By displaying virtual components and their running code in a virtual scene and providing operation execution information, the problem of low efficiency in positioning and tuning of virtual components is solved, and the code adjustment efficiency and stability of virtual components are improved.

CN119690537AActive Publication Date: 2025-03-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411758168.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-25
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently locate and adjust the performance problems of virtual components in virtual scenarios, resulting in low code adjustment efficiency.

Method used

By displaying virtual components in a virtual scene and their running code, and providing operation execution information when executing the code, helping code creators analyze and adjust code more targetedly.

Benefits of technology

It improves the efficiency of code adjustment, helps code creators to position and solve performance problems more accurately, thereby ensuring the stable operation of virtual components in virtual scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690537A_ABST
    Figure CN119690537A_ABST
Patent Text Reader

Abstract

The invention discloses an operation performance obtaining method and device, equipment, a storage medium and a program product, and relates to the technical field of computers. 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 can be displayed in a more 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 and the device can be applied to various scenes supporting code creation, such as social media scenes, game content creation scenes, programming learning scenes and multimedia sharing scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device, storage medium and program product for obtaining operating performance. Background Art

[0002] 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 programming and writing code.

[0003] In the related technology, in order to count the execution status of the written code, the code creator can write the script code based on the UGC method, and at the same time, write an additional frame rate statistics code to detect the running frame rate when the script code is executed on this side, and use the running frame rate as the running status of the script code.

[0004] However, the above method 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 code location of the problem in the script code based on the running frame rate, which affects the efficiency of code adjustment and repair. Summary of the invention

[0005] The embodiments of the present application provide a method, device, equipment, storage medium and program product for obtaining operation performance, which can more specifically display the execution status of operation codes in component operation codes through operation execution information, thereby helping to efficiently locate operation codes with performance problems, improve code adjustment efficiency, and ensure the driving stability of virtual components in virtual scenes. The technical solution is as follows.

[0006] In one aspect, a method for obtaining operating performance is provided, the method comprising:

[0007] Display virtual components in a virtual scene;

[0008] In response to receiving a component editing operation for the virtual component, displaying a component running code corresponding to the virtual component, the component running code including at least one operation code for driving a state transformation of the virtual component in the virtual scene;

[0009] When the component running code is executed to drive the virtual component, component performance information corresponding to the virtual component is displayed; the component performance information includes operation execution information for characterizing the execution status of the i-th operation code in the at least one operation code, where i is a positive integer.

[0010] In another aspect, a running performance acquisition device is provided, the device comprising:

[0011] A display module, used for displaying virtual components in a virtual scene;

[0012] The display module is further configured to display a component running code corresponding to the virtual component in response to receiving a component editing operation for the virtual component, wherein the component running code includes at least one operation code for driving a state transformation of the virtual component in the virtual scene;

[0013] The display module is also used to display component performance information corresponding to the virtual component when executing the component running code 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.

[0014] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the operating performance acquisition method as described in any of the above-mentioned embodiments of the present application.

[0015] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and 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 operating performance acquisition method as described in any of the above-mentioned embodiments of the present application.

[0016] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the operating performance acquisition methods described in the above embodiments.

[0017] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0018] Based on the component editing operation of the virtual component in the virtual scene, the component running code corresponding to the virtual component is displayed, so that when the component running code is executed to drive the virtual component, the component performance information including the operation execution information of the operation code is displayed. With the help of the component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that the code creator can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a structural block diagram of an acquisition system provided by an exemplary embodiment of the present application;

[0021] Figure 2 is a flow chart of a method for obtaining operating performance provided by an exemplary embodiment of the present application;

[0022] Figure 3 is a flow chart of a method for obtaining operating performance provided by another exemplary embodiment of the present application;

[0023] Figure 4 is a flow chart of a method for obtaining operating performance provided by another exemplary embodiment of the present application;

[0024] Figure 5 is a schematic diagram of an interface of a virtual scene provided by an exemplary embodiment of the present application;

[0025] Figure 6 is a schematic diagram of an interface of a component editing panel provided by an exemplary embodiment of the present application;

[0026] Figure 7 is a flowchart of playing a virtual scene based on a virtual map provided by an exemplary embodiment of the present application;

[0027] Figure 8 It is a schematic diagram of the correspondence between a virtual component and a component running code provided by an exemplary embodiment of the present application;

[0028] Fig. 9 is an event callback flow chart provided by an exemplary embodiment of the present application;

[0029] Fig.10 is a schematic diagram of a frame rate curve of a related technology provided by an exemplary embodiment of the present application;

[0030] Fig.11 is a structural block diagram of an operating performance acquisition device provided by an exemplary embodiment of the present application;

[0031] Fig.12 It is a structural block diagram of a terminal provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0033] First, a brief introduction is given to the terms involved in the embodiments of the present application.

[0034] Virtual scene: a virtual scene displayed (or provided) when an application is running on a terminal. The virtual scene can be a simulation of a real scene, a semi-simulation and semi-fictitious scene, or a purely fictitious scene. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, and a three-dimensional virtual scene, and this application does not limit this. The following embodiments are illustrated by taking a three-dimensional virtual scene as an example.

[0035] Virtual components: are elements used in virtual scenes to imitate real scenes. Exemplarily, virtual components occupy a certain volume in virtual scenes. Exemplarily, virtual components include: virtual terrain, virtual buildings, virtual plants and animals, virtual props, virtual vehicles, virtual objects, etc. For example, virtual terrain includes: ground, mountains, water, stones, steps, etc.; virtual buildings include: houses, walls, containers, and fixed facilities inside buildings: tables, chairs, cabinets, beds, etc.; virtual plants and animals include: trees, flowers, birds, etc.; virtual props include: virtual attack props, medicine boxes, airdrops, etc.; virtual vehicles include: cars, ships, helicopters, etc.; virtual objects include: people, animals, cartoon characters, etc.

[0036] In related technologies, in order to count the execution status of the written code, the code creator can write the script code based on the UGC method, and at the same time, write the frame rate statistics code 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. However, the above method 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 code location of the problem in the script code based on the running frame rate, which affects the efficiency of code adjustment and repair.

[0037] In the embodiment of the present application, a method for obtaining operation performance is introduced, which can more specifically display the execution status of the operation code in the component operation code through the operation execution information, thereby helping to efficiently locate the operation code with performance problems, improve the efficiency of code adjustment, and ensure the driving stability of the virtual component in the virtual scene. The method for obtaining operation performance proposed in the embodiment of the present application can be applied to a variety of scenarios that support code creation, such as social media scenarios, game content creation scenarios, programming learning scenarios, multimedia sharing scenarios, etc., which are not limited here.

[0038] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant regions.

[0039] Secondly, the acquisition system involved in the embodiment of the present application is described. The operation performance acquisition method provided in the embodiment of the present application can be implemented by the terminal alone, or by the server, or by the terminal and the server through data interaction, which is not limited in the embodiment of the present application. Optionally, the operation performance acquisition method is described by taking the interaction between the terminal and the server as an example.

[0040] For illustration, please refer to Figure 1 The acquisition system involves a terminal 110 and a server 120 , and the terminal 110 and the server 120 are connected via a communication network 130 .

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

[0042] Illustratively, a virtual component is a component in a virtual scene to be driven by code editing, such as a virtual object, a virtual vehicle, and the like.

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

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

[0045] Illustratively, a virtual component is a component to be driven by code editing. If a component editing operation is performed on a virtual component, it means that a code creator using terminal 110 writes a component running code for the virtual component to drive its state change.

[0046] Optionally, a long press operation on a virtual component is used as a component editing operation; or a position trigger operation on a preset component position in the virtual component is used as a component editing operation, etc.

[0047] The component running code includes at least one operation code for driving the state change of the virtual component in the virtual scene.

[0048] Schematically, the component running code is composed of at least one operation code, which is the smallest unit operation that can be executed by a computer processor (Central Processing Unit, CPU); usually 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 register, etc.), control flow operations (such as jumps, branches, loops, etc.), etc.; at least one operation code is integrated to drive the virtual component to realize state changes in the virtual scene.

[0049] State changes include changes in motion state (such as from still to running, etc.), component posture changes (such as from standing to squatting, etc.), component position changes (such as teleporting from A to B, etc.). The state changes of virtual components in the virtual scene are not limited here.

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

[0051] The component performance information includes operation execution information for characterizing the execution status of the ith operation code in the at least one operation code, where i is a positive integer, and the ith operation code is any one operation code in the at least one operation code.

[0052] Optionally, when terminal 110 executes component running code to drive a virtual component, 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 finer-grained operation execution information as component performance information, thereby presenting a more detailed code running status to the code creator.

[0053] Optionally, the terminal 110 sends the component running code written by the code creator to the server 120 through the communication network, and the server 120 executes the component running code to simulate driving the virtual component in the virtual scene, thereby obtaining component performance information including operation execution information corresponding to the operation code, and sends the component performance information to the terminal 110 through the communication network 130, so that the terminal 110 renders and displays the component performance information of the virtual component on the terminal screen.

[0054] In some embodiments, the code creator of the operation terminal 110 can, based on the operation execution information of the i-th operation code in the displayed component performance information, specifically determine the operation code that may have large consumption problems when executing the component running code, thereby helping to achieve the purpose of accurately locating at least one operation code in the component running code, improving the targetedness and efficiency of code adjustment, ensuring the code creator's component running code writing experience, and also helping to ensure the operating stability of virtual components in virtual scenes.

[0055] It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, etc., and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent physical servers, dedicated servers (Dedicate Server), etc., or they can be server clusters or distributed systems composed of multiple physical servers, or they can also be cloud servers.

[0056] In combination with the above-mentioned noun introduction and application scenarios, the operating performance acquisition method provided by the present application is described, and the method is applied to a terminal as an example. Figure 2 As shown, the method includes the following steps 210 to 230.

[0057] Step 210: display the virtual components in the virtual scene.

[0058] Schematically, a virtual scene is a scene created in a computer-generated virtual environment or simulated space, and the virtual scene is usually digital.

[0059] Optionally, the virtual scene is a scene displayed on the terminal. For example, a client is installed on the terminal, and the client is an application running on the terminal, responsible for processing user input, rendering graphics, playing sound effects, etc.; the virtual scene is displayed during the process of the terminal running the client.

[0060] Optionally, the virtual scene is a scene displayed based on virtual reality (VR) technology, and the user can observe and interact with the virtual scene through a VR device (such as a head-mounted display, a handle, a motion capture device, etc.), thereby isolating the virtual scene of the VR scene from the real world.

[0061] Optionally, the virtual scene is a scene displayed based on augmented reality (AR) technology, which is a technology that superimposes virtual elements (such as images, text, three-dimensional models, etc.) onto a view of the real world. Unlike virtual reality technology, AR technology does not require the user to completely enter the virtual world, but rather enhances the user's perception of the real world and displays the virtual view in the real world as a virtual scene through a screen (such as a smart phone, AR glasses, etc.).

[0062] Schematically, virtual components are elements, objects, etc. that constitute virtual scenes. Virtual components are usually implemented as digital objects such as graphics, virtual objects, and virtual objects. Virtual components exist in virtual scenes, and users can see virtual components and interact with them.

[0063] In some embodiments, the virtual component is an element pre-displayed in the virtual scene.

[0064] Illustratively, when a virtual scene is constructed, at least one virtual component is pre-set, such as the at least one virtual component includes a virtual object A1, a virtual object A2, a virtual building B1, a virtual pet P1, a virtual pet P2, etc. The virtual component is any one of the at least one virtual component.

[0065] In some embodiments, a virtual component is an element displayed based on a component creation operation.

[0066] Illustratively, when the virtual scene is constructed, no virtual components are pre-set or other virtual components are set, and the component creation operation is an operation used to specifically create virtual components in the virtual scene; if the component creation operation is received when the virtual scene is displayed, the created virtual component can be displayed in the virtual scene based on the component creation operation.

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

[0068] Step 220 : In response to receiving a component editing operation for a virtual component, displaying a component execution code corresponding to the virtual component.

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

[0070] Schematically, when a virtual component is initially displayed in a virtual scene, the virtual component cannot achieve state transformation in the virtual scene. For example, the displayed virtual component is virtual object A, which is only in a static virtual state before receiving a component editing operation. The skin, expression, posture, and action 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.

[0071] Optionally, the virtual component is a component in the virtual scene to be flexibly driven by code supplementation; receiving a component editing operation for the virtual component means that the 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.

[0072] Schematically, when a virtual component is initially displayed in a virtual scene, the virtual component can realize basic state transformation in the virtual scene, but cannot realize more flexible state transformation. For example, the displayed virtual component is virtual object A, which only has a static state and a forward walking state before receiving a component editing operation. In order to make virtual object A have richer skin states, action states (such as forward running, changing direction running, etc.), etc., it is necessary to configure the virtual component more richly based on the component editing operation.

[0073] The component editing operation is an operation for editing the component running code that drives the virtual component.

[0074] Optionally, a code editing function is provided in a client, and the code editing function is used to provide a channel for code creation for users of the client; the users can trigger the code editing function to customize the script code of virtual components and even virtual maps. The script code customized by the users can be called user generated content (UGC).

[0075] For example, when a game client is running, a virtual scene is displayed. The user object can perform a customized code editing process on at least one virtual component in the virtual scene to obtain component running codes corresponding to at least one virtual component. The component running code is the script code created by the user object.

[0076] In some embodiments, a code editing operation in a code editing bar corresponding to a virtual component is used as a component editing operation for the virtual component.

[0077] Schematically, a code editing area corresponding to the virtual component is pre-displayed around the virtual component, and the code editing operation is an operation of inputting a code in the code editing area.

[0078] In some embodiments, based on a component triggering operation on a virtual component, a code editing area corresponding to the virtual component is displayed, and a code input operation is received in the code editing area to determine the component running code. The component editing operation includes a component triggering operation and a code input operation.

[0079] The component running code includes at least one operation code for driving the state change of the virtual component in the virtual scene.

[0080] Schematically, the state change includes at least one of the various forms such as action change, style change, state amplitude change, etc., and the implementation of the state change is usually closely related to the virtual component itself. For example, taking the virtual component as a virtual object, the state change is such as changing from a stationary state to a running state, from white skin to yellow skin, etc., which is not limited here.

[0081] Illustratively, the component running code is used to drive the virtual component in the virtual scene to achieve state change, and the component running code includes at least one operation code to achieve the purpose of state change through the at least one operation code.

[0082] Schematically, an operation code can be referred to as an operation code (Operation Code, OpCode). An operation code is a binary code that indicates the basic operation type to be performed (such as data processing operation, data transmission operation); an operation code is usually combined with an operand to be called a code instruction, where the operand is a part that cooperates with the operation code and indicates the data or the storage location of the data that the operation code acts on. A code instruction usually includes at least one operation code and at least one operand executed by each operation code.

[0083] Step 230 , when the execution component runs the code to drive the virtual component, the component performance information corresponding to the virtual component is displayed.

[0084] In schematic form, after obtaining the component running code, the virtual component can be driven to change its state in the virtual scene by executing the component running code, and the code execution status can be detected during the execution of the component running code, and the component performance information corresponding to the virtual component can be obtained for rendering and display.

[0085] Optionally, when a component running code is written by a code creator, the component running code is executed through a terminal corresponding to the code creator to drive a virtual component, and the terminal obtains component performance information of the virtual component and renders and displays it.

[0086] Optionally, the terminal corresponding to the code creator sends the component running code to the server, and the server executes the component running code to drive the virtual component. The server obtains the component performance information of the virtual component and sends it to the terminal corresponding to the code creator, thereby rendering and displaying the component performance information on the terminal.

[0087] The component performance information includes operation execution information for characterizing the execution status of the i-th operation code in at least one operation code, where i is a positive integer.

[0088] In schematic form, component performance information can not only display the overall execution status of the component running code, but also display the operation execution information of at least one operation code in the component running code. The operation execution information can display the execution status of the component running code in a more fine-grained manner, such as displaying the number of code lines corresponding to the operation code and the corresponding operation execution information, thereby helping code creators to accurately locate operation codes with larger operation execution information (such as those representing higher consumption performance) based on the component performance information, thereby improving the overall grasp of the component running code.

[0089] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0090] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0091] In an optional embodiment, taking the analysis of the i-th operation code as an example, the operation execution cost corresponding to the i-th operation code is obtained, and the code execution line number corresponding to the i-th operation code is determined, so as to determine the component performance information to be displayed by combining the operation execution cost and the code execution line number. Figure 3 As shown above Figure 2 The illustrated step 230 may also be implemented as the following steps 310 to 330 .

[0092] Step 310 : in the process of traversing at least one operation code in the execution component running code, obtaining the operation execution cost for the i-th operation code.

[0093] The operation execution cost is used to represent the sum of resource consumption of executing the first i operation codes.

[0094] Illustratively, the i-th operation code is any one of at least one operation code. In 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 by executing the operation code, that is, the code execution cost is used to describe the consumption of at least one of multiple resources such as time resources, cache resources, and register resources.

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

[0096] For example: there are 3 operation codes in the component running code, namely operation code 1, operation code 2, and operation code 3; the code execution cost of operation code 1 and operation code 2 are both 1, that is, executing operation code 1 requires 1 resource, and executing operation code 2 requires 1 resource. The code execution cost of operation code 3 is 2, that is, executing operation code 3 requires 2 resources; the operation execution cost corresponding to operation code 1 is 1 (the execution cost of operation code 1); the operation execution cost corresponding to operation code 2 is 2 (the sum of the execution costs of operation code 1 and operation code 2); the operation execution cost corresponding to operation code 3 is 4 (the sum of the execution costs of operation code 1, operation code 2, and operation code 3).

[0097] Step 320: determine the code execution line number corresponding to the i-th operation code from the component running code.

[0098] Schematically, the component running code includes at least one code line, each code line may include one operation code, may include multiple operation codes, or may include no operation code (for example, the content of the code line is empty, referred to as null, which means that there is "no value" or "invalid value" in the operation execution code line, such as string name = null; it means that the name variable has no value and it does not point to any valid object or string).

[0099] Schematically, each code line corresponds to a code line number, and the code line number is used to uniquely identify the code line, such as the code line number of the first code line is 1, the code line number of the second code line is 2, and so on.

[0100] The code execution line number is the code line number of the currently executing code determined from the component running code, and can also be understood as the code line number of the code line where the currently executing operation code is located.

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

[0102] Step 330 , display component performance information based on the operation execution cost and the code execution line number.

[0103] In an illustrative manner, the operation execution cost corresponding to the ith operation code and the code execution line number corresponding to the ith operation code are integrated to display the operation execution information corresponding to the ith operation code as the component performance information.

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

[0105] For example, if the operation execution cost corresponding to the i-th operation code is 23 and the code execution line number is 16, the component performance information displayed is: 16-23, which means that 16 CPU resources are consumed when executing to the 16th line of code.

[0106] In an optional embodiment, when the operation execution cost reaches a preset cost threshold, the statistical reference line number corresponding to the ith operation code and the statistical reference time corresponding to the ith operation code are obtained.

[0107] Illustratively, the cost threshold is a preset cost value, such as 20, 50, etc. The cost threshold is used to evaluate the cost of executing an operation.

[0108] Optionally, when the code execution cost corresponding to at least one operation code is accumulated and the operation execution cost corresponding to at least one operation code is obtained in real time, the operation execution cost accumulated and determined in real time is compared with the cost threshold to determine whether the operation execution cost reaches the cost threshold.

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

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

[0111] In some embodiments, if the operation execution cost corresponding to the ith operation code reaches a 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.

[0112] Schematically, the preset hook function (Hook) 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, the statistical benchmark row number corresponding to the i-th operation code and the statistical benchmark time corresponding to the i-th operation code are obtained. The statistical benchmark row number and the statistical benchmark time are the information that needs to be analyzed when calling the hook function.

[0113] The statistical benchmark line number is used to represent the end line number of the code line that most recently reached the cost threshold, and the statistical benchmark time is used to represent the end time of the code line that most recently reached the cost threshold.

[0114] Illustratively, the statistical benchmark line number is the code line number determined from the component running code and used as a code line comparison benchmark. The statistical benchmark line number is smaller than the code execution line number and usually remains unchanged (as distinguished from the real-time changes in the code execution line number) when certain conditions are not met (the condition is related to the zeroing process of the operation execution cost, which will be introduced below); the statistical benchmark moment is the moment used as a moment comparison benchmark. The statistical benchmark moment is smaller than the execution moment and usually remains unchanged (as distinguished from the real-time changes in the execution moment) when certain conditions are not met (the condition is also related to the zeroing process of the operation execution cost, which will be introduced below).

[0115] Indicatively, if the current accumulated operation execution cost has not been reset to zero before, the statistical benchmark time is usually the start time of executing the component running code corresponding to the current virtual component, and the statistical benchmark line number is usually the first line of the component running code corresponding to the current virtual component (that is, 1); if the current accumulated operation execution cost has been reset to zero before, the statistical benchmark time is the most recent execution time of the component running code when the operation execution cost was most recently reset to zero, and the statistical benchmark line number is the end line of the operation code in the component running code when the operation execution cost was most recently reset to zero, etc. The zeroing process will be explained later.

[0116] In an optional embodiment, the accumulated consumed time is obtained based on the statistical reference time corresponding to the ith operation code and the execution time corresponding to the ith operation code.

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

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

[0119] The accumulated number of execution lines is used to represent the number of code lines of at least one operation execution code line involved in determining the operation execution cost.

[0120] Illustratively, the difference between the code execution line number and the statistical benchmark line number is added by one as the cumulative execution line number (the reason for adding one is to avoid losing the operation execution code lines indicated by the calculation of the statistical benchmark line number, and to avoid modifying the operation execution code lines indicated by the calculation of the code execution line number). The cumulative execution line number represents the number of operation execution code lines passed 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 passed in the process of the operation execution cost accumulating from zero to the cost threshold.

[0121] In an optional embodiment, based on the cumulative consumed time and the cumulative number of execution 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.

[0122] In some embodiments, the quotient of the accumulated consumed time and the accumulated number of executed rows is used as the row execution cost.

[0123] The row execution cost is used to represent the average resource consumption of the code executing the representative operation.

[0124] In an illustrative manner, the quotient between the cumulative consumption time and the cumulative number of execution lines is obtained as the line execution cost, and the code line execution costs corresponding to at least one operation execution code are obtained by means of the cumulative line execution costs; the line execution cost represents the time resources (such as clock cycles) consumed for each execution of an operation execution code line as CPU resources in the process of executing the operation execution code with the cumulative number of execution lines; taking the quotient as the line execution cost represents the average value of the consumed CPU resources as the consumption corresponding to each operation code line.

[0125] In some embodiments, for an nth operation execution code line in at least one operation execution code line, a code line execution cost corresponding to the nth operation execution code line is obtained, and code line execution costs respectively corresponding to at least one operation execution code line are obtained.

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

[0127] Illustratively, the nth operation execution code line is any one operation execution code line in at least one operation execution code, and the line execution costs corresponding to the operation execution code lines are accumulated by a cumulative calculation method to calculate the code line execution cost corresponding to the nth operation execution code line, so that the cumulative calculation method determines the code line execution cost corresponding to at least one operation execution code line.

[0128] 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, it is determined that the code line execution cost corresponding to operation execution code line 1 is 1, the code line execution cost corresponding to operation execution code line 2 is 2 (1 is added to 1 during the cumulative process), the code line execution cost corresponding to operation execution code line 3 is 3 (1 is added to 2 during the cumulative process), etc., thereby determining the code line execution costs corresponding to at least one operation execution code line.

[0129] Illustratively, during the cumulative calculation of the code line execution cost, at least one operation execution code line may have empty content. This means that there is no operation code 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 the cumulative calculation of the operation execution code line with empty content; the calculated line execution cost is used as the value for the cumulative calculation of the operation execution code line with non-empty content.

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

[0131] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0132] 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 characterizing the code line execution cost corresponding to at least one operation execution code line, and display the component performance information characterizing the correspondence between the operation execution code line and the code line execution cost.

[0133] Schematically, the correspondence relationship represents a one-to-one correspondence between the operation execution code line and the code line execution cost. For example, after determining the code line execution cost corresponding to at least one operation execution code line based on the above content, the component performance information represents the code line execution cost corresponding to at least one operation execution code line by establishing a correspondence relationship. For example, the component performance information is: 35 lines (operation execution code lines) - 38, which means that the cumulative consumption resources when executing to line 35 are 38 CPU resources, etc., which is not limited here.

[0134] 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, and the execution time is updated to the next statistical benchmark time, and the code execution line number is updated to the next statistical benchmark line number.

[0135] Illustratively, after the operation execution cost reaches a preset cost threshold and the above process is performed, since the correspondence between the operation execution code lines and the code line execution costs has been displayed on the terminal interface as component performance information, in order to avoid continued accumulation based on the operation execution costs that have reached the cost threshold, the operation execution cost can be set to zero; at the same time, in order to avoid continuing to use the previous statistical benchmark line number and statistical benchmark time when executing the operation code after the i-th operation code, the execution time and code execution line number collected this time are used as updated information, so that the execution time is updated and set to the next statistical benchmark time, and the code execution line number is updated and set to the next statistical benchmark line number, so as to facilitate the continued accumulation of a new round of operation execution costs.

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

[0137] Indicatively, after the operation execution cost is set to zero, the execution time is updated to the next statistical benchmark time, and the code execution line number is updated to the next statistical benchmark line number, the i+1th operation code after the i-th operation code in the component running code continues to be executed until all operation codes in the component running code are executed while the above performance evaluation is being performed.

[0138] For example: in a 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; determine that the current time is 15, the code execution line number is 20, the statistical benchmark line number is 1, and the statistical benchmark time is 0; after obtaining the code line execution costs corresponding to at least one operation execution code line based on the above process, set the operation execution cost 23 to zero, update the statistical benchmark line number to the code execution line number 20, update the statistical benchmark time to the current time 15, and start the next round of code execution evaluation process; 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 codes in the component running code are executed.

[0139] In schematic form, by means of the process of zeroing the operation execution cost and updating the statistical benchmark time and the statistical benchmark row number, the problem of continuous accumulation of operation execution cost leading to a large amount of computing resources can be avoided, so as to maintain continuous performance detection and improve detection efficiency.

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

[0141] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0142] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0143] In the embodiment of the present application, the content of displaying component performance information by combining operation execution cost and code execution line number is introduced. When counting the component performance information of the virtual component, the execution of the operation code in the component running code is specifically considered. By establishing the relationship between the code execution line number and the operation execution cost to display the component performance information, it is helpful for the code creator to locate the code line with higher operation execution cost based on the component performance information; wherein when the operation execution cost reaches the cost threshold, the corresponding relationship between the operation execution code line and the code line execution cost will be established more specifically, so that the code creator can more efficiently locate the operation execution code line with higher cost line execution cost, which is convenient for the code creator to more efficiently modify the code content at the operation execution code line, improve the efficiency of code adjustment, and motivate the code creator to edit better code.

[0144] In an optional embodiment, the purpose of executing component running code and obtaining component performance information can be achieved through a virtual machine. The virtual machine can be deployed on a server, so that the server can run the component running code and obtain component performance information; the virtual machine can also be deployed on a first terminal corresponding to the code creator, so that the first terminal can run the component running code and obtain component performance information; the virtual machine can also be deployed on a second terminal corresponding to other user objects, so that the second terminal can run the component running code and obtain component performance information. Schematically, as Figure 4 As shown, taking the execution subject as the first terminal as an example, the above Figure 2 The illustrated embodiment can also be implemented as steps 410 to 433; wherein step 431 introduces the content of component performance information acquired by the server, step 432 introduces the content of component performance information acquired by the first terminal, and step 433 introduces the content of component performance information acquired by the second terminal.

[0145] Step 410: display the virtual components in the virtual scene.

[0146] like Figure 5The figure shows an interface diagram for displaying virtual components in a virtual scene.

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

[0148] Illustratively, there are some preset virtual elements (also called virtual components, but for the convenience of distinguishing from virtual components that need to be edited by code, they are called virtual elements) in the newly created virtual map, such as virtual ground, virtual buildings, master virtual objects, etc. Optionally, based on the differences in virtual maps created by code creators, the preset virtual elements displayed therein may also be different. For example: the preset virtual element displayed in a plain virtual map is virtual grass, and the basic virtual element displayed in a snow scene virtual map is virtual snow, etc., which is not limited here.

[0149] like Figure 5 As shown, different from the virtual object 520 (preset virtual element) in the physical state existing in the virtual map, the virtual component 510 displayed in the virtual map is a virtual object in a virtualized state. This virtual state can serve as a prompt for the code creator to perform the code editing process for the virtual component 510 to write the corresponding component running code for the virtual component 510.

[0150] Step 420 : In response to receiving a component editing operation for a virtual component, displaying a component execution code corresponding to the virtual component.

[0151] 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, a component running code corresponding to the virtual component is displayed.

[0152] The code editing interface is used to edit the information of the driving virtual component in the form of code writing.

[0153] In some embodiments, the code creator may open a component editing panel for a virtual component and select a code editing function to add component execution code for the virtual component, that is, receive a component editing operation to display the process of component execution code.

[0154] 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 being such as a click operation, a long press operation, a sliding operation, etc.; or, 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 sliding operation, etc.

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

[0156] like Figure 6 As shown, this is a schematic diagram of the interface of the component editing panel, wherein the component editing panel includes multiple editing functions, such as multiple editing functions that can achieve different editing effects; for example, the code editing function is used to edit the component running code for the virtual component, and the component style adjustment function is used to configure the component style (color, size, etc.) for the virtual component.

[0157] If a selection is received for the code editing function in the component editing panel, component running code can be added for the virtual component in the code editing area of ​​the component editing panel. Figure 6 As shown, a selection operation on the code editing function 610 in the component editing panel is received as a component trigger operation (such as a click operation, a 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 on the code editing area 620 is used as a component editing operation to obtain the component running code configured for the virtual component.

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

[0159] Schematically, the building block interface is an interface for implementing visual programming by editing building blocks, and programming blocks are basic units for representing programming logic in visual programming.

[0160] Schematically, the block building interface is used to carry the programming blocks selected by the user in the visual programming, so that the user can drag and drop, combine, configure and other layout adjustment operations on the programming blocks in the block building interface; the programming blocks are graphical elements in the visual programming, and different programming blocks represent different concepts and operations in programming, and are used to realize different logical functions.

[0161] In some embodiments, multiple programming blocks correspond to block types, which are the types of logical functions implemented in visual programming. If a programming block is understood as a data block encapsulating data execution logic, then the process of applying a programming block in a block building interface is the process of adopting the data execution logic; schematically, the block type corresponding to a programming block is the type of logical function corresponding to the data execution logic, such as: a mathematical operation logic function corresponds to a mathematical operation type programming block, a conditional judgment logic function corresponds to a conditional judgment type programming block, a string operation logic function corresponds to a string operation type programming block, etc.

[0162] Based on the building process of programming building blocks, the visual component running code can be edited for the virtual component in a visual form, which reduces the difficulty of editing the component running code. That is, the component running code can not only be implemented as Figure 6 The text code form shown can also be implemented as a building block code form based on programming building block components, which is not limited here.

[0163] The component running code includes at least one operation code for driving the state change of the virtual component in the virtual scene.

[0164] Schematically, the operation code is referred to as the operation code, which is a binary code that indicates the basic operation type to be performed (such as data processing operation, data transmission operation); optionally, in the process of traversing and executing at least one operation code through the virtual machine, each operation code consumes CPU resources.

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

[0166] The first code identifier is used to uniquely identify the component running code.

[0167] Indicatively, the code confirmation operation is an operation for confirming the component running code of the currently edited virtual component. Figure 6 As shown, the control trigger operation for the save control 630 is used as a code confirmation operation, so that the code currently displayed in the code editing area 620 is used as the component running code corresponding to the virtual component.

[0168] Illustratively, a virtual component is a component to be edited, and a virtual scene includes at least one virtual component. A code editing operation can be used to edit the code for each virtual component, thereby determining the component running code corresponding to at least one virtual component based on the code confirmation operation.

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

[0170] Similarly, the code identifier is an identifier used to uniquely characterize 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.

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

[0172] The code identifier can be used to uniquely identify the virtual component, and the corresponding component running code can be determined by using the uniquely identified virtual component. For example, the code identifier 1 can be used to uniquely identify the virtual component A, and the corresponding component running code a can be determined by using the uniquely identified virtual component A, so as to execute the component running code in a targeted manner.

[0173] Step 431, receiving component performance information sent by the server, and displaying the component performance information.

[0174] The server collects component performance information when executing the component running code.

[0175] Illustratively, if the component running code is executed through the server, the first terminal can send the written component running code to the server (such as sending it to the background server corresponding to the first client through the installed first client), and then the server executes the component running code to simulate the driving virtual component, and analyzes the code execution performance during the execution of the component running code through a pre-written performance detection code to obtain component performance information.

[0176] Optionally, the component performance information includes at least one of an average frame rate, at least one minimum frame rate, code running consumption data, and code running consumption data corresponding to at least one minimum frame rate.

[0177] Schematically, the average frame rate is used to represent the average frame rate of the virtual component displayed during the preset time period when the execution component runs the code to achieve state change; the frame rate represents the number of state screen frames of the virtual component in the virtual scene within a unit time (such as 1 second) when the execution component runs the code. For example, if the frame rate is 24FPS (frames per second, FramePerSecond), it means that 24 status screen frames are displayed within 1 second. The larger the frame rate, the more data the code execution consumes, and the smaller the frame rate, the less data the code execution consumes.

[0178] At least one minimum frame rate is used to represent at least one minimum frame rate counted when the virtual component displayed within a preset time period of the execution component running the code realizes state change; such as a minimum frame rate or a minimum of 3 frame rates, etc., which is not limited here.

[0179] The code running consumption data is data used to reflect the resource consumption during the code running process; the code running consumption data includes at least one of the operation execution cost and the code line execution cost. The method for obtaining the operation execution cost and the code line execution cost is described in Figure 3 The illustrated embodiment has been described in detail and will not be elaborated here; wherein, when displaying the code line execution cost, the operation execution code line that has a corresponding relationship with the code line execution code is usually displayed in combination (i.e., combined as component performance information), so as to facilitate the code creator to locate the operation execution code line in a targeted manner.

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

[0181] In addition, the component performance information may be displayed in various forms such as median cost, average cost, etc. based on the code running consumption data, which is not limited here.

[0182] The server is also 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, and the logic information includes at least one of component performance information and screen information.

[0183] Schematically, the program logic is the logical part in the first client responsible for executing data processing, and the logical information generated based on the program logic is used to send to the first terminal for rendering and display, so as to reduce the data processing amount of the first terminal; for example, the processing process of executing the component running code is executed through the server, so that the server can count the component performance information so as to send it to the terminal for rendering and display; similarly, the screen information is other information that needs to be displayed on the terminal interface, such as the location information of the virtual object, etc., which is not limited here.

[0184] Optionally, the server can be implemented as a physical server or a cloud server, and the server is implemented as a cloud server and the first client is implemented as a cloud game application. As the first client is a cloud game application, the first terminal only needs to receive the logic information sent by the cloud server through the first client and render and display it, without the first terminal participating in the data processing process, including the process of executing the component running the code through the cloud server and collecting the component performance information during the code running process.

[0185] Step 432 , when the first terminal executes the component running code to drive the virtual component, the component performance information is collected and displayed.

[0186] Illustratively, if the component running code is executed through the first terminal, the server can send a performance detection code for evaluating performance information to the first terminal. The first terminal can execute the component running code to drive the virtual component, and analyze the code execution performance during the execution of the component running code through the performance detection code to obtain the component performance information.

[0187] Optionally, the component performance information includes at least one of an average frame rate, at least one minimum frame rate, code execution consumption data, and a code execution consumption value corresponding to at least one minimum frame rate.

[0188] Step 433, when the second terminal executes the component running code to drive the virtual component, the component performance information collected by the second terminal and forwarded by the server is received, and the component performance information is displayed.

[0189] Among them, 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 running code to the server, and the server forwards the component running code and the performance detection code to the second terminal. When the second terminal executes the component running code to drive the virtual component, the performance detection code analyzes the code execution performance during the execution of the component running code to obtain the component performance information.

[0190] The second terminal may then send the component performance information to the server, so that the server forwards the component performance information to the first terminal, thereby rendering and displaying the component performance information on the first terminal.

[0191] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0192] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0193] In the embodiment of the present application, a method of obtaining component performance information through statistics of different subjects is introduced. Counting component performance information through the server helps to improve the accuracy of information acquisition, counting component performance information through the first terminal can improve the efficiency of information acquisition, and counting component performance information through the second terminal helps to focus on the production environment of other users and obtain more targeted component performance information; using at least one of the above methods to obtain component performance information (such as using one method to obtain, or averaging and weighting component performance information obtained in multiple ways to obtain more dimensional information) improves the comprehensiveness and pertinence of information display, and facilitates code creators to better edit and adjust component running code.

[0194] In an optional embodiment, the virtual scene corresponds to a virtual map. After the code creator writes the component running 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 the use of objects to enter the virtual map to play the virtual scene. Figure 7 As shown above Figure 2 The step 230 shown may be followed by the following step 710 .

[0195] Step 710: In response to receiving a code confirmation operation for executing the component code, a virtual map corresponding to the virtual scene is sent to a server corresponding to the first client.

[0196] The virtual map is used to enter a virtual scene including virtual components, and the first client is used to display the virtual scene.

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

[0198] like Figure 8As shown, the virtual scene includes multiple virtual components, wherein at least one virtual component corresponds to a component running code, such as component running code 811 of virtual component 810; there may also be virtual components whose component running codes have not been edited, such as virtual component 820, etc., which are not limited here.

[0199] In some embodiments, in response to receiving a code confirmation operation, determining a correspondence between a virtual component and a component running code; and in response to receiving a map building completion operation, publishing a virtual map.

[0200] Illustratively, if the virtual map includes multiple virtual components, a correspondence between each virtual component and the corresponding component running code is established to determine the component running codes corresponding to the multiple virtual components respectively; a map construction completion operation is performed for the virtual scene. If a map save control exists, the trigger operation for the map save control is used as the map construction completion operation, which represents the determination of the component running code of the virtual component 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.

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

[0202] In addition, a work management interface is displayed on the terminal corresponding to the code creator, and the work management interface includes at least one virtual map created by the code creator himself, so that the code creator can also trigger the virtual map to play the virtual scene corresponding to the virtual map; in addition, the code creator can also trigger the virtual map to adjust the component running code corresponding to the virtual component in the virtual scene corresponding to the virtual map, so as to improve the running status of the virtual map (that is, the component running status of at least one virtual component).

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

[0204] For example, based on the code confirmation operation, the component running code is sent to the server to simulate the execution and evaluate the performance, which helps to improve the efficiency of the server in obtaining component performance information and also helps to display the component performance information on the terminal of the code creator in a more timely manner.

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

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

[0207] For example: after determining the component running code corresponding to at least one virtual component based on the map construction completion operation, a code set consisting of at least one component running code is sent to the server, and the code set corresponds to the virtual map; the server simulates the execution of at least one component running code based on the code set, and evaluates the component performance information corresponding to at least one component running code, thereby helping to avoid the problem of low efficiency caused by multiple data transmissions with the server, and also helping the server to simulate the code execution process more realistically based on the overall virtual map. After that, 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.

[0208] Among them, the analysis dimension of component performance information is very comprehensive. It can not only reflect the overall running status of the component running code, but also reflect the code consumption cost corresponding to at least one line of code in the component running code through the operation execution information of at least one operation code in the component running code; the server can send the component performance information to the terminal corresponding to the code creator, so that the code creator can locate the code with large component performance consumption in the component running code based on the code lines in the component performance information rendered and displayed on the terminal, which helps to adjust the component running code more efficiently.

[0209] In an optional embodiment, in response to receiving a map entry operation for a virtual map, a virtual scene corresponding to the virtual map is displayed; when executing a 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.

[0210] Schematically, the map entry operation is an operation of entering a virtual map, and a virtual scene corresponding to the virtual map is displayed based on the map entry operation; the virtual scene includes at least one virtual component, each virtual component corresponds to a component running code, and when the component running code corresponding to at least one virtual component is executed, the component performance information corresponding to the at least one virtual component is obtained, or the component performance information of any one or more virtual components is selected to be obtained and rendered and displayed on the screen.

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

[0212] Schematically, the virtual component corresponds to the component running code, and the component running code corresponds to the code identifier (or the virtual component corresponds to the code identifier); if the first terminal detects the performance in real time during the operation of the first client, then when executing the component running code corresponding to at least one virtual component, if the component running code b corresponding to the virtual component B is executed, the virtual component B (the first virtual component) can be displayed in the first style, and the first component performance information corresponding to the first virtual component can be displayed. The first style is different from the second style of other virtual components (virtual components that are not currently being performance-detected), such as the first style is a highlight style, the second style is a normal style, etc., so as to better display the interface effect on the interface of the first terminal of the code creator.

[0213] In schematic form, by displaying virtual components in the first style, a relationship between code execution and interface presentation can be established, which helps to strengthen the directionality of component performance information, making it easier for code creators to more specifically determine the situations of virtual components that require code adjustment, thereby improving code adjustment efficiency.

[0214] In addition, during the execution of the component running code, at least one of the following event triggering situations may exist based on the content of the component running code.

[0215] (1) It is executed when the virtual component is initialized and after the current frame of the game ends.

[0216] Indicatively, Fig. 9 As shown, in the code execution process taking the game client as an example, if the game logic is executed after the current frame starts, and it is determined whether there is an event callback; if so, step 910 is executed, if not, steps 920 to 930 are executed.

[0217] Step 910 represents the content of executing the component running code after the current frame game ends. For example, if the component execution code in the virtual component indicates to bloom fireworks, the special effect of blooming fireworks will be played after the current frame game ends.

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

[0219] Among them, Fig. 9Steps 920 to 930 shown represent executing the component execution code of the virtual component when a trigger event occurs, such as executing the component running code to play the player's homecoming special effect when the player dies.

[0220] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0221] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0222] In an optional embodiment, under the relevant technology, if the UGC code editing function is configured in the client, the user object of the terminal where the game client is installed can achieve the purpose of running the code based on the custom editing component based on the UGC code editing function, and the user object that runs the code based on the UGC editing component can also be called the code creator.

[0223] In order to quantify the running status of the customized component running code, the code creator usually writes the detection code by himself. The detection code is used to detect the frame rate during the execution of the component running code to evaluate the editing quality of the component running code.

[0224] The code creator can execute the component running code process on this end (if the code creator uses terminal 1 to edit the component running code, then this end is terminal 1), detect the frame rate during the component running code execution process by detecting the code, and thus display the frame rate curve change chart on this end. Fig.10 As shown, it is a schematic diagram of the frame rate curve change, which shows the recommended frame rate benchmark 1010, the not recommended frame rate benchmark 1020 and the frame rate curve 1030. If the frame rate curve is located near the recommended frame rate benchmark 1010, it means that the frame rate of the current component running the code is relatively high and the code execution is relatively good; if the frame rate curve is located near the not recommended frame rate benchmark 1020, it means that the frame rate of the current component running the code is relatively low and the code execution is relatively poor.

[0225] However, the detection code created by the code creator can only be executed on the local side to detect the frame rate of the component running code during execution on the local side, so as to evaluate the quality of code editing.

[0226] However, the test environment provided by this end and the production environment executed on other terminals (for example, the code creator hopes to display the process of running a virtual component based on the component running code on other terminals) are usually different. Therefore, if the frame rate is evaluated only based on the test environment to determine the execution status of the component running code, there is a great deal of randomness, which is not conducive to the code creator to analyze and adjust the code in a targeted manner; in addition, the frame rate collected by this end can only roughly reflect the overall running status of the component running code, and the code creator cannot Figure 7 The frame rate curve shown locates the code position with lower performance (such as lower frame rate), which makes it impossible for code creators to efficiently adjust component running code, affects the creative enthusiasm of code creators, and is not conducive to obtaining better component running code to stably drive virtual components.

[0227] In an optional embodiment, based on the technical problems of the above-mentioned related technologies, a method is provided in which the component performance information obtained by detection includes operation execution information used to characterize the execution status of the operation code, and the component performance information is displayed on the terminal of the code creator, which helps the code creator to locate the operation code with problems in the component running code based on the operation execution information, thereby improving the efficiency of code analysis and adjustment.

[0228] Optionally, taking a game client with a UGC code editing function as an example, if the game client is installed on a terminal, the user of the terminal can achieve the purpose of custom editing component running code based on the UGC code editing function, and the user based on the UGC editing component running code can also be called a code creator; the game client is communicated with the server, and the server is usually implemented as a background server of the game client; the game client can send the component running code edited by the code creator to the server. If the server executes the component running code to simulate driving the virtual component, the above-mentioned running performance acquisition method can also be called "a CPU performance evaluation scheme for executing UGC component running code on a server".

[0229] Optionally, the game platform corresponding to the game client can also pre-configure a performance detection code; in the process of the server executing the component running code, 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 detects the component running code by itself to obtain the component performance information, thereby rendering and displaying the component performance information on this end; or, the terminal operated by other terminal users (who are not code creators but users of the client) detects the component running code to obtain the component performance information, and sends the component performance information 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.

[0230] In an optional embodiment, the performance detection process during the execution of the component running code edited based on the UGC function is described as follows.

[0231] like Figure 5 The figure shows an interface diagram for displaying virtual components in a virtual scene.

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

[0233] In some embodiments, the code creator may open a component editing panel for a virtual component and select a code editing function to add component execution code for the virtual component, that is, receive a component editing operation to display the process of component execution code.

[0234] 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 being such as a click operation, a long press operation, a sliding operation, etc.; or, 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 sliding operation, etc.

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

[0236] like Figure 6 As shown, this is a schematic diagram of the interface of the component editing panel, which receives a selection operation (such as a click operation, a long press operation, etc.) for the code editing function 610 in the component editing panel, and displays a code editing area 620 corresponding to the virtual component; the code input operation for the code editing area 620 is used as a component editing operation to obtain the component running code configured for the virtual component.

[0237] In some embodiments, there is at least one virtual component in the virtual scene corresponding to the newly created virtual map, and based on the process of performing component editing operations on the virtual components, each virtual component corresponds to a component running code; therefore, if a virtual scene includes multiple virtual components, then one virtual scene corresponds to multiple component running codes.

[0238] Optionally, in response to receiving a code confirmation operation, determining a correspondence between a virtual object and a component running code; and in response to receiving a map building completion operation, publishing a virtual map.

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

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

[0241] Among them, the analysis dimension of component performance information is very comprehensive. It can not only reflect the overall running status of the component running code, but also reflect the code consumption cost corresponding to at least one line of code in the component running code through the operation execution information of at least one operation code in the component running code; the server can send the component performance information to the terminal corresponding to the code creator, so that the code creator can locate the code with large component performance consumption in the component running code based on the code lines in the component performance information rendered and displayed on the terminal, which helps to adjust the component running code more efficiently.

[0242] In some embodiments, the component performance information includes at least one of the average frame rate, the minimum frame rate, the component code consumption value during the global game process, the component code consumption value at the minimum frame rate, and the like.

[0243] In an optional embodiment, taking the server executing component running code as an example, a virtual machine is deployed in the server (such as the component running code is a script code in Lua language, using a Lua virtual machine, etc.), and the component running code is loaded into the virtual machine, thereby executing the component running code through the virtual machine.

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

[0245] Schematically, the operation code is referred to as an operation code, which is a binary code that indicates the basic operation type to be performed. Optionally, in the process of traversing and executing at least one operation code through the virtual machine, each operation code consumes CPU resources.

[0246] CPU resources include time resources, cache resources, register resources and other resources; time resources are used to indicate the length of time the CPU consumes when executing an operation code; cache resources are determined based on whether the operands being operated on are cached. If the operands are cached, cache resources consume less; if the operands are not cached, cache resources consume more; register resources are used to characterize the situation of accessing registers when the opcode executes operands. For example, more accesses consume more register resources, while fewer accesses consume fewer register resources.

[0247] Optionally, for any i-th operation code of at least one operation code in the component running code, an operation execution cost is obtained, where the operation execution cost is used to represent the sum of resource consumption of executing the first i operation codes.

[0248] That is: in the process of traversing and executing at least one operation code, each operation code corresponds to a code execution cost, and the code execution cost represents the CPU resources consumed by executing the operation code, that is, the code execution cost is used to describe the consumption of at least one of multiple 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, and the operation execution cost can be referred to as Cost.

[0249] Optionally, in a simplified performance evaluation mode, "Cost+1" can be used to indicate that executing a certain opcode consumes 1 unit of CPU resources, where 1 unit of CPU resources can be either a clock cycle or a unit of consumption of other hardware resources. In other words, the concept of Cost+1 is actually a hypothetical unit set to facilitate the analysis and calculation of CPU performance overhead, and usually refers to the basic consumption of an opcode, that is, the basic CPU resources required to execute the opcode.

[0250] Illustratively, in CPU design or performance evaluation, code execution can be measured by the time cycle taken to execute the opcode, so "Cost+1" can be understood as executing a certain opcode consumes 1 clock cycle.

[0251] For example, the pseudo code represents that for each OpCode pair Cost+1: CurrentCost+=1;

[0252] Among them, CurrentCost represents the operation execution cost obtained by accumulating the code execution cost. Each execution of an operation code consumes 1 CPU resource by default. Here, "1" is only an illustrative example. The consumption of CPU resources when the specific code is running is more complicated and is not limited here.

[0253] Illustratively, an opcode for a complex operation may consume more CPU resources. If CPU resources are represented by clock cycles, an opcode for a complex operation will consume more clock cycles (require more time).

[0254] For example, the operation code for executing an addition instruction (ADD) may consume 1 clock cycle, so its code execution cost is Cost+1. The operation code for complex operations (such as multiplication and division) may consume multiple clock cycles or more resources, and its code execution cost may be Cost+2 or higher.

[0255] Therefore, a complex opcode corresponds to a larger code execution code, so that the accumulated operation execution cost is also larger. Therefore, it is necessary to determine the operation execution cost more specifically based on the complex opcode.

[0256] For example, the pseudocode representation of the complex opcode plus the configured execution cost is represented as:

[0257]

[0258] Among them, SpecialOpCode represents the special opcode in the complex opcode. The special opcode is used to identify the instruction of some specific functions. The operation performed by the special opcode may not be the normal operation of the processor, but is designed for special purposes. Ordinary opcodes usually correspond to normal arithmetic, logic, data transmission and other operations, while special opcodes are usually used for some uncommon tasks, such as: system calls, special control flow operations (such as jumps, exception handling, etc.), data encryption, data flow control, exception management, etc. 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 (such as 1); the corresponding code execution cost can also be directly accumulated for the special opcode. In this case, the default execution cost is not added to the accumulation, which is not limited here.

[0259] Among them, OP_CALL represents the call opcode (also known as the function call instruction) in the complex opcode. The call opcode is an instruction used to transfer the control flow. In most computer architectures, CALL is a key instruction that transfers the execution flow of the current program to the specified function (subroutine) address, and usually saves the return address (that is, the address of the next instruction of the call instruction) in the stack so that it can return after the function is executed. 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 (such as 1); the corresponding code execution cost can also be directly accumulated for the call opcode. In this case, the default execution cost is not added to the accumulation, which is not limited here.

[0260] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

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

[0262] Illustratively, the cost threshold is a preset cost value, such as 20, 50, etc. The cost threshold can be expressed as "IntervalCheckCost"; the cost threshold is used to evaluate the operation execution cost obtained by accumulating the code execution cost.

[0263] In some embodiments, if the operation execution cost does not reach the cost threshold, other operation codes after the i-th operation code continue to be executed, and the code execution costs of the operation codes are accumulated during the execution process, thereby updating the value of the operation execution cost.

[0264] 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, and a corresponding relationship between the code execution line number and the operation execution cost is established, and used as component performance information of the virtual component at the time of execution so as to be displayed on the terminal screen of the code creator.

[0265] In some embodiments, if the operation execution cost reaches a 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.

[0266] Optionally, the execution time when the execution component runs the code is obtained, and the code execution line number in the component running code is obtained, and the statistical benchmark line number corresponding to the component running code is obtained, and the statistical benchmark time corresponding to the component running code is obtained.

[0267] Among them, the execution time is the current time when the operation execution cost obtained after executing the ith operation code reaches the cost threshold, so the execution time corresponds to the ith operation code; the code execution line number is the code line number of the currently executed code determined from the component running code when the operation execution cost obtained after executing the ith operation code reaches the cost threshold, so the code execution line number corresponds to the ith operation code and will change in real time during the execution of the component running code; the statistical benchmark line number is the code line number determined from the component running code as a code line comparison benchmark, the statistical benchmark line number is less than the code execution line number, and usually remains unchanged when certain conditions (which will be introduced below and are related to the hook function) are not met; the statistical benchmark time is the time used as a time comparison benchmark, the statistical benchmark time is less than the execution time, and usually remains unchanged when certain conditions (which will be introduced below and are related to the hook function) are not met.

[0268] Schematically, the current time can be expressed as CurTime, the code execution line number can be expressed as CurLine, the statistical benchmark line number can be expressed as StartLine, and the statistical benchmark time can be expressed as StartTime.

[0269] Optionally, based on the execution time and the statistical reference time, the cumulative consumed time is obtained.

[0270] In an illustrative manner, the difference between the execution time and the statistical benchmark time is taken as the cumulative consumed time, and the cumulative consumed time represents the time consumed in the process of the cumulative operation execution cost reaching the cost threshold. For example, the cumulative consumed time represents the time consumed in the process of the operation execution cost accumulating from zero to the cost threshold.

[0271] For example, the accumulated consumption time can be expressed as DeltaTime=CurTime-StartTime.

[0272] Optionally, based on the code execution line number and the statistical benchmark line number, the cumulative number of execution lines is obtained.

[0273] Illustratively, the difference between the code execution line number and the statistical benchmark line number is added by one as the cumulative execution line number. The cumulative execution line number represents the number of operation execution code lines passed 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 passed in the process of the operation execution cost accumulating from zero to the cost threshold.

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

[0275] Indicatively, the operation execution code line represents the code line passed between the statistical benchmark line number and the code execution line number, and the operation execution code line with the cumulative execution line number exists between the statistical benchmark line number and the code execution line number. For example: the statistical benchmark line number is 1, which means that the execution starts from the first code line of the component running code; the code execution line number is 5, which means that the statistical analysis starts from the fifth code line of the component running code currently executed; then the total number of operation execution code lines executed is 5 = (5-1+1).

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

[0277] In an illustrative manner, the quotient between the cumulative consumption time and the cumulative number of execution lines is obtained as the line execution cost, and the code line execution costs corresponding to at least one operation execution code are obtained by means of the cumulative line execution costs; the line execution cost represents the time resources (such as clock cycles) consumed for each execution of an operation execution code line as CPU resources in the process of executing the operation execution code with the cumulative number of execution lines; taking the quotient as the line execution cost represents the average value of the consumed CPU resources as the consumption corresponding to each operation code line.

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

[0279] Optionally, the code line execution costs corresponding to at least one operation execution code line are obtained by accumulating the line execution costs.

[0280] Illustratively, during the cumulative calculation of the code line execution cost, at least one operation execution code line may have empty content. This means that there is no operation code 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 the cumulative calculation of the operation execution code line with empty content; the calculated line execution cost is used as the value for the cumulative calculation of the operation execution code line with non-empty content.

[0281] For example: This process is represented in pseudocode as follows.

[0282]

[0283] Among them, CodeRecord[CurrentCodeId].Line[line]==null means that the content of the operation execution code line is empty, then CodeRecord[CurrentCodeId].Line[line]=0 is used, and 0 is used as the cumulative calculation value for the operation execution code line with empty content; if the content of the operation execution code line is not empty, CodeRecord[CurrentCodeId].Line[line]+=AvgCost is used, and the calculated line execution cost is used as the cumulative calculation value for the operation execution code line with not empty content.

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

[0285] Schematically, the correspondence represents a one-to-one correspondence between an operation execution code line and a code line execution cost. For example, after determining the code line execution cost corresponding to at least one operation execution code line based on the above content, the component performance information represents the code line execution cost corresponding to at least one operation execution code line by establishing a correspondence.

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

[0287] Schematically, it is expressed in the following form.

[0288] / / Set StartTime = CurTime: StartTime = CurTime;

[0289] / / Set StartLine=CurLine: StartLine=CurLine;

[0290] / / Reset Cost to 0: CurrentCost = 0.

[0291] In some embodiments, an initialization process is usually required before executing the above process; the component running code (Code) corresponding to each virtual component can be distinguished by a unique code identifier (CodeId). Schematically, the initialization pseudo code is shown below.

[0292]

[0293] CodeRecord represents the execution log data of the component running code; Line is used to indicate that the cost is obtained in an accumulated manner.

[0294] Schematically, the component running code process is implemented based on the code identifier CodeId corresponding to the component running code, which is expressed as function ExecuteComponentCode(CodeId); the pseudo code of the component running code process is as follows.

[0295]

[0296] The above pseudo code is only an illustrative example. The content of running the code through the virtual machine execution component based on the above pseudo code and obtaining performance has been introduced in the above content and will not be repeated here.

[0297] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.

[0298] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0299] In the embodiments of the present application, in a scenario where server cost and performance are balanced, game players can obtain real performance feedback, accurate to the number of lines of code and performance consumption, so that code creators can improve the gaming experience of the component running code writing process in a more targeted manner based on these feedbacks; in addition, product development scenarios can also obtain real-time performance data, which is convenient for game development platforms to accurately locate defects and improve products.

[0300] Fig.11 is a structural block diagram of an operating performance acquisition device provided by an exemplary embodiment of the present application, such as Fig.11 As shown, the device includes the following parts:

[0301] Display module 1110, used to display virtual components in a virtual scene;

[0302] The display module 1110 is further configured to display a component running code corresponding to the virtual component in response to receiving a component editing operation for the virtual component, wherein the component running code includes at least one operation code for driving a state change of the virtual component in the virtual scene;

[0303] The display module 1110 is also used 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.

[0304] In an optional embodiment, the display module 1110 is also used to obtain an operation execution cost for the i-th operation code during the process of traversing and executing at least one operation code in the component running code, and the operation execution cost is used to represent the sum of resource consumption for executing the first i operation codes; determine the code execution line number corresponding to the i-th operation code from the component running code, and the code execution line number is used to represent 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.

[0305] In an optional embodiment, the display module 1110 is also used to obtain the statistical benchmark line number corresponding to the ith operation code and the statistical benchmark time corresponding to the ith operation code when the operation execution cost reaches a preset cost threshold; the statistical benchmark line number is used to represent the end line number of the code line that most recently reached the cost threshold, and the statistical benchmark time is used to represent the end time of the code line that most recently reached the cost threshold; based on the statistical benchmark time corresponding to the ith operation code and the execution time corresponding to the ith operation code, obtain the cumulative consumed time; use the difference between the statistical benchmark line number corresponding to the ith operation code and the code execution line number as the cumulative execution line number, and the cumulative execution line number is used to represent the number of code lines of at least one operation execution code line that participates in determining the operation execution cost; based on the cumulative consumed 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 representing the correspondence between the operation execution code line and the code line execution cost.

[0306] In an optional embodiment, the display module 1110 is also used to obtain a line execution cost based on the cumulative consumed time and the cumulative number of execution lines, and the line execution cost is used to represent the average resource consumption of executing the operation execution 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 costs corresponding to the at least one operation execution code line respectively; the code line execution cost corresponding to the nth operation execution code line is used to represent the sum of resource consumption of executing the first n operation execution code lines, where n is a positive integer.

[0307] In an optional embodiment, the display module 1110 is also used to, in response to obtaining the code line execution cost corresponding to the at least one operation execution code line, set the operation execution cost to zero; and, update the execution time to the next statistical benchmark time, and, update the code execution line number to the next statistical benchmark line number; and execute the i+1th operation code in the component running code.

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

[0309] In an optional embodiment, the display module 1110 is also used to collect the component performance information and display the component performance information corresponding to the virtual component when the first terminal executes the component running code to drive 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.

[0310] In an optional embodiment, component performance information sent by a server is received, and the server collects the component performance information when executing the component 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; the component performance information corresponding to the virtual component is displayed.

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

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

[0313] In an optional embodiment, the display module 1110 is also used to determine the component running code corresponding to at least one virtual component in the virtual scene; when executing the component running code to drive the at least one virtual component, obtain the component performance information corresponding to the at least one virtual component; when displaying the first virtual component of the at least one virtual component in a first style, display the first component performance information corresponding to the first virtual component.

[0314] In an optional embodiment, the display module 1110 is also used to receive a component trigger operation for the virtual component and display a code editing interface, wherein the code editing interface is used to edit the information driving the virtual component in a code-written form; in response to receiving the code input operation on the code editing interface as the component editing operation, the component running code corresponding to the virtual component is displayed.

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

[0316] To sum up, with the help of component performance information, in the process of showing the overall execution status of the component running code, the execution status of the operation code in the component running code can be more specifically displayed through the operation execution information, avoiding the problem of low adjustment efficiency when adjusting the component running code due to only understanding the general information of the virtual component execution. It is also convenient to efficiently locate the operation code with performance problems through the operation execution information, improve the code adjustment efficiency to improve the code adjustment efficiency of the component running code, so that code creators can improve the component running code more specifically, thereby ensuring the driving stability of the virtual component in the virtual scene.

[0317] It should be noted that the operation performance acquisition device provided in the above embodiment is only illustrated by 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 is divided into different functional modules to complete all or part of the functions described above. In addition, the operation performance acquisition device provided in the above embodiment and the operation performance acquisition method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0318] Fig.12The block diagram of the structure of an electronic device 1200 provided by an exemplary embodiment of the present application is shown. The electronic device 1200 may be a portable mobile terminal, such as a smart phone, a vehicle-mounted terminal, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The electronic device 1200 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

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

[0320] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

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

[0322] In some embodiments, the electronic device 1200 further includes one or more sensors, including but not limited to: a proximity sensor, a gyroscope sensor, and a pressure sensor.

[0323] The proximity sensor, also called a distance sensor, is usually disposed on the front panel of the electronic device 1200. The proximity sensor is used to collect the distance between the user and the front of the electronic device 1200.

[0324] The gyroscope sensor can detect the body direction and rotation angle of the electronic device 1200, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the electronic device 1200. The processor 1201 can implement the following functions based on the data collected by the gyroscope sensor: motion sensing [such as changing the user interface (UI) according to the user's tilt operation], image stabilization during shooting, game control, and inertial navigation.

[0325] The pressure sensor can be set on the side frame of the electronic device 1200 and / or the lower layer of the display screen. When the pressure sensor is set on the side frame of the electronic device 1200, it can detect the user's holding signal of the electronic device 1200, and the processor 1201 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor. When the pressure sensor is set in the lower layer of the display screen, the processor 1201 controls the operability controls on the UI interface according to the user's pressure operation on the display screen. The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0326] In some embodiments, the electronic device 1200 also includes other components, which can be understood by those skilled in the art. Fig.12 The structure shown in the figure does not constitute a limitation on the electronic device 1200, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0327] The embodiment of the present application also provides a computer device, which can be implemented as a terminal or a server. The computer device includes a processor and a memory, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the operation performance acquisition method provided by the above-mentioned method embodiments.

[0328] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the operating performance acquisition method provided by the above-mentioned method embodiments.

[0329] The embodiments of the present application also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the operation performance acquisition method described in any of the above embodiments.

[0330] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0331] Those skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for obtaining operating performance, characterized in that: The method comprises: Display virtual components in a virtual scene; In response to receiving a component editing operation for the virtual component, displaying a component running code corresponding to the virtual component, the component running code including at least one operation code for driving a state transformation of the virtual component in the virtual scene; When the component running code is executed to drive the virtual component, component performance information corresponding to the virtual component is displayed; the component performance information includes operation execution information for characterizing 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 In the case where the component running code is executed to drive the virtual component, displaying component performance information corresponding to the virtual component includes: In the process of traversing and executing the at least one operation code in the component running code, for the i-th operation code, obtaining an operation execution cost, where the operation execution cost is used to represent the sum of resource consumption of executing the first i operation codes; Determine a code execution line number corresponding to the i-th operation code from the component running code, wherein the code execution line number is used to indicate 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.

3. The method according to claim 2, characterized in that The displaying of the component performance information based on the operation execution cost and the code execution line number includes: When the operation execution cost reaches a preset cost threshold, obtain the statistical benchmark line number corresponding to the ith operation code and the statistical benchmark time corresponding to the ith operation code; the statistical benchmark line number is used to represent the end line number of the code line that most recently reached the cost threshold, and the statistical benchmark time is used to represent the end time of the code line that most recently reached the cost threshold; Based on the statistical reference time corresponding to the i-th operation code and the execution time corresponding to the i-th operation code, the accumulated consumed time is obtained; The difference between the statistical benchmark line number corresponding to the i-th operation code and the code execution line number is used as the cumulative execution line number, where the cumulative execution line number is used to represent the number of code lines of at least one operation execution code line involved in determining the operation execution cost; Based on the accumulated consumed time and the accumulated number of executed lines, the code line execution costs corresponding to the at least one operation execution code line are obtained, and the component performance information representing the correspondence between the operation execution code line and the code line execution costs is displayed.

4. The method according to claim 3, characterized in that The acquiring, based on the accumulated consumed time and the accumulated number of executed lines, code line execution costs corresponding to the at least one operation execution code line respectively includes: Based on the accumulated consumption time and the accumulated number of executed rows, a row execution cost is obtained, where the row execution cost is used to represent an average resource consumption of the execution code representing the execution of the operation; 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 costs corresponding to the at least one operation execution code line respectively; the code line execution cost corresponding to the nth operation execution code line is used to characterize the sum of resource consumption of executing the first n operation execution code lines, where n is a positive integer.

5. The method according to claim 3, characterized in that: The method further comprises: 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 be the next statistical benchmark time, and the code execution line number is updated to be the next statistical benchmark line number; Execute the i+1th operation code in the component running code.

6. The method according to any one of claims 1 to 5, characterized in that: In the case where the component running code is executed to drive the virtual component, displaying component performance information corresponding to the virtual component includes: In the case of executing the component running code to drive the virtual component, obtaining the component performance information; the component performance information includes at least one of an 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, the code running consumption data includes at least one of an operation execution cost and a code line execution cost; The component performance information corresponding to the virtual component is displayed.

7. The method according to any one of claims 1 to 5, characterized in that: The method is performed by a first terminal, and a first client installed on the first terminal is in communication connection with a server; In the case where the component running code is executed to drive the virtual component, displaying 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, the component performance information collected by the second terminal and forwarded by the server is received, and the component performance information corresponding to the virtual component is displayed; the second terminal is a terminal other than the first terminal, and the first client is installed on the second terminal.

8. The method according to any one of claims 1 to 5, characterized in that: The method is performed by a first terminal, and a first client installed on the first terminal is in communication connection with a server; In the case where the component running code is executed to drive the virtual component, displaying component performance information corresponding to the virtual component includes: receiving component performance information sent by the server, wherein the server collects the component performance information when executing the component 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, wherein the logic information includes at least one of the component performance information and screen information; The component performance information corresponding to the virtual component is displayed.

9. The method according to any one of claims 1 to 5, characterized in that: After the component running code corresponding to the virtual component is displayed in response to receiving the component editing operation for the virtual component, the method further includes: In response to receiving a code confirmation operation for running the code for the component, the virtual map corresponding to the virtual scene is sent to a server corresponding to the first client, where the virtual map is used to enter the virtual scene including the virtual component.

10. The method according to claim 9, characterized in that In the case where the component running code is executed to drive the virtual component, displaying component performance information corresponding to the virtual component includes: In response to receiving a map entry operation for the virtual map, displaying the virtual scene corresponding to the virtual map; When the component running code respectively corresponding to at least one virtual component in the virtual scene is executed, the component performance information respectively corresponding to the at least one virtual component is displayed.

11. The method according to any one of claims 1 to 5, characterized in that: In the case where the component running code is executed to drive the virtual component, displaying component performance information corresponding to the virtual component includes: Determine a component running code corresponding to at least one virtual component in the virtual scene; In a case where the component running code is executed to drive the at least one virtual component, obtaining the component performance information respectively corresponding to the at least one virtual component; When a first virtual component of the at least one virtual component is displayed in a first style, first component performance information corresponding to the first virtual component is displayed.

12. The method according to any one of claims 1 to 5, characterized in that: In response to receiving a component editing operation for the virtual component, displaying a component running code corresponding to the virtual component includes: receiving a component triggering operation for the virtual component and displaying a code editing interface, wherein the code editing interface is used to edit information driving the virtual component in a code writing form; In response to receiving the code input operation on the code editing interface as the component editing operation, the component execution code corresponding to the virtual component is displayed.

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

14. A running performance acquisition device, characterized in that: The device comprises: A display module, used for displaying virtual components in a virtual scene; The display module is further configured to display a component running code corresponding to the virtual component in response to receiving a component editing operation for the virtual component, wherein the component running code includes at least one operation code for driving a state transformation of the virtual component in the virtual scene; The display module is also used to display component performance information corresponding to the virtual component when executing the component running code 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.

15. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the operating performance acquisition method as described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the operating performance acquisition method as described in any one of claims 1 to 13.

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

Citation Information

Patent Citations

  • Methods and systems for interactive customisation and visualisation of virtual environments and for digitally configuring virtual object assemblies

    CA3144605A1

  • Server configuration method and device and service server

    CN111277628A

  • Memory occupancy analysis method and device, equipment and storage medium

    CN114398219A

  • Abnormality detection method and device and electronic equipment

    CN118079372A

  • Game performance data acquisition method and device and electronic equipment

    CN118649410A