Graphical code execution method and device, equipment and storage medium

By adding objects in the virtual scene to a formation and controlling them with a unified graphical code, the problem of repeated programming of multiple objects in the existing technology is solved, and the code execution efficiency and debugging efficiency are improved.

CN120687078APending Publication Date: 2025-09-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410341984.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-22
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the prior art, in order to implement the same control logic for multiple objects, each object needs to be graphically programmed separately, resulting in low code execution efficiency and repeated programming.

Method used

By obtaining the graphical code from the graphical programming result, objects in the virtual scene are added to the formation, and unified graphical code is used to control the objects in the formation to avoid repeated programming.

Benefits of technology

It improves the execution efficiency of code, simplifies the code writing process, improves debugging efficiency, and realizes unified control of multiple objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687078A_ABST
    Figure CN120687078A_ABST
Patent Text Reader

Abstract

The invention discloses a graphical code execution method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps that a graphical programming result is obtained, the graphical programming result comprises a plurality of graphical codes executed in sequence, and the graphical codes are used for processing one or more virtual objects in a virtual scene; executing a first graphical code included in the graphical programming result, and adding at least one virtual object in the virtual scene into the first formation; and executing a second graphical code included in the graphical programming result, and performing unified control on the at least one virtual object joining the first formation. According to the method, the code execution efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for executing graphical code. Background Art

[0002] With the development of computer technology, graphical programming using graphical building blocks has become increasingly mature. Graphical building blocks can also be understood as graphical code that encapsulates a programming language. Users can perform graphical programming by dragging graphical building blocks.

[0003] In related technologies, when multiple objects need to be controlled separately, graphical programming is generally performed for each object. When the same control logic exists (e.g., all objects need to move 5 meters to the left), there is duplication of programming in the programming code corresponding to each object. This means that when executing the code to control the object, it is also necessary to obtain the programming code corresponding to each of the multiple objects and execute the programming code separately to control the object.

[0004] Therefore, in the above-mentioned related technologies, since it is necessary to obtain programming codes corresponding to multiple objects to control each object separately when executing the code, and there is repeated programming in the programming codes corresponding to the multiple objects, it is easy to cause low code execution efficiency. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, device, and storage medium for executing graphical code, which can improve the efficiency of code execution. The technical solutions proposed in this application are as follows:

[0006] According to one aspect of an embodiment of the present application, a method for executing graphical code is provided, the method comprising:

[0007] Obtaining a graphical programming result, wherein the graphical programming result includes a plurality of graphical codes executed in sequence, wherein the graphical codes are used to process one or more virtual objects in a virtual scene;

[0008] executing a first graphical code included in the graphical programming result to add at least one virtual object in the virtual scene to a first formation;

[0009] The second graphical code included in the graphical programming result is executed to uniformly control the at least one virtual object added to the first formation.

[0010] According to one aspect of an embodiment of the present application, a graphical code execution device is provided, the device comprising:

[0011] a result acquisition module, configured to acquire a graphical programming result, wherein the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in a virtual scene;

[0012] a code execution module, configured to execute a first graphical code included in the graphical programming result, and add at least one virtual object in the virtual scene to a first formation;

[0013] The code execution module is further configured to execute a second graphical code included in the graphical programming result, and perform unified control over the at least one virtual object added to the first formation.

[0014] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned graphical code execution method.

[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned graphical code execution method.

[0016] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned graphical code execution method.

[0017] The technical solutions provided in the embodiments of the present application can bring the following beneficial effects:

[0018] Obtaining a graphical programming result; executing a first graphical code included in the graphical programming result to implement the addition of at least one virtual object in the virtual scene to a first formation; and executing a second graphical code included in the graphical programming result to implement unified control of the at least one virtual object added to the first formation. The technical solution provided in the embodiment of the present application uses the first graphical code to organize objects that need to execute the same code logic into the first formation, so that at least one object added to the first formation shares a second graphical code. Executing the second graphical code can implement unified control of the at least one virtual object in the same formation, eliminating the need to obtain duplicate programming code to control each virtual object separately, which is beneficial to improving code execution efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a schematic diagram of an implementation environment for a solution provided by an embodiment of the present application;

[0020] Figure 2 It is an interface diagram of a graphical programming method provided by related technologies;

[0021] Figure 3 It is an interface diagram of a graphical programming method provided by related technologies;

[0022] Figure 4 It is an interface diagram of a graphical programming method provided by related technologies;

[0023] Figure 5 It is an interface diagram of a graphical programming method provided by related technologies;

[0024] Figure 6 It is an interface diagram of a graphical programming method provided by related technologies;

[0025] Figure 7 It is an interface diagram of a graphical programming method provided by related technologies;

[0026] Figure 8 This is an interface diagram of a graphical programming method provided by an embodiment of the present application;

[0027] Figure 9 This is an interface diagram of a graphical programming method provided by another embodiment of the present application;

[0028] Figure 10 is a schematic diagram of a virtual scene interface provided by an embodiment of the present application;

[0029] Figure 11 This is a schematic diagram of a code editing interface provided by an embodiment of the present application;

[0030] Figure 12 This is a flowchart of a graphical programming method provided by one embodiment of the present application;

[0031] Figure 13 This is an interface diagram of a graphical programming method provided by another embodiment of the present application;

[0032] Figure 14 This is an interface diagram of a graphical programming method provided by another embodiment of the present application;

[0033] Figure 15 is a flowchart of a graphical programming method provided by another embodiment of the present application;

[0034] Figure 16 is a schematic diagram of an object selection method provided by an embodiment of the present application;

[0035] Figure 17 is a schematic diagram of an object selection method provided by another embodiment of the present application;

[0036] Figure 18This is an interface diagram of a graphical programming method provided by another embodiment of the present application;

[0037] Figure 19 This is an interface diagram of a graphical programming method provided by another embodiment of the present application;

[0038] Figure 20 This is a block diagram of an object status updating method provided by one embodiment of the present application;

[0039] Figure 21 is a block diagram of an object status updating method provided by another embodiment of the present application;

[0040] Figure 22 is a block diagram of an object status updating method provided by another embodiment of the present application;

[0041] Figure 23 This is a schematic diagram of code execution provided by an embodiment of the present application;

[0042] Figure 24 This is a schematic diagram of interface switching provided by an embodiment of the present application;

[0043] Figure 25 is a flowchart of a graphical programming method provided by another embodiment of the present application;

[0044] Figure 26 This is a schematic diagram of a function panel interface provided by an embodiment of the present application;

[0045] Figure 27 is a schematic diagram of a function panel interface provided by another embodiment of the present application;

[0046] Figure 28 This is a flowchart of a method for executing graphical code provided by one embodiment of the present application;

[0047] Figure 29 is a flowchart of a method for executing graphical code provided by another embodiment of the present application;

[0048] Figure 30 is a flowchart of a method for executing graphical code provided by another embodiment of the present application;

[0049] Figure 31 This is a schematic diagram of a compilation process provided by an embodiment of the present application;

[0050] Figure 32 This is a schematic diagram of a component structure provided by an embodiment of the present application;

[0051] Figure 33 This is a code diagram provided by an embodiment of the present application;

[0052] Figure 34 is a block diagram of a graphical programming device provided by one embodiment of the present application;

[0053] Figure 35 This is a structural block diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

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

[0055] Before introducing the technical solutions of this application, some of the terms involved in this application are explained. The following related explanations can be combined with the technical solutions of the embodiments of this application as optional solutions, and they all fall within the scope of protection of the embodiments of this application. The embodiments of this application include at least part of the following contents.

[0056] Graphical programming: The programming language is encapsulated in graphical building blocks, and programming can be completed by dragging the building blocks to build. It is generally used for programming learning among teenagers or beginners.

[0057] IDE (Integrated Development Environment): Used to provide a development environment for applications, generally including tools such as code editors, compilers, debuggers, and graphical user interfaces.

[0058] Virtual scene: A mode in a graphical programming tool that displays a virtual scene in both non-operating static and operating states.

[0059] Code editing: A mode in a graphical programming tool that displays graphical building block code and allows users to add, delete, write code, and run it.

[0060] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application. The implementation environment of the solution may include: a terminal device 10 and a server 20.

[0061] The terminal device 10 includes, but is not limited to, mobile phones, tablet computers, intelligent voice interaction devices, game consoles, wearable devices, multimedia playback devices, PCs (Personal Computers), vehicle-mounted terminals, smart home appliances, and other electronic devices. A client for a target application can be installed in the terminal device 10. Optionally, the target application can be an application that requires downloading and installation, or a click-to-use application, which is not limited in this embodiment of the present application.

[0062] In an embodiment of the present application, the target application may be an application with a code execution function, such as an integrated development environment provided in the target application, in which users can write, compile, and run code. For example, the target application includes a graphical programming tool. For example, the graphical programming tool provides a plurality of preset graphical codes (i.e., graphical building blocks). The target application may encapsulate the programming language in the graphical code, allowing the graphical code to be presented to the user in the form of building blocks or other graphics, and the user can drag these graphical codes to implement programming. For example, the target application may directly obtain the encapsulated graphical code and provide it directly to the user. For example, the target application obtains the graphical programming results and runs the results to achieve control of various virtual objects. This application does not limit the specific functions of the target application. The target application may be a testing application, a development application, a gaming application, a virtual reality (VR) application, an augmented reality (AR) application, etc. The embodiments of the present application do not limit the specific categories of the target application. In other embodiments, the target application can be considered as a separate functional module, such as being implemented as one of the functional modules in the application to be developed. For example, the terminal device 10 runs a client of the target application.

[0063] The server 20 is used to provide background services for the client of the target application in the terminal device 10. For example, the server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited thereto.

[0064] The terminal device 10 and the server 20 can communicate with each other via a network, which can be a wired network or a wireless network.

[0065] The method provided in the embodiment of the present application may be performed by a computer device. The computer device may be any electronic device with data storage and processing capabilities. For example, the computer device may be Figure 1 The terminal device 10 in the embodiment may also be a server 20.

[0066] The following is a brief explanation using a virtual drone as an example. With the development of artificial intelligence, programming methods based on graphical programming tools are becoming increasingly mature. Some applications provide graphical programming tools that are independent of hardware environments, requiring only a network connection and are highly standardized.

[0067] However, in the related art, when it comes to grouping multiple objects to achieve an overall consistent operating effect, the code can only be copied and written for different objects separately. The process is cumbersome and repetitive, and it also increases the number of building block codes, which is not conducive to improving the efficiency of building block code writing.

[0068] In some embodiments, as Figure 2 As shown, a user interface 200 provided by a graphical programming tool in the related art includes a block area, an editing area, a stage area, and a material area. The interface layout is relatively fixed. Users select blocks in the block area according to their needs, assemble blocks in the editing area, and select materials from the material area. After clicking the run button, the effect can be previewed in the stage area. Of course, if you want to achieve the same running effect for different objects, you need to switch between different objects and add code separately during the actual programming process.

[0069] In some embodiments, as Figure 3 As shown, when you want to control the object 300, you need to splice the building blocks in the editing area to obtain the building block code 301 of the control object 300. In some embodiments, as Figure 4 As shown, when you want to control object 400, you need to splice blocks in the editing area to obtain the block code 401 of the control object 400. Even if you need to control object 300 and object 400 to achieve the same operating effect, in the actual coding process, you need to switch between different objects to add and write code separately.

[0070] In some embodiments, as Figure 5 As shown, another graphical programming tool in the related art provides a user interface 500 that includes a stage area, a material area, a block preset area, and a block editing area. The interface layout is relatively fixed. Users select blocks according to their needs in the block preset area, assemble blocks in the block editing area, select materials from the material area, and click the run button to preview the effect in the stage area. Of course, if you want to achieve the same operating effect for different objects, you will also need to switch between different objects and add code separately during the actual programming process.

[0071] In some embodiments, as Figure 6 As shown, when you want to control the object 600, you need to splice the building blocks in the editing area to obtain the building block code 601 of the control object 600. In some embodiments, as Figure 7As shown, when you want to control object 700, you need to splice blocks in the editing area to obtain the block code 701 of the control object 700. Even if you need to control object 600 and object 700 to achieve the same operating effect, in the actual coding process, you need to switch between different objects to add and write code separately.

[0072] In the above-mentioned related technologies, it is impossible to use only one set of building block codes to control objects in multiple stage areas. If you want to achieve an overall unified operating effect for multiple objects during the code writing process, you need to repeatedly write multiple sets of codes, and the process is cumbersome and complicated. In addition, when viewing and modifying the code for different objects, you need to switch back and forth to different objects, which greatly reduces the efficiency of debugging (viewing and modifying code).

[0073] The technical solution provided in the embodiments of the present application innovatively provides building block codes in the building block preset area that can simultaneously control multiple drones to join a formation. Users can use the building blocks to add multiple drones to the formation according to actual needs, and use a set of codes to complete the flight control of the entire drone formation, thereby improving the efficiency of code writing, thereby realizing group control, interconnected performances, and formation flight of virtual drones.

[0074] This application provides a set of building blocks to simultaneously control the flight states of multiple virtual drones, such as formation control, interconnected performances, and formation flying. Users only need to add a set of building block codes and modify the parameters of the building block codes to apply the code to a formation composed of multiple virtual drones, thereby simplifying the code writing process and improving writing efficiency. Avoid the tedious operation of switching back and forth between different objects during debugging (viewing and modifying building block codes), and improve debugging efficiency. In the process of adjusting parameters, the efficiency of selecting and grouping multiple drones is improved by interactively supporting the use of box selection.

[0075] Before introducing the specific method of the present application, the application scenario of the graphical programming method applied to the graphical programming tool in the present application is first exemplified. Of course, it should be noted that the following application scenario is only an example and is not limited to this.

[0076] In some embodiments, the graphical programming method and code execution method in the embodiments of the present application can be used in the field of UGC (User Generated Content). For example, UGC refers to the content that users can display or provide to other users. For example, UGC can be used in the field of games, animation production, self-media, etc. For example, only UGC in the field of games is taken as an example, and the graphical programming method mentioned in this application and the following code execution method are specifically described. For example, the target application is an application that allows users to customize the game. For example, the target application provides an interface that allows users to customize the game, which is called a game customization interface. Multiple preset graphical codes are displayed in the game customization interface, and the graphical codes are used to process one or more objects. Of course, the objects here include virtual animals, virtual plants, virtual cars, virtual buildings, etc. These objects are objects that may appear in the game that the user wants to customize. In some embodiments, in response to an edit operation on a first graphical code among multiple preset graphical codes, the edited first graphical code is displayed. The first graphical code is used to add at least one object to the same formation. The edited first graphical code is used to add the at least one object to the first formation. Exemplarily, multiple virtual stars are grouped together to control their movement direction. Exemplarily, multiple virtual plants are grouped together to control their growth direction and speed. In some embodiments, in response to an edit operation on a second graphical code among multiple preset graphical codes, the edited second graphical code is displayed. The second graphical code is used to uniformly control at least one object in the same formation. The edited second graphical code is used to uniformly control at least one object in the first formation. Exemplarily, by editing the second graphical code, the user can achieve unified control of all objects in the formation. In some embodiments, after the user edits the first and second graphical codes, the graphical programming result including the edited first and second graphical codes is executed to control at least one object in the first formation. For example, when the user clicks "Run," the following code execution method is executed, and the user can see a virtual scene constructed by the user, with objects in the scene moving, such as a fleet of virtual cars on the street driving in a user-defined direction, and multiple virtual birds in the sky flying along user-defined trajectories. Users can use graphical programming to construct game scenes, game levels, and more.

[0077] In some embodiments, the graphical programming method in the embodiments of the present application is used for animation development. In the target application, the developer adds a new scene and multiple animation objects, configures each animation object, and uses a graphical building block code to control these animation objects, including forming a formation and controlling the animation objects in the formation using a second graphical code. Exemplarily, a preview interface is also provided in the graphical programming tool, in which the control process of each animation object can be previewed while running the graphical programming result. Exemplarily, when the animation presented in the preview interface meets expectations, the previewed animation is directly used as the generated animation.

[0078] In other embodiments, the graphical programming method in the embodiments of the present application is used to control virtual drones. For example, the target application provides a virtual drone flight environment and drones. For example, graphical building block codes are used to control the combination of drone formations and realize dynamic changes such as interconnected performances and flights of the formations. For example, a building block code (i.e., a second graphical code) that can simultaneously control multiple drones to join a formation is innovatively provided in the building block preset area. Users can use the building block to add multiple drones to the formation according to actual use, and use a set of codes to complete the flight control of the entire drone formation, thereby improving the efficiency of writing code, thereby realizing formation control, interconnected performances, formation flight, etc. of virtual drones.

[0079] In some embodiments, the graphical programming method in the embodiments of the present application is used to control actual objects. Exemplarily, the specific parameters of multiple actual objects (such as multiple real toys, drones, light bulbs), etc. are imported into the target application, and the multiple actual objects are bound to the terminal device where the target application is located. Exemplarily, the graphical building block code is used to control the combination of the multiple actual object formations and realize the dynamic changes of the interconnected performances, flights, etc. of the formations. Exemplarily, multiple actual objects are added to the formation according to the second graphical code. When the second graphical code is run, a control signal is sent to the multiple actual objects to control the actual objects to perform corresponding actions, thereby realizing the use of a set of codes to complete the common control of multiple actual objects and improve the efficiency of programming.

[0080] The following uses a virtual drone as an example to illustrate the specific application scenarios of this application with reference to the accompanying drawings.

[0081] In some embodiments, as Figure 8As shown, a user download interface 800 is provided in the target application. When the user clicks to purchase the target application, the programming function provided by the target application can be used. Of course, it can also be provided to users for free download without the need for users to purchase. After the user has the authority to use the target application, a function selection interface 801 is displayed, and the user can select simulation programming 802 in the function selection interface 801. After the user selects simulation programming 802, a user login interface 803 is displayed. The user can choose different accounts to log in to the target application. After the user logs in to the target application, a programming mode selection interface 804 is displayed. In this interface, the user can select graphical programming or other programming modes, and this application does not limit this.

[0082] In some embodiments, as Figure 9 As shown, after the user selects graphical programming, an object quantity selection interface 900 is displayed, allowing the user to configure the number of objects, such as configuring only one drone. For example, after the user configures the number of objects, a scene selection interface 901 is displayed, allowing the user to configure the scene for the objects, such as configuring the scene to be "xx Smart City." After the user configures the objects and scenes, a virtual scene interface 902 is displayed, displaying the virtual scene and the objects created within it 903.

[0083] In some embodiments, as Figure 10 As shown, the user interface provided by the graphical programming tool includes a virtual scene interface 1000. In some embodiments, the virtual scene interface 1000 includes a scene area, a navigation toolbar, a map navigation area, and a function panel area.

[0084] In some embodiments, as Figure 11 As shown, the user interface provided for the graphical programming tool also includes a code editing interface 1100. In some embodiments, the code editing interface 1100 includes a building block preset area, a building block editing area, a navigation toolbar, a map navigation area, and a function panel area.

[0085] In some embodiments, the user can drag and drop a preset building block code in the code editing interface 1100 and edit it to obtain the edited building block code. When the edited building block code is executed, the control process of the object in the virtual scene can be seen in the virtual scene interface 1000.

[0086] The technical solution provided by the embodiments of this application pre-sets a first graphical code and a second graphical code in the block preset area. The first graphical code enables at least one object to be added to the same formation, while the second graphical code enables unified control of the at least one object added to the same formation. This avoids duplication of code and improves code writing efficiency. Similarly, when executing the code, there is no need to retrieve duplicate programming code, which helps improve code execution efficiency.

[0087] The above is the relevant introduction related to this application. The following is an explanation of the graphical programming method proposed in the embodiment of this application in combination with specific embodiments.

[0088] Please refer to Figure 12 , which shows a flowchart of a graphical programming method provided by one embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiments, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (1210-1240).

[0089] Step 1210 , displaying a code editing interface of a graphical programming tool, wherein the code editing interface includes a plurality of preset graphical codes, and the graphical codes are used to process one or more objects.

[0090] In some embodiments, the graphical programming tool is an application program or a functional module within an application program that provides graphical programming functionality. Exemplarily, the graphical programming tool is the aforementioned target application program. Exemplarily, the graphical programming tool is a graphical programming module within the aforementioned target application program. Exemplarily, the graphical programming tool provides graphical programming functionality.

[0091] In some embodiments, the code editing interface of the graphical programming tool is an interface provided by the graphical programming tool for editing code (including graphical code). Figure 13 As shown, the code editing interface can be interpreted broadly, that is, the complete user interface 1300 is considered to be the code editing interface. In addition to the building block editing area 1304, the complete user interface 1300 also includes at least one of the building block preset area 1303, the function panel area, the navigation toolbar, and the map navigation area. Of course, the code editing interface proposed in this application can also be interpreted narrowly, that is, only including the building block editing area 1304. In this case, the preset building block code is not displayed in the building block editing area 1304, but is displayed in the building block preset area 1303.

[0092] In some embodiments, the code editing interface includes multiple preset graphical codes. For example, multiple preset graphical codes are displayed in the building block preset area 1303. The graphical code in the embodiments of the present application refers to code displayed in the form of a graphic. The graphical code encapsulates a programming language. Different graphical codes encapsulate different programming languages, that is, different control logic for the object.

[0093] In some embodiments, graphical codes include at least two categories. The first type of graphical code is used to control a single object and can only control a single object. The second type of graphical code is used to control a formation, which includes at least one object. When there are multiple objects in the formation, the graphical code can control multiple objects in the formation. Exemplarily, the preset graphical code may include at least one graphical code of the second type. Of course, in addition to the graphical code of the second type, it may also include at least one graphical code of the first type. The embodiments of the present application do not limit the types of preset graphical codes.

[0094] The objects in the embodiments of the present application include but are not limited to virtual objects or real objects. When the object is a real object, the object can be an movable or inactive object in the real world, such as a real drone, a light bulb, a toy car, etc. When the object is a virtual object, the object can be an movable or inactive object in a virtual scene, such as a virtual drone, a virtual light bulb, a virtual car, etc. In some embodiments, when the object is a virtual object, the virtual object can be created by the user. When the object is a real object, the graphical programming tool can be connected to at least one real object. When the graphical programming result is run using the graphical programming tool, a control signal can be sent to the at least one real object to control the at least one real object.

[0095] Step 1220, in response to an editing operation on a first graphical code among multiple preset graphical codes, display the edited first graphical code, the first graphical code is used to add at least one object to the same formation, and the edited first graphical code is used to add at least one object to the first formation.

[0096] In some embodiments, in response to selecting at least one graphical code in the preset block area, multiple selected graphical codes are displayed in the block editing area 1304. For example, the code editing interface includes a first graphical code 1301 and a second graphical code 1302. For example, the first graphical code 1301 and the second graphical code 1302 can be edited separately to obtain the edited first graphical code and the edited second graphical code.

[0097] Of course, if the default first graphical code meets the user's needs, the first graphical code may not be further edited. For example, if the first graphical code defaults to adding drone 1 to formation 1, and the user also needs to add drones to formation 1, the first graphical code may not be edited.

[0098] In some embodiments, the first graphical code is a graphical code for adding at least one object to the same formation. Exemplarily, the editing operation on the first graphical code includes at least one of an editing operation on an object configuration area in the first graphical code and an editing operation on a formation configuration area in the first graphical code. In some embodiments, Figure 14 As shown, the editing operation for the first graphical code 1400 can be considered to include at least one of the editing operation for the object configuration area 1401 in the first graphical code and the editing operation for the formation configuration area 1402 in the first graphical code. For example, the first graphical code displays the text "UAV (No. 1) joins formation (1)", wherein the position of the brackets allows the user to edit, that is, not only the object to be added to the formation can be selected, but also the formation to be added can be selected. For example, the editing operation for the object configuration area is used to configure the object to be added to the formation, and the editing operation for the formation configuration area is used to configure the formation to be added.

[0099] In some embodiments, the editing operation on the first graphical code can be considered as an operation to edit the first graphical code. This application does not limit the specific operation type of the operation, such as the operation is at least one of a click operation, a long press operation, a sliding operation, an input operation, etc.

[0100] In some embodiments, the edited first graphical code includes identification information of the selected objects. For example, if object 1 and object 2 are selected to join formation 1, 1 and 2 are displayed in the edited first graphical code.

[0101] Step 1230, in response to an editing operation on a second graphical code among multiple preset graphical codes, the edited second graphical code is displayed, the second graphical code is used to uniformly control at least one object in the same formation, and the edited second graphical code is used to uniformly control at least one object in the first formation.

[0102] In some embodiments, the second graphical code is a graphical code for unified control of at least one object in the first formation. Exemplarily, the editing operation on the second graphical code includes at least one of an editing operation on a formation configuration area in the second graphical code and an editing operation on a parameter configuration area in the second graphical code. In some embodiments, as Figure 13As shown, the second graphical code displays the text "Set the flight speed of formation (1) to (x) meters per second", wherein the position of the brackets allows the user to edit, that is, not only can the formation be configured, such as configuring the formation to be formation 1, but also the control parameters of the graphical code can be configured, such as configuring the flight speed to be 10 meters per second. Exemplarily, the editing operation for the formation configuration area is used to configure the formation controlled by the graphical code, and the editing operation for the parameter configuration area is used to configure the control parameters of the graphical code.

[0103] In some embodiments, the edited first graphical code sets object 1, object 2, and object 3 to join formation 1, and the edited second graphical code sets formation 1 to move 5m to the left. When the edited first graphical code and the edited second graphical code are run, the edited second graphical code can uniformly control object 1, object 2, and object to move 5m to the left.

[0104] Step 1240 : Run the graphical programming result to control at least one object in the first formation. The graphical programming result includes the edited first graphical code and the edited second graphical code.

[0105] In some embodiments, before step 1240, the step further includes displaying a graphical programming result. For example, the edited graphical code displayed in the building block editing area is referred to as the graphical programming result.

[0106] In some embodiments, the graphical programming result includes an edited first graphical code and an edited second graphical code. Of course, the graphical programming result may also include an edited third graphical code. The edited third graphical code may be the graphical code of the first type mentioned above, or the graphical code of the second type mentioned above, that is, the edited third graphical code may control one or more objects. That is, the various objects in the embodiments of the present application are allowed to be grouped together for control, or may be controlled individually, and this application does not limit this. It should be understood that the various objects in the present application are singletons, that is, each object independently becomes an instance, because in the related art, multiple objects cannot be grouped and controlled together, but can only be controlled separately. The technical solution provided in the embodiments of the present application can not only control a single object, but also control multiple formations at the same time, and uniformly control different objects in each formation, which is conducive to improving the diversity and flexibility of object control.

[0107] In some embodiments, a run control is displayed. In response to an operation on the run control, the graphical programming result is run. In some embodiments, Figure 13As shown, in response to an operation on the run control 1305 , the graphical programming result in the building block editing area 1304 is run to control at least one object in the formation 1 .

[0108] The controls in the embodiments of this application are all user interface (UI) controls. A UI control is any visual control or element visible on the user interface of an application, such as an image, input box, text box, button, label, and other controls. Some UI controls respond to user operations, such as a run control that runs the results of graphical programming. The UI controls involved in the embodiments of this application include, but are not limited to, a run control.

[0109] The technical solution provided by the embodiment of the present application enables at least one object to be added to a first formation by editing a first graphical code in the code editing interface of a graphical programming tool. By editing a second graphical code, the edited second graphical code is used to uniformly control at least one object in the first formation. Running the graphical programming result including the edited first graphical code and the edited second graphical code enables unified control of at least one object added to the first formation. The technical solution provided by the embodiment of the present application enables objects that need to execute the same code logic to be added to the first formation by using the first graphical code, so that at least one object added to the first formation shares the same edited second graphical code, eliminating the need for repeated programming and improving programming efficiency.

[0110] Please refer to Figure 15 , which shows a flowchart of a graphical programming method provided by another embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiments, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (1510-1550).

[0111] Step 1510: Display a code editing interface of a graphical programming tool. The code editing interface includes a plurality of preset graphical codes. The graphical codes are used to process one or more objects.

[0112] Step 1520 : In response to a triggering operation on the object configuration area in the first graphical code, an object selection interface is displayed, wherein a plurality of elements are displayed in the object selection interface, and each element corresponds to an object.

[0113] In some embodiments, the first graphical code includes an object configuration area, and the object configuration area is used to configure at least one object to be added to the same formation.

[0114] In some embodiments, the object configuration area is a sub-area of ​​the displayed first graphical code. The present application does not limit the display position of the object configuration area in the user interface, such as the object configuration area being in the middle of the first graphical code.

[0115] In some embodiments, the object selection interface is displayed in full screen or non-full screen form. For example, when the object selection interface is displayed in non-full screen form, Figure 14 As shown, in response to the object configuration area 1401 in the first graphical code, an object selection interface 1403 is displayed.

[0116] In some embodiments, the object selection interface includes multiple elements, and each element corresponds to an object. For example, each element corresponds to the number of an object. For example, the objects created in the virtual scene are numbered to obtain numbers 1 to N, where N is a positive integer. Number 1 corresponds to object 1, number 2 corresponds to object 2, and so on. In other embodiments, each element corresponds to a thumbnail of an object. This form is suitable for situations where the appearance of each object is quite different. When the appearance of the object is quite different, the object can be represented by a thumbnail of the object, such as using a head picture of each object to represent the object. For example, the object selection interface includes a head picture of the object person, a head picture of the object puppy, a head picture of the object kitten, and so on. The user can determine the corresponding object by directly selecting the corresponding picture.

[0117] Of course, this application does not limit the arrangement order and arrangement position of the multiple elements in the object selection interface. For example, they can be arranged from top to bottom in ascending order of number, or from left to right in the chronological order of object creation.

[0118] Step 1530 : In response to a selection operation on at least one first element among the multiple elements, the edited first graphical code is displayed, and an object corresponding to the at least one first element is added to a first formation.

[0119] In some embodiments, the first element is the element targeted by the selection operation. Exemplarily, the selection operation for at least one first element among the multiple elements is an operation of selecting the at least one first element. This application does not limit the operation type of the operation, such as the selection operation being a click operation, a long press operation, a sliding operation, etc.

[0120] In some embodiments, the selection operation includes a click operation on each first element. That is, the user only needs to click the element that he wants to add to the formation, and when the user wants to cancel the selection, he can click it again. Figure 16As shown in 1600, when selecting an element, you can directly click on the element. When deselecting the element, as shown in Figure 16 As shown in 1610 , clicking the element again will deselect the element.

[0121] In some embodiments, the selection operation is a frame selection operation starting from the first position and ending at the second position, and the element included in the frame selection area constructed by the first position and the second position is the first element. In some embodiments, a rectangular frame formed by long pressing and sliding from the first position to the second position is the frame selection area. When the user wants to cancel the selection, just long press the frame selection again. In some embodiments, as Figure 17 As shown in 1700, when selecting an element, you can directly press and hold the element to select it (that is, the frame selection operation). When you deselect the element, as shown in Figure 17 As shown in 1710 , long pressing the selected element in the box again will deselect the element.

[0122] In some embodiments, as Figure 18 As shown in sub-figure a of , users can edit the graphical code in the code editing interface. Figure 18 As shown in sub-figure b, the user drags multiple graphical codes from the building block preset area to the code editing area. Figure 18 As shown in the sub-figure c of FIG, the user can edit the first graphical code 1800. Figure 19 As shown in sub-figure d of FIG, the user can select multiple first elements after triggering the display object selection interface 1801. Figure 19 As shown in sub-figure e of , after exiting the editing of the first graphical code, the edited first graphical code 1900 is displayed.

[0123] The technical solution provided by the embodiment of the present application provides two methods for selecting elements. For the first method, the selection operation is a click operation, that is, a click operation is performed once for all elements pointed to by objects that want to be included in the same formation. This method ensures the accuracy of the selection and avoids selection errors. For the second method, the selection operation is a frame selection operation, that is, a large number of elements can be selected at one time. This method ensures the efficiency of the selection. When a large number of objects need to be selected to join the formation, the second method is faster.

[0124] In some embodiments, in response to a trigger operation on the object configuration area in the first graphical code, the states corresponding to multiple elements are determined according to the correspondence between the elements and the objects. When an element corresponds to an object created in the virtual scene, the element is in an unselected state; when an element does not correspond to an object created in the virtual scene, the element is in an uncreated state.

[0125] Exemplarily, M elements are preset, that is, at most M objects are allowed to appear in the scene, and M is a positive integer. When the number of objects created in the scene does not exceed M, there are elements without corresponding objects, that is, they are in an uncreated state.

[0126] In some embodiments, for the m-th element among multiple elements, when the m-th element is selected and the state of the m-th element is in an uncreated state, the state of the m-th element is not changed; when the m-th element is selected and the state of the m-th element is in an unselected state, the state of the m-th element is changed to a selected state, where m is a positive integer. In some embodiments, when the m-th element is deselected and the state of the m-th element is in a selected state, the state of the m-th element is changed to an unselected state.

[0127] Exemplarily, click on the m-th element. If the element is in an unselected state, it is determined that the element is in a selected state. Exemplarily, click on the element again, then the element changes from a selected state to an unselected state.

[0128] Exemplarily, long-press to select the m-th element by frame selection. If the element is in an unselected state, it is determined that the element is in a selected state. Exemplarily, long-press to select the element by frame selection again, then the element changes from a selected state to an unselected state.

[0129] Exemplarily, click or long-press to select the m-th element by frame selection. If the element is in an uncreated state, the state of the element remains unchanged.

[0130] Please refer to Figure 20 , which shows a block diagram of an object state update method provided by an embodiment of the present application. As Figure 20 shown in 2000 of, taking the object as a drone for example, click on the drone parameters (i.e., the object configuration area) in the drone formation related building blocks (i.e., the first graphical code), and a drone formation select drone pop-up box (i.e., the object selection interface) pops up. Here, the interface of the extended pop-up box is utilized. Create a custom input type FieldFormationDronePopup that inherits from the Blockly.FieldTextInput class, and process click events and display the select drone pop-up box (abbreviated as the pop-up box) in this input type. Assume that the maximum number of drones that can be added to the scene is M, and the numbers 1 to M are fixedly displayed in the pop-up box, representing the drones numbered 1 to M created in the order of creation. Each number has three states, namely uncreated, unselected, and selected. The uncreated state indicates that there is no drone with this serial number in the scene. If the number of drones in the scene is n (n < M), then the drones numbered n + 1 to M are in an uncreated state; the unselected state indicates that the drone with this serial number is not selected; the selected state indicates that the drone with this serial number has been selected.

[0131] Please refer to Figure 21 , which shows a block diagram of an object status update method provided by another embodiment of the present application. Figure 21 As shown in 2100, taking the object as a drone as an example, for the click operation, if the serial number (that is, the above-mentioned element) is currently in the uncreated state, then the serial number cannot be clicked, does not respond to the click operation, and remains in the uncreated state; if the serial number is currently in the unselected state, then after clicking the serial number, the serial number is changed to the selected state, and at the same time, the drone entry corresponding to the serial number in the function panel area is highlighted and flashed to prompt the user, and the drone logo corresponding to the map navigation area is also highlighted to prompt the user; if the serial number is currently in the selected state, then after clicking the serial number, the serial number is changed to the unselected state, and at the same time, the drone entry corresponding to the serial number in the function panel area is highlighted and flashed in another way (distinguished from the above-mentioned selected state) to prompt the user, and the drone logo corresponding to the map navigation area is also highlighted in another way (distinguished from the above-mentioned selected state) to prompt the user.

[0132] Please refer to Figure 22 , which shows a block diagram of an object status update method provided by another embodiment of the present application. Figure 22 As shown in 2200, taking the object as a drone as an example, the state of the serial number (that is, the above-mentioned element) outside the box (referring to the box of the selected area) is not changed. For all serial numbers in the box, the following operations are performed. If the serial number is currently in an uncreated state, then the serial number does not change its state and remains in an uncreated state; if the serial number is currently in an unselected state, then the serial number is changed to a selected state, and at the same time, the drone entry corresponding to the serial number in the function panel area is highlighted and flashes to prompt the user, and the drone logo corresponding to the map navigation area is also highlighted to prompt the user; if the serial number is currently in a selected state, then the serial number is changed to an unselected state, and at the same time, the drone entry corresponding to the serial number in the function panel area is highlighted and flashed in another way (distinguished from the above-mentioned selected state) to prompt the user, and the drone logo corresponding to the map navigation area is also highlighted in another way (distinguished from the above-mentioned selected state) to prompt the user.

[0133] In some embodiments, the first element in the selected state is displayed differently from other elements in the unselected state. In some embodiments, the display color, brightness, grayscale, etc. of the first element in the selected state and other elements in the unselected state are different.

[0134] In some embodiments, the object corresponding to the first element in the selected state and the objects corresponding to other elements in the unselected state are displayed separately in the virtual scene. In some embodiments, when the user selects a target element in the object selection interface, the object corresponding to the selected target element is highlighted in the virtual scene, while the objects pointed to by the unselected elements are not highlighted. In other words, if the user selects several elements, the objects corresponding to these elements are highlighted in the virtual scene. The highlighting here also includes flashing display, yellow display, etc.

[0135] In some embodiments, the mark of the object corresponding to the first element in the selected state in the map navigation interface is displayed separately from the marks of the objects corresponding to other elements in the unselected state in the map navigation interface, wherein the map navigation interface displays a map of the virtual scene and the marks of each created object in the virtual scene in the map. In some embodiments, the map navigation interface here corresponds to the above-mentioned map navigation area. The mark of the object corresponding to the first element in the selected state in the map navigation interface is highlighted, and the highlighting here also includes flashing display, yellow display, etc. The mark in the embodiment of the present application is also used to indicate the object, such as the mark is at least one of the head picture, number, and logo of the object.

[0136] In some embodiments, the identifier of the object corresponding to the first element in the selected state in the function panel interface is displayed separately from the identifiers of the objects corresponding to other elements in the unselected state in the function panel interface, wherein the function panel interface is used to display the configuration information corresponding to each created object in the virtual scene, and the configuration information includes the identifier of the object. In some embodiments, the function panel interface here corresponds to the above-mentioned function panel area. The identifier of the object corresponding to the first element in the selected state in the function panel interface is highlighted, and the highlighting here also includes flashing display, yellow display, etc.

[0137] In some embodiments, the aforementioned several distinctions are displayed differently.

[0138] The technical solution provided in the embodiment of the present application allows users to clearly understand which objects are selected by distinguishing the selected objects from other objects in the map navigation interface, function panel interface, and object selection interface during the object selection process, thereby allowing users to more intuitively observe whether the selection is incorrect, so that users can make timely modifications.

[0139] In some embodiments, the triggering operation on the object configuration area in the first graphical code and the selection operation on at least one first element among the multiple elements are two-step operations, or can be a one-step sliding operation with no release. When the triggering operation on the object configuration area in the first graphical code and the selection operation on at least one first element among the multiple elements are a one-step sliding operation with no release, for example, by long-pressing the triggering operation on the object configuration area in the first graphical code to call out the object selection interface, without releasing the triggering operation, the user can continue to select elements to join the same formation on the object interface to reduce the number of operation steps.

[0140] In some embodiments, the method shown in steps 1520 and 1530 is used to configure at least one object to be added to the same formation. In other embodiments, identification information of at least one object to be added to the same formation can be directly input in the object configuration area. Based on the input identification information of the at least one object, the at least one object to be added to the first formation is determined. This input can be text input or voice input.

[0141] The above steps 1520 and 1530 illustrate a method for configuring at least one object to join the same formation. In other embodiments, the following steps 1560 (not shown) and 1570 (not shown) are also used to configure at least one object to join the same formation.

[0142] Step 1560, in response to the triggering operation on the object configuration area in the first graphical code, a virtual scene interface in an editing state is displayed, wherein the virtual scene interface displays the virtual scene and the objects created in the virtual scene, and different objects have different positions in the virtual scene.

[0143] Exemplarily, objects in the virtual scene interface in the editing state are allowed to be edited, which is distinguished from the previous virtual scene interface.

[0144] For example, and the above Figure 14 Similar to the object selection interface 1403 in , the virtual scene interface in the editing state is displayed in a non-full screen form.

[0145] Exemplarily, the virtual scene interface in the editing state is displayed in full screen form. That is, in response to the triggering operation on the object configuration area in the first graphical code, the virtual scene interface in the editing state is displayed in full screen.

[0146] Step 1570 : In response to a selection operation on at least one first object among the created objects, the edited first graphical code is displayed, and the at least one first object is added to the first formation.

[0147] In some embodiments, the selection operation on at least one first object among the created objects is an operation of selecting the at least one object. In some embodiments, the selection operation includes a click operation on each object. In some embodiments, the selection operation is a box selection operation starting from the third position and ending at the fourth position, and the objects included in the box selection area constructed by the third position and the fourth position are the selected objects. This is similar to the above description, and reference is made to the above explanation and is not repeated here.

[0148] In some embodiments, the edited first graphical code includes identification information of the selected objects. For example, if object 1 and object 2 are selected to join formation 1, identification 1 and identification 2 are displayed in the edited first graphical code.

[0149] The technical solution provided in the embodiment of the present application allows users to directly select objects in the virtual scene to join the formation, making the selection of objects more intuitive and less prone to errors, which is conducive to improving programming efficiency.

[0150] The above embodiment specifically introduces how to configure the object that is selected to join the formation. Of course, the formation pointed to by the first graphical code can also be configured.

[0151] In some embodiments, the first graphical code further includes a formation configuration area, and the formation configuration area is used to configure a formation to be joined by at least one object.

[0152] In some embodiments, in response to a trigger operation on a formation configuration area in a first graphical code, a formation selection interface is displayed, in which multiple formation numbers are displayed, and each formation number corresponds to a formation; in response to a selection operation on a first formation number among multiple formation numbers, the edited first graphical code is displayed, and the formation corresponding to the first formation number is the first formation.

[0153] In some embodiments, the triggering operation for the formation configuration area in the first graphical code and the selection operation for the first formation number among multiple formation numbers are two-step operations, or can be a one-step sliding operation without releasing the hand. When the triggering operation for the formation configuration area in the first graphical code and the selection operation for the first formation number among multiple formation numbers are one-step sliding operations without releasing the hand, for example, by long-pressing the triggering operation for the formation configuration area in the first graphical code to call out the formation selection interface, without releasing the hand, the user can continue to slide to the first formation number on the object interface to reduce the number of operation steps.

[0154] In other embodiments, the identification information of the team to be joined can be directly input in the team configuration area, and the team to be directed to is determined based on the input identification information of the team. The input can be text input or voice input.

[0155] Step 1540, in response to an editing operation on a second graphical code among multiple preset graphical codes, the edited second graphical code is displayed, the second graphical code is used to uniformly control at least one object in the same formation, and the edited second graphical code is used to uniformly control at least one object in the first formation.

[0156] Step 1550 : Run the graphical programming result to control at least one object in the first formation. The graphical programming result includes the edited first graphical code and the edited second graphical code.

[0157] In some embodiments, the graphical programming result is run to display the control process of at least one object in the first formation in the virtual scene. If the graphical programming result requires that formation 1 be controlled to fly 10 meters to the left, and formation 1 includes object 1 and object 2, then an animation of controlling object 1 and object 2 to fly 10 meters to the left is displayed in the virtual scene. Figure 23 As shown, in response to the operation of the running control 2301, the graphical programming result is run, and the control process 2302 of at least one object in the first formation is displayed in the virtual scene.

[0158] The technical solution provided in the embodiment of the present application can provide the running results to the user in an animated manner for preview, which is conducive to the user quickly discovering problems in the graphical programming results, thereby quickly making modifications and improving programming efficiency.

[0159] In some embodiments, at least one of a scene control and a code editing control is displayed; the scene control is used to switch to displaying a virtual scene interface, which includes a virtual scene and objects created in the virtual scene; and the code editing control is used to switch to displaying a code editing interface. The graphical programming results are executed, and in response to a triggering operation on the scene control, the virtual scene interface is displayed, which displays the control process of at least one object in the first formation in the virtual scene; and in response to a triggering operation on the code editing control, the code editing interface is redisplayed, which includes the graphical programming results.

[0160] In some embodiments, as Figure 24As shown, scene control 2401 and code editing control 2402 are displayed. In response to a triggering operation on scene control 2401, virtual scene interface 2400 is displayed. In response to a triggering operation on code editing control 2402, code editing interface 2404 is displayed. In other words, the scene control and code editing control can be used to switch between the virtual scene interface and the code editing interface. Of course, both can also be displayed on the same screen, such as displaying the virtual scene interface on the left and the code editing interface on the right. Of course, the code editing interface can also be displayed full screen while the virtual scene interface is displayed in a picture-in-picture format.

[0161] In some embodiments, in response to a formation setting operation for a target object among objects created in a virtual scene interface, a formation selection interface is displayed, wherein the formation selection interface includes multiple formation numbers, each formation number corresponding to a formation; in response to a selection operation for a second formation number among the multiple formation numbers, the target object is determined to join the formation corresponding to the second formation number. This method allows the formation of an object to be modified directly in the virtual scene interface, such as by long-pressing the target object in the virtual scene interface to display a formation selection interface; in response to a selection operation for a second formation number among the multiple formation numbers, the target object is determined to join the formation corresponding to the second formation number. By directly modifying the formation in the scene and combining the code and the scene, it is beneficial to improve the flexibility of code editing and improve programming efficiency.

[0162] For example, modifications to the formation in interfaces other than the code editing interface will be synchronized to the edited first graphical code and the edited second graphical code, so that the scene and the code remain synchronized to avoid errors.

[0163] The technical solution provided in the embodiment of the present application switches the display of the virtual scene interface and the code editing interface or displays them on the same screen, making it convenient for users to edit the code and view the control process of each object in the scene, which is conducive to improving programming efficiency.

[0164] Please refer to Figure 25 , which shows a flowchart of a graphical programming method provided by another embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiments, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (2510-2570).

[0165] Step 2510, in response to the triggering operation of the object creation control in the function panel interface, the configuration information corresponding to the newly added object is displayed in the function panel interface, and the function panel interface is used to display the configuration information corresponding to each created object in the virtual scene.

[0166] In some embodiments, in response to a triggering operation on an object creation control in the function panel interface, the configuration information corresponding to the newly added object displayed in the function panel interface is initialized information, or in other words, default configuration information.

[0167] In some embodiments, in response to a triggering operation on an object creation control in the function panel interface, a newly added object is displayed in the virtual scene.

[0168] In some embodiments, as Figure 26 As shown, in response to a triggering operation on an object creation control 2600 in the function panel interface, configuration information 2601 corresponding to the newly added object is displayed in the function panel interface.

[0169] Step 2520: In response to the modification operation on the configuration information corresponding to the newly added object, display the modified configuration information.

[0170] In other embodiments, in addition to modifying the configuration information corresponding to the newly added object, the configuration information corresponding to other created objects may also be modified.

[0171] In some embodiments, as Figure 27 As shown, in response to a modification operation on the configuration information 2701 corresponding to the created object, the modified configuration information is displayed.

[0172] Step 2530: Display the newly added object created based on the modified configuration information in the virtual scene.

[0173] In some embodiments, the newly added object is modified in the virtual scene based on the modified configuration information.

[0174] In some embodiments, an object 2702 corresponding to the modified configuration information is displayed in the virtual scene.

[0175] In some embodiments, the function panel interface includes a search input field.

[0176] Exemplarily, the search bar is used to search for a created object and view the configuration information of the object.

[0177] In some embodiments, in response to an input operation on a search input bar, search information for a created object input in the search input bar is displayed; and configuration information corresponding to the object pointed to by the search information is displayed.

[0178] In some embodiments, the computer device matches the keywords in the search information with the configuration information of each created object based on the search information input by the user, determines the created object with the highest matching degree as the object pointed to by the search information, and further displays the configuration information corresponding to the object pointed to by the search information.

[0179] Considering that when a user has created a large number of objects, it is impossible to display the configuration information of all the created objects in one interface, so the user needs to pull down or scroll to find the relevant objects. Therefore, the technical solution provided by the embodiment of the application provides a search bar to facilitate the user to quickly search for related objects, thereby quickly viewing the configuration information of the object and modifying the configuration information, which is conducive to improving information processing efficiency.

[0180] In some embodiments, the function panel interface includes tabs corresponding to each created object.

[0181] The tabs in the embodiments of this application should be interpreted broadly, that is, each object corresponds to a tab, and a tab is a specific element used to represent the object, such as a control, logo, thumbnail, etc. The reason for displaying tabs is that the tab area is small, and more tabs can be displayed in a smaller area, that is, the tabs corresponding to multiple created objects can be displayed in a small area. For example, M labels are displayed in the function panel interface, and each label corresponds to a created object.

[0182] In some embodiments, in response to selecting a target tab in the tabs corresponding to each created object, the configuration information corresponding to the object pointed to by the target tab is displayed. For example, selecting the target tab quickly displays the configuration information of the object pointed to by the tab. This method improves the efficiency of information display.

[0183] In some embodiments, in response to a delete operation on a target tab, the object pointed to by the target tab is deleted from the virtual scene. For example, deleting the target tab can quickly delete the object pointed to by the tab. This approach improves the efficiency of object deletion.

[0184] In some embodiments, in response to a team setting operation on a target tab, the team to which the object pointed by the target tab is added is changed. For example, in response to a team setting operation on the target tab, a team selection interface is displayed, on which the team to which the object pointed by the target tab is added is reselected. This approach enables quick configuration of teams, which helps improve programming efficiency.

[0185] In some embodiments, the function panel interface also displays controls corresponding to each formation. For example, in response to a click operation on a target control in the controls corresponding to each formation, the configured objects under the formation corresponding to the target control are displayed. For example, when displaying the configured objects under the formation corresponding to the target control, all objects under the formation and other objects in the virtual scene are displayed separately. For example, objects in the formation corresponding to the target control can be added or deleted. For example, the objects under each formation can also be quickly viewed in the function panel interface, and the location of each object under the formation can also be viewed in the corresponding scene. In addition, objects can be quickly deleted or added, which is conducive to improving the flexibility and efficiency of programming.

[0186] Step 2540: Display a code editing interface of the graphical programming tool. The code editing interface includes a plurality of preset graphical codes. The graphical codes are used to process one or more objects.

[0187] Step 2550, in response to an editing operation on a first graphical code among multiple preset graphical codes, display the edited first graphical code, the first graphical code is used to add at least one object to the same formation, and the edited first graphical code is used to add at least one object to the first formation.

[0188] Step 2560, in response to an editing operation on a second graphical code among multiple preset graphical codes, the edited second graphical code is displayed, the second graphical code is used to uniformly control at least one object in the same formation, and the edited second graphical code is used to uniformly control at least one object in the first formation.

[0189] Step 2570: Run the graphical programming result to control at least one object in the first formation, where the graphical programming result includes the edited first graphical code and the edited second graphical code.

[0190] The above is an introduction to the graphical programming method. The following is a detailed explanation of how to run the graphical programming results after programming using the graphical programming tool in conjunction with the following embodiments.

[0191] It should be understood that the graphical code execution method described below and the graphical programming method described above can be executed by the same computer device or by different computer devices. When executed by the same computer device, an application program that supports programming and code execution functions is running on that computer device. When executed by different computer devices, a first computer device executes the graphical programming method to obtain a graphical programming result, which is then sent to a second computer device, which then executes the result. The first computer device runs an application program that supports programming functions, while the second computer device runs an application program that supports code execution functions.

[0192] It should also be noted that the edited first and second graphical codes included in the graphical programming results in the graphical programming method described above are considered to be the first and second graphical codes in the graphical programming results mentioned in the graphical code execution method described below. Since the following embodiments deal with code execution, the graphical codes mentioned in these embodiments are considered to have been edited. That is, in these embodiments, the first graphical code directly replaces the edited first graphical code, the second graphical code replaces the edited second graphical code, and the third graphical code is considered to be the edited third graphical code.

[0193] Please refer to Figure 28 , which shows a flowchart of a method for executing graphical code provided by one embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiment, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (2810-2830).

[0194] Step 2810: Obtain a graphical programming result, where the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in the virtual scene.

[0195] In some embodiments, a graphical programming result is obtained, and the graphical programming result includes a plurality of graphical codes, which are graphical codes edited by the programmer. Exemplarily, the graphical codes in the graphical programming result are arranged in a certain order, such as from top to bottom, from left to right, and so on. Exemplarily, when the graphical programming result is executed, the graphical codes in the graphical programming result are executed in sequence. In some embodiments, each graphical code corresponds to a control code logic, that is, a programming language encapsulated in the graphical code. Exemplarily, different graphical codes correspond to different control code logics, that is, different programming languages ​​encapsulated in the graphical code.

[0196] In some embodiments, the virtual scene is a virtual environment created (or provided) by the application program for the user. The virtual environment can be a simulation of the real world, a semi-simulated and semi-imaginary three-dimensional world, or a purely imaginary three-dimensional world. The virtual environment can be any of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment.

[0197] In some embodiments, a virtual object is an movable object in a virtual environment. The movable object may be at least one of a virtual drone, a virtual person, a virtual animal, and an animated character. In some embodiments, when the virtual environment is a three-dimensional virtual environment, the virtual object may be a three-dimensional virtual model, each virtual object having its own shape and volume in the three-dimensional virtual environment and occupying a portion of the space in the three-dimensional virtual environment. Optionally, the virtual object is a three-dimensional character constructed based on three-dimensional human skeleton technology, and the virtual object achieves different external appearances by wearing different skins. In some implementations, the virtual object may also be implemented using a 2.5-dimensional or 2-dimensional model, which is not limited in the embodiments of the present application.

[0198] Step 2820: Execute the first graphical code included in the graphical programming result to add at least one virtual object in the virtual scene to the first formation.

[0199] In some embodiments, the first graphical code is a graphical code for adding at least one virtual object in a virtual scene to a first formation. In response to the user's editing operation on the first graphical code during the programming process, the edited first graphical code includes first configuration information. The first configuration information includes identification information of the first formation and identification information corresponding to at least one virtual object added to the first formation. In some embodiments, the identification information here is information used to characterize the formation or object, such as a number, a label, a serial number, etc. Figure 19As shown, the edited first graphical code 1900 shows that drones 1 and 2 join formation 1, and drones 1 and 2 and the formation are the first configuration information included in the edited first graphical code.

[0200] In some embodiments, when the code is executed, at least one virtual object in the virtual scene is added to the first formation according to the first configuration information included in the first graphical code.

[0201] Exemplarily, the identification information corresponding to at least one virtual object joining the first formation in the first configuration information is bound to the identification information of the first formation, that is, at least one virtual object joining the first formation can be quickly found based on the identification information of the first formation.

[0202] Exemplarily, a correspondence table between virtual objects and formations is established based on the identification information corresponding to at least one virtual object joining the first formation in the first configuration information and the identification information of the first formation. That is, based on the identification information of the first formation, at least one virtual object joining the first formation can be quickly found from the correspondence table.

[0203] Exemplarily, based on the identification information corresponding to at least one virtual object joining the first formation in the first configuration information and the identification information of the first formation, dynamic links are established between the first formation and at least one virtual object joining the first formation. For example, a dynamic link is established between formation 1 and virtual object 1, a dynamic link is established between formation 1 and virtual object 2, and a dynamic link is established between formation 1 and virtual object 3. This means that when the second graphical code is executed, that is, when controlling each object in the formation, the dynamic link of the first formation is used to link to the virtual object joining the first formation. This method directly constructs dynamic links to find virtual objects joining the formation, which not only avoids the construction of a correspondence table or binding relationship, but also enables rapid positioning to improve search efficiency.

[0204] Step 2830: Execute the second graphical code included in the graphical programming result to uniformly control the at least one virtual object added to the first formation.

[0205] In some embodiments, the second graphical code is a graphical code used to uniformly control the virtual objects in the first formation. In response to a user editing the second graphical code during programming, the edited second graphical code includes second configuration information. The second configuration information includes identification information and control parameter information of the first formation.

[0206] The technical solution provided by the embodiment of the present application achieves the addition of at least one virtual object in a virtual scene to a first formation by obtaining a graphical programming result; executing a first graphical code included in the graphical programming result; and achieving unified control of the at least one virtual object added to the first formation by executing a second graphical code included in the graphical programming result. The technical solution provided by the embodiment of the present application uses the first graphical code to organize objects that need to execute the same code logic into the first formation, so that at least one object added to the first formation shares a second graphical code. Executing the second graphical code can achieve unified control of at least one virtual object in the same formation, eliminating the need to obtain repeated programming code to control each virtual object separately, which is conducive to improving code execution efficiency.

[0207] Please refer to Figure 29 , which shows a flowchart of a method for executing graphical code provided by another embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiments, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (2910-2950).

[0208] Step 2910: Obtain a graphical programming result, where the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in the virtual scene.

[0209] Step 2920: Execute the first graphical code included in the graphical programming result to add at least one virtual object in the virtual scene to the first formation.

[0210] Step 2930: Obtain a control logic code corresponding to the second graphical code. The control logic code refers to a programming language encapsulated in the second graphical code.

[0211] In some embodiments, a programming language encapsulated in the second graphical code is acquired to obtain control code logic corresponding to the second graphical code.

[0212] Step 2940: Determine at least one virtual object to join the first formation.

[0213] In some embodiments, since the identification information corresponding to at least one virtual object joining the first formation and the identification information of the first formation have been bound, the at least one virtual object joining the first formation can be quickly found directly based on the identification information of the first formation.

[0214] Exemplarily, since a correspondence table is established between virtual objects and formations, at least one virtual object added to the first formation can be quickly found from the correspondence table directly based on the identification information of the first formation.

[0215] For example, since dynamic links have been established between the first team and at least one virtual object that joins the first team, the dynamic link of the first team is directly used to link to the at least one virtual object that joins the first team. This method of directly establishing dynamic links to search for virtual objects that join the team can improve search efficiency.

[0216] Step 2950: Execute the control logic code to uniformly control at least one virtual object that joins the first formation.

[0217] In some embodiments, after determining at least one virtual object, control logic code is used to control each virtual object individually, i.e., simultaneously controlling each virtual object. For example, if the control logic code is a programming language that controls a flight to the left by 1 meter, this programming language is used to control each virtual object in the formation.

[0218] In some embodiments, there is no priority order when controlling at least one virtual object. For example, the target application includes multiple executors, with the sth executor executing control logic code to control the sth virtual object added to the first formation, where s is a positive integer. Synchronizing multiple executors to control virtual objects facilitates faster processing and improved code execution efficiency.

[0219] In some embodiments, there is a second graphical code having an execution condition, that is, the second graphical code can only be executed when the virtual object satisfies the condition. The execution condition of the second graphical code is exemplarily described below.

[0220] In some embodiments, the above method further includes at least one of the following steps S1 to S3 (not shown in the figure).

[0221] Step S1: obtaining status information corresponding to at least one virtual object added to a first formation, where the status information is used to reflect the real-time status of the virtual object.

[0222] In some embodiments, the state information includes the virtual object's current position information, color information, shape information, etc. In some embodiments, before executing the second graphical code, it is determined whether at least one virtual object in the first formation meets the execution condition of the second graphical code.

[0223] Step S2: When the status information corresponding to at least one virtual object joining the first formation does not meet the execution conditions of the second graphical code, continue to control the at least one virtual object joining the first formation until the status information corresponding to at least one virtual object joining the first formation meets the execution conditions of the second graphical code.

[0224] Exemplarily, the execution condition of the second graphical code is that the maximum distance between two virtual objects joining the first formation does not exceed 5 meters. In this case, the state information corresponding to at least one virtual object joining the first formation is obtained. If it is determined that the maximum distance between the two virtual objects joining the first formation is 3 meters, the execution of the second graphical code is permitted. Exemplarily, if it is determined that the maximum distance between the two virtual objects joining the first formation is 6 meters, the execution of the second graphical code is not permitted. Exemplarily, if the execution of the second graphical code is not permitted, the at least one virtual object joining the first formation needs to continue to be controlled until the state information corresponding to the at least one virtual object joining the first formation satisfies the execution condition of the second graphical code.

[0225] Step S3: When the state information corresponding to the at least one virtual object added to the first formation meets the execution condition of the second graphical code, the control logic code is executed to uniformly control the at least one virtual object added to the first formation.

[0226] The above steps S1 to S3 introduce how to execute graphical codes simultaneously. Taking the graphical code as a building block code as an example, when a drone in the group executes a building block, if the current state does not meet the prerequisite for executing the building block, other drones need to wait for the drone to adjust its state to a state that meets the execution of the building block. The drone formation executor will check the status of all drones in the group. If it meets the requirements, the building block will be executed; if it does not meet the requirements, the drones that do not meet the requirements for executing the building block will adjust their states. The drone formation executor (see the explanation of the following embodiment) will check the status of all drones in the group again in the next main loop of the life cycle, and repeat the cycle until all drones meet the requirements for executing the building block. For example, there are 3 drones in drone formation A, namely 1, 2, and 3. To let formation A perform circular motion around a certain point p, it is necessary to wait for drones 1, 2, and 3 to spin to a direction perpendicular to the current position and the line connecting the center of the circle, and then perform circular motion together.

[0227] In some embodiments, the above method further includes at least one of the following steps S4 to S6 (not shown in the figure).

[0228] Step S4: for the kth virtual object among the at least one virtual object, after executing the control logic code to control the kth virtual object, determining whether the kth virtual object is in a state where the execution of the second graphical code is completed, where k is a positive integer.

[0229] In some embodiments, a flag is set for all virtual objects, and when the kth virtual object is in a state where the execution of the second graphical code is completed, the value of the flag is a first value.

[0230] Exemplarily, when the control logic code is executed to control the kth virtual object, the value of the flag bit of the kth virtual object is changed from the second value to the first value. Exemplarily, the original value of the flag bit is the second value.

[0231] Step S5 , when the control logic code is executed and the kth virtual object is not controlled, it is determined that the kth virtual object is in an uncompleted execution state of the second graphical code, and the first value represents the completed execution state.

[0232] In some embodiments, when the kth virtual object is in an unfinished execution state for the second graphical code, the value of the flag bit is a second numerical value, and the second numerical value represents the unfinished execution state.

[0233] Exemplarily, when the control logic code is executed and the kth virtual object is not controlled, the value of the flag bit of the kth virtual object is not changed. Exemplarily, the original value of the flag bit is the second value.

[0234] Step S6, traverse at least one virtual object added to the first formation, and when all at least one virtual object added to the first formation is in a state of completing the execution of the second graphical code, execute the third graphical code, which is the graphical code located after the second graphical code in the graphical programming result.

[0235] In some embodiments, when all flag bits of at least one virtual object added to the first formation are a first value, it is considered that all of the at least one virtual object added to the first formation has completed execution of the second graphical code, and execution of the next graphical code of the second graphical code is permitted. In some embodiments, when one of the flag bits of at least one virtual object added to the first formation is a second value, it is considered that not all of the at least one virtual object added to the first formation has completed execution of the second graphical code, and execution of the next graphical code of the second graphical code is prohibited.

[0236] The above steps S4 to S6 introduce how to determine whether the graphical code has been executed. When the building block starts to execute, a flag (completed) is set to false for all drones in the group. When the building block is executed, the value of the flag is changed to true. The drone formation executor checks the value of the flag of the drones in the group in each main loop of the life cycle. If the flag of any drone is false, it means that the execution of the building block of this group of drones has not been completed. Otherwise, it means that the execution of the building block of this group of drones has been completed, and the execution of the subsequent building blocks can continue. For example, there are 3 drones in drone formation A, namely 1, 2, and 3. To move formation A to a certain point p, it is necessary to wait until drones 1, 2, and 3 have all flown to point p before executing the subsequent building blocks.

[0237] In some embodiments, the code type of the second graphical code is the first type or the second type.

[0238] In some embodiments, when the code type of the second graphical code is the first type, the control type of the second graphical code on at least one virtual object in the first formation is instantaneous control. Instantaneous control refers to modifying the attributes of the virtual object, such as, for example, modifying the color of the virtual object, modifying the lighting of the virtual object, modifying the clothing of the virtual object, etc.

[0239] In some embodiments, when the code type of the second graphical code is the second type, the control type of the second graphical code on at least one virtual object in the first formation is continuous control. Continuous control refers to controlling the virtual object for a first duration, such as controlling the virtual object to fly left at speed a for 1 minute, controlling the virtual object to fly around point b for 5 seconds, or controlling the virtual object to remain stationary for 1 hour.

[0240] In some embodiments, when the code type of the second graphical code is the second type, before executing the second graphical code, it is necessary to determine whether at least one virtual object joining the first formation meets the execution condition. For example, when the code type of the second graphical code is the second type, when executing the second graphical code, it is necessary to determine whether the execution of the second graphical code has been completed.

[0241] In some embodiments, when the code type of the second graphical code is the second type, it is not necessary to determine whether the at least one virtual object joining the first formation meets the execution condition before executing the second graphical code. For example, when the code type of the second graphical code is the second type, it is not necessary to determine whether the second graphical code has been executed completely when executing the second graphical code.

[0242] In some embodiments, when the code type of the second graphical code is the first type, before executing the second graphical code, it is necessary to determine whether at least one virtual object joining the first formation meets the execution condition. For example, when the code type of the second graphical code is the first type, when executing the second graphical code, it is necessary to determine whether the execution of the second graphical code has been completed.

[0243] In some embodiments, when the code type of the second graphical code is the first type, it is not necessary to determine whether at least one virtual object joining the first formation meets the execution condition before executing the second graphical code. For example, when the code type of the second graphical code is the first type, it is not necessary to determine whether the second graphical code has been executed completely before executing the second graphical code.

[0244] In some embodiments, drone formation blocks (i.e., graphical codes) can be divided into two categories based on the block execution time. The first category (i.e., the first type of graphical code described above) is blocks that do not need to be executed for a period of time (for example, setting properties such as speed or light, and the block is considered to have been executed after the properties are modified), and no special processing is required. The second category (i.e., the second type of graphical code described above) is blocks that need to be executed for a period of time (for example, a drone flies forward at a speed of t for t time, and the block is considered to have been executed after t time). Blocks executed by a group of drones for a period of time require special processing. Exemplarily, the special processing includes steps S1 to S6 above, that is, determining whether at least one virtual object joining the first formation meets the execution conditions and determining whether the graphical code has been executed.

[0245] This embodiment of the application takes into account that instantaneous control graphical code generally only needs to modify the value of the corresponding position, which is less likely to cause errors. Therefore, there is no need to determine whether the execution conditions are met and whether the execution has been completed. However, continuous control graphical code usually requires a period of execution, especially when there are many virtual objects in the formation, which is relatively prone to errors. Therefore, for continuous control graphical code, it is necessary to determine whether the execution conditions are met and whether the execution has been completed. This processing method helps ensure the smooth execution of graphical code and reduces the possibility of errors.

[0246] The technical solution provided in the embodiment of the present application also provides an error correction function for the formation.

[0247] Exemplarily, after obtaining at least one virtual object added to the formation according to the first graphical code, the rationality of the at least one virtual object being included in the same team is judged. If the judgment result is unreasonable, the execution of the code is suspended, and a formation error correction prompt message is sent. The formation error correction prompt message is used to be displayed on the user interface for the user to review, so that the formation can be modified in a timely manner. If the judgment result is reasonable, the formation error correction prompt message is not sent. Exemplarily, the formation error correction prompt message includes status information of the unreasonable virtual object, which is a virtual object that is considered to be inappropriate for the formation.

[0248] For example, the position information of each virtual object in the formation is obtained. If there is a virtual object with a large position deviation, the result is judged as unreasonable. For example, if there are 10 virtual objects in a formation, the distance between 9 virtual objects is less than a threshold, and only the distance between the 10th virtual object and the other 9 virtual objects is greater than the threshold, then the 10th virtual object is considered to have an error and the result is judged as unreasonable. If there is no virtual object with a large position deviation, the result is judged as reasonable.

[0249] Exemplarily, historical formation information (historical formations and objects that joined the formation) is obtained, and the current formation information is compared with the historical formation information. When the error is greater than a threshold, the result is judged to be unreasonable. Exemplarily, historical formation information (historical formations and objects that joined the formation) is obtained, and the current formation information is compared with the historical formation information. When the error is less than a threshold, the result is judged to be reasonable.

[0250] The technical solution provided by the embodiments of this application is to first determine the rationality of the first graphical code detected in the execution order each time a graphical programming result is obtained from the graphical programming result. Once the rationality is determined, the first graphical code is then executed. This approach can prevent explicit errors in advance and report them to the user in a timely manner, facilitating timely modification by the user, thereby improving code execution efficiency.

[0251] Please refer to Figure 30 , which shows a flowchart of a method for executing graphical code provided by one embodiment of the present application. The execution entity of each step of the method can be the terminal device 10 described above, or the client of the target application running on the terminal device 10, or the server 20. In the following method embodiments, for ease of description, only the execution entity of each step is described as a "computer device". The method can include at least one of the following steps (3010-3030).

[0252] Step 3010: Obtain a graphical programming result, where the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in the virtual scene.

[0253] Step 3020: Update the first correspondence table according to the first configuration information to obtain an updated first correspondence table. The first correspondence table is used to record the correspondence between the formation and the virtual object. The updated first correspondence table records the correspondence between the identification information of the first formation and the identification information corresponding to at least one virtual object joining the first formation.

[0254] In some embodiments, when executing the graphical programming result, the first correspondence table is updated each time the first graphical code is encountered. When the first graphical code is encountered for the first time during execution of the graphical programming result, the first correspondence table is created based on the first configuration information in the first graphical code. When the first graphical code is encountered again subsequently, only the first correspondence table needs to be updated.

[0255] In some embodiments, the first graphical code includes first configuration information, which is used to configure the virtual objects included in the first formation. The first configuration information includes identification information of the first formation and identification information corresponding to at least one virtual object added to the first formation.

[0256] In some embodiments, before step 3030, the second graphical code is compiled. If the compilation is successful, a compiled control logic code corresponding to the second graphical code is obtained. The compiled control logic code is executed to control at least one virtual object joining the first formation. The control logic code refers to the programming language encapsulated in the second graphical code. If the compilation is unsuccessful, a modification prompt message is sent, and the modification prompt message is used to instruct the second graphical code to be edited. Exemplarily, the modification prompt message includes a text prompt message, a voice broadcast message, a picture prompt message, etc.

[0257] In some embodiments, when executing the code, the programming language encapsulated in the graphical code needs to be compiled to obtain executable compiled code. For example, the graphical code is translated into C# code that can be run by Unity. In some embodiments, in addition to compiling the second graphical code, other graphical codes in the graphical programming result also need to be compiled.

[0258] In some embodiments, as Figure 31As shown in Figure 3100, the user is operating graphical code. In the block editing interface, perform operations on the graphical code (building blocks) (including dragging, dropping, and combining). Clicking the Run control compiles the graphical code. After the compiler compiles, if an error is reported, the user will be prompted to modify the code and try again. If no error is reported, the code will start running.

[0259] Step 3030: Execute the second graphical code included in the graphical programming result to uniformly control the at least one virtual object added to the first formation.

[0260] In some embodiments, the second graphical code includes second configuration information, where the second configuration information is used to indicate the first formation and parameters for controlling the first formation, and the second configuration information includes identification information and control parameter information of the first formation.

[0261] In some embodiments, the identification information of the first formation is used to find at least one virtual object added to the first formation from the updated first correspondence table, and the control parameter information is used to modify the original logic code corresponding to the second graphical code to obtain the control logic code corresponding to the second graphical code. The control logic code refers to the programming language encapsulated in the second graphical code.

[0262] In some embodiments, the identification information here is information used to characterize the formation, such as a number, label, or serial number. In some embodiments, if the second graphical code is "Formation 1 flies 1 meter to the left," the identification information of the first formation included in the second configuration information is "Formation 1," and the control parameter information is "left, 1 meter." For example, the original control code logic corresponding to the second graphical code is consistent, that is, the programming language encapsulated in the second graphical code is consistent. Therefore, whether flying left or right, only the control parameters are different, while the original control code logic is consistent. Therefore, it is only necessary to modify the control parameters in the programming language to obtain the control logic code corresponding to the second graphical code.

[0263] In some embodiments, the control parameter information in the second configuration information is used to modify the programming language encapsulated in the second graphical code to obtain a modified programming language, and the modified programming language is used to control at least one virtual object added to the first formation.

[0264] In some embodiments, third configuration information is obtained, and the third configuration information is used to configure the virtual object created in the virtual scene. The third configuration information includes identification information of the created virtual object and instance information of the created virtual object. The instance information is used to indicate the configuration information corresponding to the virtual object.

[0265] For example, a user may create a new virtual object in a graphical programming tool and may also modify the configuration information of the new virtual object, so the instance information of the virtual object is determined based on the last saved created virtual object and its corresponding configuration information.

[0266] In some embodiments, the second correspondence table is updated according to the third configuration information to obtain an updated second correspondence table. The second correspondence table is used to record the correspondence between the virtual object and the instance information. The instance information is used to provide configuration information corresponding to the virtual object when executing the second graphical code to control the virtual object.

[0267] Exemplarily, the second correspondence table is constructed according to the instance information of the original created virtual object.

[0268] In some embodiments, for a first virtual object among the created virtual objects, when executing the second graphical code to control the first virtual object, instance information of the first virtual object is retrieved from the updated second correspondence table based on the identification information of the first virtual object.

[0269] Exemplarily, the computer device pre-stores an original second correspondence table, which is used to record the correspondence between virtual objects and instance information. Specifically, the second correspondence table records the configured virtual objects in the virtual scene in a tabular format. Exemplarily, the identification information of each virtual object corresponds to the instance information of the virtual object. Exemplarily, the instance information includes the configuration information of the virtual object, including the position, color, lighting, etc. of the virtual object.

[0270] In some embodiments, the instance information of the first virtual object in the second correspondence table is updated according to the control result of the first virtual object.

[0271] For example, when the control logic code corresponding to the second graphical code is used to control the first virtual object, the control is performed based on the instance information of the virtual object. Therefore, when control begins, the corresponding instance information needs to be found. When control ends, the configuration information of the virtual object changes, and the changed configuration information needs to be used to update the instance information of the first virtual object.

[0272] In some embodiments, when the second graphical code is executed and the first virtual object is not controlled, the instance information of the first virtual object in the second correspondence table is not updated.

[0273] For example, when the second graphical code is executed and the first virtual object is not controlled, it means that the first virtual object is not controlled, and the configuration information is unchanged, and there is no need to update the instance information of the first virtual object in the second correspondence table.

[0274] Taking the virtual drone as an example, the core of code-based control of a drone formation lies in its runtime implementation. The drone formation runtime relies on the lifecycle provided by Unity. In each main loop of the lifecycle, the drone's status is updated based on its attributes (basic properties such as speed and direction, which are used to calculate the drone's motion for that frame and update its position, orientation, and other status). The target application for the drone formation runtime consists of two parts: the formation drone manager and the drone formation executor.

[0275] Please refer to Figure 32 , which shows a schematic diagram of the component structure provided by an embodiment of the present application. Figure 32 As shown in 3200, the formation drone manager class is a singleton (a singleton is a creational design pattern that ensures that a class has only one instance and provides a global node for accessing the instance). It provides the following functions to the outside world, including adding a new drone, deleting a drone, modifying drone information, obtaining a drone instance through the drone's identification information (a drone instance refers to the specific implementation of a drone object), adding a drone to a formation, deleting a drone from a formation, and obtaining a list of identification information of a group of drones through the formation's identification information. All user operations on drones in the function panel interface are managed by the formation drone manager. Exemplarily, the formation drone manager maintains each virtual object in the formation and the instance information of each virtual object. Exemplarily, the formation drone manager is used to dynamically update at least one of the above-mentioned first correspondence table and the above-mentioned second correspondence table.

[0276] The Drone Formation Executor class is created and dynamically mounted by the Drone Formation Runtime class. It is responsible for executing the lifecycle state management of user code. The Drone Formation Executor class inherits from the Unity script base class Monobehaviour and is driven by the Mono script lifecycle functions. It determines whether to execute the next action in the user code, thereby driving the Drone Formation Runtime to execute the next action and update the state of all drones. In other words, the Drone Formation Executor is used to execute the control logic code corresponding to each graphical code to control at least one virtual object in the formation, updating its properties or controlling its movement.

[0277] In some embodiments, when the edited graphical code is compiled, the graphical code controlling a single virtual object includes the drone's identification information, while the graphical code controlling a formation (including the first graphical code and the second graphical code) includes the formation's identification information. For example, taking a drone as the virtual object, the drone formation manager contains a table of correspondences between drone identification information and drone instance information. The drone's identification information can be used to retrieve the corresponding drone instance information, and once the drone instance information is retrieved, the drone can be controlled.

[0278] like Figure 33 As shown, the edited graphical code 3300 is used to control a single drone. The control logic code 3301 corresponding to the edited graphical code 3300 includes the identification information (droneID) of the single drone. The edited first graphical code 3302 is used to add the virtual drone to a formation. The control logic code 3303 corresponding to the edited first graphical code 3302 includes the identification information (droneID) of the drone and the identification information (formationID) of the formation to be added.

[0279] The technical solution provided in the embodiment of the present application uses the first configuration information to construct a first correspondence table, that is, to establish a correspondence between the formation and the virtual object, and constructs a second correspondence table based on the third configuration information, that is, the correspondence between the virtual object and the instance. The second configuration information can be used to find the identification information of the virtual object joining the formation from the first object relationship table, and then by looking up the second correspondence table, the instance information of the virtual object joining the formation can be found, thereby realizing control over the virtual object. The technical solution provided in the embodiment of the present application can realize rapid search for virtual objects, which is conducive to realizing unified control of virtual objects in the formation, thereby improving code execution efficiency.

[0280] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0281] Please refer to Figure 34 , which shows a block diagram of a graphical code execution device provided by an embodiment of the present application. Figure 34 As shown, the device 3400 may include: a result acquisition module 3410 and a code execution module 3420.

[0282] A result acquisition module 3410 is used to acquire a graphical programming result, wherein the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in the virtual scene;

[0283] A code execution module 3420 is configured to execute a first graphical code included in the graphical programming result, and add at least one virtual object in the virtual scene to a first formation;

[0284] The code execution module 3420 is further configured to execute the second graphical code included in the graphical programming result, and perform unified control over the at least one virtual object added to the first formation.

[0285] In some embodiments, the code execution module 3420 is configured to obtain a control logic code corresponding to the second graphical code, where the control logic code refers to a programming language encapsulated in the second graphical code.

[0286] The code execution module 3420 is configured to determine the at least one virtual object to be added to the first formation.

[0287] The code execution module 3420 is used to execute the control logic code to uniformly control the at least one virtual object added to the first formation.

[0288] In some embodiments, the code execution module 3420 is used to obtain status information corresponding to the at least one virtual object added to the first formation, where the status information is used to reflect the real-time status of the virtual object.

[0289] The code execution module 3420 is used to continue controlling the at least one virtual object added to the first formation until the status information corresponding to the at least one virtual object added to the first formation meets the execution condition of the second graphical code when the status information corresponding to the at least one virtual object added to the first formation does not meet the execution condition of the second graphical code.

[0290] In some embodiments, the code execution module 3420 is also used to execute the control logic code and perform unified control of the at least one virtual object joining the first formation when the status information corresponding to the at least one virtual object joining the first formation meets the execution condition of the second graphical code.

[0291] The code execution module 3420 is also used to determine, for the kth virtual object among the at least one virtual object, after executing the control logic code and controlling the kth virtual object, whether the kth virtual object is in a state where the execution of the second graphical code is completed, where k is a positive integer.

[0292] The code execution module 3420 is further configured to, when executing the control logic code and failing to control the k-th virtual object, determine that the k-th virtual object is in a state where the second graphical code has not been completely executed.

[0293] The code execution module 3420 is used to traverse the at least one virtual object added to the first formation, and when all the at least one virtual object added to the first formation is in a state of completing the execution of the second graphical code, execute the third graphical code, where the third graphical code is the graphical code located after the second graphical code in the graphical programming result.

[0294] In some embodiments, the code type of the second graphical code is a first type or a second type.

[0295] When the code type of the second graphical code is the first type, the control type of the second graphical code on the at least one virtual object in the first formation is instantaneous control, and the instantaneous control refers to modifying the attributes of the virtual object.

[0296] When the code type of the second graphical code is the second type, the control type of the second graphical code on the at least one virtual object in the first formation is continuous control, and the continuous control refers to controlling the virtual object for a first duration.

[0297] In some embodiments, the first graphical code includes first configuration information, and the first configuration information is used to configure the virtual objects included in the first formation. The first configuration information includes identification information of the first formation and identification information corresponding to the at least one virtual object added to the first formation.

[0298] The code execution module 3420 is used to update the first correspondence table according to the first configuration information to obtain an updated first correspondence table, wherein the first correspondence table is used to record the correspondence between the formation and the virtual object, and the updated first correspondence table records the correspondence between the identification information of the first formation and the identification information corresponding to the at least one virtual object joining the first formation.

[0299] In some embodiments, the second graphical code includes second configuration information, and the second configuration information is used to indicate the first formation and parameters for controlling the first formation. The second configuration information includes identification information and control parameter information of the first formation.

[0300] The identification information of the first formation is used to find the at least one virtual object added to the first formation from the updated first correspondence table, and the control parameter information is used to modify the original logic code corresponding to the second graphical code to obtain the control logic code corresponding to the second graphical code, and the control logic code refers to the programming language encapsulated in the second graphical code.

[0301] In some embodiments, the result acquisition module 3410 is further configured to acquire third configuration information, where the third configuration information is used to configure a virtual object created in the virtual scene, where the third configuration information includes identification information of the created virtual object and instance information of the created virtual object, where the instance information is used to indicate configuration information corresponding to the virtual object.

[0302] The result acquisition module 3410 is also used to update the second correspondence table according to the third configuration information to obtain an updated second correspondence table, where the second correspondence table is used to record the correspondence between the virtual object and the instance information, and the instance information is used to provide the configuration information corresponding to the virtual object when executing the second graphical code to control the virtual object.

[0303] The result acquisition module 3410 is also used to, for a first virtual object among the created virtual objects, search for instance information of the first virtual object from the updated second correspondence table according to the identification information of the first virtual object when executing the second graphical code to control the first virtual object.

[0304] The result acquisition module 3410 is further configured to update the instance information of the first virtual object in the second correspondence table according to the control result of the first virtual object.

[0305] The result acquisition module 3410 is further configured to not update the instance information of the first virtual object in the second correspondence table when the second graphical code is executed and the first virtual object is not controlled.

[0306] In some embodiments, the code execution module 3420 is also used to compile the second graphical code. If the compilation is successful, the compiled control logic code corresponding to the second graphical code is obtained. The compiled control logic code is run to control the at least one virtual object joining the first formation. The control logic code refers to the programming language encapsulated in the second graphical code.

[0307] The code execution module 3420 is further configured to send a modification prompt message when the compilation is unsuccessful, wherein the modification prompt message is used to instruct to edit the second graphical code.

[0308] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, 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 content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0309] Please refer to Figure 35 , which shows a block diagram of a computer device 3500 provided in one embodiment of the present application. The computer device 3500 can be any electronic device with data computing, processing, and storage capabilities. The computer device 3500 can be used to implement the graphical code execution method provided in the above embodiment.

[0310] Typically, the computer device 3500 includes a processor 3501 and a memory 3502 .

[0311] The processor 3501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 3501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or PLA (Programmable Logic Array). The processor 3501 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 3501 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 3501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0312] Memory 3502 may include one or more computer-readable storage media, which may be non-transitory. Memory 3502 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage media in memory 3502 is used to store a computer program configured to be executed by one or more processors to implement the aforementioned graphical code execution method.

[0313] Those skilled in the art will understand that Figure 35 The structure shown in the figure does not constitute a limitation on the computer device 3500, and the computer device 3500 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0314] In an exemplary embodiment, a computer-readable storage medium is further provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the computer program implements the above-mentioned method for executing the graphical code. Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0315] In an exemplary embodiment, a computer program product is further provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned graphical code execution method.

[0316] It should be noted that the collection and processing of relevant data in this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in practice, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0317] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application do not limit this.

[0318] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for executing graphical code, characterized in that: The method comprises: Obtaining a graphical programming result, wherein the graphical programming result includes a plurality of graphical codes executed in sequence, wherein the graphical codes are used to process one or more virtual objects in a virtual scene; executing a first graphical code included in the graphical programming result to add at least one virtual object in the virtual scene to a first formation; The second graphical code included in the graphical programming result is executed to uniformly control the at least one virtual object added to the first formation.

2. The method according to claim 1, characterized in that The executing the second graphical code included in the graphical programming result to uniformly control the at least one virtual object added to the first formation includes: Obtaining a control logic code corresponding to the second graphical code, where the control logic code refers to a programming language encapsulated in the second graphical code; determining the at least one virtual object to join the first formation; The control logic code is executed to uniformly control the at least one virtual object that joins the first formation.

3. The method according to claim 2, characterized in that The executing the control logic code to control the at least one virtual object added to the first formation respectively includes: Acquire status information corresponding to each of the at least one virtual object added to the first formation, where the status information is used to reflect the real-time status of the virtual object; If the state information corresponding to the at least one virtual object added to the first formation does not satisfy the execution condition of the second graphical code, continue to control the at least one virtual object added to the first formation until the state information corresponding to the at least one virtual object added to the first formation satisfies the execution condition of the second graphical code; When the status information corresponding to the at least one virtual object added to the first formation meets the execution condition of the second graphical code, the control logic code is executed to uniformly control the at least one virtual object added to the first formation.

4. The method according to claim 2, characterized in that The method further comprises: For a kth virtual object among the at least one virtual object, after executing the control logic code to control the kth virtual object, determining that the kth virtual object is in a state where execution of the second graphical code is completed, where k is a positive integer; When the control logic code is executed and the k-th virtual object is not controlled, determining that the k-th virtual object is in a state where the second graphical code has not been completely executed; Traverse the at least one virtual object added to the first formation, and when all of the at least one virtual object added to the first formation are in a state of completing the execution of the second graphical code, execute a third graphical code, where the third graphical code is a graphical code that follows the second graphical code in the graphical programming result.

5. The method according to claim 1, wherein The code type of the second graphical code is the first type or the second type; When the code type of the second graphical code is the first type, the control type of the second graphical code on the at least one virtual object in the first formation is instantaneous control, and the instantaneous control refers to modifying the attributes of the virtual object; When the code type of the second graphical code is the second type, the control type of the second graphical code on the at least one virtual object in the first formation is continuous control, and the continuous control refers to controlling the virtual object for a first duration.

6. The method according to claim 1, characterized in that The first graphical code includes first configuration information, the first configuration information being used to configure virtual objects included in the first formation, the first configuration information including identification information of the first formation and identification information corresponding to the at least one virtual object added to the first formation; The executing the first graphical code included in the graphical programming result to add at least one virtual object in the virtual scene to the first formation includes: According to the first configuration information, the first correspondence table is updated to obtain an updated first correspondence table, wherein the first correspondence table is used to record the correspondence between the formation and the virtual object, and the updated first correspondence table records the correspondence between the identification information of the first formation and the identification information corresponding to the at least one virtual object joining the first formation.

7. The method according to claim 6, characterized in that The second graphical code includes second configuration information, where the second configuration information is used to indicate the first formation and parameters for controlling the first formation, and the second configuration information includes identification information and control parameter information of the first formation; The identification information of the first formation is used to find the at least one virtual object added to the first formation from the updated first correspondence table, and the control parameter information is used to modify the original logic code corresponding to the second graphical code to obtain the control logic code corresponding to the second graphical code, and the control logic code refers to the programming language encapsulated in the second graphical code.

8. The method according to claim 1, characterized in that The method further comprises: Obtaining third configuration information, where the third configuration information is used to configure a virtual object created in the virtual scene, the third configuration information including identification information of the created virtual object and instance information of the created virtual object, where the instance information is used to indicate configuration information corresponding to the virtual object; According to the third configuration information, the second correspondence table is updated to obtain an updated second correspondence table, wherein the second correspondence table is used to record the correspondence between the virtual object and the instance information, and the instance information is used to provide the configuration information corresponding to the virtual object when the second graphical code is executed to control the virtual object.

9. The method according to claim 8, characterized in that The method further comprises: For a first virtual object among the created virtual objects, when executing the second graphical code to control the first virtual object, searching the updated second correspondence table for instance information of the first virtual object according to the identification information of the first virtual object; updating instance information of the first virtual object in the second correspondence table according to a control result of the first virtual object; When the second graphical code is executed and the first virtual object is not controlled, the instance information of the first virtual object in the second correspondence table is not updated.

10. The method according to claim 1, characterized in that Before executing the second graphical code included in the graphical programming result, the method further includes: Compiling the second graphical code, and if the compilation is successful, obtaining compiled control logic code corresponding to the second graphical code, wherein the compiled control logic code is executed to control the at least one virtual object joining the first formation, the control logic code being a programming language encapsulated in the second graphical code; In the case of unsuccessful compilation, a modification prompt message is sent, where the modification prompt message is used to instruct to edit the second graphical code.

11. A graphical code execution device, characterized in that: The device comprises: a result acquisition module, configured to acquire a graphical programming result, wherein the graphical programming result includes a plurality of graphical codes executed in sequence, and the graphical codes are used to process one or more virtual objects in a virtual scene; a code execution module, configured to execute a first graphical code included in the graphical programming result, and add at least one virtual object in the virtual scene to a first formation; The code execution module is further configured to execute a second graphical code included in the graphical programming result, and perform unified control over the at least one virtual object added to the first formation.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the graphical code execution method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the graphical code execution method according to any one of claims 1 to 10.

14. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. A processor reads and executes the computer program from the computer-readable storage medium to implement the graphical code execution method according to any one of claims 1 to 10.