Program running state indication system and physical code block
Through the program running status indication system, the running status of the program module is indicated by a luminous indicator light strip, which solves the problem of the existing technology that the program running flow relationship cannot be intuitively indicated, and improves the efficiency of program debugging and development.
Patent Information
- Application Number
- PCT/CN2025/081981
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-27
- Filing Date
- 2025-03-12
- Publication Date
- 2025-10-02
AI Technical Summary
Existing program debugging systems cannot intuitively indicate the flow relationship between specific statements in program execution, making it difficult for developers to understand the program's running process and status.
A program running status indication system is provided. An indicator board is formed by splicing multiple program statement blocks. A luminous indicator light strip is used to indicate the running status of the program module, including entry and exit indicator bars. Different forms of light-emitting units are lit according to the program running status.
Users can intuitively understand the program's running process and status, improving program debugging and development efficiency.
Smart Images

Figure CN2025081981_02102025_PF_FP_ABST
Abstract
Description
Program running status indication system and physical code building blocks Technical Field
[0001] The present invention relates to the field of program debugging, and in particular to a program running state indication system and a physical code building block. Background Art
[0002] During current program debugging, the display of the program's current running status is very limited. Typically, integrated development environments (IDEs) only indicate whether the program is running, without displaying the current program location or the branch it is currently executing on. When a program is paused, some IDEs can display the line number where the program was paused, while others can highlight the line where the program is currently executing. However, the program developer has no way of knowing which branch the program is executing on, which logical path it is jumping through, how expressions are being calculated, what the expression operation priority is, what the intermediate steps in the expression calculation are, and what the expression calculation results are. Technical issues
[0003] The technical problem to be solved by the present invention is to provide a program running status indication system and a physical code building block in response to the above-mentioned defects of the prior art, aiming to overcome the current code debugging system's inability to indicate the flow relationship between specific program statements during program execution, so that users can obtain the information required for program debugging very intuitively and efficiently, and intuitively understand the program running process and status. Technical Solutions
[0004] The technical solution adopted by the present invention to solve its technical problem is to provide a program running status indication system, including multiple program statement blocks, each of which is provided with an indicator bar including multiple light-emitting units. Multiple program statement blocks are spliced to form a program running indication board for representing a specified program module, and the indicator bars in the program running indication board are connected to form a light-emitting indicator water light strip, and the light-emitting indicator water light strip is used to represent the program running status of the specified program module. When the specified program module is running, the light-emitting units of the light-emitting indicator water light strip are lit in sequence according to the running direction of the specified program module, and when the specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the program statement are lit, wherein different program running states correspond to different lighting forms of the light-emitting indicator water light strip, and each program statement block in the program running indication board corresponds one-to-one to a program statement in the specified program module;
[0005] The spliced luminous indicator light strip is used to indicate the program flow control status. The indicator bar of each program statement block includes at least one entry indicator bar and at least one exit indicator bar. One end of the entry indicator bar extends to a docking end surface of the program statement block, and the other end is connected to one end of the exit indicator bar. The other end of the exit indicator bar extends to a docking end surface of the program statement block.
[0006] When the program blocks are connected, the entry indicator strips and the exit indicator strips between the program blocks are connected to form the luminous indicator water light strip;
[0007] At least one program statement block in the program running status indication system includes at least two exit indication bars;
[0008] When the program is running, the program statement block corresponding to the previous completed program statement is called the predecessor program statement block, the program statement block corresponding to the currently running program statement is called the current program statement block, and the program statement block corresponding to the next program statement to be run is called the successor program statement block;
[0009] When the program runs to the program statement corresponding to any program statement block, the following steps are included:
[0010] The light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block are lit in sequence from the previous program statement block to the current program statement block, and the brightness of the other entry indicator bars of the current program statement block remains unchanged;
[0011] Perform calculations or operations on the program statements corresponding to the current program statement block;
[0012] The light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block are lit in sequence from the current program statement block to the subsequent program statement block, and the brightness of the other exit indicator bars of the current program statement block remains unchanged.
[0013] Preferably, the program running status includes a program flow control status, and the program flow control status includes at least any one of a program sequential running status, a loop status, a branch status, a jump status, a waiting status, and a subroutine call status. When the program running indicator board is working, the luminous indicator light strip lights up in the lighting form corresponding to the program flow control status.
[0014] Preferably, the program running status includes a program expression calculation status, and the indicator bar includes a Boolean data indicator bar and / or a numerical data indicator bar, and the Boolean data indicator bar and / or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block. When the specified program module performs a program expression calculation, the Boolean data indicator bar and / or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
[0015] Preferably, one or more of the program statement blocks constitute a line of program statement units, each line of the program statement units represents a line of code in the designated program module, and the program execution indicator board is composed of multiple lines of the program statement units;
[0016] The luminous flow indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state. The first luminous light strip extends from the first row of program statement units to the last row of program statement units. The second luminous light strip is horizontally distributed along the program statement units of the specified row. The program statement units of the specified row are composed of multiple program statement blocks.
[0017] Preferably, each of the program statement blocks is a program statement block of the same or / and different types, and the types of the program statement blocks include at least two of the flow control type, the data structure type, the input and output type, and the operator type.
[0018] Preferably, the program statement block includes a jump semantics program statement block, and the jump semantics program statement block is provided with a spotlight or a projection light, and the lighting direction of the spotlight or the projection light is the same as the jump direction of the designated program module.
[0019] Preferably, the Boolean data indicator bar lights up in different colors when the value calculated by the program expression calculation state is Boolean true and Boolean false; the numerical data indicator bar lights up brighter when the absolute value of the value calculated by the program expression calculation state is larger.
[0020] Preferably, the system also includes an input device, and the light-emitting unit on the program statement block corresponding to the input device is lit according to the input state of the input device; when the input state of the input device is in different states, the light-emitting unit on the program statement block corresponding to the input device is lit in different colors, brightness or patterns.
[0021] Preferably, the program statement blocks are graphic controls on a screen graphic interface, and the program running indicator board is formed by dragging and splicing the program statement blocks on the screen graphic interface.
[0022] Preferably, the program statement block is a physical code building block, and the physical code building block is provided with an electronic interface, and the physical code building blocks are connected through the electronic interface.
[0023] The present invention also provides a physical code building block, comprising a building block body, wherein the building block body is the program statement block in the above-mentioned program running status indication system. Beneficial effects
[0024] Through the above-mentioned program running status indicator system or physical code building blocks, users can very intuitively and efficiently obtain the information required for program debugging, intuitively understand the program running process and status, and by observing the path of the light-emitting units of the indicator bar on the program statement block and the flow direction of the light spots formed by the light-emitting units lighting up in sequence, users can intuitively understand where the program is running at every moment, which branch it has taken, how the program jumps, from where it jumps to where, what the input device reads the result, what is the output status of the output device, what is the current value of the variable, what are the data types and values of various data, what is the calculation order of the expression, and what is the result of the expression calculation, which greatly improves the developer's program debugging efficiency and learning efficiency for program development. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic diagram of the structure of a program running status indication system according to an embodiment of the present invention.
[0026] FIG2 is a schematic diagram of the structure of a program statement block in an embodiment of the present invention. Best Mode for Carrying Out the Invention
[0027] The present invention will be described in further detail below with reference to the accompanying drawings.
[0028] Figure 1 shows a program execution status indicator system, which uses multiple program blocks to create a complete program. This system can be constructed from physical program blocks or a graphical programming IDE running on a mobile phone, computer, or tablet.
[0029] In an optional embodiment, the program running status indication system includes multiple program statement blocks, which are building blocks with graphic or text symbols that represent program statements. The above-mentioned building blocks can be physical building blocks, such as plastic building blocks with circuit boards inside, or virtual building blocks displayed on a screen graphical interface, such as graphic controls.
[0030] Multiple program blocks can be connected to form a code. The program running status indication system shown in FIG1 includes multiple program blocks, such as a loop start program block 101 and an if start program block 102.
[0031] Taking the loop start program statement block 101 shown in FIG. 2 as an example, an indicator bar indicating the program running status is provided thereon, and the indicator bar includes a plurality of independently controllable light emitting units 401 .
[0032] A light-emitting unit can be one or more LEDs, screen pixels, small light bulbs, lasers, and so on. For example, a single LED, or multiple LEDs connected in series or parallel, can constitute a light-emitting unit. An indicator bar consists of multiple light-emitting units. By lighting these units on and off, the indicator bar can be animated, with changes in color, brightness, and pattern indicating the corresponding program logic.
[0033] In this embodiment, a plurality of program statement blocks are spliced together to form a program running indicator board for representing a specified program module. The above-mentioned specified program module is defined by the spliced program statement blocks, and the specified program module can be a program consisting of any number of lines and any type of code. It can be a complete program, or a subroutine in a complete program, or an incomplete program. The program semantics can be correct or erroneous. When the program is incomplete or the program semantics are erroneous, the system can indicate the error state by lighting up or animating a portion of the indicator bar or a separate light-emitting unit when the error prompt function is enabled.
[0034] For example, the program semantics represented by the specified program module shown in Figure 1 are:
[0035] Loop Start
[0036] If start(x>1024)
[0037] f(1234+x)
[0038] Motor rotation (true)
[0039] If it ends
[0040] End of loop
[0041] The corresponding C language program is:
[0042] while(true){
[0043] if(x>1024){
[0044] f(1234+x);
[0045] motorRotate(true);
[0046] }
[0047] }
[0048] The program running indicator board is a collection of spliced program statement blocks, including indicator bars.
[0049] The indicator bars in the program execution indicator panel are connected to form a luminous indicator light strip. For example, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 in Figure 1 are connected to form a luminous indicator light strip, which is used to indicate program execution flow control and branch selection. Another example is the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 in Figure 1. The indicator bars are connected to form a luminous indicator light strip, which is used to indicate information such as the program expression calculation order, operation priority, intermediate calculation quantities, and calculation results.
[0050] The above-mentioned luminous indicator light strip is used to represent the program running status of the above-mentioned specified program module. When the above-mentioned specified program module is running, the light-emitting units of the above-mentioned luminous indicator light strip are lit in sequence according to the running direction of the above-mentioned specified program module, and when the above-mentioned specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the above-mentioned program statement are lit.
[0051] The designated program module running direction includes the sequential execution and jump directions between one program line and another. For example, the program in FIG1 takes the left branch from the if start program statement block 102 to the if end program statement block 105; or takes the right branch from the if start program statement block 102 to sequentially execute to the subroutine call program statement block 103. The designated program module running direction also includes the direction of data transfer during expression calculation. For example, in FIG1 , the expression consisting of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203 is: x>1234, where the value of the variable x is passed from left to right to the comparison operator, and the value of the constant 1234 is passed from right to left to the comparison operator. The values of the two are compared in the comparison operator to obtain a comparison result of true or false. The Boolean operation result is then passed from right to left to the if start program statement block 102 at the beginning of the line as the basis for program flow control to take the left branch if false or the right branch if true.
[0052] For example, after the program in FIG. 1 has finished running the program statement for controlling motor rotation represented by the motor rotation program statement block 104, it will soon run to the right branch of the if-end program statement block 105. Therefore, the lights on the luminous indicator light strip composed of the first indicator bar 3031 and the second indicator bar 3032 will light up and go out in sequence from top to bottom, presenting a flowing lighting effect from top to bottom. This lighting effect is used to simulate the flow of the program process and present the user with the current location and direction of the program. When the program runs to the if-end program statement block 105, the light-emitting unit on the second indicator bar 3032 on the if-end program statement block 105 lights up, indicating that the program has run to this line of program.
[0053] Among them, different program running states correspond to different lighting forms of the above-mentioned luminous indicator water light strip.
[0054] For example, if the end program statement block 105 has two entry branches, namely the upper left branch and the upper right branch of the Y shape, and one exit branch, namely the lower branch of the Y shape, therefore when the program running state is to enter the if end program statement block 105 from the right branch of the if end program statement block 105, the luminous indicator light strip on the right branch of the if end program statement block 105 will light up in sequence from top to bottom; and when the program running state is to enter the if end program statement block 105 from the left branch of the if end program statement block 105, the luminous indicator light strip on the left branch of the if end program statement block 105 will light up in sequence from top to bottom.
[0055] In this embodiment, each program statement block in the program execution indicator board corresponds one-to-one to a program statement in a designated program module.
[0056] For example, in FIG1 , the if-start program statement block 102 provides an inverted Y-shaped indicator bar in the program running indicator panel to indicate the program running branch, which represents the program semantics of the starting position of the branch statement in the specified program module. When the program runs to the branch judgment program statement represented by the if-start program statement block 102, the light-emitting unit on the inverted Y-shaped indicator bar on the if-start program statement block 102 in the program running indicator panel will also light up accordingly. When the program runs to the right branch of the if-start program statement block 102, the light-emitting indicator light strip on the right side of the inverted Y-shaped indicator bar on the program running indicator panel will also light up in sequence from top to bottom.
[0057] When the program is running, the program statement block corresponding to the previous completed program statement is called the predecessor program statement block, the program statement block corresponding to the currently running program statement is called the current program statement block, and the program statement block corresponding to the next program statement to be run is called the successor program statement block.
[0058] For example, in Figure 1, when the program has just finished running the loop start program statement block 101 and runs to the if start program statement block 102, and is about to leave the if start program statement block 102 from the right branch of the if start program statement block 102, and is about to run the subroutine call program statement block 103 in the next line, the loop start program statement block 101 is called the predecessor program statement block, the if start program statement block 102 is called the current program statement block, and the subroutine call program statement block 103 is called the subsequent program statement block.
[0059] When the program runs to the program statement corresponding to any program statement block, the following steps are included:
[0060] The program running environment sends a lighting control instruction to the corresponding program statement block, controlling the light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block to light up in sequence from the previous program statement block to the current program statement block, while the brightness of the other entry indicator bars of the current program statement block remains unchanged;
[0061] The program execution environment performs calculations or operations on the program statements corresponding to the current program statement block;
[0062] The program running environment sends a lighting control instruction to the corresponding program statement block, controlling the light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block to light up in sequence from the current program statement block to the subsequent program statement block, while the brightness of the remaining exit indicator bars of the current program statement block remains unchanged.
[0063] For example, in the program in FIG1 , when the program statement corresponding to the loop start program statement block 101 has just been completed and the program statement corresponding to the if start program statement block 102 has begun to be executed, the program execution environment sends a lighting control instruction to the if start program statement block 102 to control the entry indicator bar that interfaces with the preceding program statement block, i.e., the indicator bar in the middle position above the if start program statement block 102, to light up in sequence from top to bottom, indicating that the program has entered the if start program statement block for calculation;
[0064] At this time, the program execution environment calculates the program statement corresponding to the current program statement block, that is, it determines whether the conditional branch corresponding to the "if start program statement block" should execute the left branch or the right branch. In Figure 1, this judgment process is to calculate whether the expression x>1234 on the right side is true. If the expression calculation result is true, the right branch of the "if start program statement block 102" is executed, and if the expression calculation result is false, the left branch of the "if start program statement block 102" is executed.
[0065] Assuming that the calculation result determines that if the program statement block 102 is started, it takes the right branch, that is, the next subroutine to be run calls the program statement block 103, then the program running environment sends a lighting control instruction to the if program statement block 102, controlling the exit indicator bar connected to the subsequent program statement block, that is, the indicator bar at the lower right of the if program statement block 102 is started, lights up in sequence from top to bottom, and the brightness of the remaining exit indicator bars, that is, the indicator bar at the lower left, remains unchanged.
[0066] In an optional embodiment, the program running state includes a program flow control state, a program expression calculation state, and the like.
[0067] The above-mentioned program flow control state includes at least any one of the program sequential running state, loop state, branch state, jump state, waiting state, and subroutine call state. In this embodiment, the luminous indicator light strip lights up according to the lighting form corresponding to the program flow control state when the program running indicator board is working.
[0068] Taking the loop state as an example, loop start block 101 in FIG1 represents the program logic semantics of the starting point of a program loop. When used in conjunction with loop end block 106 in FIG1 , this constitutes the program semantics of a program loop, indicating that the program loops through the program statements between loop start block 101 and loop end block 106. When the program reaches the program represented by loop end block 106, the program flow control state is in a loop state, indicating that the program is about to loop back to the beginning of the loop, i.e., the program position represented by loop start block 101.
[0069] At this time, the luminous indicator light strip including the third indicator bar 3033 lights up in sequence according to the direction of program execution. For example, the light-emitting unit arranged below the upright U-shaped third indicator bar 3033 on the loop end program statement block 106 will light up and go out in sequence in a clockwise direction. At this time, the light-emitting unit arranged below the inverted U-shaped indicator bar on the loop start program statement block 101 will light up and go out in sequence in a clockwise direction. Through this lighting form of the luminous indicator light strip, it is shown that the program execution direction has changed from the original top-to-bottom operation, and the loop returns to the loop start program statement block 101 located above, and then continues to run sequentially from the loop start program statement block 101 downward.
[0070] Taking the sequential running state as an example, for example, in Figure 1, the process of the program running from the subroutine calling program statement block 103 to the motor rotation program statement block 104 is sequential running, and the program flow control state is the sequential running state. The light-emitting indicator light strip, including the indicator bars of the subroutine calling program statement block 103 and the motor rotation program statement block 104, lights up from top to bottom, and then goes out in turn, indicating that the program is running downward in sequence. When the program runs to the subroutine calling program statement block 103, some of the light-emitting units of the light-emitting indicator light strip on the subroutine calling program statement block 103 light up, indicating that the current program has run to this line; when the program runs to the motor rotation program statement block 104, some of the light-emitting units of the light-emitting indicator light strip on the motor rotation program statement block 104 light up, indicating that the current program has run to this line.
[0071] Taking the branch state as an example, for example, in Figure 1, the if-start program statement block 102 and the if-end program statement block 105 constitute the starting point and end point of the branch, respectively. At the program position represented by the if-start program statement block 102, the program calculates the result based on the expression spliced to the right of the if-start program statement block 102, and then chooses to run the left branch based on the calculation result, that is, directly jump to the if-end program statement block 105, or run the right branch, that is, run sequentially to the subroutine call program statement block 103, the motor rotation program statement block 104, and the if-end program statement block 105. When the program flow control state is in the branch state, if the program runs the left branch, the indicator bars on the left half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the left branch; if the program runs the right branch, the indicator bars on the right half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the right branch.
[0072] Taking the jump state as an example, in FIG1 , when loop-end program statement block 106 loops back to loop-start program statement block 101, a program jump from back to front actually occurs. During this jump, the program flow control state is in the jump state, and the second projection light 3012 and the first projection light 3011 illuminate sequentially, simultaneously, or one of them illuminates, indicating that the program has jumped from loop-end program statement block 106 to loop-start program statement block 101.
[0073] For example, when the program reaches the waiting block, a progress bar-shaped indicator light strip will gradually illuminate from one side of the bar to the other, indicating that the program is waiting at the next block. The progress bar can be in a long, circular, or folded shape.
[0074] Taking the subroutine call state as an example, for example, the subroutine call program statement block 103 in Figure 1, when the target subroutine, that is, subroutine "f()" here, is being called and executed, the luminous indicator light strip set above or around the subroutine identifier, that is, "f()" here, lights up according to a certain pattern. For example, the luminous indicator light strip surrounding the subroutine identifier rotates and lights up and goes out; or the luminous indicator light strip here gradually brightens and then gradually dims; or the luminous indicator light strip here flashes as a whole.
[0075] In an optional embodiment, the program expression calculation status includes the value of a variable or constant, the value of intermediate data in the expression calculation, the data type, the expression operation priority, the order of calculation of each part of the expression, etc. The indicator bar includes a Boolean data indicator bar and / or a numerical data indicator bar. The Boolean data indicator bar and / or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block. When the specified program module performs the program expression calculation, the Boolean data indicator bar and / or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
[0076] Referring to Figure 1, the conditional branch program semantics jointly constituted by the if start program statement block 102 and the if end program statement block 105. A conditional expression of the conditional branch is spliced on the right side of the if start program statement block 102. The content of this expression is x>1234, specifically, it is composed of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203. The designated statement blocks in this expression, such as the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203, are all provided with indicator bars for indicating Boolean data transfer, namely the above-mentioned Boolean data indicator bars, and the three indicator bars are adjacent to each other, and together constitute a luminous indicator water light strip, which is used to indicate the Boolean data transfer relationship between the program statements represented by these program statement blocks.
[0077] The specified statement blocks in this expression, such as the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203, are all provided with indicator bars for indicating the transfer of numerical data, namely the above-mentioned numerical data indicator bars. The three indicator bars are adjacent to each other and together constitute a luminous indicator flow light strip, which is used to indicate the numerical data transfer relationship between the program statements represented by these program statement blocks.
[0078] In this embodiment, the Boolean data indicator bar and the numerical data indicator bar are divided into two independent indicator bars. In other embodiments, the Boolean data indicator bar and the numerical data indicator bar can also be set as the same indicator bar, or only one of them can be set, or neither can be set.
[0079] It is worth noting that the Boolean data indicator bar and the numerical data indicator bar are only set in the specified statement block, such as the program statement block involving data generation, data calculation, data transfer, and data use of the corresponding data type. For example, if the start program statement block 102 requires the calculation result of a Boolean expression as the basis for the left branch or right branch of the program operation, a Boolean data indicator bar is set on the start program statement block 102; if the start program statement block 102 cannot receive numerical data, there is no numerical data indicator bar on the start program statement block 102. The first variable program statement block 2011 is provided with a numerical data indicator bar because it represents the numerical variable x; the first variable program statement block 2011 can constitute a part of an expression whose return value is Boolean type data in the expression, so it has the function of transferring Boolean data, and therefore a Boolean data indicator bar is provided.
[0080] For example, when the conditional expression is true, that is, when the judgment result of x>1234 is true, the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the right branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the right branch, and the light-emitting units of the adjacent indicator bars on the subsequent program statement block subroutine call program statement block 103 and the motor rotation program statement block 104 on the right branch will also light up in sequence from top to bottom in accordance with the program running direction; when the conditional expression is not true, that is, when the judgment result of x>1234 is false, the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the left branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the left branch, and through the left branch of the if-start program statement block 102, the program will directly jump to the left branch of the if-end program statement block 105, and the left branch of the indicator bar of the if-end program statement block 105 will light up the light-emitting units on the left branch in sequence from top to bottom in accordance with the program running direction.
[0081] If the indicator bar on the right branch of the start program statement block 102, the indicator bar on the subroutine calling program statement block 103, and the indicator bar on the motor rotation program statement block 104 are adjacent to each other, these adjacent indicator bars constitute a luminous indicator flow light strip, which is used to indicate the program running status transfer relationship between the program statements represented by these program statement blocks, that is, after the program runs to the right branch of the start program statement block 102, the next step will be to run the program statement represented by the subroutine calling program statement block 103, and the next step will be to run the program statement represented by the motor rotation program statement block 104, and the program running status is transferred between the program statements represented by the above-mentioned blocks.
[0082] The program statement block includes a conditional branch block, and the indicator bar of the conditional branch block includes at least one program entry indicator bar and at least two program exit indicator bars.
[0083] 1 , if the start program statement block 102 is a conditional branch block, an inverted Y-shaped indicator bar is provided, with the program entry indicator bar for the program statement above and two program exit indicator bars for the program statement below.
[0084] In this embodiment, the numerical data includes integers, floating-point numbers, decimals, fractions, etc. The Boolean data includes true and false. Data transfer includes the logical process of transferring the data represented by a variable or constant to an operator for calculation during expression calculation, and the logical process of transferring intermediate values or results of expression calculation.
[0085] For example, in the expression x>1234, the program statements involved in calculating this expression correspond to first variable program statement block 2011, comparison operator program statement block 202, and first constant program statement block 203. Taking first variable program statement block 2011 as an example, a first Boolean data indicator bar 3021 representing Boolean data transfer is located above it, and a numerical data indicator bar representing numerical data transfer is located below it.
[0086] 0058. The following uses the calculation and data transfer process of the expression x>1234 as an example to illustrate how the Boolean data indicator bar and the numerical data indicator bar work.
[0087] The first step is to obtain the current variable value x. The first variable program block 2011 displays the value represented by the numeric variable x through the numeric data indicator bar below it. The light below the first variable program block 2011 illuminates at a corresponding brightness based on the value of x. The brightness or color of the numeric data indicator bar when it illuminates is related to the value or data type of the data being transferred. For example, when transferring numeric data, blue indicates positive numbers and purple indicates negative numbers; when transferring Boolean data, red indicates false and green indicates true. When the indicator bar used to indicate data transfer is lit, the brightness of the indicator bar is positively correlated with the size of the transferred numeric data or the absolute value of the numeric data. For example, when the value of x is 50, the light brightness is 50%, and when the value of x is 20, the light brightness is 20%, which directly reflects the current value of x. In this calculation, it is assumed that the current value of x is 20.
[0088] The second step is to take the value represented by the first constant program statement block 203. The first constant program statement block 203 displays the value represented by the numeric constant 1234 through the numerical data indicator bar below it. For example, if the value of constant 1234 is 1234, the light brightness is 100%. By observing the brightness of the numerical data indicator bar in the first variable program statement block 2011 and the brightness of the numerical data indicator bar in the first constant program statement block 203, the user can intuitively see the relationship between the two.
[0089] In the third step, the comparison operator program block 202, which connects the first variable program block 2011 and the first constant program block 203, compares the two numerical data and generates Boolean comparison result data. In this calculation process, the numerical data transfer process is as follows: the first variable program block 2011 transfers the numerical data of the value of x to the comparison operator program block 202 from left to right, and the left half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from left to right. The first constant program block 203 transfers the numerical data of the value 1234 from right to left to the comparison operator program block 202, and the right half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from right to left.
[0090] The fourth step is to perform a greater-than check. The value on the left is not greater than the value on the right, so the result is false. When the indicator bar indicating data transfer is illuminated, the semantics of the transfer are Boolean data. The indicator bar illuminates in different colors when transferring true and false. Here, red represents false and green represents true. Comparison operator program block 202 illuminates the upper Boolean data indicator bar in red, indicating that the greater-than check results in a false Boolean result.
[0091] Step 5: Pass the expression calculation result to the if-start program statement block 102. The greater-than judgment statement represented by the comparison operator program statement block 202 evaluates to false, and this Boolean data needs to be passed to the if-start program statement block 102. Therefore, the indicator bars indicating Boolean data transfer on the comparison operator program statement block 202, the first variable program statement block 2011, and the if-start program statement block 102 sequentially light up the red light-emitting units representing false from right to left, reflecting the false data transfer process.
[0092] After any program statement block is connected with other program statement blocks to form an expression, the potential data transfer path represented by the indicator bar for indicating data transfer is invisible if it is not constructed as a valid data transfer path.
[0093] The data transfer path refers to the path taken from the program statement that generates the data to the program statement that uses the data. For example, in the process of transferring the Boolean data resulting from the expression x>1234 to the "if start" program statement block 102, the Boolean data is generated from the comparison operator program statement block 202 and is represented by the Boolean data indicator bar above the comparison operator program statement block 202. The data transfer passes through the first Boolean data indicator bar 3021 above the first variable program statement block 2011, is transferred to the "if start" program statement block 102, and is represented by the Boolean data indicator bar to the upper right of the "if start" program statement block 102. The data transfer path in this case is the comparison operator program statement block 202, the first variable program statement block 2011, and the indicator bar indicating the Boolean data transfer above the "if start" program statement block 102.
[0094] A potential data delivery path refers to an indicator bar that may be part of a data delivery path.
[0095] For example, the first Boolean data indicator bar 3021 and the second Boolean data indicator bar 3022 above the first variable program statement block 2011 and the second variable program statement block 2012. Since the first Boolean data indicator bar 3021 above the first variable program statement block 2011 participates in transmitting the Boolean data of the calculation result of the expression x>1234, its potential data transmission path constitutes a valid data transmission path, and therefore the first Boolean data indicator bar 3021 is visible.
[0096] However, since the second Boolean data indicator bar 3022 above the second variable program statement block 2012 does not participate in the transmission of any Boolean data in the expression 1234+x, its potential data transmission path does not constitute a valid data transmission path, so the second Boolean data indicator bar 3022 is not visible.
[0097] In the program running status indication system shown in Figure 1, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 together constitute a light-emitting indicator flow light strip for indicating the program flow control status; the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 together constitute a light-emitting indicator flow light strip for indicating the program expression calculation status.
[0098] Taking Figure 1 as an example, the program blocks that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status include all program blocks at the beginning of the line, including the loop start program block 101, the if start program block 102, the subroutine call program block 103, the motor rotation program block 104, the if end program block 105, and the loop end program block 106. These program blocks all contain indicator bars that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status, such as the first indicator bar 3031, the second indicator bar 3032, the third indicator bar 3033, etc.
[0099] In an optional embodiment, the above-mentioned program statement blocks are solid building blocks, and after splicing, the light-emitting indicator light strips are used to indicate the program flow control status. At this time, the indicator bars of each of the above-mentioned program statement blocks in the spliced program operation indicator board include at least one entry indicator bar and at least one exit indicator bar. For example, if the Y-shaped indicator bar set on the end program statement block 105 is divided into an entry indicator bar on the upper left, an entry indicator bar on the upper right, and an exit indicator bar at the bottom. One end of the above-mentioned entry indicator bar extends to a docking end face of the program statement block, and the other end is connected to one end of the exit indicator bar, and the other end of the exit indicator bar extends to a docking end face of the program statement block.
[0100] Specifically, one end of the two entry indicator bars and the exit indicator bar are connected at the center point of the Y shape, and the other end extends to a docking end face of the program statement block. For example, the entry indicator bar on the upper right extends to the docking end face of the program statement block interface directly connected to the top, and with reference to FIG1 , it docks with the motor rotation program statement block 104; the entry indicator bar on the upper left extends to the docking end face of the program statement block logic interface indirectly connected to the top, and the extension line of the indicator bar logically and semantically docks with the if start program statement block 102; the exit indicator bar below extends to the docking end face of the program statement block interface directly connected to the bottom, and with reference to FIG1 , it docks with the loop end program statement block 106. When the above-mentioned program statement block is a graphic control on the screen graphical interface, the docking end face is the graphic edge where the two program statement block graphics dock with each other; when the above-mentioned program statement block is a physical code building block, the docking end face is the outer surface where the physical code building block is connected with each other.
[0101] When each of the above-mentioned program statement blocks is spliced together, the entry indicator bars and exit indicator bars between the program statement blocks are docked to form the above-mentioned luminous indicator water light strip. For example, in Figure 1, the entry indicator bar on the upper right of the if-end program statement block 105 is docked with the first exit indicator bar 3031 below the motor rotation program statement block 104; the entry indicator bar on the upper left of the if-end program statement block 105 is docked with the exit indicator bar on the lower left of the if-start program statement block 102. Docking in the air means that the extension lines of the docked indicator bars of both parties can be directly connected, presenting the logical semantics of docking; the exit indicator bar below the if-end program statement block 105 is docked with the third entry indicator bar 3033 above the loop end program statement block 106. After these indicator bars are docked, a luminous indicator water light strip is formed.
[0102] In an optional embodiment, one or more program statement blocks constitute a line of program statement units, each line of program statement units represents a line of code in a specified program module, and the program running indicator board is composed of multiple lines of program statement units. Referring to Figure 1, the first line of program includes only a loop start program statement block 101, which constitutes a line of program statement units, representing the first line of code "loop start" in the specified program module; the second line of program includes an if start program statement block 102, a first variable program statement block 2011, a comparison operator program statement block 202, and a first constant program statement block 203. These four program statement blocks constitute a line of program statement units, representing the second line of code "if start (x>1234)" in the specified program module; the third line of program includes a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012. The four program statement blocks constitute a line of program statement unit, representing the third line of code "f(1234+x)" in the specified program module; the fourth line of the program includes a motor rotation program statement block 104 and a Boolean constant program statement block. These two program statement blocks constitute a line of program statement unit, representing the fourth line of code "Motor rotation (true)" in the specified program module; the fifth line of the program includes only an if-end program statement block 105, which constitutes a line of program statement unit, representing the first line of code "if-end" in the specified program module; the sixth line of the program includes only a loop-end program statement block 106, which constitutes a line of program statement unit, representing the first line of code "loop-end" in the specified program module.
[0103] In this embodiment, the aforementioned six-line program statement unit collectively constitutes a program execution indicator panel, and the corresponding luminous indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state. For example, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 collectively constitute the luminous indicator light strip for indicating the program flow control state, referred to as the first luminous light strip; the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 collectively constitute the luminous indicator light strip for indicating the program expression calculation state, referred to as the second luminous light strip.
[0104] The first luminous light strip extends from the first row of the above-mentioned program statement units to the last row of the above-mentioned program statement units. For example, the luminous indicator light strip located on the far left in Figure 1 that runs through all the program statement blocks at the beginning of the row is composed of partial indicator bars on each program statement block at the beginning of the row, such as the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033.
[0105] The second light-emitting indicator light strip is horizontally distributed along the program statement unit of the specified row, such as the numerical data indicator bar below the horizontally distributed expression in the third line of program f(1234+x) in Figure 1, and the fourth is composed of indicator bar 3041, fifth indicator bar 3042, and sixth indicator bar 3043.
[0106] In an optional embodiment, the program statement unit of a specified line is composed of multiple program statement blocks. For example, the program statement unit of the third line is composed of a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012.
[0107] In an optional embodiment, each program statement block can be a program statement block of the same or / and different types, and the types of program statement blocks include at least two of process control class, data structure class, input and output class and operator class, wherein the process control class includes loop start program statement block 101, loop end program statement block 106, if start program statement block 102, otherwise program statement block, if end program statement block 105, etc.; the data structure class includes variable program statement block, constant program statement block, Boolean constant program statement block, etc.; the input and output class includes motor rotation program statement block 104, motor stop program statement block, sensor read program statement block, etc.; the operator class includes comparison operator program statement block 202, plus operator program statement block, etc.
[0108] 1 , the program execution indicator board includes a loop start program statement block 101 of the process control class, a variable program statement block of the data structure class, a motor rotation program statement block 104 of the input and output class, a plus operator program statement block of the operator class, and the like.
[0109] In an optional embodiment, the program running indicator board can be used to represent jump semantics, and the corresponding spliced program statement block can be called a jump semantic program statement block. Referring to Figure 1, if the start program statement block 102 and the if end program statement block 105, in the case where the if start program statement block 102 takes the left branch, the program will directly jump from the left branch of the if start program statement block 102 on the second row to the left branch of the if end program statement block 105 on the fifth row. For another example, the loop end program statement block 106 and the loop start program statement block 101, when the loop end program statement block 106 on the sixth row runs to the leftmost branch, the program will jump back to the leftmost branch of the loop start program statement block 101 on the first row after reaching the exit indicator bar.
[0110] In this embodiment, a spotlight or projection light is provided for a jump semantic program statement block, and the lighting direction of the spotlight or projection light is the same as the program jump direction.
[0111] For example, loop end block 106 indicates that when the program reaches this loop end block, the program jumps back to the program start block represented by loop start block 101. Therefore, a spotlight or second projection light 3012 and a first projection light 3011 are respectively provided on loop end block 106, the jump start point, and loop start block 101, the jump end point. The spotlight or second projection light 3012 illuminates from the jump start point to the jump end point, and the spotlight or first projection light 3011 illuminates from the jump end point to the jump start point.
[0112] There may be multiple jump semantic program blocks in the system, and spotlights or projection lights can be set on only some of the program blocks. For example, for loop start program block 101 and loop end program block 106, spotlights or projection lights can be set on both program blocks, or only on one of them.
[0113] In an optional embodiment, the system further includes input devices, such as a range sensor and a light sensor. The system includes program blocks corresponding to the input devices, such as the "Read range sensor reading" and "Read light sensor reading" blocks corresponding to the range sensor. In this embodiment, the light-emitting units in the program blocks corresponding to the input devices illuminate according to the input state of the input devices. When the input state of the input devices is in different states, the light-emitting units in the program blocks corresponding to the input devices illuminate with different colors, brightness, or patterns.
[0114] For example, when the program is running and reaches the program block corresponding to the "Read Distance Sensor Reading" block, the distance sensor acquires sensor information and passes the reading or the corresponding display content to the "Read Distance Sensor Reading" block. The "Read Distance Sensor Reading" block then illuminates the light-emitting units located therein based on the reading or the corresponding display content. For example, the greater the reading, the brighter the light-emitting unit; the light-emitting unit may be green when the reading is greater than a certain threshold, and orange when the reading is less than a certain threshold; the reading may be displayed directly on a digital tube using a pattern; or the greater the reading, the more light-emitting units may be illuminated, displaying different patterns based on the reading size.
[0115] In an optional embodiment, based on the above, program blocks are displayed on a screen graphical interface, wherein the program blocks are graphical controls on the screen graphical interface, the indicator bar is a striped pattern, and the light-emitting units are graphical elements or screen pixels within the striped pattern. A user can drag the program blocks on the graphical interface using a mouse or touch screen to form the program execution indicator board, thereby splicing the program blocks and building a program.
[0116] In an optional embodiment, based on the above, the program statement blocks are physical code building blocks, and the physical code building blocks are provided with electronic interfaces, and the physical code building blocks can be connected through the electronic interfaces. The indicator bar is a plastic part with a silk-screen pattern, and the light-emitting unit is a lamp bead or a small screen embedded in the program statement block. The lamp bead can be an LED, and the small screen can be an OLED screen, an ink screen, or a TTF screen. Users can build programs by connecting the electronic interfaces of the physical code building blocks.
[0117] The present invention also provides a physical code building block, including a building block body, which is the program statement block described in the above embodiment.
[0118] The above embodiments merely represent preferred embodiments of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims
1. A program running status indication system, characterized by: The system comprises a plurality of program statement blocks, each of which is provided with an indicator bar comprising a plurality of light-emitting units. The plurality of program statement blocks are spliced together to form a program running indicator board for representing a specified program module. The indicator bars in the program running indicator board are connected to form a light-emitting indicator water light strip. The light-emitting indicator water light strip is used to represent the program running status of the specified program module. When the specified program module is running, the light-emitting units of the light-emitting indicator water light strip are lit in sequence according to the running direction of the specified program module. When the specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the program statement are lit. The light-emitting indicator water light strip has different lighting forms corresponding to different program running statuses, and each of the program statement blocks in the program running indicator board corresponds one-to-one to a program statement in the specified program module. The spliced luminous indicator light strip is used to indicate the program flow control status. The indicator bar of each program statement block includes at least one entry indicator bar and at least one exit indicator bar. One end of the entry indicator bar extends to a docking end surface of the program statement block, and the other end is connected to one end of the exit indicator bar. The other end of the exit indicator bar extends to a docking end surface of the program statement block. When the program blocks are connected, the entry indicator strips and the exit indicator strips between the program blocks are connected to form the luminous indicator water light strip; At least one program statement block in the program running status indication system includes at least two exit indication bars; When the program is running, the program statement block corresponding to the previous completed program statement is called the predecessor program statement block, the program statement block corresponding to the currently running program statement is called the current program statement block, and the program statement block corresponding to the next program statement to be run is called the successor program statement block; When the program runs to the program statement corresponding to any program statement block, the following steps are included: The light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block are lit in sequence from the previous program statement block to the current program statement block, and the brightness of the other entry indicator bars of the current program statement block remains unchanged; Perform calculations or operations on the program statements corresponding to the current program statement block; The light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block are lit in sequence from the current program statement block to the subsequent program statement block, and the brightness of the other exit indicator bars of the current program statement block remains unchanged.
2. The program running status indication system according to claim 1, characterized in that: The program running status includes the program flow control status, and the program flow control status includes at least any one of the program sequential running status, loop status, branch status, jump status, waiting status, and subroutine call status. When the program running indication board is working, the luminous indicator light strip lights up according to the lighting form corresponding to the program flow control status.
3. The program running status indication system according to claim 1, characterized in that: The program running status includes the program expression calculation status, and the indicator bar includes a Boolean data indicator bar and / or a numerical data indicator bar. The Boolean data indicator bar and / or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block. When the specified program module performs program expression calculation, the Boolean data indicator bar and / or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
4. The program running status indication system according to claim 1, characterized in that: One or more of the program statement blocks constitute a line of program statement units, each line of the program statement units represents a line of code in the designated program module, and the program execution indicator panel is composed of multiple lines of the program statement units; The luminous flow indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state. The first luminous light strip extends from the first row of program statement units to the last row of program statement units. The second luminous light strip is horizontally distributed along the program statement units of the specified row. The program statement units of the specified row are composed of multiple program statement blocks.
5. The program running status indication system according to claim 1, characterized in that: Each of the program statement blocks is a program statement block of the same or / and different types, and the types of the program statement blocks include at least two of a process control type, a data structure type, an input and output type, and an operator type.
6. The program running status indication system according to claim 1, characterized in that: The program statement block includes a jump semantics program statement block, and the jump semantics program statement block is provided with a spotlight or a projection light, and the lighting direction of the spotlight or the projection light is the same as the jump direction of the designated program module.
7. The program running status indication system according to claim 3, characterized in that: The Boolean data indicator bar lights up in different colors when the value calculated by the program expression calculation state is Boolean true or Boolean false; The numerical data indicator bar is lit with higher brightness as the absolute value of the value calculated in the program expression calculation state is larger.
8. The program running status indication system according to claim 1, characterized in that: It also includes an input device, and the light-emitting unit on the program statement block corresponding to the input device is lit according to the input state of the input device; when the input state of the input device is in different states, the color, brightness or pattern of the light-emitting unit on the program statement block corresponding to the input device is different.
9. The program running status indication system according to any one of claims 1 to 8, characterized in that: The program statement blocks are graphic controls on a screen graphic interface, and the program running indicator board is formed by dragging and dropping the program statement blocks on the screen graphic interface to form a splicing operation.
10. The program running status indication system according to any one of claims 1 to 8, characterized in that: The program statement block is a physical code building block, and the physical code building block is provided with an electronic interface, and the physical code building blocks are connected through the electronic interface.
11. A physical code building block, characterized in that: It comprises a building block body, and the building block body is the program statement block in the program running status indication system according to claim 10.
Citation Information
Patent Citations
Portable electronic equipment and light effect displaying method thereof
CN102375475A
Method and device for providing operation state of software of display equipment
CN103257915A
Program block running method and device, equipment and storage medium
CN113094282A
Program running state indicating system and entity code building block
CN117951037A
System and method to measure and report on effectiveness of software program testing
US6959431B1