Programming building block detection method and related device
By detecting programming building blocks in the invisible workspace and displaying incorrect programming building blocks by category in the visual programming platform, the problems of user interface lag and incorrect search efficiency caused by the large number of programming building blocks are solved, and the user experience and programming efficiency are improved.
Patent Information
- Application Number
- CN202411218874.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In the visual programming platform, the large number of programming building blocks leads to high pressure to render the visual workspace, stuttering the user interface, and incorrect programming building block search efficiency, affecting the user experience.
By detecting programming building blocks in the non-visible workspace, avoid detection in the visual workspace to reduce rendering pressure, and displaying incorrect programming building blocks in the graphical programming interface according to the error category. Incorrect programming building blocks belonging to the same category are displayed in In the same sub-region.
It effectively avoids user interface lag, improves user experience, simplifies the search and correction process of wrong programming building blocks, and improves programming efficiency.
Smart Images

Figure CN119088375A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a detection method and related devices for programming building blocks. Background Art
[0002] With the development of artificial intelligence technology, more and more visual programming platforms are available for programming beginners. The visual programming platforms encapsulate programming language interfaces in graphical programming blocks. Users can complete programming by building programming blocks and obtain the target programming files.
[0003] In the related art, a graphical programming interface in a visual programming platform has a visual workspace, through which a target programming file can be rendered to obtain a visual presentation of multiple programming blocks included in the target programming file in the visual workspace, so as to ensure that users can intuitively understand and operate the programming blocks.
[0004] However, a target programming file generally includes a large number of programming blocks, and the rendering pressure of the visual workspace is relatively large. Even after the rendering is completed, it is necessary to respond to user interaction operations in real time, such as adding new programming blocks, modifying existing programming blocks, and other modification operations on programming blocks. The visual workspace needs to adjust the programming blocks in a timely manner according to the modification operations and other interactive operations and render them in real time, thereby increasing the rendering pressure of the visual workspace. Moreover, if new functions are added to the visual programming platform, it may cause the user interface to freeze, that is, the visual workspace in the graphical programming interface will experience delays or unsmoothness when responding to user operations, resulting in a poor user experience. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a programming block detection method, which is used to avoid user interface freeze problems and improve user experience during the process of interacting with a visual programming platform.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a method for detecting a programming building block, the method comprising:
[0008] Displaying a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in a target programming file;
[0009] In the process of displaying the plurality of programming blocks through the visible work area, the plurality of programming blocks are detected through the invisible work area to obtain an erroneous programming block, wherein the erroneous programming block is an erroneous programming block, and the invisible work area and the visible work area do not affect each other;
[0010] The erroneous programming blocks are displayed in the graphical programming interface according to the error categories, and the erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
[0011] On the other hand, an embodiment of the present application provides a detection device for programming building blocks, the device comprising: a display unit and a detection unit;
[0012] The display unit is used to display a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in the target programming file;
[0013] The detection unit is used to detect the multiple programming blocks through the invisible working area during the process of displaying the multiple programming blocks through the visual working area to obtain an erroneous programming block, wherein the erroneous programming block is a programming block with an error, and the invisible working area and the visible working area do not affect each other;
[0014] The display unit is further used to display the erroneous programming blocks according to error categories in the graphical programming interface, and erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
[0015] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0016] The memory is used to store a computer program and transmit the computer program to the processor;
[0017] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.
[0018] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.
[0019] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above aspects.
[0020] It can be seen from the above technical solution that a graphical programming interface is displayed, and the graphical programming interface includes a visual workspace, which can display multiple programming blocks included in the target programming file. In order to reduce the pressure of the visual workspace, the programming blocks are no longer detected based on the visual workspace, but in the process of displaying the programming blocks in the visual workspace, the multiple programming blocks included in the target programming file are detected through the invisible workspace to obtain the wrong programming blocks. Among them, the visual workspace and the invisible workspace do not affect each other, so that the detection of programming blocks through the invisible workspace will not affect the rendering process of the visual workspace. While adding new functions, there is no pressure to add a new visual workspace, which avoids the problem of user interface jamming and improves the user experience. In addition, when displaying the wrong programming blocks in the graphical programming interface, it can be displayed according to the error category, so that the wrong programming blocks belonging to the same category are displayed in the same sub-area in the graphical programming interface, so that the user can view the wrong programming blocks belonging to the same category together, which is highly readable and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A schematic diagram of an application scenario of a detection method for programming blocks provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a flow chart of a method for detecting programming blocks provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a graphical programming interface provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of a graphical programming interface provided in an embodiment of the present application;
[0026] Figure 5 A schematic diagram of a detection control provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of an erroneous programming building block provided in an embodiment of the present application;
[0028] Figure 7 A schematic diagram of an erroneous programming building block provided in an embodiment of the present application;
[0029] Figure 8 A schematic diagram of an erroneous programming building block provided in an embodiment of the present application;
[0030] Fig. 9 A schematic diagram of an erroneous programming building block provided in an embodiment of the present application;
[0031] Fig.10 A schematic diagram of an error control provided in an embodiment of the present application;
[0032] Fig.11 A schematic diagram of a viewing control provided in an embodiment of the present application;
[0033] Fig.12 A schematic diagram of a non-blocking area provided in an embodiment of the present application;
[0034] Fig.13 A schematic diagram of a non-blocking area provided in an embodiment of the present application;
[0035] Fig.14 A schematic diagram of highlighting an erroneous programming building block provided in an embodiment of the present application;
[0036] Fig.15 A schematic diagram of highlighting an erroneous programming building block provided in an embodiment of the present application;
[0037] Fig.16 A schematic diagram of highlighting an erroneous programming building block provided in an embodiment of the present application;
[0038] Fig.17 A schematic diagram of the relationship between programming building blocks provided in an embodiment of the present application;
[0039] Fig.18 A schematic diagram of a method for detecting a programming block provided in an embodiment of the present application;
[0040] Fig.19 A schematic diagram of the structure of a detection device for programming blocks provided in an embodiment of the present application;
[0041] Fig. 20 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0042] Fig.21 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0044] In the related art, in the process of rendering the target programming file through the visual workspace, the rendering pressure of the visual workspace is relatively large, and as the number of programming blocks included in the target programming file increases, the rendering pressure of the visual workspace also increases. In addition, as the number of programming blocks increases, the probability of errors in programming blocks increases, and it is difficult for users to find the programming blocks with errors (hereinafter referred to as error programming blocks) one by one. It takes a long time to find the error programming blocks, resulting in low efficiency in finding the error programming blocks, thereby affecting the efficiency of programming and resulting in a poor user experience.
[0045] Therefore, in order to improve the user experience, a detection function can be added to the visual programming platform to help users automatically detect incorrect programming blocks. However, due to the high rendering pressure of the visual workspace, if the programming blocks are detected based on the visual workspace, the user interface may freeze, resulting in a poor user experience. Moreover, after the incorrect programming blocks are detected, there is no way to display the incorrect programming blocks in a highly readable manner, resulting in a poor user experience.
[0046] Based on this, the embodiment of the present application provides a method and a related device for detecting programming blocks, which detects programming blocks in an invisible work area that does not affect the visual work area, does not affect the rendering process of the visual work area, avoids the problem of user interface freeze, and improves the user experience. In addition, the erroneous programming blocks are displayed according to the error category, so that the erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface, so that the user can view the erroneous programming blocks belonging to the same category together, which is highly readable and improves the user experience.
[0047] The programming block detection method provided in the present application can be applied to computer devices with programming block detection capabilities, such as terminal devices and servers.
[0048] Among them, the terminal devices can specifically be desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The smart car-mounted devices can be car-mounted navigation terminals and car-mounted computers, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc., but are not limited to these.
[0049] The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0050] In order to facilitate understanding of the detection method of the programming building block provided in the embodiment of the present application, the following takes the execution subject of the detection method of the programming building block as an example, and exemplarily introduces the application scenario of the detection method of the programming building block.
[0051] See also Figure 1 , which is a schematic diagram of an application scenario of a detection method for programming building blocks provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes a terminal device 100, and the terminal device 100 is used to execute the detection method of the programming building blocks provided in the present application.
[0052] The terminal device 100 is installed with a visual programming platform, which encapsulates the programming language interface in graphical programming building blocks. The user can complete the programming by building the programming building blocks and obtain the programming file required by the user.
[0053] The visual programming platform has a graphical programming interface 110, such as the graphical programming interface 110 includes a visual workspace 120, and the visual workspace 120 is used to display multiple programming blocks included in the target programming file, that is, rendering is performed through the visual workspace 120, so that the programming blocks in the target programming file are visually presented to the user. The embodiment of the present application does not specifically limit the graphical programming interface 110, such as it can also include a programming block list 130, so that a programming block can be selected from the programming block list, so that the selected programming block can be dragged to the visual workspace 120, so that the programming block is rendered through the visual workspace.
[0054] Since the visual programming platform has a new detection function, in order not to increase the pressure on the visual workspace 120, the programming building blocks are no longer detected based on the visual workspace 120. Instead, during the process of displaying the programming building blocks in the visual workspace 120, that is, during the rendering process of the visual workspace 120, the programming building blocks are detected through the invisible workspace (the invisible workspace is not visible and is not displayed in the display). Figure 1(shown in) detects multiple programming blocks included in the target programming file to obtain erroneous programming blocks. Among them, the invisible workspace is an invisible workspace, and the workspace is a logical area or space in the visual programming platform, which is used to organize and display programming elements (such as code blocks, controls, charts, etc.) and project-related files and resources. In other words, the invisible workspace is not responsible for rendering, but for detection, that is, the invisible workspace and the visible workspace are two workspaces with different functions, so that the invisible workspace will not affect the rendering of the visual workspace during the execution of the detection function, that is, the visible workspace and the invisible workspace do not affect each other, and then the detection of programming blocks by the invisible workspace will not affect the rendering process of the visual workspace, so that there is no pressure to add a new visual workspace while adding new functions, avoiding the problem of user interface jamming and improving the user experience.
[0055] After the multiple programming blocks are detected through the invisible workspace, the obtained erroneous programming blocks are displayed through the graphical programming interface 110, such as Figure 1 As shown, a pop-up window 140 is displayed on the graphical programming interface 110, and the erroneous programming building blocks are displayed through the pop-up window 140. In addition, the erroneous programming building blocks are displayed according to the error category, such as Figure 1 In the embodiment, the erroneous programming blocks are displayed according to the trigger groups to which the erroneous programming blocks belong. Thus, the erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface 110, so that the user can view the erroneous programming blocks belonging to the same category together, which has high readability and improves the user experience.
[0056] The detection method of the programming building block provided in the embodiment of the present application can be executed by the terminal device. However, in other embodiments of the present application, the server can also have similar functions as the terminal device, so as to execute the detection method of the programming building block provided in the embodiment of the present application, or the terminal device and the server can jointly execute the detection method of the programming building block provided in the embodiment of the present application, which is not limited in the present embodiment.
[0057] The detection method for programming blocks provided in this application can be applied to various scenarios, and two scenarios are used as examples for explanation below.
[0058] Scenario 1: Visual programming scenario.
[0059] Visual programming platforms can be used to teach programming concepts. By intuitively understanding and operating programming blocks, students can understand algorithms and logical thinking, lowering the threshold for learning programming. Alternatively, in skills training, visual programming platforms can help students quickly master programming skills in specific fields, such as industrial automation control, smart home system design, etc.
[0060] In the process of students or trainees programming by building programming blocks, the programming block detection method provided in the present application can help students or trainees quickly detect problematic erroneous programming blocks in the process of learning using a visual programming platform, thereby helping them to have a deeper understanding of what they have learned and improve the user experience.
[0061] Scenario 2: User-generated content editor scenario in the game.
[0062] The user-generated content (UGC) editor provided by the game has a visual programming function. Through the visual programming function in the UGC editor, users can combine and splice events, roles, actions, etc. by dragging modules, and implement game design like building blocks, such as parkour, battle, and level-breaking games. The UGC editor provides great convenience for users to build game scenes, such as allowing users to easily design game scenes and game maps.
[0063] Although ordinary users who have never been exposed to programming languages can design games through the UGC editor, as the number of programming blocks increases, the probability of errors in the programming blocks increases, and it is difficult for users to find the erroneous programming blocks one by one. Therefore, the UGC editor provided in the embodiment of the present application adds a detection function to help users quickly detect problematic erroneous programming blocks, thereby helping them improve game development efficiency and improve user experience.
[0064] In order to avoid the problem of user interface freezing, the embodiment of the present application detects the programming building blocks through the invisible workspace, and the invisible workspace and the visible workspace do not affect each other, so that the invisible workspace will not affect the rendering process of the visible workspace during the detection process. In addition, the erroneous programming building blocks are displayed according to the error category, so that the erroneous programming building blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface, so that the user can view the erroneous programming building blocks belonging to the same category together, which is highly readable and improves the user experience.
[0065] It should be noted that the above application scenarios are only examples, and the detection method of programming blocks provided in this embodiment can also be applied to other scenarios, which are not limited here.
[0066] A method for detecting programming blocks provided by the present application is described in detail below through a method embodiment.
[0067] See also Figure 2 , which is a flow chart of the detection method of the programming building block provided in the embodiment of the present application. For the convenience of description, the following embodiment is still introduced by taking the execution subject of the detection method of the programming building block as the terminal device as an example. Figure 2As shown, the detection method of the programming building block includes the following S201-S203.
[0068] S201: Displaying a graphical programming interface including a visual workspace.
[0069] Display the graphical programming interface, which is the interface of graphical programming, that is, the user interface of the entire programming environment, which contains all the visual and functional elements required by the user for programming. Graphical programming refers to encapsulating the programming language in graphical programming blocks, and programming can be completed by dragging the programming blocks to build. Graphical programming can be applied to programming learning for teenagers or beginners.
[0070] The graphical programming interface includes a visual workspace, which is used to display multiple programming blocks included in the target programming file, that is, the display of programming blocks is realized through the rendering function of the visual workspace. Among them, the programming language is encapsulated in the programming blocks, and different programming blocks can represent different programming concepts, such as variables, logical expressions, loops, etc. The embodiment of the present application does not specifically limit the creation method of the visual workspace. Taking the visual programming platform as Blocly as an example, the visual workspace can rely on the graphical programming interface to first create a DOM element, embed the Blockly editor interface into the created DOM element, configure the editor options, and render the editor for user interaction, thereby realizing the creation of the visual workspace. For example, after creating the DOM element, call the Blockly.Inject() function to realize the creation of the visual workspace, and the subsequent visual workspace operations are all using the visual workspace by default.
[0071] Among them, a DOM element is a single node in a DOM tree structure. A DOM tree is a tree structure representing a document, which is composed of different types of nodes (such as element nodes, attribute nodes, text nodes, etc.), and each node is a DOM element.
[0072] The target programming file is a programming file composed of one or more programming building blocks. For example, the target programming file may be a programming file that the user is editing, that is, the user may add programming building blocks to the visual workspace by dragging or the like to obtain a target programming file including multiple programming building blocks. For another example, the target programming file may be a pre-edited programming file, and the target programming file may be imported through the import function provided by the visual programming platform, so that the visual workspace is rendered.
[0073] See also Figure 3 , which is a schematic diagram of a graphical programming interface provided in an embodiment of the present application. Figure 3In the example, the interface displayed on the display screen of the terminal device is a graphical programming interface 310. The graphical programming interface 310 includes a visual workspace 320. The visual workspace 320 displays two programming blocks, a trigger block and a programming block connected to the trigger block, wherein the trigger block is "when the game starts", and the variables of the programming blocks connected to the trigger block are set to arbitrary values, that is, no parameters are input to the programming blocks. The trigger block is the starting point when the code is running.
[0074] As a possible implementation, the graphical programming interface may also include a programming block list. Figure 3 The graphical programming interface 310 includes not only a visual workspace 320, but also a programming building block list 330. It should be noted that if the target programming file includes a large number of programming building blocks, the multiple programming building blocks included in the target programming file can be divided into multiple trigger groups, each trigger group includes multiple programming building blocks, and the visual workspace simultaneously displays the programming building blocks belonging to one trigger group. Figure 3 , if the display trigger group A is selected based on the programming building block list 330, then Figure 3 The visual workspace 320 shows a plurality of programming blocks included in the trigger group A.
[0075] In addition, users can switch between different trigger groups. During the switching process, the visual programming platform will delete the programming blocks included in the old trigger group in the visual workspace and load the programming blocks included in the new trigger group in the visual workspace. Figure 4 As shown, if the display trigger group B is selected based on the programming building block list 330, then Figure 4 The visual workspace 320 shows a plurality of programming blocks included in trigger group B. Figure 4 In the example, trigger group B includes a trigger block and a programming block connected to the trigger block, wherein the trigger block is "when the sky environment changes", and the variable of the programming block connected to the trigger block is set to an arbitrary value, that is, no parameters are input to the programming block. Moreover, multiple trigger blocks can exist simultaneously in the same trigger group.
[0076] It is understandable that in the specific implementation of the present application, if user-related information (such as imported target programming files, etc.) is involved, when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0077] S202: In the process of displaying a plurality of programming blocks in the visible workspace, the plurality of programming blocks are detected in the invisible workspace to obtain erroneous programming blocks.
[0078] As mentioned above, in order to improve the user experience, the visual programming platform has added a detection function, which is used to detect whether there are errors in the programming blocks. Due to the high rendering pressure of the visual workspace, if the detection function is implemented based on the visual workspace, the user interface may freeze, thus affecting the user experience.
[0079] Based on this, the embodiment of the present application no longer performs the detection function based on the visual workspace, but creates a new invisible workspace, and performs the detection function through the invisible workspace, that is, in the process of displaying multiple programming blocks through the visual workspace, such as when the visual workspace is rendering programming blocks, responding to interactive operations between users after displaying programming blocks, and other situations where the rendering pressure of the visual workspace is relatively high, the multiple programming blocks are detected through the invisible workspace to obtain erroneous programming blocks (i.e., erroneous programming blocks).
[0080] Among them, the invisible workspace is invisible to the user, that is, the invisible workspace does not need to perform rendering functions, so it will not affect the rendering process of the visible workspace, that is, the visible workspace and the invisible workspace do not affect each other, and then there is no pressure to add new visual workspaces while adding new functions, and the user interface freeze problem is avoided, which improves the user experience.
[0081] The embodiments of the present application do not specifically limit the creation method of the invisible workspace. Taking the visual programming platform Blockly as an example, the constructor of the workspace can be called and the identifier of the returned invisible workspace can be saved. A new instance of the Workspace class can be initialized through the constructor, and this instance represents a container that can accommodate, organize, and manage code blocks. It contains a variety of methods and properties for interacting with these code blocks, such as adding, removing, and finding code blocks, monitoring code block events, etc. The identifier of the invisible workspace is used to uniquely represent the invisible workspace. Subsequently, the instance corresponding to the created invisible workspace can be obtained and the identifier of the invisible workspace can be passed in, so as to perform a detection function based on the obtained invisible workspace. For example, the getWorkspace function can be called and the identifier of the invisible workspace can be passed in to obtain an instance of the invisible workspace and then perform a detection function based on the invisible workspace.
[0082] The embodiment of the present application does not specifically limit the detection method of the invisible working area, which will be explained later based on C1-C3 and will not be repeated here.
[0083] In addition, in the embodiments of the present application, not only known errors can be detected, such as connection logic errors between programming blocks, but also custom errors can be detected, wherein custom errors are errors newly added by users or platforms, such as when the input of a programming block has no other programming blocks connected to it, there is an error in the programming block, and the error is an empty input, thereby realizing customized detection, that is, checking for custom errors, thereby further improving the accuracy of detection and improving user experience.
[0084] The embodiment of the present application does not specifically limit the timing of performing the detection operation in the invisible working area, and two methods are used as examples for explanation below.
[0085] Method 1: By setting an error detection control in a graphical programming interface, in response to obtaining a trigger operation for the error detection control, multiple programming blocks are detected through an invisible workspace. Figure 5 , which is a schematic diagram of a detection control provided by an embodiment of the present application. If the user performs a trigger operation such as single-clicking or double-clicking on the detection control 340, the terminal device detects multiple programming blocks through the invisible workspace in response to obtaining the trigger operation on the detection control.
[0086] Among them, the response is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be real-time or have a set delay: unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.
[0087] Method 2: The detection function is used as the default function. In response to detecting that the programming blocks are displayed in the visible workspace, the programming blocks are detected through the invisible workspace to obtain the wrong programming blocks. In other words, if the user has built the programming blocks, the built programming blocks are detected, so that the user does not need to actively turn on the detection function and actively detect the programming blocks, thereby improving the user experience.
[0088] S203: Displaying error programming blocks according to error categories in the graphical programming interface.
[0089] After detecting multiple programming blocks through the invisible workspace and obtaining the error programming blocks, the error programming blocks can be displayed through the graphical programming interface, and the error programming blocks can be displayed according to the error category, wherein the error category is the category of the programming block error. Thus, the error programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface, and the user can view the error programming blocks belonging to the same category together, which has high readability and improves the user experience.
[0090] The embodiments of the present application do not specifically limit the categories, and those skilled in the art can set them according to actual needs. For example, the error categories may include trigger group categories, error cause categories, and programming building block categories. They are described below.
[0091] Error category 1 displays the error blocks according to the trigger group category, so that the error blocks in the same trigger group are displayed in the same sub-area of the graphical programming interface. Figure 6 , which is a schematic diagram of an erroneous programming building block provided in an embodiment of the present application. Figure 6 In the example, the incorrect programming blocks are displayed according to the trigger groups. For example, the incorrect programming blocks belonging to trigger group A are displayed below trigger group A, and the incorrect programming blocks belonging to trigger group B are displayed below trigger group B. Therefore, when the programming blocks are displayed based on the trigger groups in the visual workspace, the incorrect programming blocks are displayed based on the trigger group categories, and the incorrect programming blocks can be quickly modified based on the trigger groups, thereby improving the user experience.
[0092] Error Category 2 displays error blocks according to the error cause, so that blocks with the same error cause are displayed in the same sub-area of the graphical programming interface. Figure 7 , which is a schematic diagram of an erroneous programming building block provided in an embodiment of the present application. Figure 7 In the program, the error blocks are displayed according to the error reasons. For example, the error reasons of the two error blocks are both illegal or missing parameters. Therefore, when detecting the target programming file with multiple error categories, the problem of the target programming file can be quickly determined, improving the user experience.
[0093] Error category three: display the error programming blocks according to the programming block category, so that the error programming blocks of the same programming block category are displayed in the same sub-area of the graphical programming interface. Figure 8 , which is a schematic diagram of an erroneous programming building block provided in an embodiment of the present application. Figure 8 In the , the wrong programming blocks are displayed according to the programming block category. For example, the wrong programming blocks belonging to the trigger blocks are displayed below the trigger block category. Therefore, when testing the target programming file, the type of programming blocks with problems can be quickly identified, helping users to improve their programming skills in a targeted manner and improve user experience.
[0094] Therefore, by displaying the error programming blocks according to different error categories, such as trigger group category, error cause category and programming block category, not only can the error programming blocks belonging to the same category be displayed in the same sub-area of the graphical programming interface, which helps users to view the error programming blocks belonging to the same category together, the readability is high, and the user experience is improved. It is also possible to respond to different usage scenarios based on setting different error categories to improve the user experience.
[0095] It can be seen from the above technical solution that a graphical programming interface is displayed, and the graphical programming interface includes a visual workspace, which can display multiple programming blocks included in the target programming file. In order to reduce the pressure of the visual workspace, the programming blocks are no longer detected based on the visual workspace, but in the process of displaying the programming blocks in the visual workspace, the multiple programming blocks included in the target programming file are detected through the invisible workspace to obtain the wrong programming blocks. Among them, the visual workspace and the invisible workspace do not affect each other, so that the detection of programming blocks through the invisible workspace will not affect the rendering process of the visual workspace. While adding new functions, there is no pressure to add a new visual workspace, which avoids the problem of user interface jamming and improves the user experience. In addition, when displaying the wrong programming blocks in the graphical programming interface, it can be displayed according to the error category, so that the wrong programming blocks belonging to the same category are displayed in the same sub-area in the graphical programming interface, so that the user can view the wrong programming blocks belonging to the same category together, which is highly readable and improves the user experience.
[0096] As a possible implementation, the present application provides two specific implementations of S203, namely, specific implementations of displaying error programming blocks according to error categories in a graphical programming interface. The first specific implementation is specifically referred to in A1, and the second specific implementation is specifically referred to in B1-B2.
[0097] The first specific implementation method: direct display.
[0098] A1: In the error programming block display area in the graphical programming interface, the error programming blocks are displayed.
[0099] The error programming block display area is a part of the graphical programming interface.
[0100] See also Fig. 9 , which is a schematic diagram of an erroneous programming building block provided in an embodiment of the present application. Fig. 9 In the example, the error programming block display area 350, the visual workspace 320 and the programming block list 330 are all directly displayed on the graphical programming interface.
[0101] Therefore, after the erroneous programming blocks are detected through the invisible workspace, the erroneous programming blocks can be directly displayed on the graphical programming interface through the erroneous programming block display area, so that the user can view the erroneous programming blocks in real time, such as modifying the erroneous programming blocks while adjusting the target programming file, thereby improving the user experience.
[0102] The second specific implementation method: display after interaction.
[0103] B1: Display error controls in the graphical programming interface.
[0104] The Error control is used to indicate whether there are incorrect programming blocks in the target programming file.
[0105] See also Fig.10 , which is a schematic diagram of an error control provided by an embodiment of the present application. Fig.10 In FIG. 3 , an error control 360 is shown, and a number 2 is displayed on the error control 360, that is, there are two error programming blocks in the current target programming file. That is, the error control combined with the number can not only indicate whether there are error programming blocks in the target programming file, but also display the number of error programming blocks.
[0106] It should be noted that the embodiments of the present application do not specifically limit the display form of the error control, such as error controls combined with numbers, error controls displayed with icons, etc. Those skilled in the art can set them according to actual needs.
[0107] B2: In response to obtaining a trigger operation for an erroneous control, displaying erroneous programming blocks according to the error category in a graphical programming interface.
[0108] After the user performs a trigger operation such as clicking on the error control, the terminal device displays the error programming blocks according to the error category in the graphical programming interface in response to obtaining the trigger operation for the error control, such as Figure 6-Figure 8 Any embodiment shown.
[0109] Therefore, an error control is set in the graphical programming interface, and the error control is used to indicate whether there are erroneous programming blocks in the target programming file, or even how many erroneous programming blocks there are. By occupying the least area of the graphical programming interface, as much information related to the erroneous programming blocks as possible can be provided, thereby ensuring that in the limited display interface of the graphical programming interface, the visual workspace is displayed as much as possible while prompting the user that there are erroneous programming blocks, and after interacting with the error control, the information related to the erroneous programming blocks can be further displayed in detail, thereby improving the user experience.
[0110] The embodiment of the present application does not specifically limit the display method of the erroneous programming building blocks in B2. For example, the erroneous programming building blocks are displayed through various interactive methods such as pop-up windows, drawers, page jumps, drop-down menus, etc., and those skilled in the art can set them according to actual needs.
[0111] Taking a pop-up window as an example, in response to obtaining a trigger operation for an error control, a pop-up window is displayed on the graphical programming interface, and the pop-up window is used to display the error programming building blocks according to the error category. Fig.10 In response to obtaining a trigger operation for an erroneous control, a pop-up window 370 is displayed on the graphical programming interface 310 , and the erroneous programming building block is displayed through the pop-up window 370 .
[0112] Therefore, displaying error programming blocks through pop-up windows has the following advantages: (1) Pop-up windows can appear in time when users need them, directly attracting the user's attention, allowing users to immediately see important information or perform necessary operations without having to search or browse in the graphical programming interface. (2) Pop-up windows can also reduce page jumps, thereby maintaining the user's context on the current page, that is, after exiting the pop-up window, the previous operation can be continued. (3) Pop-up windows can focus the user's attention to a certain extent, forcing the user to process the information or operations in the pop-up window before continuing with other tasks. (4) Pop-up windows can be customized as needed, including size, style, content, etc., to adapt to different scenarios and needs.
[0113] As a possible implementation, after displaying the wrong programming blocks in the second specific implementation, the wrong programming blocks can be closed and then the wrong programming blocks required for positioning display can be displayed in the visual workspace. The following is a description using a pop-up window as an example.
[0114] The pop-up window is used not only to display the error programming building block, but also to display the view control corresponding to the error programming building block, and the view control is used to jump to the visual workspace to view the corresponding error programming building block. It should be noted that if there are multiple error programming building blocks, each error programming building block can correspond to a view control, so that each view control can be used to view the corresponding error programming building block, thereby having multiple view controls.
[0115] See also Fig.11 , which is a schematic diagram of a viewing control provided by an embodiment of the present application. Fig.11 In the embodiment, there are two error programming blocks, each of which corresponds to a viewing control. For example, the error programming block of trigger group A corresponds to viewing control 381, and the error programming block of trigger group B corresponds to viewing control 382.
[0116] If the user performs a trigger operation on the view control corresponding to the erroneous programming block, the terminal device responds to obtaining the trigger operation on the view control by closing the pop-up window in the graphical programming interface and displaying the erroneous programming block corresponding to the view control in the visual workspace.
[0117] Continue to see Fig.11 If the user wants to view the error programming building blocks belonging to trigger group A, he can perform a trigger operation on the viewing control 381. In response to the trigger operation on the viewing control 381, the terminal device closes the pop-up window 370 in the graphical programming interface 310, thereby displaying the portion blocked by the pop-up window 370, namely, the visual workspace 310 and the programming building block list 330. The error programming building block corresponding to the viewing control 381, namely, the error programming building block belonging to trigger group A, is displayed in the visual workspace 310.
[0118] The embodiments of the present application do not specifically limit the manner of displaying erroneous programming blocks in the visual workspace, such as displaying the required erroneous programming blocks in the middle of the visual workspace, highlighting (such as highlighting, etc.) the required erroneous programming blocks in the visual workspace, etc., to further improve viewing efficiency.
[0119] Therefore, each erroneous programming building block is equipped with a corresponding viewing control, and the corresponding erroneous programming building block can be viewed in the visual workspace through the viewing control, that is, the pop-up window is closed in the graphical programming interface, and the erroneous programming building block corresponding to the selected viewing control is displayed in the visual workspace, thereby realizing the positioning display of the erroneous programming building block in the visual workspace, improving the viewing efficiency and improving the user experience.
[0120] As a possible implementation method, it can be known from the above that the visual workspace can display programming blocks in the form of trigger groups, that is, programming blocks belonging to the same trigger group are displayed in the visual workspace at the same time. However, if the erroneous programming blocks are displayed through the aforementioned second specific implementation method, the visual workspace will be blocked, so that it is impossible to determine which trigger group the visual workspace has rendered. If the user chooses to view the erroneous programming blocks of other trigger groups, the visual workspace needs to be re-rendered for the programming blocks included in other trigger groups, wasting rendering resources. The following will continue to explain using the pop-up window as an example.
[0121] Based on this, the embodiment of the present application displays the identifier of the trigger group while displaying the pop-up window. The trigger group is the trigger group displayed in the visual workspace, so that the user can give priority to viewing the trigger group displayed in the visual workspace based on the identifier of the trigger group. At this time, there is no need to render again, and the waiting time is short.
[0122] If the user chooses to view other trigger groups, that is, trigger groups other than the trigger group displayed in the visual workspace, the visual workspace needs to render other trigger groups first. Not only does it need to wait for the rendering to be completed, but if the user again selects the trigger group previously displayed in the visual workspace, it needs to be rendered again. The rendering times are large and the waiting time is long.
[0123] The following takes the display of the first trigger group in the visual workspace as an example. The first trigger group is one of the multiple trigger groups included in the target programming file.
[0124] If the visual workspace displays the programming blocks included in the first trigger group, then in the process of displaying the erroneous programming blocks included in the target programming file through a pop-up window, the identifier of the first trigger group is displayed in the non-blocked area of the graphical programming interface, and the identifier is used to uniquely identify the first trigger group.
[0125] The non-blocked area refers to an area that will not be blocked by pop-up windows, error programming blocks, etc., to ensure that the user can view the logo of the first trigger group while viewing the error programming blocks. The embodiment of the present application does not specifically limit the position of the non-blocked area, and those skilled in the art can set it according to actual needs. For example, the non-blocked area can be displayed on the pop-up window together with the error programming blocks, such as Fig.12 The non-blocking area shown is area 390, which is displayed on the pop-up window 370. For another example, the non-blocking area can be displayed in the area outside the pop-up window with the visible working area, such as Fig.13 The non-blocked area shown is area 390 , which is located in the graphical programming interface 310 but not in the pop-up window 370 .
[0126] Therefore, in the process of displaying erroneous programming blocks through interactive methods such as pop-ups, in order to avoid the pop-ups and other interactive methods blocking the visual workspace, resulting in the inability to clearly identify which trigger group is displayed in the visual workspace, the identifier of the corresponding trigger group (such as the identifier of the first trigger group) can be displayed in the non-blocked area of the graphical programming interface, so that the user can clearly see that the trigger group displayed in the visual workspace is the first trigger group, so that the erroneous programming blocks of the first trigger group can be given priority, thereby avoiding multiple renderings, saving rendering resources, reducing the rendering pressure of the visual workspace, reducing user waiting time, and improving user experience.
[0127] In addition, if the user chooses to view the error programming building block of the second trigger group, the user can perform a trigger operation on the viewing control of the error programming building block. In response to obtaining the trigger operation for the second trigger group, the terminal device clears the programming building blocks included in the first trigger group in the visual workspace and then loads the programming building blocks included in the second trigger group in the visual workspace. It can be understood that the programming building blocks included in the second trigger group include the error programming building blocks that the user wants to view. The second trigger group is a different trigger group from the first trigger group.
[0128] The embodiment of the present application does not specifically limit the display method of the erroneous programming building blocks in the visual workspace. The following takes the case where there are multiple erroneous programming building blocks as an example and illustrates the display methods in two ways.
[0129] Method 1: Highlight.
[0130] If the user wants to view an erroneous programming block among multiple erroneous programming blocks, namely, a target erroneous programming block, the user can perform a viewing operation on the target erroneous programming block, such as clicking a viewing control corresponding to the target erroneous programming block, etc. In response to obtaining the viewing operation on the target erroneous programming block, the terminal device displays the target erroneous programming block in a first display mode in the visual workspace, and displays other programming blocks in a second display mode.
[0131] Among them, the other programming blocks are programming blocks except the target error programming blocks. For example, if the first trigger group includes 10 programming blocks, the other programming blocks are 9 programming blocks except the target error programming blocks among the 10 programming blocks included in the first trigger group.
[0132] The first display mode is different from the second display mode. For example, the first display mode is a highlighted display, and the second display mode is a non-highlighted display. For another example, the first display mode is a bold display, and the second display mode is a normal display. For another example, the first display mode is a color font display, and the second display mode is a black font display, etc.
[0133] See also Fig.14 , which is a schematic diagram of highlighting an erroneous programming building block provided by an embodiment of the present application. Fig.14 In the example, the target error programming block is a programming block connected to the trigger block "when starting the game", and the display mode of the target error programming block is different from the display mode of the trigger block "when starting the game", thereby highlighting the display of the target error programming block.
[0134] Thus, the target error programming block and other programming blocks are displayed respectively through the first display mode and the second display mode, so that the target error programming block and other programming blocks are displayed differently and highlighted in the visual workspace, so that the user can quickly view the target error programming block, facilitate modification, and improve the user experience.
[0135] Method 2: Center display.
[0136] If the user wants to view an erroneous programming block among multiple erroneous programming blocks, namely, a target erroneous programming block, the user can perform a viewing operation on the target erroneous programming block, such as clicking a viewing control corresponding to the target erroneous programming block, etc. In response to obtaining the viewing operation on the target erroneous programming block, the terminal device displays the target erroneous programming block in the central area of the visual workspace.
[0137] The central area refers to a portion of the area that expands outward from the center of the visible workspace.
[0138] See also Fig.15 , which is a schematic diagram of highlighting an erroneous programming building block provided by an embodiment of the present application. Fig.15 In the example, the target error programming block is a programming block connected to the trigger block "when starting the game", and the target error programming block is displayed in the middle of the visual workspace, i.e., the center area, so that the user can immediately see the target error programming block.
[0139] Therefore, by displaying the target error programming block in the central area of the visual workspace, the target error programming block can be highlighted in the visual workspace, so that the user can quickly view the target error programming block, facilitate modification, and improve the user experience.
[0140] It should be noted that multiple display modes can be used in combination. For example, in response to obtaining a viewing operation for a target error programming block, the target error programming block is displayed in a first display mode in the center area of the visual workspace, and other programming blocks are displayed in a second display mode.
[0141] See also Fig.16 , which is a schematic diagram of highlighting an erroneous programming building block provided by an embodiment of the present application. Fig.16 In the example, the target error programming block is a programming block connected to the trigger block "When starting the game". The target error programming block is displayed in the middle of the visual workspace, i.e., the center area. It is displayed in a highlighted manner so that the user can immediately see the target error programming block.
[0142] As a possible implementation, the embodiment of the present application does not specifically limit the number of visual workspaces created. For example, the number of invisible workspaces created is determined based on the number of multiple programming building blocks included in the target programming file, wherein the more programming building blocks the target programming file includes, the more invisible workspaces need to be created, that is, the larger the number of invisible workspaces created. The creation number is the number of invisible workspaces created.
[0143] Therefore, after determining the number of invisible workspaces to be created based on the multiple programming blocks included in the target programming file, invisible workspaces that meet the number of creations are created, so that when the number of the multiple programming blocks is greater, the multiple programming blocks can be detected separately through more invisible workspaces, that is, each invisible workspace can detect the programming blocks it is responsible for separately, and obtain erroneous programming blocks, thereby improving the detection speed.
[0144] For another example, if the number of programming blocks displayed in the visual workspace is relatively large, the number of invisible workspaces to be created can be determined based on the number of programming blocks displayed in the visual workspace, wherein the more programming blocks displayed in the visual workspace, the more invisible workspaces need to be created, that is, the larger the number of invisible workspaces to be created. For example, if the visual workspace displays programming blocks in trigger groups, the already created invisible workspaces can be reused when the visual workspace displays the next trigger group, thereby increasing the detection speed while reducing the number of invisible workspaces to be created.
[0145] Therefore, the number of invisible workspaces to be created is determined by the number of programming blocks, and by creating invisible workspaces that meet the detection requirements, the programming blocks are quickly detected through multiple invisible workspaces, thereby improving the detection efficiency.
[0146] The following is an explanation of the process of detecting programming blocks in the invisible workspace. See C1-C3 for details.
[0147] C1: After clearing the programming blocks included in the i-1th trigger group in the invisible workspace, load the programming blocks included in the i-th trigger group.
[0148] As can be seen from the above, programming blocks can be displayed in the form of trigger groups. Similarly, detection can also be performed in the form of trigger groups through the invisible workspace, that is, the invisible workspace detects multiple programming blocks included in the target programming file in units of trigger groups, that is, after detecting the programming blocks included in the i-1th trigger group, continue to detect the programming blocks included in the i-th trigger group to ensure the comprehensiveness of the detection.
[0149] In addition, the invisible workspace can be reused, that is, after the invisible workspace detects the programming blocks included in the i-1th trigger group, the programming blocks included in the i-1th trigger group are cleared, and the i-th trigger group is loaded in the cleared invisible workspace, so as to continue to detect the programming blocks included in the i-th trigger group through the invisible workspace, until all the trigger groups included in the target programming file are detected, and multiple erroneous programming blocks included in the target programming file are obtained.
[0150] Wherein, i is a positive integer. It should be noted that, when i is 1, there is no i-1th trigger group, and the clearing operation may not be performed.
[0151] C2: Get the trigger building block in the programming building blocks included in the i-th trigger group.
[0152] As can be seen from the foregoing, a trigger group may include one or more trigger blocks, each of which is the starting point when the code is running. Therefore, subsequent detection based on the trigger blocks can realize the detection of multiple programming blocks included in the trigger group to avoid omissions.
[0153] Thus, all trigger blocks included in the multiple programming blocks included in the i-th trigger group are obtained, so as to start detection based on the trigger blocks, avoid missing the programming blocks included in the i-th trigger group, and improve the coverage of detection.
[0154] As a possible implementation method, the trigger blocks included in the i-th trigger group can be put into an array, so that the array can be directly reused later (such as counting the number of erroneous programming blocks, etc.), without the need to re-acquire the trigger blocks, thereby reducing the amount of calculation.
[0155] C3: Starting from the trigger block, detect the trigger block and the sub-blocks of the trigger block to obtain the wrong programming blocks.
[0156] The child blocks of the trigger block are blocks connected to the trigger block and require the parent block to provide data or instructions to perform their functions. For example, the first child block connected to the trigger block has the trigger block as its parent block. The parent block is used to provide data or instructions to the child blocks. The child blocks and parent blocks are relative concepts. The child blocks can also serve as the parent blocks of other blocks and provide data or instructions to other blocks. The child blocks of the trigger block correspond to the trigger block for one code run.
[0157] In other words, the parent block can also be called a container block. This type of block usually has one or more slots to receive other blocks (i.e. "child blocks") and defines how these child blocks are organized or executed. Child blocks can also be called slot blocks. These blocks are designed to be inserted into the slots of container blocks. They can be simple commands (such as moving characters), conditional judgments (if...then...), loops (such as repeatedly executing...), or variable assignments.
[0158] Generally speaking, in a visual programming platform, a parent block provides more of an organizational structure and control flow, and the interaction and data flow between child blocks are implemented based on programming logic and data flow. A parent block can receive and organize multiple child blocks, and multiple child blocks are called brother blocks. However, these child blocks are not directly "provided with input" by the parent block, but they together constitute a logical unit or execution sequence. In this sequence, the child blocks may receive some form of organization or control from the parent block (through its structure or position), but more often they collaborate with each other according to programming logic. For example, if a parent block defines a certain flow control structure of the program (such as sequential execution, conditional judgment, loop, etc.), then the child blocks under it will be executed according to this structure. In this process, the child blocks may receive data or instructions from other child blocks, and may also provide data or instructions to other child blocks, but this interaction is usually based on programming logic and data flow, rather than directly "providing input" by the parent block.
[0159] See also Fig.17 , which is a schematic diagram of the relationship between programming building blocks provided in an embodiment of the present application. Fig.17 In the example, five programming blocks constitute a code run, such as the content executed after "When the sky environment changes", and the connection relationship is used to represent the flow of data. The trigger block is the parent block of programming block 1 and programming block 2, programming block 1 and programming block 2 are child blocks of the trigger block, programming block 1 and programming block 2 are sibling blocks, programming block 3 is the child block of programming block 1, programming block 1 is the parent block of programming block 3, programming block 4 is the child block of programming block 2, and programming block 2 is the parent block of programming block 4.
[0160] Therefore, starting from the trigger block, detect the trigger block and the sub-blocks of the trigger block, and then detect all the blocks under the trigger block, such as Fig.17As shown, the four sub-blocks associated with the trigger block can be regarded as sub-blocks of the trigger block, and the five programming blocks constitute a code run. Thus, all blocks under the trigger block are detected, and by traversing all trigger blocks of the i-th trigger group, all programming blocks of the i-th trigger group can be detected, and then all trigger groups included in the target programming file are detected, and multiple error blocks included in the target programming file are obtained.
[0161] Therefore, by clearing the programming blocks included in the i-1th trigger group in the invisible workspace, loading the programming blocks included in the i-th trigger group, and checking the programming blocks included in the i-th trigger group, the invisible workspace can be reused, the creation process of the invisible workspace can be reduced, and the detection efficiency can be improved. Moreover, in the process of detecting the programming blocks included in the i-th trigger group, the trigger blocks of the i-th trigger group are first obtained, and the trigger blocks are used as the detection starting point. Based on the data flow relationship between the programming blocks, the detection is performed one by one, thereby avoiding missing the detection of the programming blocks in the i-th trigger group and improving the detection accuracy.
[0162] As a possible implementation, if the error to be detected is an input error, then if there is an input error in a sub-block, the sub-blocks after the sub-block do not need to be detected again, that is, there is no need to traverse all programming blocks included in the i-th trigger group.
[0163] Based on this, the embodiment of the present application provides a specific implementation method of C3, that is, starting from the trigger building block, detecting the trigger building block and the sub-building blocks of the trigger building block, and obtaining the specific implementation method of the erroneous programming building block, specifically refer to C31-C32.
[0164] C31: Starting from the trigger block, detect the trigger block and the child blocks of the trigger block.
[0165] Starting from the trigger block, you can detect the trigger block and its sub-blocks according to the data flow relationship. Fig.17 For example, the trigger block can be detected first, then programming block 1 and programming block 3 can be detected, and then programming block 2 and programming block 4 can be detected. It can be understood that after the trigger block is detected, programming block 2 and programming block 4 can be detected first, and then programming block 1 and programming block 3 can be detected. This application does not make specific limitations on this.
[0166] C32: If there is an input error in the target sub-block among the sub-blocks of the trigger block, the parent block of the target sub-block is determined as an erroneous programming block, and the detection of the sub-blocks of the target sub-block is stopped, and the detection continues from the sibling blocks of the parent block of the target sub-block to obtain the erroneous programming block.
[0167] The trigger block includes multiple sub-blocks. If one of the sub-blocks in the trigger sub-block, that is, the target sub-block, has an input error, it means that the parent block of the target sub-block has an error in the process of transmitting data, and the parent block of the target sub-block is an erroneous programming block. At this time, the detection of the branch where the target sub-block is located can be stopped, that is, there is no need to detect the sub-blocks of the target sub-block, but continue to detect from the brother blocks of the parent block of the target sub-block, and obtain the erroneous programming block through continuous detection.
[0168] Continue with Fig.17 For example, the target sub-block is programming block 3. If there is an input error in programming block 3, its parent block, programming block 1, is an erroneous programming block. At this time, the sub-blocks (not shown in the figure) of programming block 3 are no longer tested, but the testing starts from the sibling block of programming block 1, programming block 2, and then programming block 4, and so on, and finally the erroneous programming blocks included in the target programming file are obtained.
[0169] Therefore, if the error to be detected is an input error, then if there is an input error in a sub-block, the sub-blocks after the sub-block do not need to be detected again, that is, there is no need to traverse all the programming blocks included in the i-th trigger group, thereby improving the detection efficiency by immediately stopping useless detection.
[0170] In order to facilitate further understanding of the technical solution provided in the embodiment of the present application, the following takes the execution subject of the detection method of the programming building block provided in the embodiment of the present application as a terminal device, and customized detection of custom errors as an example, to give an overall exemplary introduction to the detection method of the programming building block.
[0171] The custom error may be that when the input of a certain programming block is not connected to other programming blocks, the programming block is defined as an empty input error, and its parent block is an error programming block.
[0172] See also Fig.18 , which is a schematic diagram of a programming block detection method provided in an embodiment of the present application.
[0173] S1801: Display the graphical programming interface.
[0174] After the user imports the target programming file through the visual programming platform, the visual programming platform displays a graphical programming interface, which has a visual workspace. The visual workspace is used to display the programming blocks included in the first trigger group included in the target programming file, that is, the visual workspace displays the programming blocks according to the trigger groups, see S201 for details.
[0175] The following describes a process of detecting multiple programming blocks through an invisible workspace to obtain erroneous programming blocks during the process of displaying multiple programming blocks included in a target programming file through a visible workspace.
[0176] S1802: Create an invisible workspace.
[0177] An invisible workspace is created to detect erroneous programming blocks among multiple programming blocks. Different from the visible workspace, the invisible workspace is only used to detect programming blocks and is invisible to the user, thereby avoiding occupying rendering resources and preventing a user interface from freezing. For details, see S202.
[0178] S1803: Import programming blocks into the invisible workspace.
[0179] After clearing the programming blocks included in the i-1th trigger group in the invisible workspace, load the programming blocks included in the i-th trigger group, see C1 for details.
[0180] S1804: Get all trigger blocks.
[0181] Get the trigger blocks in the programming blocks included in the i-th trigger group. For example, you can get all the trigger blocks (i.e., top-level blocks) in the current invisible workspace. For example, call Blockly's "getTopBlocks" function, which can traverse all programming blocks in the workspace, find the top-level blocks without parent blocks, and return them as a list, thereby obtaining all trigger blocks. Store all trigger blocks in an array, see C2 for details.
[0182] S1805: Check programming blocks.
[0183] Starting from the trigger block, check the trigger block and the sub-blocks of the trigger block to obtain the wrong programming block, see C3 for details. For example, define an algorithm to check whether there is an input error in each programming block in the i-th trigger group. This algorithm can be a depth-first search (DFS) algorithm, starting from each trigger block, check whether it and all its sub-blocks have input errors. If there is an error, record the error and store it in the global error list, and use the identifier of the trigger block and the identifier of the sub-block as the key to stop checking the current path and trace back to the sibling blocks of the sub-block.
[0184] S1806: Determine whether all trigger groups have been detected. If so, execute S1807; if not, execute S1803.
[0185] S1803-S1805 are repeatedly executed, that is, the value of i is continuously increased by 1, so as to detect each trigger group included in the target programming file and realize loop checking.
[0186] S1807: Display error controls in the graphical programming interface.
[0187] The error control is used to indicate whether there are any error blocks in the target programming file, and the number of error blocks. In other words, after checking all the trigger groups, the number of error blocks in the target programming file is calculated and displayed in the error control, such as Fig.10 As shown, see B1 for details.
[0188] It is understandable that when counting the number of incorrectly programmed blocks according to the trigger group, the array in S1804 can be reused to reduce the amount of calculation.
[0189] S1808: A pop-up window appears.
[0190] In response to obtaining a trigger operation for an error control, a pop-up window is displayed on the graphical programming interface, the pop-up window is used to display error programming blocks according to error categories, and error programming blocks belonging to the same category are displayed in the same sub-area of the pop-up window. See B2 for details.
[0191] S1809: Obtain a trigger operation for a target error programming control.
[0192] S1810: Determine whether to switch the workspace, if so, execute S1811, if not, execute S1812.
[0193] In the process of displaying the erroneous programming blocks through the pop-up window, the identifier of the first trigger group is displayed in the non-blocked area of the graphical programming interface, so that the user can preferentially select the erroneous programming blocks in the first trigger being displayed in the visual workspace, such as Fig.12 or Fig.13 shown.
[0194] However, it is also necessary to ensure that the user views the wrong programming blocks of other trigger groups. Specifically, when the user clicks on a trigger group, it is determined whether it is necessary to switch the visual workspace. This can be achieved by comparing the trigger group displayed in the visual workspace with the trigger group clicked by the user. If they are the same trigger group, then there is no need to switch the visual workspace. If they are not the same trigger group, then a visual workspace switch is required. When switching the visual workspace, it is necessary to clear the programming blocks included in the previous trigger group in the visual workspace, and then load the programming blocks included in the selected trigger. This process can be implemented through Blockly's "clear" function and "load" function. Among them, the "clear" function is used to clear all blocks in the workspace, that is, to completely clear the contents of the current workspace and restore it to the initial blank state. The "load" function is used to load an externally defined program structure into the workspace. This usually involves parsing a file (such as XML) containing programming blocks and their connection information, and then recreating these programming blocks and their relationships in Blockly's workspace, thereby restoring or displaying an existing program.
[0195] S1811: Import the programming blocks included in the new trigger group into the visual workspace.
[0196] S1812: Highlight and center the incorrectly programmed blocks.
[0197] When the user clicks the view control corresponding to the target erroneous programming block, the pop-up window is closed. The erroneous programming block can be regarded as a Scalable Vector Graphics (SVG) element, so that the erroneous programming block can be highlighted by modifying the Cascading Style Sheets (CSS) class of the SVG element, or by directly applying style rules to the SVG element. For example, add a specific class to the erroneous programming block that needs to be highlighted, and then define the style of this class in CSS as highlighting. Specifically, the target erroneous programming block can be highlighted through Blockly's "Highlight" function.
[0198] Then, the highlighted error programming block is positioned or laid out in the parent element or container in the top center and horizontal center manner, so as to realize the center display. For example, the CenterOnBlockByTopMiddle method of Workspace is used to center the target error programming block, such as Fig.16 shown.
[0199] It can be seen from the above technical solution that the embodiment of the present application provides a method for detecting and prompting programming blocks. The method can handle the inspection of a large number of programming blocks by creating an invisible workspace specifically to detect errors in programming blocks, while avoiding interface freezes and improving user experience. Moreover, by classifying and displaying error categories such as trigger groups, a more user-friendly prompt is achieved, which can help users quickly locate and correct errors and improve programming efficiency and accuracy. A better user experience is provided. In addition, a method for locating erroneous programming blocks is also provided, which can help users quickly find the desired erroneous programming blocks and achieve the effect of quickly repairing erroneous programming blocks.
[0200] With respect to the above-described programming block detection method, the present application also provides a corresponding programming block detection device, so that the above-described programming block detection method can be applied and implemented in practice.
[0201] See also Fig.19 , which is a schematic diagram of the structure of a detection device for programming building blocks provided in an embodiment of the present application. Fig.19 As shown, the detection device 1900 of the programming building block includes: a display unit 1901 and a detection unit 1902;
[0202] The display unit 1901 is used to display a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in a target programming file;
[0203] The detection unit 1902 is used to detect the multiple programming blocks through the invisible work area during the process of displaying the multiple programming blocks through the visual work area, and obtain an erroneous programming block, wherein the erroneous programming block is a programming block with an error, and the invisible work area and the visible work area do not affect each other;
[0204] The display unit 1901 is further configured to display the erroneous programming blocks according to error categories in the graphical programming interface, and erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
[0205] It can be seen from the above technical solution that a graphical programming interface is displayed, and the graphical programming interface includes a visual workspace, which can display multiple programming blocks included in the target programming file. In order to reduce the pressure of the visual workspace, the programming blocks are no longer detected based on the visual workspace, but in the process of displaying the programming blocks in the visual workspace, the multiple programming blocks included in the target programming file are detected through the invisible workspace to obtain the wrong programming blocks. Among them, the visual workspace and the invisible workspace do not affect each other, so that the detection of programming blocks through the invisible workspace will not affect the rendering process of the visual workspace. While adding new functions, there is no pressure to add a new visual workspace, which avoids the problem of user interface jamming and improves the user experience. In addition, when displaying the wrong programming blocks in the graphical programming interface, it can be displayed according to the error category, so that the wrong programming blocks belonging to the same category are displayed in the same sub-area in the graphical programming interface, so that the user can view the wrong programming blocks belonging to the same category together, which is highly readable and improves the user experience.
[0206] As a possible implementation, the display unit 1901 is specifically used for:
[0207] Displaying an error control in the graphical programming interface, the error control is used to indicate whether the target programming file contains the error programming building block;
[0208] In response to obtaining a trigger operation for the erroneous control, the erroneous programming building blocks are displayed on the graphical programming interface according to the error category.
[0209] As a possible implementation, the display unit 1901 is specifically used for:
[0210] In response to obtaining a trigger operation for the erroneous control, a pop-up window is displayed on the graphical programming interface, wherein the pop-up window is used to display the erroneous programming building blocks according to the error category.
[0211] As a possible implementation, the pop-up window is further used to display a viewing control corresponding to the erroneous programming building block, and the viewing control is used to jump to the visual workspace to view the corresponding erroneous programming building block. The display unit 1901 is also used to:
[0212] In response to obtaining a trigger operation for the viewing control, the pop-up window is closed in the graphical programming interface, and an erroneous programming building block corresponding to the viewing control is displayed in the visual workspace.
[0213] As a possible implementation, if the visual workspace displays programming blocks included in a first trigger group, and the first trigger group is one of a plurality of trigger groups, then the display unit 1901 is further configured to:
[0214] In the process of displaying the erroneous programming building block through the pop-up window, the identifier of the first trigger group is displayed in the non-blocking area of the graphical programming interface.
[0215] As a possible implementation, if the number of the erroneous programming blocks is multiple, the display unit 1901 is specifically used to:
[0216] In response to obtaining a viewing operation for a target error programming block, in the visual workspace, the target error programming block is displayed in a first display mode, and other programming blocks are displayed in a second display mode, wherein the first display mode is different from the second display mode, and the other programming blocks are programming blocks other than the target error programming block.
[0217] As a possible implementation, if the number of the erroneous programming blocks is multiple, the display unit 1901 is specifically used to:
[0218] In response to obtaining a viewing operation for a target error programming block, the target error programming block is displayed in a central area of the visual workspace.
[0219] As a possible implementation, the error categories include trigger group categories, error cause categories, and programming building block categories;
[0220] Among them, the erroneous programming blocks belonging to the same trigger group category belong to the same trigger group, the erroneous programming blocks belonging to the same error cause category have the same errors, and the erroneous programming blocks belonging to the same programming block category have the same category.
[0221] As a possible implementation manner, the device further includes a creating unit, configured to:
[0222] Determining the number of the invisible workspaces to be created according to the number of the plurality of programming building blocks, wherein the greater the number of the plurality of programming building blocks, the greater the number of the invisible workspaces to be created;
[0223] Creating invisible workspaces that match the number of creations, where different invisible workspaces are used to detect different programming blocks;
[0224] The detection unit 1902 is specifically used for:
[0225] The corresponding programming building blocks are detected respectively through each of the invisible working areas to obtain the erroneous programming building blocks.
[0226] As a possible implementation manner, the detection unit 1902 is specifically configured to:
[0227] After clearing the programming building blocks included in the i-1th trigger group in the invisible workspace, loading the programming building blocks included in the i-th trigger group, where i is a positive integer;
[0228] Obtaining a trigger building block from the programming building blocks included in the i-th trigger group;
[0229] Starting from the trigger block, the trigger block and the sub-blocks of the trigger block are detected to obtain the erroneous programming block, wherein the sub-blocks of the trigger block and the trigger block correspond to a code run once.
[0230] As a possible implementation manner, the detection unit 1902 is specifically configured to:
[0231] Starting from the trigger building block, detecting the trigger building block and sub-building blocks of the trigger building block;
[0232] If there is an input error in the target sub-block among the sub-blocks of the trigger block, the parent block of the target sub-block is determined to be the erroneous programming block, and the detection of the sub-blocks of the target sub-block is stopped, and the detection is continued from the sibling blocks of the parent block of the target sub-block to obtain the erroneous programming block.
[0233] The present application also provides a computer device, which may be a server or a terminal device. The following will introduce the computer device provided by the present application from the perspective of hardware entity. Fig. 20 The following is a schematic diagram of the server structure. Fig.21 Shown is a schematic diagram of the structure of the terminal equipment.
[0234] See also Fig. 20 , which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more processors 1422, such as central processing units (CPU), memory 1432, one or more application programs 1442 or storage media 1430 (such as one or more massive storage devices) for data 1444. Among them, the memory 1432 and the storage medium 1430 may be temporary storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.
[0235] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0236] The steps performed by the server in the above embodiment can be based on the Fig. 20 The server structure shown.
[0237] The processor 1422 is used to perform the following steps:
[0238] Displaying a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in a target programming file;
[0239] In the process of displaying the plurality of programming blocks through the visible work area, the plurality of programming blocks are detected through the invisible work area to obtain an erroneous programming block, wherein the erroneous programming block is an erroneous programming block, and the invisible work area and the visible work area do not affect each other;
[0240] The erroneous programming blocks are displayed in the graphical programming interface according to the error categories, and the erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
[0241] Optionally, the processor 1422 may also execute the method steps of any specific implementation of the method for detecting programming blocks in the embodiments of the present application.
[0242] See also Fig.21 , which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Taking the terminal device as a smart phone as an example, Fig.21 The block diagram of the partial structure of the smart phone is shown, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Fig.21 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0243] Combine the following Fig.21 A detailed introduction to the various components of a smartphone:
[0244] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.
[0245] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .
[0246] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0247] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0248] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.
[0249] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.
[0250] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.
[0251] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.
[0252] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0253] In the embodiment of the present application, the memory 1520 included in the smart phone can store a computer program and transmit the computer program to the processor.
[0254] The processor 1580 included in the smart phone can execute the programming block detection method provided in the above embodiment according to the instructions in the computer program.
[0255] The embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the detection method of the programming building block provided in the above embodiment.
[0256] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the detection method of the programming building block provided in various optional implementations of the above aspects.
[0257] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.
[0258] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0259] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0260] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0261] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for detecting programming blocks, characterized in that: The method comprises: Displaying a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in a target programming file; In the process of displaying the plurality of programming blocks through the visible work area, the plurality of programming blocks are detected through the invisible work area to obtain an erroneous programming block, wherein the erroneous programming block is an erroneous programming block, and the invisible work area and the visible work area do not affect each other; The erroneous programming blocks are displayed in the graphical programming interface according to the error categories, and the erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
2. The method according to claim 1, characterized in that The displaying of the erroneous programming blocks according to the error categories on the graphical programming interface includes: Displaying an error control in the graphical programming interface, the error control is used to indicate whether the target programming file contains the error programming building block; In response to obtaining a trigger operation for the erroneous control, the erroneous programming building blocks are displayed on the graphical programming interface according to the error category.
3. The method according to claim 2, characterized in that In response to obtaining a trigger operation for the error control, displaying the error programming building blocks according to error categories on the graphical programming interface includes: In response to obtaining a trigger operation for the erroneous control, a pop-up window is displayed on the graphical programming interface, wherein the pop-up window is used to display the erroneous programming building blocks according to the error category.
4. The method according to claim 3, characterized in that The pop-up window is also used to display a viewing control corresponding to the erroneous programming building block, and the viewing control is used to jump to the visual workspace to view the corresponding erroneous programming building block. The method also includes: In response to obtaining a trigger operation for the viewing control, the pop-up window is closed in the graphical programming interface, and an erroneous programming building block corresponding to the viewing control is displayed in the visual workspace.
5. The method according to claim 3, characterized in that: If the visual workspace displays programming blocks included in a first trigger group, and the first trigger group is one of a plurality of trigger groups, the method further includes: In the process of displaying the erroneous programming building block through the pop-up window, the identifier of the first trigger group is displayed in the non-blocking area of the graphical programming interface.
6. The method according to claim 1, characterized in that If the number of the erroneous programming blocks is multiple, the method further includes: In response to obtaining a viewing operation for a target error programming block, in the visual workspace, the target error programming block is displayed in a first display mode, and other programming blocks are displayed in a second display mode, wherein the first display mode is different from the second display mode, and the other programming blocks are programming blocks other than the target error programming block.
7. The method according to claim 1, characterized in that The feature is that If the number of the erroneous programming blocks is multiple, the method further includes: In response to obtaining a viewing operation for a target error programming block, the target error programming block is displayed in a central area of the visual workspace.
8. The method according to claim 1, characterized in that The error categories include trigger group categories, error cause categories, and programming building block categories; Among them, the erroneous programming blocks belonging to the same trigger group category belong to the same trigger group, the erroneous programming blocks belonging to the same error cause category have the same errors, and the erroneous programming blocks belonging to the same programming block category have the same category.
9. The method according to claim 1, characterized in that: The method further comprises: Determining the number of the invisible workspaces to be created according to the number of the plurality of programming building blocks, wherein the greater the number of the plurality of programming building blocks, the greater the number of the invisible workspaces to be created; Creating invisible workspaces that match the number of creations, where different invisible workspaces are used to detect different programming blocks; The detecting the plurality of programming blocks through the invisible workspace to obtain the erroneous programming blocks includes: The corresponding programming building blocks are detected respectively through each of the invisible working areas to obtain the erroneous programming building blocks.
10. The method according to claim 1, characterized in that The detecting the plurality of programming blocks through the invisible workspace to obtain the erroneous programming blocks includes: After clearing the programming building blocks included in the i-1th trigger group in the invisible workspace, loading the programming building blocks included in the i-th trigger group, where i is a positive integer; Obtaining a trigger building block from the programming building blocks included in the i-th trigger group; Starting from the trigger block, the trigger block and the sub-blocks of the trigger block are detected to obtain the erroneous programming block, wherein the sub-blocks of the trigger block and the trigger block correspond to a code run once.
11. The method according to claim 10, characterized in that The method starts from the trigger block, detects the trigger block and sub-blocks of the trigger block, and obtains the erroneous programming block, including: Starting from the trigger building block, detecting the trigger building block and sub-building blocks of the trigger building block; If there is an input error in the target sub-block among the sub-blocks of the trigger block, the parent block of the target sub-block is determined to be the erroneous programming block, and the detection of the sub-blocks of the target sub-block is stopped, and the detection is continued from the sibling blocks of the parent block of the target sub-block to obtain the erroneous programming block.
12. A detection device for programming building blocks, characterized in that: The device comprises: a display unit and a detection unit; The display unit is used to display a graphical programming interface including a visual workspace, wherein the visual workspace is used to display a plurality of programming building blocks included in the target programming file; The detection unit is used to detect the multiple programming blocks through the invisible working area during the process of displaying the multiple programming blocks through the visual working area to obtain an erroneous programming block, wherein the erroneous programming block is a programming block with an error, and the invisible working area and the visible working area do not affect each other; The display unit is further used to display the erroneous programming blocks according to error categories in the graphical programming interface, and erroneous programming blocks belonging to the same category are displayed in the same sub-area of the graphical programming interface.
13. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 11 according to the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Error inspection method
CN101515249A
Building block placement interaction method, device and equipment for graphical programming platform
CN113656018A
Code error positioning method and device, electronic equipment and storage medium
CN113778854A
Building block display method and device based on graphical programming and electronic equipment
CN118245041A
Programming building block searching method, device and equipment and computer readable storage medium
CN118259894A
Cited By
Information processing method and device for game editing, program product and equipment
CN119961132A
Information processing method, device, program product and equipment for game editing
CN119961132B
