Code structured programming system

Through the programming system that adds pictures and replaces text units, the limitations of traditional programming tools are solved, the intuitive display and easy to understand code is realized, and programming efficiency and quality are improved, especially the friendliness of multilingual programming.

CN120276722APending Publication Date: 2025-07-08周续珍
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410020193.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-07
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Traditional programming tools have limitations in expression and operation methods, which leads to difficulty in reading and comprehension of code, especially for non-English code written, which increases the difficulty in understanding among people in different languages.

Method used

The programming system adopts a self-added picture replacement text unit, and operates the response unit through the voice input module and the interface to support the image replacement specified code strings, and utilizes the diversified operation methods of image items and text items, including dragging, merging, splitting code lines and function modules, dynamically displaying the code structure, supporting voice interaction, and reducing physical fatigue.

Benefits of technology

It improves the intuitiveness and comprehensibility of the code, reduces programming difficulty, reduces understanding obstacles for people in different languages, enhances the compactness of the code structure and the clarity of the display of logical relationships, and improves programming efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276722A_ABST
    Figure CN120276722A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of programming, and discloses a programming system which structurally comprises portable equipment capable of running software, a voice input module and a programming software system. The programming software system comprises an interface used for displaying codes, an interface operation response unit, a self-adding picture replacement text unit, a self-defining picture storage unit and a voice response unit. According to the method, the customized picture can be adopted to replace the specified text content, more diversified code line arrangement modes are provided, logic expression of a certain degree is represented by the arrangement modes, and code reading is more visual and easy to understand. Meanwhile, compared with an existing programming system, the programming system has the advantages that convenient operation modes of dragging, placing and the like which take a row as a unit, an item as a unit and a function module as a unit are added, clear structural division is formed by different code units, and a target needing to be operated can be quickly found through a voice instruction, so that the programming system can be completely suitable for portable equipment and can be widely applied to the field of electronic equipment. The limb fatigue of the programmer is relieved, the working space of the programmer is expanded, the programming operation is more convenient, and the programming work becomes efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of programming technology, and particularly relates to a code structured programming system. Background Art

[0002] With the wide application of programming technology, programming efficiency has become increasingly important. Since it is very difficult to read and understand a large amount of code, with complex syntax and logical structures, traditional programming tools still have limitations in terms of expression and operation methods. The present invention provides a programming system with diverse intuitive operation methods, thus making programming work efficient. Summary of the Invention

[0003] The purpose of the present invention is to provide a programming system with diverse intuitive operation methods, making the reading of code more intuitive and easy to understand, the operation more convenient, more predictable and accurate, and reducing the difficulty of programming.

[0004] A programming system according to the present invention includes: a portable device capable of running software, a voice input module, and a programming software system. The programming software system includes: an interface for displaying code, an interface operation response unit, a self-adding picture to replace text unit, a custom picture storage unit, and a voice response unit.

[0005] As a preferred mode, the programming system supports using any self-added picture to replace a specified code string (this does not exclude the programming system from presetting some pictures to replace the specified code string). The programmer designates a specific folder as a custom picture storage unit for storing and calling user self-added pictures. The programmer customizes pictures that they believe can intuitively express the meaning of the specified text, stores the pictures in the custom picture storage unit, and then the programmer sets the text content corresponding to each picture through interface operations, or adopts the preset scheme of the programming system. The preset scheme is: using the picture name without the suffix as the text content corresponding to the picture. The programming system finds the string to be replaced and its position by comparing the code text with the specified text content corresponding to the picture, performs the replacement, and displays it on the programming interface. When the cursor of the mouse moves to the position of the picture item, the picture item can be operated like a character through keyboard operations, enabling this programming system to apply all the operation methods of the text programming method. Each picture item after replacement serves as a code item unit on the canvas and is called a picture item; each text item separated by the picture item serves as a code item unit on the canvas and is called a text item; the picture item and the text item are arranged horizontally to form a code line, and the code line without any picture replacement is displayed as a text item unit as a whole. Pictures can prominently express certain features. In a specific field, certain features only appear on specific targets, so they are specific. Using a single and concise feature to express a specific target in a specific field can intuitively express the target orientation. Based on the self-added picture replacement text unit of this programming system, batch replacement of the specified text content is performed, and more intuitive pictures are used to replace the specified text and displayed for display and editing in the code editing interface, thereby reducing the difficulty of code reading and understanding. Especially considering that most current codes are written in English, using pictures to replace English reduces the understanding difficulty for people of different languages. At the same time, using shorter pictures to replace longer text content makes the code structure more compact, and a more complete logical structure is presented within the field of vision at the same moment, making it easier to understand the association relationship between code lines.

[0006] As a preferred mode, the programming system supports treating the self-added picture item as a character object within the code line. Single or multiple items within the range can be selected through the mouse cursor, and the following functions can be completed through key operations: sequentially delete the picture items located in front of the cursor, sequentially copy the selected picture items, and sequentially paste the copied picture items at the cursor. Further, through preset combination keys, such as shift + ctrl + other different keys, and through the interface operation response unit, pictures with preset shortcut keys can be conveniently inserted at the cursor.

[0007] As a preferred method, the programming system supports horizontal arrangement of different code lines. When the code lines in a certain column are too long to be conveniently read, or when multiple logical structures at the same level need to be more clearly presented, one or more first code lines of the code lines to be arranged into a new column are selected by means of a mouse or a keyboard, and a new column is created by selecting and clicking using the shortcut keys provided by the system or the right-click menu items. When creating a new column, the first code line in the original column that has the same running level as the first line of the new column and runs before it is found, and the height of the new column is the same as the height of this code line, indicating that they have the same indentation value, so as to correctly express the running order and inclusion relationship between the code lines in different columns; if such a line cannot be found, the programming system will refuse to create a new column to prevent damage to the code structure. When it is necessary to merge two adjacent columns, the operation is also carried out in the way of shortcut key operation or right-click menu operation.

[0008] As a preferred method, the programming system supports arranging code in a grid layout with function modules as units. Each function is displayed as a separate square code block. For the display of a sub-function within a parent function, the function name line replaces the entire sub-function and is displayed within the square code block of the parent function. The content of the sub-function is separately displayed as a square code block in the grid outside the parent function. The form of the grid is such that the overall interface is divided into one or more large rows with a certain gap, each large row is divided into one or more columns with a certain gap, each column is divided into one or more small rows with a certain gap, and one or more square code blocks are horizontally arranged within the small rows with a certain gap. Each square code block represents a specific function. The code line where the function name is located can be dragged with the mouse to make it follow the mouse movement, and by clicking, it can be inserted between the code lines within a specific function or placed at a grid position outside the function. Then the system automatically adjusts the gaps between the square code blocks and the gaps between the grids to preset values. At the same time, the programming system has preset specific rules for function movement and placement. The system adjusts the overall indentation value and scope of the moved function according to specific rules. For example, the overall indentation value of the moved function is adjusted according to the placement position. When the function name line is dragged with the mouse and placed below a non-judgment line within a certain function A, the indentation of the entire function will be the same as that of this non-judgment line, and the moved function also becomes an internal function of function A, thus changing the scope of the moved function. Another example is when the function name line is dragged with the mouse and placed in the part outside the function in the grid. According to specific rules, the previous sibling function B corresponding to this placement position is found, and the indentation and scope of the moved function are adjusted to be the same as those of function B, and the function name line of the moved function is inserted below the function name line of function B. Programmers can freely arrange the square code blocks in a grid layout by dragging the mouse according to the size and relevance of the square code blocks, making the logical structure more clearly displayed, making the structure more compact, helping to display the logical structure more completely, and helping to quickly read and retrieve the code.

[0009] As a preferred method, the programming system also supports dragging by code line unit and also supports dragging individual text items and picture items. One or more text items or picture items or code lines or function modules can be dragged away from their original positions to follow the mouse movement by dragging with the left mouse button or by dragging with the shift key and the left mouse button; when moving to different positions, different dragging results and program running sequences are pre-hinted in the form of text displayed at specific positions; and placed by clicking the left mouse button; such hints help beginners who are not familiar with the syntax to reduce their thinking about the syntax.

[0010] As a preferred method, the programming system can display picture items and text items in the form of animation to achieve dynamic expression of program operation. First, the programming system presets a large number of specific dynamic effects for selection, such as: fading in from left to right to express creation, fading in from left to right to express clearing, sliding in from top to bottom to express insertion, etc. After magnifying the picture items and text items, in the central area of the display interface, one by one or multiple items are displayed in sequence according to the preset dynamic effects in the order of code execution. The items with reasonable dynamic effects are continuously displayed at reasonable time intervals to form an animation. At the same time, since the program follows specific syntax, the programming system can determine the operation target of the code through the syntax and automatically select the correct dynamic effects and methods for expression according to its operation target. For the parts that are not satisfied with the system-preset dynamic effects and cannot be automatically selected, the programmer can select and set the dynamic effects of text items and picture items by himself. Reasonable animation effects can enable the programmer to form a deep memory, which helps the programmer to trace back the overall operation process of the program, thereby improving programming efficiency and programming quality. Further, the programming system reads the complete code, obtains the overall structure of the code and combs the program operation process, and sorts the branch structure and branch process, and dynamically displays the program in a certain order, especially displaying the code according to the main program operation order: the display methods include but are not limited to, first displaying the non-function code lines in the file module, that is, the main program process including the main functions, to display the overall structure of the code file; then sequentially displaying one or more branch processes; then displaying the jump relationships between the processes. At the same time, the programmer can pause, backtrack, search for branch processes, and jump to branch processes during the display process to implement code reading of the logic of different processes in the order of operation. In this way, the programming system combs the code structure and displays the code structure to the programmer according to its operation order, helping the programmer to understand the code and solving the problem that it is difficult for the programmer to understand the relevance between scattered code blocks. Further, in a large code project, since a large amount of code needs to be replaced with pictures, the code can be input into a large model such as ChatGPT. The large model such as ChatGPT generates pictures, and the pictures are manually marked and scored by humans to speed up the speed of picture replacement work and improve the matching degree of pictures and code items; at the same time, by taking screenshots of the canvas content after picture replacement displayed by this programming system, let the large model such as ChatGPT read the pictures, select animation effects for each item in sequence and generate animation effect files, and the programming system sets dynamic effects for code items by reading the animation effect files, thereby speeding up the implementation of animation effects.

[0011] As a preferred method, the programming system displays the code structure through associative colors. For example, when displaying a function, the name lines of the parent function and the child function are rendered as associative background colors, such as the same color value with different transparency, or a specific color represents a specific level, so as to more intuitively display its inclusion relationship.

[0012] As a preferred method, when editing or selecting a specific code line, the programming system highlights or sets a special background color to the judgment line in the function to which it belongs that determines whether this code line will be executed, so as to display its logical association structure as intuitively as possible.

[0013] As a preferred method, in addition to using a common computer system as a carrier, the programming system can also run on a portable device that can run software. The programmer can completely break away from the mouse, keyboard and touch operation, and use voice commands to interact with the programming software system to complete the relevant programming operations. The portable devices include but are not limited to mobile phones, VR glasses, etc. Since the aforementioned content of this programming system has divided the code content into a clear multi-level structure, the voice response unit of the programming software system can use different units at different levels and unit numbers as instruction-related content to clearly locate the target to be operated, thereby achieving fast operation. Explanation on voice operation: A folder can be selected through a folder command, and a file can be selected through a file command. Each file is displayed through a canvas, and a specific area of ​​the canvas (such as the upper right corner) shows the relevant information of the target currently being operated, including but not limited to: current position, function name and serial number, multi-level parent function name and serial number, the serial number of the current line in the function, the line number of the current line in the entire text file, and the serial number of the current item. Through the zoom command and the up, down, left, and right movement commands, you can locate different positions of the canvas. You can select the corresponding function to be operated through the function name or serial number command, you can select the code line to be operated through the code line serial number command, you can select the code item to be operated through the item serial number command, and you can perform menu item operations through the content command of the menu item. Furthermore, this programming system uses a preset convenient command method to make voice operation more convenient. For example, the preset convenient command mode that can be used includes: setting "row" to represent the row of the "grid row N" command, setting "column" to represent the column of the "grid column N" command, and setting "small row" to represent the small row of the "grid small row N" command. There are also many other preset methods to make voice operation more convenient. Based on this, this programming system reduces the programmer's physical fatigue, expands the programmer's workspace, and makes programming work more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a diagram showing the operation interface and grid structure.

[0015] Figure 2It is a display diagram of a square code block structure.

[0016] Figure 3 It is a diagram for replacing text content with picture items.

[0017] Figure 4 It is a structural diagram of the replaced code lines.

[0018] Figure 5 、 6 、7 is a diagram for dragging and placing code lines. Specific implementation manners

[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0020] Referring to the figure, in an embodiment of the present invention, a programming system includes: a portable device capable of running software, a voice input module, and a programming software system. The programming software system includes: an interface for displaying code, an interface operation response unit, a unit for self-adding pictures to replace text, a custom picture storage unit, and a voice response unit.

[0021] Among them, an Android mobile phone is used as the portable device capable of running software, the microphone of the Android mobile phone is used as the voice input module. In the operating system of the Android mobile phone, qt is used as the application framework, an instance of the QMainWindow class is created as the main window, an instance of the QMdiSubWindow class is created as the sub-window, an instance of the QGraphicsScene class is created as the canvas for placing code, and an instance of the QGraphicsView class is created to display the canvas to the sub-window, forming an interface display and operation response unit that can be compatible with multiple platforms.

[0022] The system designates a specific folder as the custom picture storage unit for storing and calling pictures added by users themselves. Programmers customize pictures that they think can intuitively express the meaning of the specified text, store the pictures in the custom picture storage unit, and programmers modify the picture names by themselves. The picture name without a suffix represents the code string that needs to be replaced. The system finds the position of the string that needs to be replaced by comparing the code text and the picture name, performs the replacement, and displays it on the programming interface.

[0023] The system is set with a menu bar. The menu bar has an option to open a code file. The system reads in the code file selected through the menu bar, then divides the code content into a structure and displays it in a grid. The form of the grid is as follows: The overall interface is divided into one or more large rows at a certain interval. Each large row is divided into one or more function columns at a certain interval. Each function column is divided into one or more small rows at a certain interval. One or more square code blocks are arranged horizontally within the small row at a certain interval, and each square code block represents a specific function. Each square code block includes a name row and one or more code columns. The height of the code column is adjusted according to its indentation. Each code column includes one or more code lines, and the code lines are composed of text items and picture items, arranged horizontally. Among them, the QGraphicsTextItem class instance is used to represent the text item, and the QGraphicsItem class instance is used to represent the picture item.

[0024] The system sets an "import" row at the top of the canvas. First, it reads in the content of the module import at the beginning of the file and writes it to the "import" row at the top of the canvas.

[0025] When reading the code of the first non-import line, first create a grid on the canvas. First, create a large row, create a column within the large row, create a small row within the column, and create the first square code block named structure within the small row. Align the code line to the left and put it into structure. When encountering the creation of a function, use a copy of the function name row to replace the whole function and put it into structure, then create a new grid, and put the function itself into the new grid. For the sub-functions of the function, do the same, use a copy of their function name rows to replace the whole functions, put them into the square code blocks of the parent function, and then create a new grid and put the function itself into the new grid.

[0026] By dragging the code line where the function name is located with the mouse, making it follow the mouse movement, and clicking to place it at a specific grid position inside or outside a function, the system automatically adjusts the gaps between the square code blocks and the gaps between the grids to the preset values. At the same time, the programming system has preset specific rules for function movement and placement. The system adjusts the overall indentation value and scope of the moved function according to the specific rules. When the function name line is placed below a non-judgment line inside a certain function A by dragging with the mouse, the indentation of the whole function will be the same as that of this non-judgment line, and the moved function also becomes an internal function of function A, thus changing the scope of the moved function. When the function name line is placed in the part outside the function in the grid by dragging with the mouse, find the first function in front of it as its sibling function B, and adjust the indentation and scope of the moved function to be the same as that of function B, and insert the function name line of the moved function below the function name line of function B.

[0027] By clicking the left mouse button or selecting a box, the programmer can select single or multiple text items or image items in units of text items or image items. By clicking the left mouse button or selecting a box and holding down ctrl, the programmer can select single or multiple code lines in units of code lines. Then, the programmer drags the selected items or lines by holding down shift and pressing the left mouse button, and places them at the target location by clicking the left mouse button. When the target location is below the target code line, a text prompt is displayed below the target code line: "1. Insert operations or judgments in sequence, and execute after the indicated operation is executed." When the target location is above the target code line, a text prompt is displayed above the target code line: "0. Insert operations or judgments in sequence, and execute before the indicated operation is executed."

[0028] When displaying function, the name lines of the parent function and the child function are rendered as associated background colors. The background colors use the same color value, and the transparency of the background color of the child function name line is 10% less than that of the parent function name line.

[0029] When the mouse clicks on a specific code line, the background color of all the judgment statements preceding it in the square code block is set to pink to display its logical association structure as intuitively as possible.

[0030] This embodiment can choose to display the code in an animated form. First, the dynamic effects of the items are preset in units of items. Items without dynamic effects will be directly displayed in the middle area of ​​the interface at a time interval of 0.2s relative to the previous item. Then, the starting line of the animation effect is selected through the voice command "Line N" (N is the line number in the text file), and then the animated code display is started through the voice command "Animation Demonstration". The dynamic effects used include but are not limited to: fade in from left to right to express creation; fade in from left to right to express clearing; slide in from top to bottom to express insertion; and various dynamic effects provided by other programming systems. The picture items and text items are displayed one by one or more in the central area of ​​the display interface according to the order in which the code runs, according to their preset dynamic effects. Items with reasonable dynamic effects are displayed continuously at reasonable time intervals to form animations.

[0031] This embodiment can perform programming operations entirely through voice commands without the need for a mouse and keyboard. Select the line to be operated on by the voice command 'Line N' (where N is the line number of the line in the text file), select the function to be operated on by the function name voice command, select the item to be operated on by the item serial number of the item in the line. When editing text, move the cursor through the commands 'Move Left', 'Move Right', 'Move Up', 'Move Down', and perform editing through commands such as 'Copy', 'Paste', 'Delete', etc., and input through the word name or character name. Operate on the canvas through commands such as 'Zoom In', 'Zoom Out', 'Canvas Move Up', 'Canvas Move Down' and canvas coordinates such as 'x100, y200', position to the Nth line divided by the canvas through the command 'Grid Line N', position to the Nth column of the current grid row through the command 'Grid Column N', and position to the Nth small row of the current column through the command 'Grid Small Row N'. Repeat the previous operation through the 'Repeat' command. Further, the embodiment adopts the method of presetting convenient commands, setting 'Line' to represent the line of the command 'Grid Line N', setting 'Column' to represent the column of the command 'Grid Column N', setting 'Small Row' to represent the small row of the command 'Grid Small Row N', etc., to make the voice commands shorter and more convenient.

[0032] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-described exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. Therefore, in any regard, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved.

Claims

1. A programming system, characterized in that, The programming system supports using any self-added image to replace a specified code string.

2. A programming system, characterized in that, The programming system supports dividing different code lines into multiple columns and arranging them horizontally between columns.

3. A programming system, characterized in that, The programming system supports dividing each function into separate square code blocks and arranging them in a grid with the square code blocks as units.

4. A programming system, characterized in that, In addition to using a common computer system as a carrier, the programming system can also run on portable devices that can run software. Programmers can completely break away from the mouse, keyboard, and touch operations and interact with the programming software system entirely using voice commands to complete relevant programming operations.

5. The programming system according to claim 1, wherein Specify a specific folder as a custom image storage unit for storing and calling user self-added images. The text content corresponding to the images can be preset in the programming system or customized by the user. The programming system finds the string in the code that is the same as the text content corresponding to the image and its position through comparison, replaces it, and displays it on the programming interface.

6. The programming system according to claim 5, characterized in that The programming system supports treating the self-added image items as character objects within a code line. Single or multiple items within a range can be selected using the mouse cursor, and the following functions can be completed through key operations: sequentially delete the image items located before the cursor, sequentially copy the selected image items, and sequentially paste the copied image items at the cursor.

7. The programming system according to claim 2, wherein For the left and right columns arranged horizontally, the first line of the right column has the same indentation value as the code line horizontally aligned with it in the left column.

8. The programming system according to claim 3, wherein For the display of sub-functions within a parent function, the programming system uses the function name line to replace the entire sub-function and displays it in the square code block of the parent function. The sub-function content is separately displayed in a square code block form in the grid outside the parent function.

9. The programming system according to claim 8, wherein The square code blocks can be arranged horizontally and vertically. The arrangement of the square code blocks can be done by dragging with the mouse. The system changes the indentation and scope of the function according to the placement position, and the programming system can automatically adjust the gaps between the square code blocks and align them with the grid.

10. The programming system according to claims 1, 2, and 3, characterized in that, The programming system can set dynamic effects for image items and text items to display the code in the form of an animation.