A graphical programming method and system
Through graphical programming methods, the chip plug-in files are parsed to generate SDK and JSON datagrams, and the script interpreter and graphical programming interface are generated based on the database, which solves the problem that ordinary users have difficulty in hardware programming, realizes low-threshold and high-efficiency embedded programming, and supports cloud programming.
Patent Information
- Application Number
- CN202110223902.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-26
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-02-26
AI Technical Summary
In the prior art, ordinary non-technology industry practitioners find it difficult to master hardware programming and circuit design. The Arduino project has limited the independent programming capabilities of novice users due to the complex source code and insufficient Chinese support.
The graphical programming method is adopted to generate SDK program packages and JSON datagrams by parsing chip plug-in files, and generate script interpreters and graphical programming interfaces based on the database. Users realize program logic and data control of functional modules through the graphical interface, and generate script programs to drive script interpreters.
It lowers the programming threshold, improves learning efficiency, enables non-professionals to easily perform embedded programming, and supports cloud programming, reducing the pressure on users' computers.
Smart Images

Figure CN112860244B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graphical programming, and in particular to a graphical programming method and system. Background Art
[0002] With the development of the times, the threshold for the use of science and technology has gradually decreased, but the threshold for scientific and technological inventions is still very high. For an ordinary non-technical industry practitioner, the knowledge of hardware programming and circuit design required to make a simple single-chip microcomputer design is already very complicated, and it is limited to the lack of foundation and the inability to plan and target learning, which makes learning more difficult. At present, there is also an open source project Arduino on the market that seems to improve this situation. However, in reality, because the Arduino source code involves more C++, it is difficult for novice users to independently implement it outside the framework, resulting in the situation that users are always restricted by the framework and their own abilities cannot transcend the framework. And because it is a foreign open source project, both the documentation and many frameworks do a poor job in Chinese support, which is not really suitable for domestic users. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a graphical programming method, which adopts a graphical programming method to replace the traditional C / C++ programming method, greatly reducing the learning threshold and improving the learning efficiency.
[0004] The objective of the present invention is achieved through the following technical solutions:
[0005] A graphical programming method comprises the following steps:
[0006] S1: parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database;
[0007] S2: Based on the database, generate a script interpreter executable file according to the selected plug-in and the corresponding SDK program package;
[0008] S3: Based on the database, the selected plug-in and the corresponding JSON datagram are graphically rendered to generate a graphical programming interface;
[0009] S4: In the graphic programming interface, program logic and data control of the functional module are realized through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end;
[0010] S5: Generate a script program according to the graphic programming datagram, wherein the script program is used to drive the script interpreter executable file.
[0011] The beneficial effect of the present invention is that, through the cooperation of SDK and JSON datagram, cloud programming can be realized, thereby reducing the pressure on the user's computer. At the same time, through graphical programming, it can not only lower the programming threshold, improve the logic and structure of the program, so that non-professionals can also easily perform embedded programming, but also facilitate programming using portable devices such as mobile phones and tablets.
[0012] Further, the S1 specifically includes:
[0013] S101: receiving a plug-in file that complies with the specification;
[0014] S102: copying the contents of the script interpreter program file in the internal data of the plug-in file, generating and storing an SDK program package, and recording the information in a database;
[0015] S103: parsing the file contents of the functions and properties in the plug-in files of different chips, generating and storing JSON datagrams, and recording the information in a database;
[0016] S104: Deleting the parsed plug-in file.
[0017] The beneficial effect of adopting the above further scheme is that the program can be isolated and abstracted through the use of plug-in files, and users can directly use the plug-ins that have been uploaded in advance and parsed and saved as SDK files and JSON datagrams by calling database records, without waiting for the plug-in files to be uploaded, parsed and regenerated. This can effectively reduce the preparation and waiting time, help improve the generation speed of the graphical interface and script interpreter, and alleviate the pressure caused by the server needing to process large amounts of data at the same time.
[0018] Further, the S2 specifically includes:
[0019] S201: Based on the database, encapsulate the API of the SDK program package corresponding to the selected plug-in through a search program, and add a Bootloader program to generate a script interpreter program file;
[0020] S202: Compile the script interpreter program file using a cross-compilation tool to generate the script interpreter executable file.
[0021] The beneficial effect of adopting the above further solution is that by calling the SDK's API to compile the program, the SDK can be pre-processed and compiled. At the same time, this method requires less processing when compiling and linking, which can effectively shorten the program compilation time and reduce server resource usage.
[0022] Further, the S3 specifically includes:
[0023] S301: Based on the database and according to the front-end and back-end interactions, the selected plug-in and the corresponding JSON datagram related information are combined and sent to the front-end web page;
[0024] S302: Rendering is performed in the front-end webpage according to the datagram content specification to generate the graphical programming interface.
[0025] The beneficial effect of adopting the above further solution is that a changeable graphical programming interface is provided, and the content display can be filtered according to the plug-in selection, which can not only increase the orderliness when selecting the plug-in, but also prevent redundant functions from appearing in the interface.
[0026] Further, the S4 specifically includes:
[0027] S401: In the graphical interface, the graphical programming datagram is generated by connecting the interface marks of the selected functional modules and adjusting the attribute parameters of the selected functional modules, and the datagram is sent to the backend.
[0028] The beneficial effect of adopting the above further solution is that it helps users to clarify their logic and beautify the interface through connections and inclusion relationships.
[0029] Further, it also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module;
[0030] One or more operations of encapsulating, annotating, importing, exporting, splitting and modifying the theme style of the required functional modules are performed to generate a programming interface script datagram and send it to the back end.
[0031] The beneficial effect of adopting the above further solution is to make the graphical interface more structured and organized, so that non-professional users can use graphical programming more conveniently, and at the same time make the graphical program easier to transplant and expand.
[0032] Further, the S5 specifically includes:
[0033] S501: Generate a function relationship according to the connection relationship and attributes of each of the functional modules;
[0034] S502: Encoding the function relationship according to the number set for each function by the script interpreter to generate a function call code;
[0035] S503: Splitting the graphic programming datagram into constant data and variable data;
[0036] S504: According to different types of constant data and variable data, subdivide the constant data and the variable data to generate multiple strings of data calling codes;
[0037] S505: Add keywords to isolate the function call code and the multiple strings of data call codes and encapsulate the isolated data to generate the script program, which is used to drive the script interpreter executable file.
[0038] The beneficial effect of adopting the above further solution is that because the script program is based on logic and data relationships and is relatively small in size, it can effectively shorten the script program generation time and reduce the content uploaded. The script program is faster from production completion to downloading and uploading to the chip for formal operation than the conventional programming, compilation and burning method. At the same time, because the script program space is small and the script interpreter can have its own Bootloader, it can realize multi-platform portable programming such as mobile phones and tablets and IAP functions. In the script interpreter and script program, users can easily expand functions by adding functions and adding keywords.
[0039] The present invention also provides a graphics programming system, including a file parsing module, a script interpreter generating module, a graphics rendering module, a graphics programming module and a script program generating module;
[0040] The file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database;
[0041] The script interpreter generation module is used to generate a script interpreter executable file based on the database, according to the selected plug-in and the corresponding SDK program package;
[0042] The graphics rendering module is used to perform graphics rendering on the selected plug-in and the corresponding JSON datagram to generate a graphics programming interface based on the database;
[0043] The graphic programming module is used to realize the program logic and data control of the functional module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end;
[0044] The script program generation module is used to generate a script program according to the graphic programming datagram, and the script program is used to drive the script interpreter executable file.
[0045] The beneficial effect of the present invention is that, through the cooperation of SDK and JSON datagram, cloud programming can be realized, thereby reducing the pressure on the user's computer. At the same time, through graphical programming, it can not only lower the programming threshold, improve the logic and structure of the program, so that non-professionals can also easily perform embedded programming, but also facilitate programming using portable devices such as mobile phones and tablets.
[0046] Furthermore, the file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database. The specific process includes:
[0047] Receive plugin files that meet the specifications;
[0048] Copy the contents of the script interpreter program file in the internal data of the plug-in file, generate and store the SDK program package, and record the information in the database;
[0049] Parse the file contents of the functions and properties in the plug-in files of different chips, generate and store JSON datagrams, and record the information in the database;
[0050] Delete the plugin files that have been parsed.
[0051] The beneficial effect of adopting the above further scheme is that the program can be isolated and abstracted through the use of plug-in files, and users can directly use the plug-ins that have been uploaded in advance and parsed and saved as SDK files and JSON datagrams by calling database records, without waiting for the plug-in files to be uploaded, parsed and regenerated. This can effectively reduce the preparation and waiting time, help improve the generation speed of the graphical interface and script interpreter, and alleviate the pressure caused by the server needing to process large amounts of data at the same time.
[0052] Furthermore, the script interpreter generation module is used to generate a script interpreter executable file based on the database according to the selected plug-in and the corresponding SDK program package. The specific process includes:
[0053] Based on the database, the API of the SDK program package corresponding to the selected plug-in is encapsulated through a search program, and a Bootloader program is added to generate a script interpreter program file;
[0054] The script interpreter program file is compiled by a cross-compilation tool to generate the script interpreter executable file.
[0055] The beneficial effect of adopting the above further solution is that by calling the SDK's API to compile the program, the SDK can be pre-processed and compiled. At the same time, this method requires less processing when compiling and linking, which can effectively shorten the program compilation time and reduce server resource usage.
[0056] Further, the graphics rendering module is used to render the selected plug-in and the corresponding JSON datagram to generate a graphics programming interface based on the database, specifically including:
[0057] Based on the database, according to the front-end and back-end interactions, the selected plug-in and the corresponding JSON datagram related information are combined and sent to the front-end web page;
[0058] The front-end web page is rendered according to the datagram content specification to generate the graphical programming interface.
[0059] The beneficial effect of adopting the above further solution is that a changeable graphical programming interface is provided, and the content display can be filtered according to the plug-in selection, which can not only increase the orderliness when selecting the plug-in, but also prevent redundant functions from appearing in the interface.
[0060] Further, the graphic programming module is used to realize the program logic and data control of the functional module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end, specifically including:
[0061] In the graphical interface, the graphical programming datagram is generated by connecting the interface marks of the selected functional modules and adjusting the attribute parameters of the selected functional modules and is sent to the back end.
[0062] The beneficial effect of adopting the above further solution is that it helps users to clarify their logic and beautify the interface through connections and inclusion relationships.
[0063] Further, it also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module;
[0064] One or more operations of encapsulating, annotating, importing, exporting, splitting and modifying the theme style of the required functional modules are performed to generate a programming interface script datagram and send it to the back end.
[0065] The beneficial effect of adopting the above further solution is to make the graphical interface more structured and organized, so that non-professional users can use graphical programming more conveniently, and at the same time make the graphical program easier to transplant and expand.
[0066] Furthermore, the script program generation module is used to generate a script program according to the graphic programming datagram, and the script program is used to drive the script interpreter executable file, specifically including:
[0067] Generate a functional relationship according to the connection relationship and attributes of each of the functional modules;
[0068] Encoding the functional relationship according to the number set for each function by the script interpreter to generate a function call code;
[0069] Splitting the graphic programming datagram into constant data and variable data;
[0070] According to different types of constant data and variable data, the constant data and the variable data are subdivided to generate multiple strings of data calling codes;
[0071] Keywords are added to isolate the function call code and the multiple strings of data call codes and to encapsulate the isolated data to generate the script program, which is used to drive the script interpreter executable file.
[0072] The beneficial effect of adopting the above further solution is that because the script program is based on logic and data relationships and is relatively small in size, it can effectively shorten the script program generation time and reduce the content uploaded. The script program is faster from production completion to downloading and uploading to the chip for formal operation than the conventional programming, compilation and burning method. At the same time, because the script program space is small and the script interpreter can have its own Bootloader, it can realize multi-platform portable programming such as mobile phones and tablets and IAP functions. In the script interpreter and script program, users can easily expand functions by adding functions and adding keywords. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 A flowchart of a graphical programming method of the present invention;
[0074] Figure 2 It is a specific process diagram of S1 of the present invention;
[0075] Figure 3 It is a specific process diagram of S2 of the present invention;
[0076] Figure 4 It is a specific process diagram of S3 of the present invention;
[0077] Figure 5 It is a specific process diagram of S5 of the present invention;
[0078] Figure 6 This is a connection relationship diagram of a graphical programming system of the present invention.
[0079] As shown in Table 1, some terms and definitions in the present invention are as follows:
[0080] Table 1
[0081]
[0082]
[0083] DETAILED DESCRIPTION
[0084] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following.
[0085] Example 1
[0086] Reference Figure 1 , a graphical programming method, comprising the following steps:
[0087] S1: parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database;
[0088] S2: Based on the database, generate a script interpreter executable file according to the selected plug-in and the corresponding SDK program package;
[0089] S3: Based on the database, the selected plug-in and the corresponding JSON datagram are graphically rendered to generate a graphical programming interface;
[0090] S4: In the graphic programming interface, program logic and data control of the functional module are realized through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end;
[0091] S5: Generate a script program according to the graphic programming datagram, wherein the script program is used to drive the script interpreter executable file.
[0092] In this embodiment, a datagram is a basic unit of data transmitted over a network, and includes a header and the data itself, wherein the header describes the destination of the data and the relationship between the data and other data. A datagram is a complete, independent data entity that carries information to be transferred from a source computer to a destination computer. In this embodiment, a JSON datagram includes the data required for front-end rendering. In this embodiment, spatial connections can be understood as setting the flow connection of a programming module, similar to the connections of a drawn flowchart. Attribute adjustment can be understood as: parameter adjustment of a programming module, similar to the process of programming a function call to pass parameters. The back end can be understood as a service program running in a web server.
[0093] The chip plug-in file can realize cloud programming through the cooperation of SDK and JSON datagram, thus reducing the pressure on the user's computer. At the same time, through graphical programming, it can not only lower the programming threshold, but also improve the logic and structure of the program, so that non-professionals can easily perform embedded programming, and it is more convenient to use mobile phones, tablets and other portable devices for programming.
[0094] In this embodiment, refer to Figure 2 , the S1 specifically includes:
[0095] S101: receiving a plug-in file that complies with the specification;
[0096] S102: copying the contents of the script interpreter program file in the internal data of the plug-in file, generating and storing an SDK program package, and recording the information in a database;
[0097] S103: parsing the file contents of the functions and properties in the plug-in files of different chips, generating and storing JSON datagrams, and recording the information in a database;
[0098] S104: Deleting the parsed plug-in file.
[0099] The use of plug-in files can isolate and abstract the program. Users can directly use the plug-ins that have been uploaded in advance and parsed and saved as SDK files and JSON datagrams by calling database records, without waiting for the plug-in files to be uploaded, parsed and regenerated. This can effectively reduce the preparation and waiting time, help improve the generation speed of the graphical interface and script interpreter, and alleviate the pressure on the server to process large amounts of data at the same time.
[0100] In this embodiment, the chip plug-in file contains the chip's pin information, basic functions, etc. Compliance with the specification can be understood as similar to grammatical rules, such as double slashes in C language are comments, parentheses indicate functions, #define indicates definitions, and #include indicates references. Then, based on these grammar parsing programs, the program can understand what method needs to be used to process this text. The file content of the plug-in file about the introduction of functions and properties, that is, the purpose of the program in the plug-in and the interface parameters of the program are described, for example:
[0101] Purpose: The user needs to use STM32F103C8T6 to flash the LED connected to the PA5 pin under an 8M external clock. The positive pole of the LED is connected to the PA5 pin, and the negative pole is connected to the GND pole through a 1K resistor. The flashing frequency is 1s on and 1s off.
[0102] Explanation: What the user needs to achieve is that under the 8M external clock, the PA5 pin performs level conversion at a frequency of once per second.
[0103] step
[0104] 1. User selection interface Select the basic process plug-in, hardware configuration plug-in, time plug-in, and basic input and output plug-in of the STM32F103C series. After the above four plug-ins generate the interpreter toolset, you can enter the graphical programming interface.
[0105] 2. Select New Project from the toolbar of the graphical programming interface.
[0106] 3. Then select the clock configuration function icon in the hardware configuration plug-in bar in the plug-in bar and drag it into the graphic programming bar.
[0107] 4. Then click the clock configuration function icon dragged in in the graphic programming bar to display the properties in the property bar. After configuring the properties, the function becomes that the clock of this series of chips can be configured as an 8M external clock.
[0108] 5. Then drag the pin configuration function icon and pin output level icon of the basic input and output plug-in bar in the plug-in bar into the graphic programming bar again.
[0109] 6. Using the same method as above, configure the PA5 pin as output function in the property column of the pin configuration function icon, and configure the PA5 pin as high level in the output level icon.
[0110] 7. Then drag in the loop function icon from the basic process plug-in.
[0111] 8. In the property bar, configure the loop function icon to an infinite loop. At this time, one of the two next interfaces of the loop function icon will disappear.
[0112] 9. Then drag in the Level Shift icon from the Basic I / O plugin.
[0113] 10. In the property bar, configure the icon to target pin PA5.
[0114] 11. Then drag the delay function icon from the time plug-in.
[0115] 12. In the property bar, configure the icon to have a medium delay of 1s.
[0116] 13. In the graphic programming bar, right-click the clock configuration function icon and set it as the starting point. At this time, the timing previous step interface of the icon disappears.
[0117] 14. Connect the next step of the timing icon to the previous step interface of the pin configuration function icon.
[0118] 15. Similarly, connect the pin output level function icon, loop function icon, level conversion icon, and delay function icon in sequence.
[0119] 16. In the above icons, the loop function icon has two previous interfaces. You can select any one of them when connecting the pin output level function icon's next interface to it.
[0120] 17. Connect the Next Step interface of the Delay function icon to the remaining Previous Step interface of the Loop function icon.
[0121] 18. The above steps have completed the functional programming. The steps of selecting plug-ins and connecting plug-ins can be exchanged, as long as the final display results are the same.
[0122] 19. Select Generate Script Program in the toolbar to download the script program and upload it to the STM32F103C8T6 chip that has been burned with the script interpreter executable file in the above interpreter toolset and then execute it.
[0123] In this embodiment, refer to Figure 3 , the S2 specifically includes:
[0124] S201: Based on the database, encapsulate the API of the SDK program package corresponding to the selected plug-in through a search program, and add a Bootloader program to generate a script interpreter program file;
[0125] S202: Compile the script interpreter program file using a cross-compilation tool to generate the script interpreter executable file.
[0126] In this embodiment, the bootloader of different chips includes the basic receiving script program of the chip, parsing, saving and adding personalized content according to the characteristics of the chip, etc. The search program is the algorithm content that does not involve the bottom layer. The bottom layer here can be understood as: programs involving chip characteristics such as clock, memory size, etc., or programs that need to be configured by calling the internal registers of the chip, and programs that need to be called directly for the chip address.
[0127] By calling the SDK's API to compile the program, the SDK can be preprocessed and compiled. At the same time, this method requires less processing when compiling and linking, which can effectively reduce program compilation time and reduce server resource usage.
[0128] In this embodiment, refer to Figure 4 , the S3 specifically includes:
[0129] S301: Based on the database and according to the front-end and back-end interactions, the selected plug-in and the corresponding JSON datagram related information are combined and sent to the front-end web page;
[0130] S302: Rendering is performed in the front-end webpage according to the datagram content specification to generate the graphical programming interface.
[0131] Provides a changeable graphical programming interface that can filter the content displayed based on the plug-in selection, which can not only increase the orderliness when selecting plug-ins, but also prevent redundant functions from appearing in the interface.
[0132] In this embodiment, the S4 specifically includes:
[0133] S401: In the graphical interface, the graphical programming datagram is generated by connecting the interface marks of the selected functional modules and adjusting the attribute parameters of the selected functional modules, and the datagram is sent to the backend.
[0134] Connections and inclusion relationships can help users clarify their logic and beautify the interface.
[0135] In this embodiment, it also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module;
[0136] One or more operations of encapsulating, annotating, importing, exporting, splitting and modifying the theme style of the required functional modules are performed to generate a programming interface script datagram and send it to the back end.
[0137] Make the graphical interface more structured and organized, so that non-professional users can use graphical programming more conveniently, and make graphical programs easier to port and expand.
[0138] In this embodiment, refer to Figure 5 , the S5 specifically includes:
[0139] S501: Generate a function relationship according to the connection relationship and attributes of each of the functional modules;
[0140] S502: Encoding the function relationship according to the number set for each function by the script interpreter to generate a function call code;
[0141] S503: Splitting the graphic programming datagram into constant data and variable data;
[0142] S504: According to different types of constant data and variable data, subdivide the constant data and the variable data to generate multiple strings of data calling codes;
[0143] S505: Add keywords to isolate the function call code and the multiple strings of data call codes and encapsulate the isolated data to generate the script program, which is used to drive the script interpreter executable file.
[0144] Because the script program is based on logic and data relationships, it is small in size, which can effectively shorten the script program generation time and reduce the content uploaded. The script program is faster from production completion to downloading and uploading to the chip for formal operation than the conventional programming compilation and burning method. At the same time, because the script program space is small and the script interpreter can have its own Bootloader, it can realize multi-platform portable programming such as mobile phones and tablets and IAP functions. In the script interpreter and the script program, it is convenient for users to expand functions by adding functions and adding keywords. Among them, the work that needs to be completed in the conventional programming compilation and burning method includes: programming, cross-compilation, and burning the C language executable file generated after compilation through the JTAG emulator. If it is cloud programming, it is also necessary to add the process of downloading executable files after compilation. However, this application has burned the script interpreter in advance, so after completing the programming, we only need to encapsulate our connection logic into a script program. This process will be faster than cross-compilation because we need to process less information. And then because we generate fewer messages, it takes less time to download. Moreover, burning does not require JTAG and can be directly burned using Bootloader, which is more convenient and easy to use.
[0145] In this embodiment, IAP is the abbreviation of In Application Programming. IAP is the burning of a part of the User Flash area by the user's own program during operation, so that the firmware program in the product can be easily updated through the reserved communication port after the product is released. Here, Bootloader is the implementation method, and once Bootloader is implemented, the IAP function is implemented.
[0146] On the basis of Example 1, Example 2 further implemented is:
[0147] Reference Figure 6 ,The present invention also provides a graphics programming system including ,a file parsing module, a script interpreter generating module, a graphics rendering module, a graphics programming module and a script program generating module;
[0148] The file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database;
[0149] The script interpreter generation module is used to generate a script interpreter executable file based on the database, according to the selected plug-in and the corresponding SDK program package;
[0150] The graphics rendering module is used to perform graphics rendering on the selected plug-in and the corresponding JSON datagram to generate a graphics programming interface based on the database;
[0151] The graphic programming module is used to realize the program logic and data control of the functional module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end;
[0152] The script program generation module is used to generate a script program according to the graphic programming datagram, and the script program is used to drive the script interpreter executable file.
[0153] Through the cooperation of SDK and JSON datagram, cloud programming can be realized, thus reducing the pressure on users' computers. At the same time, through graphical programming, it can not only lower the programming threshold, but also improve the logic and structure of the program, so that non-professionals can easily perform embedded programming, and it is more convenient to use mobile phones, tablets and other portable devices for programming.
[0154] In this embodiment, the file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database. The specific process includes:
[0155] Receive plugin files that meet the specifications;
[0156] Copy the contents of the script interpreter program file in the internal data of the plug-in file, generate and store the SDK program package, and record the information in the database;
[0157] Parse the file contents of the functions and properties in the plug-in files of different chips, generate and store JSON datagrams, and record the information in the database;
[0158] Delete the plugin files that have been parsed.
[0159] The use of plug-in files can isolate and abstract the program. Users can directly use the plug-ins that have been uploaded in advance and parsed and saved as SDK files and JSON datagrams by calling database records, without waiting for the plug-in files to be uploaded, parsed and regenerated. This can effectively reduce the preparation and waiting time, help improve the generation speed of the graphical interface and script interpreter, and alleviate the pressure on the server to process large amounts of data at the same time.
[0160] In this embodiment, the script interpreter generation module is used to generate a script interpreter executable file based on the database according to the selected plug-in and the corresponding SDK program package. The specific process includes:
[0161] Based on the database, the API of the SDK program package corresponding to the selected plug-in is encapsulated through a search program, and a Bootloader program is added to generate a script interpreter program file;
[0162] The script interpreter program file is compiled by a cross-compilation tool to generate the script interpreter executable file.
[0163] By calling the SDK's API to compile the program, the SDK can be preprocessed and compiled. At the same time, this method requires less processing when compiling and linking, which can effectively reduce program compilation time and reduce server resource usage.
[0164] In this embodiment, the graphics rendering module is used to render the selected plug-in and the corresponding JSON datagram to generate a graphics programming interface based on the database, specifically including:
[0165] Based on the database, according to the front-end and back-end interactions, the selected plug-in and the corresponding JSON datagram related information are combined and sent to the front-end web page;
[0166] The front-end web page is rendered according to the datagram content specification to generate the graphical programming interface.
[0167] Provides a changeable graphical programming interface that can filter the content displayed based on the plug-in selection, which can not only increase the orderliness when selecting plug-ins, but also prevent redundant functions from appearing in the interface.
[0168] In this embodiment, the graphic programming module is used to realize the program logic and data control of the functional module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end, specifically including:
[0169] In the graphical interface, the graphical programming datagram is generated by connecting the interface marks of the selected functional modules and adjusting the attribute parameters of the selected functional modules and is sent to the back end.
[0170] Connections and inclusion relationships can help users clarify their logic and beautify the interface.
[0171] In this embodiment, it also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module;
[0172] One or more operations of encapsulating, annotating, importing, exporting, splitting and modifying the theme style of the required functional modules are performed to generate a programming interface script datagram and send it to the back end.
[0173] Make the graphical interface more structured and organized, so that non-professional users can use graphical programming more conveniently, and make graphical programs easier to port and expand.
[0174] In this embodiment, the script program generation module is used to generate a script program according to the graphic programming datagram, and the script program is used to drive the script interpreter executable file, specifically including:
[0175] Generate a functional relationship according to the connection relationship and attributes of each of the functional modules;
[0176] Encoding the functional relationship according to the number set for each function by the script interpreter to generate a function call code;
[0177] Splitting the graphic programming datagram into constant data and variable data;
[0178] According to different types of constant data and variable data, the constant data and the variable data are subdivided to generate multiple strings of data calling codes;
[0179] Keywords are added to isolate the function call code and the multiple strings of data call codes and to encapsulate the isolated data to generate the script program, which is used to drive the script interpreter executable file.
[0180] Because the script program is based on logic and data relationships, it is small in size, which can effectively shorten the script program generation time and reduce the content uploaded. The script program is faster from production completion to downloading and uploading to the chip for formal operation than the conventional programming compilation and burning method. At the same time, because the script program space is small and the script interpreter can have its own Bootloader, it can realize multi-platform portable programming such as mobile phones and tablets and IAP functions. In the script interpreter and the script program, it is convenient for users to expand functions by adding functions and adding keywords. Among them, the work that needs to be completed in the conventional programming compilation and burning method includes: programming, cross-compilation, and burning the C language executable file generated after compilation through the JTAG emulator. If it is cloud programming, it is also necessary to add the process of downloading executable files after compilation. However, this application has burned the script interpreter in advance, so after completing the programming, we only need to encapsulate our connection logic into a script program. This process will be faster than cross-compilation because we need to process less information. And then because we generate fewer messages, it takes less time to download. Moreover, burning does not require JTAG and can be directly burned using Bootloader, which is more convenient and easy to use.
[0181] The above are only preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the present invention through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall be protected by the claims attached to the present invention if they do not depart from the spirit and scope of the present invention.
Claims
1. A graphical programming method, characterized in that: The following steps are involved: S1: parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database; S2: Based on the database, generate a script interpreter executable file according to the selected plug-in and the corresponding SDK program package; S3: Based on the database, the selected plug-in and the corresponding JSON datagram are graphically rendered to generate a graphical programming interface; S4: In the graphic programming interface, program logic and data control of the functional module are realized through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end; S5: generating a script program according to the graphic programming datagram, wherein the script program is used to drive the script interpreter executable file; The S4 specifically includes: S401: in the graphical interface, generating the graphical programming datagram by connecting the interface mark of the selected functional module and adjusting the attribute parameters of the selected functional module and sending it to the back end; It also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module; encapsulating, annotating, importing, exporting, splitting and modifying one or more operations in the theme style of the required functional module to generate a programming interface script datagram and send it to the back end.
2. The graphical programming method according to claim 1, characterized in that: The S1 specifically includes: S101: receiving a plug-in file that complies with the specification; S102: copying the contents of the script interpreter program file in the internal data of the plug-in file, generating and storing an SDK program package, and recording the information in a database; S103: parsing the file contents of the functions and properties in the plug-in files of different chips, generating and storing JSON datagrams, and recording the information in a database; S104: Deleting the parsed plug-in file.
3. The graphical programming method according to claim 1, characterized in that: The S2 specifically includes: S201: Based on the database, encapsulate the API of the SDK program package corresponding to the selected plug-in through a search program, and add a Bootloader program to generate a script interpreter program file; S202: Compile the script interpreter program file using a cross-compilation tool to generate the script interpreter executable file.
4. The graphical programming method according to claim 1, characterized in that: The S3 specifically includes: S301: Based on the database and according to the front-end and back-end interactions, the selected plug-in and the corresponding JSON datagram related information are combined and sent to the front-end web page; S302: Rendering is performed in the front-end webpage according to the datagram content specification to generate the graphical programming interface.
5. The graphical programming method according to any one of claims 1 to 4, characterized in that: The S5 specifically includes: S501: Generate a function relationship according to the connection relationship and attributes of each of the functional modules; S502: Encoding the function relationship according to the number set for each function by the script interpreter to generate a function call code; S503: Splitting the graphic programming datagram into constant data and variable data; S504: According to different types of constant data and variable data, subdivide the constant data and the variable data to generate multiple strings of data calling codes; S505: Add keywords to isolate the function call code and the multiple strings of data call codes and encapsulate the isolated data to generate the script program, which is used to drive the script interpreter executable file.
6. A graphical programming system, characterized in that: Including, file parsing module, script interpreter generation module, graphics rendering module, graphics programming module and script program generation module; The file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database; The script interpreter generation module is used to generate a script interpreter executable file based on the database, according to the selected plug-in and the corresponding SDK program package; The graphics rendering module is used to perform graphics rendering on the selected plug-in and the corresponding JSON datagram to generate a graphics programming interface based on the database; The graphic programming module is used to realize the program logic and data control of the functional module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end; The script program generating module is used to generate a script program according to the graphic programming datagram, and the script program is used to drive the script interpreter executable file; The graphic programming module is used to realize the program logic and data control of the function module in the graphic programming interface through spatial connection and attribute adjustment to generate a graphic programming datagram and send it to the back end, specifically including: in the graphic interface, by connecting the interface mark of the selected function module and adjusting the attribute parameters of the selected function module, generate the graphic programming datagram and send it to the back end; It also includes connecting the interface mark of the selected functional module and adjusting the selected functional module to generate the required functional module; encapsulating, annotating, importing, exporting, splitting and modifying one or more operations in the theme style of the required functional module to generate a programming interface script datagram and send it to the back end.
7. The graphical programming system according to claim 6, characterized in that: The file parsing module is used to parse the internal data of the plug-in files of different chips, generate SDK packages and JSON datagrams, and record them in the database. The specific process includes: Receive plugin files that meet the specifications; Copy the contents of the script interpreter program file in the internal data of the plug-in file, generate and store the SDK program package, and record the information in the database; Parse the file contents of the functions and properties in the plug-in files of different chips, generate and store JSON datagrams, and record the information in the database; Delete the plugin files that have been parsed.
8. The graphical programming system according to claim 6, characterized in that: The script interpreter generation module is used to generate a script interpreter executable file based on the database according to the selected plug-in and the corresponding SDK program package. The specific process includes: Based on the database, the API of the SDK program package corresponding to the selected plug-in is encapsulated through a search program, and a Bootloader program is added to generate a script interpreter program file; The script interpreter program file is compiled by a cross-compilation tool to generate the script interpreter executable file.
Citation Information
Patent Citations
SDK packaging method using packaging plug-in, packaging plug-in and corresponding terminal
CN109918075A
Blockly and Raspberry Pi-based online graphical programming system and usage method thereof
CN110362299A