Visual programming method and device, equipment, storage medium and program product

By displaying the availability status of programming blocks in real time within the programming interface, the problem of runtime errors caused by incorrect selection of programming blocks is solved, thus improving programming efficiency and code standardization.

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

Patent Information

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

AI Technical Summary

Technical Problem

In existing visual programming, errors in program code execution due to incorrect selection of programming blocks reduce programming efficiency and increase debugging difficulty.

Method used

By displaying the availability status of programming blocks in real time in the programming interface, the availability of blocks is determined based on their relationships and usage status, avoiding the generation of incorrect program code from blocks, and providing availability judgment and prompt functions for programming blocks.

Benefits of technology

It improves programming efficiency, reduces programming difficulty, avoids the generation of unnecessary or redundant program code, and enhances the standardization and correctness of program code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064327A_ABST
    Figure CN122064327A_ABST
Patent Text Reader

Abstract

The invention discloses a visual programming method and device, equipment, a storage medium and a program product, and belongs to the technical field of computers. The method comprises the steps that a programming interface is displayed, the programming interface comprises at least one programming building block, and the programming building blocks are used for representing basic elements for generating program codes; in response to a change operation of an association relationship of a first programming building block in the programming building blocks, determining availability of the first programming building block; the first programming building blocks in a first state or a second state are displayed based on the availability of the first programming building blocks, the first state represents that the first programming building blocks are used for generating program codes corresponding to the first programming building blocks, and the second state represents that the first programming building blocks are limited to generate the corresponding program codes. According to the method, whether the first programming building block is available or not can be visually known by displaying the first state or the second state of the first programming building block, the correct first programming building block can be selected in the programming process, the programming difficulty is reduced, and the programming efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the continuous development of computer technology, visual programming (also known as block programming) has been widely used in programming education and software development due to its simplicity and intuitiveness.

[0003] In related technologies, visual programming clients provide different types of programming blocks, which can represent the basic elements that make up code. For example, programming blocks can represent basic elements such as variables, functions, conditional statements, and loops. Based on the connections between programming blocks, corresponding program code can be generated. When an incorrect programming block is selected, it will cause the program code to run incorrectly and display error messages. The problem can only be identified after reviewing the error messages, reducing the efficiency of visual programming. Summary of the Invention

[0004] This application provides a method, apparatus, device, storage medium, and program product for visual programming, which reduces programming difficulty and improves programming efficiency. The technical solution is as follows.

[0005] Firstly, a visual programming method is provided, the method comprising:

[0006] The programming interface is displayed, which includes at least one programming block, which represents the basic elements for generating program code.

[0007] In response to a change in the association of the first programming block in the programming blocks, determine the availability of the first programming block;

[0008] Based on the availability of the first programming block, the first programming block is displayed in either a first state or a second state. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

[0009] Secondly, a visual programming apparatus is provided, the apparatus comprising:

[0010] A display module is used to display a programming interface, the programming interface including at least one programming block, the programming block being used to represent the basic elements for generating program code;

[0011] A determination module is used to determine the availability of the first programming block in response to a change operation in the association relationship of the first programming block in the programming blocks;

[0012] The display module is further configured to display the first programming block in a first state or a second state based on the availability of the first programming block. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

[0013] In one possible implementation, the determining module is used to determine the scope of the first programming block; obtain the usage status of the first programming block; and determine the availability of the first programming block based on the usage status and scope of the first programming block.

[0014] In one possible implementation, the determining module is further configured to obtain the type of the second programming block and the type of a reference programming block, wherein the programming block of the reference programming block type is a programming block type that can be associated with the second programming block; and when the type of the first programming block is the same as the type of the reference programming block, and a change operation on the association relationship of the first programming block is received, the association relationship between the first programming block and the second programming block is changed from unassociated to associated.

[0015] In one possible implementation, the programming interface further includes a delete control for deleting programming blocks. The determining module is also used to determine a selected third programming block among the programming blocks, the third programming block being associated with the first programming block. The determining module is used to determine the availability of the first programming block when the selected third programming block is deleted based on the delete control.

[0016] In one possible implementation, the programming interface further includes a delete control for deleting programming blocks, and the determining module is used to determine the availability of the first programming blocks when the number of the first programming blocks is two or more and any first programming block is deleted based on the delete control.

[0017] In one possible implementation, the determining module is further configured to, in response to a movement operation of a fourth programming block among the programming blocks, determine a reference programming block, wherein the fourth programming block is associated with the first programming block, and the reference programming block is associated with at least one of the first programming block or the fourth programming block; the determining module is configured to determine the availability of the first programming block if the movement operation indicates that the association between the fourth programming block and the reference programming block has been established; or, if the movement operation indicates that the association between the fourth programming block and the reference programming block has been canceled, determine the availability of the first programming block.

[0018] In one possible implementation, the display module is further configured to display a prompt control in a prompt state when the first programming block is in a second state, the prompt state indicating that there is an error in the use of the first programming block; and to display first prompt information in response to the triggering operation of the prompt control, the first prompt information being used to prompt the corresponding error content during the use of the first programming block.

[0019] In one possible implementation, the display module is further configured to generate positioning information in response to the first prompt information or a trigger operation of a control associated with the first prompt information, the positioning information including the position information of the first programming block in the second state; and display the first programming block in the second state based on the positioning information.

[0020] In one possible implementation, the programming interface includes a programming area for placing programming blocks. The display module is further configured to display two or more programming blocks in the programming area of ​​the programming interface. If any programming block is not associated with the remaining programming blocks, a second prompt message is displayed, which is used to prompt the programming blocks that are not associated.

[0021] In one possible implementation, the device further includes a generation module and a running module. The generation module is used to generate program code using the programming blocks in the first state of the programming interface and the relationships between the programming blocks. The running module is used to display the running result of the program code after it is run.

[0022] Thirdly, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to enable the computer device to implement any of the above-described visual programming methods.

[0023] Fourthly, a computer-readable storage medium is also provided, wherein at least one piece of program code is stored therein, the at least one piece of program code being loaded and executed by a processor to enable a computer to implement any of the above-described methods of visual programming.

[0024] Fifthly, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement any of the above-described visual programming methods.

[0025] The technical solution provided in this application brings at least the following beneficial effects:

[0026] When the association of the first programming block displayed in the programming interface changes, this application displays either the first programming block in the first state (available state) or the first programming block in the second state (unavailable state) in the programming interface. By observing the display state of the first programming block, one can intuitively understand whether the first programming block is available, which helps to select the correct first programming block during the programming process, reduces programming difficulty, and improves programming efficiency.

[0027] In addition, the first programming block in the second state is restricted from generating corresponding program code, which helps to avoid generating unnecessary or redundant program code during the programming process, helps to improve the standardization and correctness of the program code generated by visual programming, and reduces debugging time. Attached Figure Description

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

[0029] Figure 1 This is a structural block diagram of a computer system provided in an embodiment of this application;

[0030] Figure 2 This is a flowchart illustrating a visual programming method provided in an embodiment of this application;

[0031] Figure 3 This is a schematic diagram of a programming interface containing custom-type programming blocks provided in an embodiment of this application;

[0032] Figure 4 This is a schematic diagram of a programming interface for creating parameter programming blocks and signal usage programming blocks, provided in an embodiment of this application;

[0033] Figure 5 This is a flowchart illustrating the creation of parametric programming blocks and signal usage programming blocks, and the determination of the availability of parametric programming blocks, provided in an embodiment of this application.

[0034] Figure 6 This is a schematic diagram of a programming interface for deleting signal programming blocks provided in an embodiment of this application;

[0035] Figure 7 This is a flowchart illustrating a deletion signal programming block and a parameter determination programming block provided in an embodiment of this application;

[0036] Figure 8 This is a schematic diagram of a programming interface for deleting parameter programming blocks provided in an embodiment of this application;

[0037] Figure 9 This is a flowchart illustrating the process of deleting a parameter programming block and determining the availability of a parameter block that has not been deleted, as provided in an embodiment of this application.

[0038] Figure 10 This is a schematic diagram of another programming interface for creating parameter programming blocks and signal receiving programming blocks provided in an embodiment of this application;

[0039] Figure 11 This is a flowchart illustrating how to establish the association between parametric programming blocks and received signal programming blocks, and how to determine the availability of parametric programming blocks, as provided in an embodiment of this application.

[0040] Figure 12 This is a schematic diagram of a programming interface for canceling the association between a signal programming block and a receiving signal programming block, provided in an embodiment of this application.

[0041] Figure 13 This is a flowchart illustrating how to disconnect the association between the parameter programming block and the received signal programming block, and how to determine the availability of the parameter programming block, according to an embodiment of this application.

[0042] Figure 14 This is a schematic diagram of a process interface for displaying the first prompt information provided in an embodiment of this application;

[0043] Figure 15 This is a schematic diagram of a programming interface in the process of displaying second information provided in an embodiment of this application;

[0044] Figure 16 This is a schematic diagram of the structure of a visual programming device provided in an embodiment of this application;

[0045] Figure 17 This is a structural block diagram of a terminal device provided in an embodiment of this application;

[0046] Figure 18 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

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

[0048] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0049] First, let me introduce the terms used in this application:

[0050] Visual programming, also known as block programming, is a programming paradigm that uses graphical blocks or modules to represent the logic and functionality of a program. It's a graphical interface-based programming method designed to reduce programming complexity, enabling non-professional developers to easily understand and create programs.

[0051] Programming blocks, also known as code blocks, are the basic units in a code editor within visual programming. Each programming block represents a programming concept or operation; for example, it represents a basic element used to construct executable code, also called a basic unit. These basic units of executable code can include, but are not limited to, variables, functions, conditions, and loops. In some implementations, different types of programming blocks have different shapes and colors, allowing users to easily identify and combine different types of programming blocks.

[0052] The programming area, also known as the workspace or canvas area, is the main area where users drag, drop, create, and edit programming blocks. Users can drag programming blocks into the programming area of ​​the code editor, where different blocks are combined. The code editor can then connect the code corresponding to the blocks and set the call relationships between the codes, thereby generating the corresponding program code. This program code enables certain functions within the application. The programming area also stores the current program state, including information such as the programming blocks, their arrangement, and their connections.

[0053] Programming Block Candidate Area: This area displays available programming blocks. It typically appears as a pop-up sidebar, allowing users to drag and drop the desired blocks into the programming area for programming. The programming blocks displayed in the candidate area can be customized according to the user's needs.

[0054] Figure 1 This is a structural block diagram of a computer system provided in an embodiment of this application, such as... Figure 1 As shown, the computer system includes a terminal device 101 and a server 102. The terminal device 101 has a client that supports visual programming installed and running, and user 103 is logged into the client. Therefore, the terminal device 101 is the terminal device used by user 103. The visual programming method provided in this embodiment can be executed by the terminal device 101, or it can be executed jointly by the terminal device 101 and the server 102; this embodiment does not limit the execution in this way.

[0055] Server 102 provides background services for the client supporting visual programming installed on terminal device 101. In one possible implementation, server 102 undertakes the main computational work, and terminal device 101 undertakes the secondary computational work. Alternatively, server 102 undertakes the secondary computational work, and terminal device 101 undertakes the main computational work. Or, terminal device 101 and server 102 collaborate on computation using a distributed computing architecture.

[0056] For example, the client supporting visual programming can be a game client, or it can be other types of clients, and this application embodiment does not limit this. For example, based on the premise that the client supporting visual programming is a game client, the game client can be a third-person shooter (TPS) game, a first-person shooter (FPS) game, a multiplayer online battle arena (MOBA) game, a multiplayer shooting survival game, a massively multiplayer online role-playing game (MMO), an action role-playing game (ARPG), a virtual reality (VR) client, an augmented reality (AR) client, a 3D map program, a map simulation program, a social client, an interactive entertainment client, etc.

[0057] Clients supporting visual programming can refer to clients that require independent download and installation, or to embedded programs that depend on a host program to run. An embedded program is an application developed using a programming language that relies on a host program to run. Embedded programs do not require download and installation; they only need to be dynamically loaded into the host program to run. Embedded programs include, but are not limited to, applets. This application embodiment does not limit the type of client. Users can find the embedded program they need through searching, scanning, or other methods, open it, and run it. After use, closing the app will not occupy the terminal device's memory.

[0058] In this embodiment, a client supporting visual programming can provide UGC (User-Generated Content) gameplay by executing the visual programming method provided in this embodiment. Users can build game scenes themselves through UGC gameplay, or edit and modify existing game scenes. Building game scenes themselves refers to game scenes created, designed, and contributed by game users. Users can use in-game creation tools and code editors to build their own game scenes and code. They can also design terrain, buildings, props, obstacles, skills, event triggering logic, etc., to create unique game environments and levels. These scenes can be various types of game scenes, such as adventure, racing, shooting, and role-playing.

[0059] Furthermore, users can build game element programming blocks through the graphical programming interface provided by the UGC gameplay. Each programming block corresponds to a piece of program code. Based on the program code corresponding to each built programming block, the program code corresponding to the game element can be obtained, thus enabling game elements in the game scene to operate according to their corresponding program code. Since game elements can be virtual devices or non-user-controlled virtual objects (Non-PlayerCharacters, NPCs), this game client can make virtual devices and NPCs in the virtual environment operate according to the edited program code.

[0060] In this context, a virtual environment refers to the environment provided (or displayed) by an application while it is running on a terminal device. This virtual environment is a created environment for virtual objects to perform activities. The virtual environment can be a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment, etc. It can be a simulation of the real world, a semi-simulation of the real world, or a purely fictional environment. For example, the virtual environment involved in this embodiment is a three-dimensional virtual environment. A virtual object refers to an active object in the virtual environment, which can be a virtual character, virtual animal, anime character, etc. Users can manipulate virtual objects through peripheral components or by clicking on a touchscreen. Each virtual object has its own shape and volume in the virtual environment, occupying a portion of the space within the virtual environment. For example, when the virtual environment is a three-dimensional virtual environment, the virtual object is a three-dimensional model created based on animation skeletal technology.

[0061] Optionally, the terminal device 101 can be any electronic device product capable of human-computer interaction with the user through one or more methods such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. For example, the terminal device 101 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, PC (Personal Computer), mobile phone, PDA (Personal Digital Assistant), wearable device, PPC (Pocket PC), smart car system, smart TV, etc.

[0062] Terminal device 101 can refer to one of a plurality of terminal devices. This embodiment uses terminal device 101 as an example. Those skilled in the art will know that the number of terminal devices 101 can be more or less. For example, there may be only one terminal device 101, or there may be dozens or hundreds of terminal devices 101, or more. This application embodiment does not limit the number or type of terminal devices 101.

[0063] Server 102 can be a single server, a server cluster consisting of multiple servers, or any of the following: a cloud computing platform or a virtualization center. This embodiment of the application does not limit this. Server 102 communicates directly or indirectly with terminal device 101 via wired or wireless communication. Server 102 has data receiving, data processing, and data sending functions. Of course, server 102 may also have other functions, which are not limited in this embodiment of the application.

[0064] In an exemplary embodiment of this application, a programming interface can be displayed on the terminal device 101, and multiple programming blocks can be displayed on the programming interface. The terminal device 101 detects a change operation in the association relationship of a first programming block among the multiple programming blocks, wherein the change operation includes establishing an association relationship between the first programming block and other programming blocks, or dissolving the association relationship between the first programming block and other programming blocks. The terminal device 101 sends relevant information about the change operation in the association relationship of the first programming block to the server 102 via the network. The server 102 determines the availability of the first programming block and sends the determination result of the availability of the first programming block to the terminal device 101 via the network. The terminal device 101 adjusts the state of the displayed first programming block based on the received availability of the first programming block, for example, displaying the first programming block in a first state (available state) or a second state (unavailable state).

[0065] Those skilled in the art should understand that the terminal device 101 and server 102 described above are merely illustrative examples. Other existing or future terminal devices or servers that are applicable to this application should also be included within the scope of protection of this application, and are hereby incorporated by reference.

[0066] This application provides a visual programming method, which can be applied to the above-mentioned... Figure 1 The computer system shown. Figure 2 The flowchart shown in this embodiment of the present application illustrates a visual programming method. This method can be implemented by... Figure 1 The terminal device 101 in the middle executes. For example... Figure 2 As shown, the method includes the following steps 201 to 203.

[0067] In step 201, a programming interface is displayed, which includes at least one programming block used to represent the basic elements for generating program code.

[0068] In an exemplary embodiment of this application, a client supporting visual programming is installed and runs on the terminal device, through which a programming interface is displayed. Exemplarily, this client includes an Integrated Development Environment (IDE), which is an application that provides a program development environment, generally including tools such as a code editor, compiler, debugger, and programming interface. This client can be an application based on the Blockly (visual programming tool) visual programming library.

[0069] The programming interface can include a programming area and a candidate programming block area. The programming area is used to place the selected programming blocks, while the candidate area offers various types of programming blocks. Users can select the type of programming block and then choose a specific block from that type, dragging and dropping the selected block into the programming area. The programming blocks displayed in the programming area can have their relationships determined based on their position. For example, if the first programming block is adjacent to the second programming block, they can be associated; or, if the first programming block is located within the second programming block, they can also be associated. The program code corresponding to associated programming blocks can be combined to obtain program code snippets.

[0070] In addition, the types of programming blocks can include, but are not limited to, event-type programming blocks, control-type programming blocks, action-type programming blocks, condition-type programming blocks, value-getting-type programming blocks, custom-type programming blocks, and variable-type programming blocks.

[0071] Among them, event-type programming blocks are used to provide candidate programming blocks for event types. These candidate programming blocks define when the program starts executing or triggers a specific operation, which typically involves user interaction or interactive events. For example, candidate programming blocks for event types could include clicking a specific game element or clicking a specific button.

[0072] Control-type programming blocks provide candidate programming blocks for control types. These candidate blocks control the execution flow of the program, which includes, but is not limited to, conditional statements, loops, waiting, and stopping. For example, candidate programming blocks for control types could include controlling game elements to repeatedly perform specified operations and pausing for a specified time.

[0073] Action-type programming blocks provide candidate programming blocks for action types, which are used to perform specific tasks or operations under specific conditions. For example, action-type candidate programming blocks can control the movement, rotation, and release of skills of virtual objects.

[0074] Conditional programming blocks provide candidate programming blocks for specific conditions, allowing for the execution of different program segments based on those conditions. For example, candidate programming blocks for conditional types might include signal-receiving blocks and signal-using blocks. Signal blocks can contain signals, a software communication mechanism used to deliver notifications and information between different components, objects, or processes. Signals allow for decoupled communication between different software components and are typically used to trigger event handlers or perform specific operations. Communication between signal-receiving and signal-using blocks conforms to the signal mechanism, a software design pattern that defines how signals are sent, received, and processed between different components or programming blocks. This mechanism facilitates modularity and reusability of programming blocks while reducing direct dependencies between components.

[0075] Value-based programming blocks provide candidate programming blocks of value types, which are used to retrieve various values ​​during program execution. For example, candidate programming blocks of value types could include retrieving a virtual character's position, health, attack power, and defense.

[0076] Custom-type programming blocks provide candidate programming blocks of custom types, which are used to create blocks with specific functions based on user needs. For example, candidate programming blocks of custom types can include custom signal programming blocks, which can be associated with variable-type programming blocks.

[0077] Variable-type programming blocks provide programming blocks for variable types, which are used to store and manage data during program execution. These blocks store signal parameters, which can be of various data types. Signal parameters, also called parameters, are a set of data or information associated with a signal. Signal parameters provide additional contextual information to the signal, allowing the receiver to perform corresponding operations or processes based on these parameters. Signal parameters can include various data types, such as integers, floating-point numbers, strings, and boolean values. By using signal parameters, components can achieve more flexible and efficient communication and collaboration.

[0078] In this embodiment of the application, the example is given where the programming area includes multiple trigger groups, and each trigger group includes multiple programming blocks. Figure 3 This is a schematic diagram of a programming interface including custom-type programming blocks provided in an embodiment of this application, such as... Figure 3As shown, the programming interface may include a programming area 301 and a programming block candidate area 302. The programming block candidate area 302 may include multiple programming block types 303. For example, the programming block type 303 may include programming blocks of event type, control type, action type, condition type, value type, function type, variable type, and custom type.

[0079] When a custom type is selected in programming block type 303, a custom option 304 is displayed, allowing users to create or select custom programming block types. For example, custom option 304 may include regular type programming blocks, value type programming blocks, and signal type programming blocks. When a signal type programming block is selected, a signal programming block creation area 305 is displayed, showing user-created signal programming blocks 306. For example, user-created signal programming blocks 306 may be "Homemade Signal 1" and "Homemade Signal 2," where the signal functions of "Homemade Signal 1" and "Homemade Signal 2" can be the same or different.

[0080] The signal programming block 306 may also include a signal parameter setting area 307, which is used to place the parameter programming block. When a parameter programming block is placed in the signal parameter setting area 307, the custom signal of the signal programming block 306 is associated with the parameter in the parameter programming block. For example, "Custom Signal 1" is associated with the signal parameter "Signal 1 Value 1", and "Custom Signal 2" is associated with the signal parameter "Signal 2 Value 1". Users can drag programming blocks under type 303 in the programming block candidate area 302 to the programming area 301. The programming blocks displayed in the programming area 301 can be used to generate corresponding program code.

[0081] When different programming blocks are adjacent or located within other programming blocks, they can be associated, meaning there is a relationship between them. For example, programming area 301 can display two trigger groups 308. Each trigger group can include a signal receiving programming block 309 and a signal using programming block 310, and these two blocks can be associated. Specifically, signal receiving programming block 309 is used to receive "homemade signal 1" and "homemade signal 2," and signal using programming block 310 is used to use "homemade signal 1" and "homemade signal 2." Furthermore, signal using programming block 310 can also include an object programming block 311, which represents the object on which the signal acts. For example, the object could be "numerical variable 1."

[0082] It should be noted that the above description of the programming blocks displayed in the programming interface is an illustrative example. Different programming blocks can be displayed in the programming area of ​​the programming interface based on actual programming needs, and this application does not impose any restrictions on this.

[0083] In step 202, in response to a change in the association of the first programming block in the programming blocks, the availability of the first programming block is determined.

[0084] In an exemplary embodiment of this application, the availability of a first programming block is determined based on changes to its association relationships. The process of determining the availability of a first programming block may include: determining the scope of the first programming block; obtaining the usage state of the first programming block; and determining the availability of the first programming block based on its usage state and scope.

[0085] For example, scope is the range of accessibility or lifetime of variables, functions, and objects in a program. Scope specifies where a variable can be accessed and its lifetime. The scope of the first programming block, i.e., its usage range or accessibility range, is obtained based on its attribute information. When the first programming block is located in the programming area of ​​the programming interface, it means that the first programming block is used. If the first programming block is used within its scope, it means that the first programming block is available; if it is used outside its scope, it means that the first programming block is unavailable. Specifically, when the first programming block is available, corresponding program code can be generated; when the first programming block is unavailable, corresponding program code is not generated.

[0086] Let's take the first programming block as an example of a parametric programming block. The scope of a parametric programming block can be global or partial. For example, if the parametric programming block is located within a signal programming block, then the scope of the parametric programming block can be the signal range of the associated signal programming region. In one embodiment, the program code corresponding to the signal programming block can be a function, and the function parameters corresponding to the parametric programming block can be local variables defined within the function; that is, the scope of the function parameters is within the function.

[0087] When the first programming block is used, that is, when the first programming block participates in generating the corresponding program code, the scope of the first programming block being used can be compared with the area where the first programming block is used. If the first programming block is used outside the scope, it is determined that the first programming block is unusable; if the first programming block is used within the scope, it is determined that the first programming block is usable.

[0088] For example, the program code corresponding to a signal programming block can be a function, and the function parameters corresponding to a parameter programming block can be local variables defined within the function. When the function is executed, the values ​​of the function parameters are passed to the function. The program code inside the function has access to the function parameters; that is, the function parameters are available, and then the function is executed. If the function parameters cannot be accessed or used outside the function, that is, if the function parameters are unavailable, then the function cannot obtain the function parameters when it is executed.

[0089] In the application of visual programming in games, for example, signal programming blocks can correspond to jump operations. The parameter programming blocks contained in the signal programming blocks can be jump height. That is to say, when controlling the virtual object to perform a jump operation, the jump height can be accessed, that is, the parameter programming blocks are available; when controlling the virtual object to perform other operations (such as attack operations, running operations), the jump height cannot be accessed, that is, the parameter programming blocks are unavailable.

[0090] In this embodiment of the application, by determining the availability of the first programming block, the misuse of the first programming block can be avoided, thereby effectively avoiding logical errors in the program code of the first programming block during runtime, reducing programming difficulty and subsequent program debugging difficulty, and improving programming efficiency.

[0091] The availability of the first programming block can be determined based on changes to its associations, including but not limited to cases one through three. Cases one through three are explained below.

[0092] Scenario 1: The relationship between the first programming block and the second programming block changes from no relationship to a relationship.

[0093] For example, the first programming block is moved into the second programming block to establish an association between the two programming blocks; or, the first programming block is spliced ​​into the second programming block to establish an association between the two programming blocks.

[0094] In an exemplary embodiment of this application, before establishing the association between programming blocks, the type of the second programming block and the type of the reference programming block can be obtained. The programming block of the reference programming block type is the type of programming block that can be associated with the second programming block.

[0095] For example, the programming area of ​​the programming interface can display a second programming block, obtain the type of the second programming block, and determine the type of programming block that can be associated with the second programming block, i.e., the reference programming block type, based on the type of the second programming block. For example, if the second programming block is a signal programming block, the reference programming block type can be a variable type programming block.

[0096] If the type of the first programming block is the same as that of the reference programming block, and a change operation on the association relationship of the first programming block is received, the association relationship between the first programming block and the second programming block will be changed from unassociated to associated.

[0097] For example, the second programming block may have a programming block association area, which is used to place programming blocks. Programming blocks placed in the programming block association area can establish an association relationship with the second programming block.

[0098] During the process of dragging the first programming block to the programming block association area of ​​the second programming block, the type of the first programming block can be compared with the type of the reference programming block. If the type of the first programming block is the same as the type of the reference programming block, the first programming block is allowed to be placed in the programming block association area of ​​the second programming block. That is, the change operation of the association relationship of the first programming block is detected, and the association relationship between the first programming block and the second programming block is established.

[0099] If the type of the first programming block is different from that of the reference programming block, and the first programming block is dragged to the programming block association area of ​​the second programming block, that is, a change in the association relationship of the first programming block is detected, guidance information can be displayed on the programming interface. In other words, the first programming block cannot be associated with the second programming block. The guidance information can be determined based on the reference programming block type and is used to guide the user to select the first programming block that matches the second programming block.

[0100] In one embodiment, a first programming block is used as a parameter programming block, which is associated with a signal programming block. A second programming block is used as an example of a signal programming block. Exemplarily, the basic elements of the program code corresponding to the parameter programming block may include, but are not limited to, a parameter identifier (argumentId), a parameter type (argumentType), a parameter name (argumentName), and an associated signal identifier (refId). refId is a unique identifier used to associate with or reference another object, entity, or resource. By using refId, the system can establish associations between different components, data structures, or modules, and achieve efficient information retrieval and management. refId is typically a unique string, number, or other data type, possessing uniqueness and easy identification characteristics.

[0101] The basic elements of a signal programming block's program code can include, but are not limited to, a signal identifier (signalId), a signal name (signalName), and an array of signal parameters (arguments). Signal programming blocks and parameter programming blocks are linked through the signal parameter array. For example, establishing a link between a signal programming block and a parameter programming block can be done by creating a new signal parameter, initializing it, and then adding it to the signal parameter array.

[0102] Furthermore, signal parameter arrays can be used to delete parameter programming blocks, modify the attributes of corresponding parameters within parameter programming blocks, and search for parameter programming blocks. For example, by traversing the signal parameter array, determining the parameter to be deleted based on its parameter identifier, and removing the parameter from the signal, the deletion operation of the parameter programming block can be completed; by determining the parameter to be modified based on its parameter identifier and modifying its attributes, the modification operation of the parameter programming block can be completed; and by determining the parameter to be searched based on its parameter identifier, the search operation of the parameter programming block can be completed.

[0103] Figure 4 This is a schematic diagram of a programming interface for creating parameter programming blocks and signal usage programming blocks, provided in an embodiment of this application. Figure 4 As shown, the programming interface can display a signal receiving programming block group 401 and a signal usage programming block group 405. The signal receiving programming block group 401 can include a signal receiving programming block 402, a signal programming block 403, and a parameter programming block 404. The signal programming block 403 and the parameter programming block 404 are associated. Specifically, the signal receiving programming block 401 is used to receive the "self-made signal 1" signal and the signal parameter "signal 1 value 1" associated with the "self-made signal 1".

[0104] The signal usage programming block group 405 may include a signal usage programming block 406, an object programming block 407, and a programming block association area 408. The programming block association area 408 is used to place programming blocks that will be associated with the signal receiving programming block 406. A user can drag any programming block to the programming block association area 408. If the type of the dragged programming block can be associated with the signal usage programming block 406, the dragged programming block will be displayed in the programming block association area 408 in subsequent processes. If the type of the dragged programming block cannot be associated with the signal usage programming block 406, the dragging fails, and the dragged programming block will not be displayed in the programming block association area 408.

[0105] For example, the programming block association area 408 is used to place programming blocks of variable types. The programming interface can also display a candidate variable area 409, which can display multiple candidate variable programming blocks. The user can select any variable programming block and drag it into the programming block association area 408, as shown by the dotted line in the figure. That is, the association between the variable programming block and the signal usage programming block is established. After the signal programming block is moved to the programming block association area 408, the availability of the moved signal programming block needs to be determined.

[0106] In determining the availability of parametric programming blocks, the scope of the block is obtained. If the block is used within its scope, it is considered available; if it is used outside its scope, it is considered unavailable. For example, the scope of the parametric programming block "Signal 1 Parameter 1" is "Homemade Signal 1", and the scope of the parametric programming block "Signal 2 Parameter 1" is "Homemade Signal 2". Figure 4 After “Signal2Parameter1” is moved to the programming block that uses “Homemade Signal1”, “Signal2Parameter1” is used in “Homemade Signal1”. “Homemade Signal1” is outside the scope of “Signal2Parameter1”, at which point “Signal2Parameter1” is unavailable.

[0107] Figure 5 This is a flowchart illustrating the creation of parametric programming blocks and signal usage programming blocks, and the determination of the usability of the parametric programming blocks, as provided in an embodiment of this application. Figure 5 As shown, the method includes the following steps 501 to 505.

[0108] Step 501: Obtain the root programming block and child programming blocks of the parametric programming blocks.

[0109] Specifically, a trigger group is defined, which includes parameter programming blocks. A trigger group can contain multiple programming blocks. The topmost programming block in the trigger group is designated as the root programming block; the remaining programming blocks in the trigger group can be used as child programming blocks.

[0110] Step 502: Determine whether the programming block is a signal receiving programming block. If yes, proceed to step 504; otherwise, proceed to step 503.

[0111] For example, the root programming block and child programming blocks of the trigger group including the parameter programming block are traversed to determine whether the root programming block and child programming blocks are signal receiving programming blocks.

[0112] Step 503: Are there any unprocessed sub-programming blocks? If yes, return to step 502; otherwise, proceed to step 505.

[0113] For example, the sub-programming blocks of the trigger group including the parametric programming blocks are detected to determine whether the self-programming blocks have been traversed, the untraversed sub-programming blocks are identified, and the untraversed sub-programming blocks are traversed to ensure that all sub-programming blocks are traversed.

[0114] Step 504: Check if the programming block ID matches the parameter programming block refId. If yes, proceed to step 505; otherwise, end the process.

[0115] For example, obtain the ID of any traversed programming block, and compare the ID of the programming block with the refId of the parameter programming block to determine whether the ID of the programming block and the refId of the parameter programming block are consistent.

[0116] Step 505: Determine the availability of the parametric programming blocks.

[0117] If the ID of the programming block matches the refId of the parameter programming block, the parameter programming block is determined to be usable; if the ID of the programming block does not match the refId of the parameter programming block, the parameter programming block is determined to be unusable.

[0118] In this embodiment, the type of the reference programming block is determined by the type of the second programming block. When the type of the first programming block is the same as the type of the reference programming block, the first programming block and the second programming block are associated based on the change operation of the association relationship of the first programming block. This can avoid the establishment of incorrect association relationships due to user misoperation or incorrect selection of programming blocks, enabling users to select the correct first programming block more quickly, reducing the threshold of visual programming and improving programming efficiency.

[0119] Scenario 2: The relationship between the first and third programming blocks changes from being related to not being related.

[0120] In an exemplary embodiment of this application, the programming area of ​​the programming interface can display a first programming block, a third programming block, and a delete control, wherein the first programming block and the third programming block are associated, and the delete control is used to delete the programming block in the programming area.

[0121] In one embodiment, the process of changing the association of a first programming block and confirming its availability may include: identifying a selected third programming block among the programming blocks, the third programming block being associated with the first programming block; and determining the availability of the first programming block if the selected third programming block is deleted based on a delete control. Specifically, determining the availability of the first programming block means determining the availability of a first programming block displayed on the programming interface that is not associated with the selected third programming block.

[0122] Taking the first programming block as a parameter programming block and the third programming block as a signal programming block as an example, the programming interface can include a programming area, which can include multiple signal programming blocks. The user can select at least one signal programming block from among the multiple signal programming blocks. When the delete control is triggered, the selected signal programming block and the parameter programming blocks associated with the selected signal programming block can be deleted from the programming area. Then, the availability of parameter programming blocks not associated with signal programming blocks displayed in the programming area is determined. The process of determining the availability of parameter programming blocks is described in detail below.

[0123] Figure 6 This is a schematic diagram of a programming interface for deleting signal programming blocks provided in an embodiment of this application. For example... Figure 6 As shown, the programming interface may include a signal display area 601, which can display the created signals "Homemade Signal 1" and "Homemade Signal 2". When any created signal is selected, a signal editing area 602 can be displayed. The signal editing area 602 can display the name of the signal being edited 603, an editing control 604, and a deletion control 605. The editing control 604 is used to edit the selected signal, and the deletion control 605 is used to delete the selected signal. After the selected signal is modified, the programming area of ​​the programming interface can update the information of the corresponding signal programming block, and it needs to determine the availability of the parameter programming block that is identical to the parameter programming block in the signal programming block.

[0124] For example, "Homemade Signal 1" includes "Signal 1 Parameter 1". After "Homemade Signal 1" is selected and the delete control 605 is triggered, "Homemade Signal 1" and "Signal 1 Parameter 1" included in "Homemade Signal 1" can be deleted. After "Homemade Signal 1" and "Signal 1 Parameter 1" included in "Homemade Signal 1" are deleted, "Homemade Signal 1" and "Signal 1 Parameter 1" included in "Homemade Signal 1" are not displayed in the signal display area 601. The signal programming block corresponding to "Homemade Signal 1" and the parameter block associated with the signal programming block are deleted in the programming area. It is necessary to determine the availability of the parameter programming block 606 of "Signal 1 Parameter 1" that is not associated with "Homemade Signal 1".

[0125] For example, the basic elements of the program code corresponding to a signal programming block can include a signal array (signals), which can contain multiple signals. The signal array can also be called a signal repository. The signal repository allows for the management of signal programming blocks involved in the programming process. For instance, signal programming blocks in the signal repository can be managed using edit and delete controls. Taking adding a signal programming block as an example, create a new signal, initialize it, and then add the initialized signal to the signal array to complete the addition operation.

[0126] Furthermore, signal arrays can be used to delete signal programming blocks, modify the attributes of corresponding signals within signal programming blocks, and search for signal programming blocks. For example, by iterating through the signals in the signal array, identifying the signal to be deleted based on its signal ID (signalId), and removing it from the signal array, the deletion operation of a signal programming block can be completed. Similarly, by identifying the signal to be modified based on its signal identifier and modifying its attributes, the modification operation of a signal programming block can be completed. Finally, by identifying the signal to be searched based on its signal identifier, the search operation of a signal programming block can be completed.

[0127] In determining the availability of parametric programming blocks, after signal programming blocks and parametric programming blocks are deleted, parametric programming blocks with the same identifier as the deleted parametric programming blocks can be identified in the programming area, and the availability of parametric programming blocks with the same identifier in the programming area can be determined. The scope of the deleted parametric programming block and the parametric programming block with the same identifier is the same.

[0128] If a parametric programming block with the same identifier is used within its scope, then the parametric programming block with the same identifier is determined to be available; if a parametric programming block with the same identifier is used outside its scope, then the parametric programming block with the same identifier is determined to be unavailable.

[0129] For example, the scope of the parametric programming block "Signal 1 parameter 1" is "Custom Signal 1", and the scope of the parametric programming block "Signal 2 parameter 1" is "Custom Signal 2". Combined Figure 6 After "Homemade Signal 1" and "Signal 1 Parameter 1" are deleted, determine the availability of the remaining "Signal 1 Parameter 1" in the programming area. That is, determine the availability of the parametric programming block 606. If "Signal 1 Parameter 1" is not used in "Homemade Signal 1", that is, "Signal 1 Parameter 1" is not used in its scope, then "Signal 1 Parameter 1" is unavailable.

[0130] Figure 7 This is a flowchart illustrating a signal deletion programming block and a parameter determination programming block provided in an embodiment of this application. Figure 7 As shown, the method includes the following steps 701 to 705.

[0131] Step 701: Determine the signal programming block to be deleted.

[0132] For example, the signal array may include multiple signals, and the corresponding signal programming block candidate area of ​​the programming interface may display multiple signal programming blocks. Based on the user's selection operation in the programming interface, the relevant information of the signal programming block to be deleted can be determined.

[0133] Step 702: Does the signal programming block to be deleted contain a parameter programming block? If yes, proceed to step 703; otherwise, end the process.

[0134] By using relevant information about the signal programming blocks, it is determined whether the signal programming block to be deleted contains parametric programming blocks; that is, it is determined whether there are parametric programming blocks that are related to the signal programming block to be deleted.

[0135] Step 703: Delete the signal programming block to be deleted and the parameter programming block it contains.

[0136] After identifying the signal programming block to be deleted and the parametric programming blocks associated with it, the deletion operation can be performed on both the signal programming block and its associated parametric programming blocks. (Combined) Figure 6 You can delete the "Homemade Signal 1" signal programming block and the "Signal 1 Value 1" parameter programming block that is associated with the "Homemade Signal 1" signal programming block in the receiving signal block.

[0137] Step 704: Are there any parameter programming blocks with the same ID that have not been deleted in the programming area? If yes, proceed to step 705; otherwise, end the process.

[0138] After performing the deletion operation, determine the deletion status of the parametric programming block. Specifically, determine if any parametric programming blocks with the same ID as the deleted signal parametric programming block still exist in the programming region. In other words, determine if there are any parametric programming blocks in the programming region with the same ID as the deleted signal parametric programming block that are not associated with any signal programming block. Combined with... Figure 6 The signal usage programming block 606 has the same ID as the "signal1 value1" parameter programming block in the signal receiving block.

[0139] Step 705: Determine the availability of parameter programming blocks with the same ID.

[0140] Determine the availability of unparalleled programming blocks if there are parametric programming blocks associated with signal programming blocks that have not been deleted. Combined with... Figure 6 After deleting the "Signal 1 Value 1" parameter programming block, which is associated with the "Homemade Signal 1" signal programming block, the availability of the "Signal 1 Value 1" parameter programming block 606 in the signal usage programming block needs to be determined. The process of determining the availability of parameter programming block 606 has been explained above and will not be repeated here.

[0141] In this embodiment of the application, when the third programming block and the first programming block associated with the third programming block are deleted by the deletion control, the availability of the first programming block that has not been deleted in the programming area is determined. This can effectively avoid the unavailability of parameter programming caused by the deletion operation of programming blocks, prevent users from using signal parameter blocks in the wrong place, and reduce programming difficulties and debugging difficulties.

[0142] In another embodiment, the process of changing the association of the first programming block and confirming the availability of the first programming block may include: determining the availability of the first programming block if there are two or more first programming blocks and any first programming block is deleted based on a delete control. The first programming block includes the first programming blocks that have not been deleted and are displayed in the programming interface.

[0143] Optionally, based on the association between the remaining programming blocks displayed in the programming interface and the first programming block, the programming block to be evaluated is determined, and the programming block to be evaluated is the programming block that has an association with the first programming block, thus determining the availability of the programming block to be evaluated.

[0144] Taking the first programming block as an example of a parametric programming block, the programming interface can display multiple parametric programming blocks and programming blocks that are associated with them. For example, programming blocks associated with parametric programming blocks may include, but are not limited to, signal programming blocks, receive signal programming blocks, and use signal programming blocks. When it is detected that a user-selected parametric programming block has been deleted using the delete control, the availability of the remaining parametric programming blocks in the programming area can be determined. Optionally, the availability of signal programming blocks, receive signal programming blocks, and use signal programming blocks can also be determined.

[0145] Figure 8 This is a schematic diagram of a programming interface for deleting parameter programming blocks provided in an embodiment of this application. For example... Figure 8 As shown, the programming interface may include a signal setting area 801, which is used to set the relevant properties of signal programming blocks, such as adding parameter programming blocks associated with the signal programming blocks. The parameter programming blocks can be of types including numerical values, strings, and Boolean values. The signal setting area 801 may also include a signal selection area 802, which displays the selected signal. For example, if the selected signal is "Homemade Signal 1", after "Homemade Signal 1" is selected, the signal setting area 801 can display the parameter information 803 of "Homemade Signal 1". The parameter information 803 of "Homemade Signal 1" may include parameter type 804, parameter content 805, and a delete control 806. When the delete control is triggered, the parameter information 803 can be deleted. The deleted parameter information 803 can be executed synchronously in the programming area. For example, the programming area can display parameter programming blocks 807 that are associated with "homemade signal 1" and parameter programming blocks 808 that are not associated with "homemade signal 1". After the parameter information 803 is deleted, the parameter programming blocks 807 that are associated with "homemade signal 1" are deleted simultaneously, and it is necessary to determine the availability of parameter programming blocks 808 that are not associated with "homemade signal 1".

[0146] In determining the availability of parametric programming blocks, after a parametric programming block in the signal programming block is deleted, its availability relative to the deleted signal programming block can be determined in the programming area. If the parametric programming block is used within its scope, it is determined to be available; if it is used outside its scope, it is determined to be unavailable.

[0147] Combination Figure 8The scope of the parameter programming block "Signal1Parameter1" is "Homemade Signal1". After "Signal1Parameter1" is deleted from "Homemade Signal1", the scope of "Signal1Parameter1" no longer includes "Homemade Signal1". "Signal1Parameter1" is not in the scope of "Homemade Signal1" when it is not used in "Homemade Signal1", and therefore "Signal1Parameter1" is unavailable.

[0148] Figure 9 This is a flowchart illustrating the process of deleting a parameter programming block and determining the availability of any parameter blocks that have not been deleted, as provided in an embodiment of this application. Figure 9 As shown, the method includes the following steps 901 to 906.

[0149] Step 901: Determine the parameter programming block to be deleted. The parameter programming block to be deleted is the parameter programming block in the signal programming block.

[0150] The programming area of ​​the programming interface can display multiple programming blocks, including parameter programming blocks and signal programming blocks. The placement of the parameter programming blocks and signal programming blocks determines whether a parameter programming block is associated with a signal programming block. For example, the user can choose to delete a parameter programming block associated with a signal programming block.

[0151] Step 902: Traverse the programming blocks and determine the parameter programming blocks based on the type of the programming blocks.

[0152] For example, programming blocks can have different types. In the case of a parameter programming block selected by the user to be deleted, the programming blocks can be traversed to determine all parameter types of programming blocks displayed in the programming area.

[0153] Step 903: Determine if the parameter programming block ID matches the parameter programming block ID to be deleted. If yes, proceed to step 904; otherwise, end.

[0154] Obtain the programming block IDs of all parameter types displayed in the programming area, compare the programming block ID of the parameter to be deleted with the programming block IDs of all parameter types, and generate the comparison results.

[0155] Step 904: Based on the association between parameter programming blocks and signal programming blocks with the same ID, determine the parameter programming blocks to be deleted in the programming area, and perform a deletion operation on the parameter programming blocks to be deleted.

[0156] In the comparison results, it is determined that the programming block ID of the parameter type is consistent with the programming block ID of the parameter to be deleted. It is then determined whether the programming block with the same ID is associated with the corresponding signal programming block. If the programming block with the same ID is associated with the corresponding signal programming block, it is identified as the programming block to be deleted, and the deletion operation is performed on the programming block to be deleted.

[0157] Step 905: Determine if there are any untraversed programming blocks in the programming area. If yes, return to step 902; otherwise, proceed to step 906.

[0158] After performing the deletion operation on the programming block to be deleted, it can be determined whether there are any untraversed programming blocks in the programming area. If so, the traversal of programming blocks in the programming area continues.

[0159] Step 906: Determine the availability of parameter programming blocks that have not been deleted in the programming area.

[0160] Combination Figure 8 The programming area can display parametric programming blocks "Signal 1 Value 1" with the same ID. One "Signal 1 Value 1" is associated with "Homemade Signal 1" (parametric programming block 807), while the other "Signal 1 Value 1" is not associated with "Homemade Signal 1" (parametric programming block 808). After parametric programming block 807 is deleted, the availability of parametric programming block 808 needs to be determined. The process for determining the availability of parametric programming block 806 has been explained above and will not be repeated here.

[0161] In this embodiment of the application, when the first programming block is deleted by the deletion control, the availability of the first programming block that has not been deleted in the programming area is determined. This can effectively avoid the unavailability of parameter programming caused by the deletion operation of the programming block, prevent users from using signal parameter blocks in the wrong place, and reduce programming difficulties and debugging difficulties.

[0162] Scenario 3: Based on the movement operation of the fourth programming block, determine the change in the association between the first programming block and the reference programming block, and determine the availability of the first programming block.

[0163] In an exemplary embodiment of this application, the programming interface may display a first programming block and other programming blocks. When a user selects a programming block from among the other programming blocks that is associated with the first programming block (i.e., the user selects a fourth programming block), a movement operation on the fourth programming block is detected, and a reference programming block is determined from among the other programming blocks. The reference programming block may be associated with the first programming block, or it may be associated with the fourth programming block, or it may be associated with both the first and fourth programming blocks.

[0164] In one embodiment, the availability of the first programming block is determined when the association between the fourth programming block and the reference programming block is established based on the movement operation representation of the fourth programming block.

[0165] Taking the first programming block as the parametric programming block, the fourth programming block as the signal programming block, and the reference programming block as the signal receiving programming block as an example, the following explanation is provided. The parametric programming block can be located within the associated programming block area of ​​the signal programming block; that is, the parametric programming block is located on top of the signal programming block, and the parametric programming block and the signal programming block have an association relationship. The system detects the establishment of an association between the signal programming block containing the parametric programming block and the signal receiving programming block, thus determining the availability of the parametric signal block in the display area.

[0166] Figure 10 This is a schematic diagram of another programming interface for creating parameter programming blocks and signal receiving programming blocks provided in an embodiment of this application. For example... Figure 10 As shown, the programming interface displays a signal receiving programming block 1001, which has a programming block association area 1002 for placing signal programming blocks. The programming interface also displays a signal programming block candidate area 1003, which displays multiple signal programming blocks 1004 for the user to select. These signal programming blocks 1004 are associated with parameter programming blocks 1005. The user can select any signal programming block 1004 and drag it to the programming block association area 1002 to establish an association between the signal programming block 1004 and the signal receiving programming block 1001. For example, the signal programming block of "Homemade Signal 1" includes the parameter programming block of "Signal 1 Value 1". The signal programming block of "Homemade Signal 1" selected by the user, including the parameter programming block of "Signal 1 Value 1", is moved to the programming block association area 1002. The parameter programming block of "Signal 1 Value 1" displayed in the programming area needs to determine its availability, that is, the parameter programming block 1006 of "Signal 1 Value 1" needs to determine its availability.

[0167] In determining the availability of parametric programming blocks, after establishing an association between the signal programming block and the signal receiving block containing the parametric programming block, the availability of parametric blocks with the same identifier as the parametric programming blocks in the signal programming block is determined in the programming area. If a parametric block with the same identifier is used within its scope, it is determined to be available; if a parametric block with the same identifier is used outside its scope, it is determined to be unavailable.

[0168] Combination Figure 10The scope of the parameter programming block "Signal1Parameter1" is "Homemade Signal1". Before "Homemade Signal1" and "Signal1Parameter1" are associated with the signal receiving programming block, if "Signal1Parameter1" is used outside its scope, it will be unavailable. After "Homemade Signal1" and "Signal1Parameter1" are associated with the signal receiving programming block, if "Signal1Parameter1" is used within its scope, it will be available.

[0169] Figure 11 This is a flowchart illustrating how to establish the association between parametric programming blocks and received signal programming blocks, and how to determine the availability of parametric programming blocks, as provided in an embodiment of this application. Figure 11 As shown, the method includes the following steps 1101 to 1107.

[0170] Step 1101: Determine the signal programming block associated with the parameter programming block.

[0171] Combination Figure 10 Determine the signal programming block 1004, "Homemade Signal 1", associated with the parameter programming block 1005 "Signal 1 Value 1".

[0172] Step 1102: Does the signal programming block establish an association with the receive signal programming block? If yes, proceed to step 1103; otherwise, end the process.

[0173] The system detects whether the signal programming block and its contained parameter blocks have moved to the programming block association area of ​​the receiving signal programming block. If the signal programming block and its contained parameter blocks have moved to the programming block association area of ​​the receiving signal programming block, the signal programming block and the receiving signal programming block are associated; otherwise, the signal programming block and the receiving signal programming block are not associated.

[0174] Step 1103: Determine the root programming block of the signal programming blocks that establish the association relationship, and determine the child programming blocks corresponding to the root programming block.

[0175] For example, a trigger group is determined to establish the association between signal programming blocks. The trigger group may include multiple programming blocks. The topmost programming block in the trigger group is determined as the root programming block; the remaining programming blocks in the trigger group can be used as child programming blocks.

[0176] Step 1104: Traverse the root programming block and child programming blocks, and determine the parameter programming blocks of the same type based on the type of the parameter programming blocks associated with the signal programming block.

[0177] The signal programming block can be associated with at least one type of parameter programming block. For example, the parameter programming block can be a numeric parameter programming block, a string parameter programming block, or a Boolean parameter programming block. Taking the parameter block associated with the signal programming block as a numeric type as an example, the root programming block and child programming blocks of the trigger group in the programming area are traversed to determine the numeric parameter programming block.

[0178] Step 1105: Does there exist any untraversed parameter programming blocks of the same type? If yes, return to step 1104; otherwise, proceed to step 1106.

[0179] The sub-programming blocks of the trigger group in the programming area are checked to determine whether all parameter programming blocks of the same type have been traversed. If there are parameter programming blocks of the same type that have not been traversed, the traversal operation of the programming blocks continues to ensure that all parameter programming blocks of the same type have been traversed.

[0180] Step 1106: Determine the parameter programming block with the same parameter programming block ID as the one contained in the signal programming block.

[0181] Each programming block has an ID. The IDs of parameter programming blocks of the same type are compared with the IDs of the parameter programming blocks contained in the signal programming block to identify the parameter programming blocks with the same ID.

[0182] Step 1107: Determine the availability of parameter programming blocks with the same ID.

[0183] Combination Figure 10 The ID of parameter programming block 1005 "Signal 1 Value 1" contained in the signal programming block is the same as the ID of parameter programming block 1006 "Signal 1 Value 1" in the programming area. Therefore, it is necessary to confirm the availability of parameter programming block 1006 "Signal 1 Value 1". The process for determining the availability of parameter programming block 1006 has already been explained above and will not be repeated here.

[0184] In another embodiment, the availability of the first programming block is determined when the movement operation of the fourth programming block represents the cancellation of the association between the fourth programming block and the reference programming block.

[0185] Taking the first programming block as the parametric programming block, the fourth programming block as the signal programming block, and the reference programming block as the receive signal programming block as an example, the following explanation is provided. When the receive signal programming block includes a signal programming block, and the signal programming block includes a parametric programming block—that is, when the receive signal programming block is associated with the signal programming block, and the signal programming block is associated with the parametric programming block—if it is detected that the signal programming block containing the parametric programming block has been removed from the receive signal programming, the association between the receive signal programming block and the signal programming block is canceled, and the availability of the first programming block in the programming area is determined.

[0186] Figure 12 This is a schematic diagram of a programming interface for canceling the association between a signal programming block and a signal receiving programming block, provided in an embodiment of this application. For example... Figure 12 As shown, the programming interface can display a signal receiving programming block 1201. Signal receiving programming block 1201 is associated with signal programming block 1202. Signal programming block 1202 contains a parameter programming block 1203. The programming interface can also include a parameter programming block 1204 that is not associated with the signal programming blocks, and parameter programming block 1204 has the same ID as parameter programming block 1203. For example, the signal receiving programming block is used to receive "homemade signal 1," and "homemade signal 1" includes "signal 1 parameter 1." After signal programming block 1202 and parameter programming block 1203 are removed, the availability of parameter programming block 1204 needs to be determined.

[0187] In determining the availability of parametric programming blocks, after the signal programming block containing the parametric programming block is unassociated with the signal receiving block, the availability of parametric blocks with the same identifier as the parametric programming block in the programming area is determined. If a parametric block with the same identifier is used within its scope, it is determined to be available; if it is used outside its scope, it is determined to be unavailable.

[0188] Combination Figure 12 The scope of the parameter programming block "Signal1Parameter1" is "Homemade Signal1". Before the association between "Homemade Signal1", "Signal1Parameter1" and the signal receiving programming block is removed, "Signal1Parameter1" is available if used within its scope. After the association between "Homemade Signal1" and "Signal1Parameter1" is removed from the signal receiving programming block, "Signal1Parameter1" becomes unavailable if used outside its scope.

[0189] Figure 13This is a flowchart illustrating how to disconnect the association between the parameter programming block and the received signal programming block, and how to determine the availability of the parameter programming block, according to an embodiment of this application. Figure 13 As shown, the method includes the following steps 1301 to 1306.

[0190] Step 1301: In the programming area, determine the root programming block and child programming blocks of the selected signal programming block. The selected signal programming block contains parameter programming blocks and is associated with the received signal programming block.

[0191] For example, the programming area can display multiple programming blocks, and the user can select at least one programming block in the programming area. When the selected programming block is a signal programming block, and the signal programming block contains parameter programming blocks, and the signal programming block is associated with a receive signal programming block, the trigger group to which the signal programming block belongs is determined, and the root programming block and child programming blocks of the trigger group are determined. The process of determining the root programming block and child programming blocks has already been described above and will not be repeated here.

[0192] Step 1302: Check if the signal programming block is disconnected from the receiving signal programming block. If yes, proceed to step 1303; otherwise, end the process.

[0193] In an exemplary embodiment of this application, it is detected whether the signal programming block and the parameter block contained in the signal programming block have moved out of the programming block association area of ​​the receiving signal programming block. If the signal programming block and the parameter block contained in the signal programming block have moved out of the programming block association area of ​​the receiving signal programming block, the signal programming block and the receiving signal programming block are disconnected.

[0194] Step 1303: Traverse the root programming block and child programming blocks, and determine the parameter programming blocks of the same type based on the type of the parameter programming blocks contained in the signal programming block.

[0195] The signal programming block can be associated with at least one type of parameter programming block. For example, the parameter programming block can be a numeric parameter programming block, a string parameter programming block, or a Boolean parameter programming block. Taking the parameter block associated with the signal programming block as a numeric type as an example, the root programming block and child programming blocks of the trigger group in the programming area are traversed to determine the numeric parameter programming block.

[0196] Step 1304: Does there exist any untraversed parameter programming blocks of the same type? If yes, return to step 1303; otherwise, proceed to step 1305.

[0197] For example, the sub-programming blocks of the trigger group in the programming area are detected to determine whether all parameter programming blocks of the same type have been traversed. If there are parameter programming blocks of the same type that have not been traversed, the traversal operation of the programming blocks continues to ensure that all parameter programming blocks of the same type have been traversed.

[0198] Step 1305: Determine the parameter programming block with the same parameter programming block ID as the one contained in the signal programming block among the parameter programming blocks of the same type.

[0199] For example, the programming blocks have an ID. The ID of the parameter programming blocks of the same type is compared with the ID of the parameter programming blocks contained in the signal programming blocks to determine the parameter programming blocks with the same ID.

[0200] Step 1306: Determine the availability of parameter programming blocks with the same ID.

[0201] Combination Figure 12 Since the parameter programming blocks 1203 and 1204 contained in the signal programming block 1202 have the same ID, and after the signal programming block 1202 and parameter programming block 1203 are removed from the signal receiving programming block 1201, the availability of parameter programming block 1204 needs to be determined. The process of determining the availability of parameter programming block 1204 has been explained above and will not be repeated here.

[0202] In this embodiment, when the association between the fourth programming block and the reference programming block affects the association between the first programming block and the reference programming block, the usability of the first programming block is determined. This prevents users from using the first programming block in the wrong location, thereby effectively avoiding logical errors in the runtime of the first programming block's program code. It reduces programming difficulty and subsequent program debugging difficulty, and improves programming efficiency.

[0203] In step 203, the availability of the first programming block is used to display the first programming block in either a first state or a second state. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

[0204] In an exemplary embodiment of this application, after determining the availability of the first programming block, the display state of the first programming block can be determined based on its availability, and the first programming block can be displayed in the programming interface based on the display state. For example, the display state can be a first state or a second state. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code. That is, the first state can indicate that the first programming block is in an available state, that is, the first programming block can generate the corresponding program code; the second state can indicate that the first programming block is in an unavailable state, that is, the first programming block cannot generate the corresponding program code, i.e., the first programming block is restricted from generating the corresponding program code.

[0205] Optionally, the first programming block in the first state is displayed differently from the first programming block in the second state. The display methods for the first programming block in the second state include, but are not limited to, methods one through four.

[0206] Method 1: Specify a color for display.

[0207] For example, unavailable first programming blocks can be displayed in gray or a darker shade, distinguishing them from available first programming blocks by color.

[0208] Method 2: Disable border or background display.

[0209] For example, unavailable first programming blocks can be distinguished from available first programming blocks by adding disabled borders (dashed table borders) or lines (diagonal shading).

[0210] Method 3: Display with icons or markers.

[0211] For example, add an icon or mark (such as a prohibition symbol or lock symbol) to a corner or next to the unavailable first programming block to distinguish it from the available first programming block.

[0212] Method 4: Adjust the transparency of the display.

[0213] For example, reducing the transparency of unavailable first programming blocks makes them appear more "blurry" or "semi-transparent," thus distinguishing them from available first programming blocks.

[0214] It should be noted that the above description of the display method of the first programming block is an illustrative example. The display method of the first programming block can be set according to the actual programming situation, and this application does not limit it.

[0215] In an exemplary embodiment of this application, when the first programming block is in a second state, a prompt control in a prompt state is displayed, indicating that an error has occurred in the use of the first programming block. In response to the triggering operation of the prompt control, a first prompt message is displayed, which is used to indicate the corresponding error content during the use of the first programming block.

[0216] For example, a prompt control can be displayed in the programming interface. This prompt control generates prompt information based on user actions during the programming process. When an error occurs during programming, the programming control can change from a normal state to a prompt state, reminding the user to promptly identify and correct the incorrect programming block. For instance, if an unusable first programming block exists during programming, a prompt control in a prompt state can be displayed. The display method of the prompt state differs from that of the normal state. The display methods of the prompt state include, but are not limited to, dynamic display, patterned display, zoomed-in display, highlighted display, negative display, and marked display.

[0217] Upon detecting a trigger operation on the prompt control, the developer tools panel can be displayed, and the first prompt message can be shown in the developer tools panel. The trigger operation on the prompt control includes, but is not limited to, a single click, double click, and long press operation on the prompt control. The first prompt message may include the incorrect programming block and the error content. Furthermore, the developer tools panel can be displayed as a separate interface, or it can be displayed in a designated area within the programming interface, or it can be displayed as a floating window; this application does not limit the display method of the prompt screen.

[0218] Figure 14 This is a schematic diagram of a process interface for displaying the first prompt information provided in an embodiment of this application. For example... Figure 14 As shown, the programming interface can display unusable parameter programming blocks 1401 and 1402, meaning the parameter programming blocks "Signal 2 Value 1" and "Signal 1 Value 1" need to be modified. The programming interface can also display a prompt control 1403 in a prompt state, which can be displayed as a number (such as the number displayed in the upper right corner). The number in the number indicates the number of the first prompt message. After the prompt control 1403 is triggered, the development tool panel is displayed. The development tool panel can include a prompt bar 1404, which can include options such as block check, runtime information, error detection, and performance check. After block check is selected, the first prompt message 1405 can be displayed, showing the specific content of the error in parameter programming block 1401. For example, the first prompt message 1405 could be: "There is an incorrect or missing parameter in the trigger 'When Received Signal'."

[0219] Optionally, the first prompt message may also include a jump control, which can be associated with its corresponding first prompt message, i.e., the jump control can correspond one-to-one with the first prompt message. In response to a triggering operation of the first prompt message or a control associated with the first prompt message, positioning information is generated, including the position information of the first programming block in the second state; the first programming block in the second state is displayed based on the positioning information.

[0220] In the exemplary embodiments of this application, the triggering operation of the first prompt information or the control associated with the first prompt information may include a single-click operation, a double-click operation, and a long-press operation. After the first prompt information or the control associated with the first prompt information is triggered, positioning information corresponding to the first prompt information can be generated. The positioning information can be the position coordinates of the first programming block in the second state. Based on the positioning information, the user can jump to the position area of ​​the first programming block in the second state in the programming interface.

[0221] Combination Figure 14 The first prompt message 1405 can be associated with the jump control 1406, namely the "Go" control. After the first prompt message 1405 or the jump control 1406 is triggered, it can jump to the corresponding first programming block in the second programming state, namely the unavailable parameter programming block 1401 and parameter programming block 1402, namely "signal 2 value 1" and "signal 1 value 1".

[0222] This application embodiment utilizes the prompting state of a prompt control to allow users to promptly identify errors in the use of programming blocks during visual programming, preventing further errors in subsequent programming. After the prompt control is triggered, a first prompt message is displayed, providing specific error details. This helps users understand the cause of the error and find solutions. Using the prompt control and the first prompt message allows users to correct programming errors more quickly, saving programming time and improving efficiency. Furthermore, the prompting state of the prompt control and the first prompt message reduce the difficulty of learning visual programming, enabling users to master visual programming skills more quickly and contributing to the promotion and use of visual programming.

[0223] Furthermore, after the first prompt message or jump control is triggered, the system directly jumps to the first programming block in the second state based on the location information. Users do not need to scroll back and forth or search in the programming interface to find the first programming block with errors, which improves the convenience of correcting errors during programming and the user experience, thereby improving programming efficiency.

[0224] In an exemplary embodiment of this application, during the process of placing programming blocks into the programming area of ​​the programming interface, two or more programming blocks may be displayed in the programming area of ​​the programming interface; if any programming block is not associated with the remaining programming blocks, a second prompt message is displayed, which is used to prompt the programming blocks that are not associated.

[0225] For example, the programming area displays multiple programming blocks. The relationships between each programming block are detected. When it is detected that any programming block is not associated with the remaining programming blocks, a second prompt message can be displayed in the programming interface. The second prompt message can be used to inform the user that the current programming block does not generate corresponding program code and is considered a redundant programming block. The method of displaying the second prompt message is the same as the method of displaying the first prompt message; please refer to the relevant description of displaying the first prompt message, which will not be elaborated further here.

[0226] Figure 15 This is a schematic diagram of a programming interface provided in an embodiment of this application for displaying second information. Figure 15 As shown, the programming area of ​​the programming interface can display multiple programming blocks. Programming block 1501 is an independent programming block, meaning it has no association with any other programming blocks in the programming area and does not generate corresponding program code. The programming blocks displayed in area 1502 are associated programming blocks, meaning any programming block displayed in area 1502 is associated with at least one other programming block, and can generate corresponding program code when the programming block is available. The programming interface can also display a prompt control 1503 in a prompt state. The prompt state can be displayed as a numerical marker (such as the number displayed in the upper right corner), and the number in the numerical marker can represent the quantity of the second prompt message.

[0227] This application embodiment improves the accuracy and standardization of the visual programming process and increases the efficiency of visual programming by detecting the relationships between programming blocks and providing a second prompt when a programming block with no relationship is found.

[0228] In an exemplary embodiment of this application, after the programming blocks are placed in the programming area, program code can be generated using the programming blocks in the first state in the programming interface and the relationships between the programming blocks; after the program code is run, the running result of the program code is displayed.

[0229] For example, programming blocks in the programming interface in the first state (available state) are used to generate program code fragments, while programming blocks in the second state (unavailable state) do not generate program code fragments. The relationships between the programming blocks are used to adjust each program code fragment to obtain the final program code. The final program code is then run in the runtime environment to obtain the corresponding execution result. The display method of the execution result may include, but is not limited to, text display, graphic display, audio display, and video display. The display method of the execution result can be based on the program code settings, and this application does not limit this.

[0230] In the process of generating program code, the embodiments of this application can generate the corresponding program code using only the available programming blocks, which can reduce errors in the generated program code to a certain extent, reduce the debugging time of the program code, and improve programming efficiency.

[0231] This application determines the availability of a first programming block when the relationships between the first programming blocks displayed in the programming interface change. It then displays either the first programming block in a first state (available state) or a second state (unavailable state) in the programming interface. This display status provides a clear understanding of the first programming block's availability, helping to select the correct block during programming, reducing programming difficulty, and improving efficiency. Furthermore, the first programming block in the second state is restricted from generating corresponding program code, helping to avoid generating unnecessary or redundant code during programming. This improves the standardization and correctness of the code generated by the visual programming system and reduces debugging time.

[0232] This application also provides a visual programming apparatus. Figure 16 This is a schematic diagram of the structure of a visual programming device provided in an embodiment of this application, such as... Figure 16 As shown, the device includes:

[0233] Display module 1601 is used to display a programming interface, which includes at least one programming block, and the programming block is used to represent the basic elements for generating program code.

[0234] The determination module 1602 is used to determine the availability of the first programming block in response to a change operation in the association relationship of the first programming block in the programming blocks;

[0235] The display module 1601 is also used to display the first programming block in a first state or a second state based on the availability of the first programming block. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

[0236] In one possible implementation, module 1602 is used to determine the scope of the first programming block; obtain the usage status of the first programming block; and determine the availability of the first programming block based on the usage status and scope of the first programming block.

[0237] In one possible implementation, the determining module 1602 is further configured to obtain the type of the second programming block and the type of the reference programming block, wherein the programming block of the reference programming block type is a programming block type that can be associated with the second programming block; and if the type of the first programming block is the same as the type of the reference programming block, and a change operation on the association relationship of the first programming block is received, the association relationship between the first programming block and the second programming block is changed from unassociated to associated.

[0238] In one possible implementation, the programming interface also includes a delete control for deleting programming blocks. The determination module 1602 is also used to determine a selected third programming block among the programming blocks, the third programming block being associated with the first programming block. The determination module 1602 is used to determine the availability of the first programming block in the case of deleting the selected third programming block based on the delete control.

[0239] In one possible implementation, the programming interface also includes a delete control for deleting programming blocks, and a determination module 1602 for determining the availability of the first programming blocks when the number of first programming blocks is two or more and any first programming block is deleted based on the delete control.

[0240] In one possible implementation, the determining module 1602 is further configured to, in response to a move operation of a fourth programming block in the programming blocks, determine a reference programming block, wherein the fourth programming block is associated with the first programming block, and the reference programming block is associated with at least one of the first programming block or the fourth programming block; the determining module 1602 is configured to determine the availability of the first programming block if the move operation indicates that the association between the fourth programming block and the reference programming block has been established; or, if the move operation indicates that the association between the fourth programming block and the reference programming block has been canceled, determine the availability of the first programming block.

[0241] In one possible implementation, the display module 1601 is further configured to display a prompt control in a prompt state when the first programming block is in a second state, the prompt state indicating that there is an error in the use of the first programming block; and to display a first prompt message in response to the triggering operation of the prompt control, the first prompt message being used to prompt the corresponding error content during the use of the first programming block.

[0242] In one possible implementation, the display module 1601 is further configured to generate positioning information in response to a first prompt message or a trigger operation of a control associated with the first prompt message, the positioning information including the position information of the first programming block in the second state; and display the first programming block in the second state based on the positioning information.

[0243] In one possible implementation, the programming interface includes a programming area for placing programming blocks. The display module 1601 is also used to display two or more programming blocks in the programming area of ​​the programming interface. If any programming block is not associated with the remaining programming blocks, a second prompt message is displayed to prompt the programming blocks that are not associated.

[0244] In one possible implementation, the device further includes a generation module (not shown in the figure) and a running module (not shown in the figure). The generation module is used to generate program code using the programming blocks in the first state in the programming interface and the relationships between the programming blocks. The running module is used to display the running result of the program code after it is run.

[0245] This application determines the availability of a first programming block when the relationships between the first programming blocks displayed in the programming interface change. It then displays either the first programming block in a first state (available state) or a second state (unavailable state) in the programming interface. This display status provides a clear understanding of the first programming block's availability, helping to select the correct block during programming, reducing programming difficulty, and improving efficiency. Furthermore, the first programming block in the second state is restricted from generating corresponding program code, helping to avoid generating unnecessary or redundant code during programming. This improves the standardization and correctness of the code generated by the visual programming system and reduces debugging time.

[0246] It should be understood that the above-described apparatus is only illustrated by the division of the functional modules described above when implementing its functions. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0247] Figure 17This is a structural block diagram of a terminal device provided in an embodiment of this application. The terminal device 1700 can be any electronic device product capable of human-computer interaction with a user through one or more methods such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. Examples include PCs (Personal Computers), mobile phones, smartphones, PDAs (Personal Digital Assistants), wearable devices, PPCs (Pocket PCs), tablet computers, smart car systems, smart TVs, smart speakers, and smartwatches.

[0248] Typically, terminal device 1700 includes a processor 1701 and a memory 1702.

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

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

[0251] In some embodiments, the terminal device 1700 may also optionally include a peripheral device interface 1703 and at least one peripheral device. The processor 1701, memory 1702, and peripheral device interface 1703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: radio frequency circuitry 1704, display screen 1705, camera assembly 1706, audio circuitry 1707, and power supply 1708.

[0252] Peripheral interface 1703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1701 and memory 1702. In some embodiments, processor 1701, memory 1702 and peripheral interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1701, memory 1702 and peripheral interface 1703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0253] The radio frequency (RF) circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 1704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1704 can communicate with other terminal devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0254] Display screen 1705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1705 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1701 for processing. In this case, display screen 1705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1705, disposed on the front panel of terminal device 1700; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal device 1700 or in a folded design; in still other embodiments, display screen 1705 may be a flexible display screen, disposed on a curved or folded surface of terminal device 1700. Furthermore, display screen 1705 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1705 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0255] The camera assembly 1706 is used to acquire images or videos. Optionally, the camera assembly 1706 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal device 1700, and the rear-facing camera is located on the back of the terminal device 1700. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1706 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.

[0256] The audio circuit 1707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1701 for processing, or input to the radio frequency circuit 1704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal device 1700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1701 or the radio frequency circuit 1704 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1707 may also include a headphone jack.

[0257] Power supply 1708 is used to power the various components in terminal device 1700. Power supply 1708 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1708 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0258] In some embodiments, the terminal device 1700 further includes one or more sensors 1710. The one or more sensors 1710 include, but are not limited to: an acceleration sensor 1711, a gyroscope sensor 1712, a pressure sensor 1713, an optical sensor 1714, and a proximity sensor 1715.

[0259] Accelerometer 1711 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal device 1700. For example, accelerometer 1711 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1701 can control display screen 1705 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1711. Accelerometer 1711 can also be used for games or for acquiring user motion data.

[0260] The gyroscope sensor 1712 can detect the orientation and rotation angle of the terminal device 1700. The gyroscope sensor 1712, in conjunction with the accelerometer sensor 1711, can collect 3D motion data from the user on the terminal device 1700. Based on the data collected by the gyroscope sensor 1712, the processor 1701 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0261] The pressure sensor 1713 can be disposed on the side bezel of the terminal device 1700 and / or on the lower layer of the display screen 1705. When the pressure sensor 1713 is disposed on the side bezel of the terminal device 1700, it can detect the user's grip signal on the terminal device 1700, and the processor 1701 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1713. When the pressure sensor 1713 is disposed on the lower layer of the display screen 1705, the processor 1701 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1705. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0262] Optical sensor 1714 is used to collect ambient light intensity. In one embodiment, processor 1501 can control the display brightness of display screen 1705 based on the ambient light intensity collected by optical sensor 1714. Specifically, when the ambient light intensity is high, the display brightness of display screen 1705 is increased; when the ambient light intensity is low, the display brightness of display screen 1705 is decreased. In another embodiment, processor 1701 can also dynamically adjust the shooting parameters of camera assembly 1706 based on the ambient light intensity collected by optical sensor 1714.

[0263] The proximity sensor 1715, also known as a distance sensor, is typically located on the front panel of the terminal device 1700. The proximity sensor 1715 is used to detect the distance between the user and the front of the terminal device 1700. In one embodiment, when the proximity sensor 1715 detects that the distance between the user and the front of the terminal device 1700 is gradually decreasing, the processor 1701 controls the display screen 1705 to switch from a screen-on state to a screen-off state; when the proximity sensor 1715 detects that the distance between the user and the front of the terminal device 1700 is gradually increasing, the processor 1701 controls the display screen 1705 to switch from a screen-off state to a screen-on state.

[0264] Those skilled in the art will understand that Figure 17 The structure shown does not constitute a limitation on the terminal device 1700, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0265] Figure 18This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1800 can vary considerably due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1801 and one or more memories 1802. The one or more memories 1802 store at least one line of program code, which is loaded and executed by the one or more processors 1801 to implement the visual programming method provided in the various method embodiments described above. Of course, the server 1800 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1800 may also include other components for implementing device functions, which will not be elaborated here.

[0266] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code that is loaded and executed by a processor to enable a computer to implement any of the above-described visual programming methods.

[0267] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0268] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer instruction that is loaded and executed by a processor to enable the computer to implement any of the above-described visual programming methods.

[0269] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the programming blocks, reference states, and various programming interfaces involved in this application were all obtained with full authorization.

[0270] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0271] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A visual programming method, characterized in that, The method includes: The programming interface is displayed, which includes at least one programming block, which represents the basic elements for generating program code. In response to a change in the association of the first programming block in the programming blocks, determine the availability of the first programming block; Based on the availability of the first programming block, the first programming block is displayed in either a first state or a second state. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

2. The method according to claim 1, characterized in that, Determining the availability of the first programming block includes: Determine the scope of the first programming block; Obtain the usage status of the first programming block, and determine the availability of the first programming block based on its usage status and scope.

3. The method according to claim 1, characterized in that, Before determining the availability of the first programming block, the method further includes: Obtain the type of the second programming block and the type of the reference programming block, wherein the programming block of the reference programming block type is a programming block type that can be associated with the second programming block; If the type of the first programming block is the same as the type of the reference programming block, and a change operation on the association relationship of the first programming block is received, the association relationship between the first programming block and the second programming block is changed from unassociated to associated.

4. The method according to claim 1, characterized in that, The programming interface also includes a delete control for deleting programming blocks. Before determining the availability of the first programming block, the following steps are also included: A third programming block is selected from the programming blocks, and the third programming block is associated with the first programming block. Determining the availability of the first programming block includes: In the case of deleting the selected third programming block based on the deletion control, the availability of the first programming block is determined.

5. The method according to claim 1, characterized in that, The programming interface also includes a delete control, which is used to delete programming blocks. Determining the availability of the first programming block includes: The availability of the first programming block is determined when there are two or more of the first programming blocks and any of the first programming blocks is deleted based on the deletion control.

6. The method according to claim 1, characterized in that, Before determining the availability of the first programming block, the method further includes: In response to a movement operation of the fourth programming block in the programming blocks, a reference programming block is determined, wherein the fourth programming block is associated with the first programming block, and the reference programming block is associated with at least one of the first programming block or the fourth programming block; Determining the availability of the first programming block includes: In the case where the movement operation characterization establishes the association between the fourth programming block and the reference programming block, the availability of the first programming block is determined; Alternatively, if the movement operation characterizes the cancellation of the association between the fourth programming block and the reference programming block, the availability of the first programming block is determined.

7. The method according to any one of claims 1 to 6, characterized in that, After determining the availability of the first programming block, the method further includes: When the first programming block is in the second state, a prompt control in a prompt state is displayed, the prompt state indicating that there is an error in the use of the first programming block; In response to the triggering operation of the prompt control, a first prompt message is displayed, which is used to indicate the corresponding error content during the use of the first programming block.

8. The method according to claim 7, characterized in that, After displaying the first prompt message, the method further includes: In response to the first prompt message or the triggering operation of the jump control associated with the first prompt message, location information is generated, the location information including the position information of the first programming block in the second state; The first programming block in the second state is displayed based on the location information.

9. The method according to any one of claims 1 to 6, characterized in that, The programming interface includes a programming area for placing programming blocks, and the method further includes: Two or more programming blocks are displayed in the programming area of ​​the programming interface; If any programming block is not associated with the remaining programming blocks, a second prompt message is displayed. The second prompt message is used to prompt the programming blocks that are not associated.

10. The method according to any one of claims 1 to 6, characterized in that, After the availability display of the first programming block is based on whether it is in a first state or a second state, the method further includes: Program code is generated using the programming blocks in the first state of the programming interface and their relationships. After the program code is executed, the execution result of the program code is displayed.

11. A visual programming apparatus, characterized in that, The device includes: A display module is used to display a programming interface, the programming interface including at least one programming block, the programming block being used to represent the basic elements for generating program code; A determination module is used to determine the availability of the first programming block in response to a change operation in the association relationship of the first programming block in the programming blocks; The display module is further configured to display the first programming block in a first state or a second state based on the availability of the first programming block. The first state indicates that the first programming block is used to generate the program code corresponding to the first programming block, and the second state indicates that the first programming block is restricted from generating the corresponding program code.

12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to enable the computer device to implement the visual programming method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to enable the computer to implement the visual programming method as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement the visual programming method as described in any one of claims 1 to 10.