Online hardware programming system based on online editor and Raspberry Pi and use method thereof

By integrating software and hardware programming through an online hardware programming system based on an online editor and Raspberry Pi, and supporting multi-language programming, this system solves the problems of single programming language and software-hardware separation in existing technologies. It realizes a programming learning system for students of all ages, enhances the fun and continuity of learning, reduces the difficulty of learning, and enriches the learning scenarios.

CN121922020APending Publication Date: 2026-04-24BAIYUAN (HANGZHOU) EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BAIYUAN (HANGZHOU) EDUCATION TECH CO LTD
Filing Date
2026-01-13
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing programming education products cannot simultaneously meet the learning needs of students of different ages. They suffer from problems such as limited programming language support, separation of software and hardware programming, and poor learning continuity. There is an urgent need for a programming learning system that can integrate software and hardware programming, support multi-language programming, and adapt to students of different ages.

Method used

Design an online hardware programming system based on an online editor and Raspberry Pi, integrating software and hardware programming, supporting three programming languages: Scratch, Python, and C++. Through the intuitive effects of the Raspberry Pi development board and external electronic devices, it provides multi-language adaptation and real-time interactive feedback, reducing the learning difficulty and improving learning interest and efficiency.

Benefits of technology

It has built an integrated programming learning system that is suitable for students of all ages, solved the problems of single programming language and separation of software and hardware, improved the fun and continuity of learning, lowered the threshold for programming learning, enriched the learning scenarios, supported multi-language programming, and realized real-time interactive feedback that intuitively combines code and hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121922020A_ABST
    Figure CN121922020A_ABST
Patent Text Reader

Abstract

The invention discloses an online hardware programming system based on an online editor and Raspberry Pi and a use method thereof, and relates to the technical field of programming education. The system comprises a Raspberry Pi development board, an external electronic device, a Raspberry Pi service program, an online programming platform based on a browser and a cloud server. The Raspberry Pi service program comprises a distribution network service, a code interpretation service and a basic service, and the online programming platform is provided with a menu bar, a programming area supporting Scratch, Python and C + +, and a console. When the system is used, environment preparation is firstly completed, then a program is written through the online programming platform and sent to the Raspberry Pi for execution, and finally codes can be stored in the cloud server. Software and hardware programming is integrated, multiple languages are supported to adapt to students of different age groups, the programming learning difficulty is reduced by means of the visual effect of hardware, the learning interest and efficiency are improved, and an integrated solution is provided for programming education of middle and primary schools.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of programming education technology, specifically to an online hardware programming system based on an online editor and a Raspberry Pi, and its usage method. Background Technology

[0002] With the rapid development of science and technology and artificial intelligence, the country is paying increasing attention to information technology and programming education in primary and secondary schools, and programming education is gradually becoming more widespread among primary and secondary school students. Currently, there are two main popular models for programming education in primary and secondary schools:

[0003] One approach is pure software programming, which typically involves editing and running code on a computer. Common programming languages ​​include graphical programming (Scratch), Python, and C++. Graphical programming uses a block-based approach, visually demonstrating the code assembly process, making it easier for younger students to understand and operate. Python and C++, on the other hand, are code-based programming languages ​​with fixed syntax rules, making them more abstract and challenging for younger students, potentially leading to frustration.

[0004] Another approach is maker-style programming, which typically uses open-source hardware such as micro:bit, Arduino, and Raspberry Pi, and can be combined with peripherals like LEDs and sensors for programming learning. Its advantage lies in the intuitiveness of the programming results; after students write and run programs on the hardware, they can directly observe the changes in the peripherals' states, such as the LEDs turning on and off, and the feedback from sensor data. Compared to pure software programming, maker-style programming is more fun and practical, not only maintaining students' enthusiasm for learning programming but also stimulating their desire for exploration and innovative thinking.

[0005] However, existing programming education products have many shortcomings:

[0006] While Scratch 3.0, developed by the MIT Multimedia Lab, supports partial hardware control through plugins, it only supports graphical programming and is suitable only for younger students in grades 1-3. For students in grade 4 and above whose abstract thinking is developing, this platform cannot meet their needs for cultivating logical thinking skills through coding.

[0007] The open-source hardware Arduino supports Scratch and C programming languages, but not Python programming. Furthermore, there are syntactic differences between C and C++, requiring students to readjust to the syntax rules when learning C++, resulting in poor learning continuity.

[0008] GoodMicrosoft's hardware-integrated programming learning system, based on Blockly, enables graphical control of hardware and can convert graphical code into Python code, facilitating student learning of principles. However, the system's Python code is encapsulated (secondary development), primarily controlling hardware by calling internally implemented APIs, and is not pure Python programming. Furthermore, it does not support C++, limiting the scope and depth of students' programming learning.

[0009] In summary, existing programming education products cannot simultaneously meet the learning needs of students of different ages. They suffer from problems such as limited programming language support, separation of software and hardware programming, and poor learning continuity. There is an urgent need for a programming learning system that can integrate software and hardware programming, support multi-language programming, and adapt to students of different ages to address the shortcomings of existing technologies. Summary of the Invention

[0010] To address the shortcomings of existing technologies, the present invention aims to provide an online hardware programming system and its usage method based on an online editor and Raspberry Pi. This system integrates software programming and hardware programming, supports three programming languages: Scratch, Python, and C++, and meets the learning needs of students of different ages. By leveraging the intuitive effects of the Raspberry Pi development board and external electronic devices, it helps students better understand programming concepts, reduces learning difficulty, and enhances learning interest and efficiency.

[0011] To achieve the above objectives, the present invention adopts the following technical solution:

[0012] An online hardware programming system based on an online editor and a Raspberry Pi includes a Raspberry Pi development board, an external electronic device, a service program installed on the Raspberry Pi, a browser-based online programming platform, and a cloud server. The external electronic device is connected to the Raspberry Pi development board, the online programming platform communicates with the service program on the Raspberry Pi via a network, and the cloud server communicates with the online programming platform. The service program includes network configuration services, code interpretation services, and basic services. The online programming platform supports programming operations in at least three programming languages, including graphical programming languages, scripting programming languages, and compiled programming languages.

[0013] Furthermore, the Raspberry Pi development board comes pre-installed with a Linux-based operating system. The external electronic devices include sensors and output devices. The sensors are used to acquire external signals, and the output devices are used to execute commands sent by the Raspberry Pi development board. The sensors can be temperature sensors, humidity sensors, ultrasonic sensors, etc., capable of acquiring signals such as temperature, humidity, and distance from the external environment. The output devices can be LED lights, buzzers, fans, tri-color LEDs, etc., capable of performing corresponding actions according to commands sent by the Raspberry Pi development board, such as turning lights on and off, emitting a buzzer, or rotating a fan.

[0014] Furthermore, the network configuration service listens on a preset port and connects the Raspberry Pi development board to the local area network based on the HTTP protocol. When it receives an HTTP request to access the preset port, it returns the scanned WiFi information for the user to set up the connection. Preferably, the preset port is port 8888. Users can access the network configuration service by entering a specified URL in a browser on a computer or mobile phone connected to the same WiFi network, select the target WiFi network, enter the password, and complete the network setup for the Raspberry Pi development board. The operation is simple and quick.

[0015] Furthermore, the code interpretation service listens on a designated port, transmits data based on the WebSocket protocol, receives code sent by the online programming platform, interprets the code line by line according to the programming language type, and sends execution instructions to the Raspberry Pi development board. The designated port is preferably port 5000. The WebSocket protocol enables bidirectional communication, ensuring the real-time performance and stability of code transmission. For different types of programming languages, the code interpretation service uses different parsing methods: when the programming language is Scratch, it calls specific functions block by block; when the programming language is Python, it uses the Python interpreter to parse the code; and when the programming language is C++, it uses a C++ compiler to compile the code before execution.

[0016] Furthermore, the basic services are used to implement OTA upgrades and device binding functions for the service programs on the Raspberry Pi development board. The menu bar of the online programming platform includes device management, file management, and code saving functions. The OTA upgrade function enables remote updates of the service programs without manual user operation, facilitating system maintenance and function optimization. The device binding function binds the Raspberry Pi development board to the user account, ensuring the security and uniqueness of programming operations. The device management function in the menu bar can be used to view and manage connected Raspberry Pi development boards and external electronic devices; the file management function supports operations such as creating, deleting, and renaming programming files; and the code saving function can save the written program to the cloud server for easy viewing and editing by the user later.

[0017] Furthermore, the programming area of ​​the online programming platform includes a graphical programming sub-area, a script programming sub-area, and a compiled programming sub-area. The graphical programming sub-area adds support for the Raspberry Pi development board on top of standard graphical programming tools. The script programming sub-area and the compiled programming sub-area support keyword color display. The graphical programming sub-area uses a block-based programming method, which is in line with the cognitive characteristics of young students. It also adds control blocks for the Raspberry Pi development board and external electronic devices to realize hardware control functions. The script programming sub-area (Python) and the compiled programming sub-area (C++) support keyword color display, which can help students quickly identify keywords in the code, improve programming efficiency, and reduce syntax errors.

[0018] Furthermore, the console of the online programming platform has input and output functions, used to input data required for program execution, output program error messages, debugging logs, and data returned by the hardware. When the program requires user input parameters during execution, the console will display corresponding input boxes for the user to input; error messages, debugging logs, and hardware data acquired by sensors generated during program execution will be output to the console in real time, making it convenient for users to view the program's running status and troubleshoot errors in a timely manner.

[0019] A method for using an online hardware programming system based on an online editor and Raspberry Pi, applied to the aforementioned system, includes the following steps:

[0020] Step S1: Environment preparation. Burn the service program containing network configuration service, code interpretation service and basic service to the TF card. Insert the TF card into the Raspberry Pi development board and start it. Configure the Raspberry Pi development board to connect to the local area network.

[0021] Step S2: Code writing and running. Users log in to the online programming platform through a browser, select the target programming language, write the program in the programming area, and click the run button to send the code to the code interpretation service of the Raspberry Pi development board.

[0022] Step S3: The code interpretation service parses the code and controls the Raspberry Pi development board to drive the external electronic devices to perform corresponding operations, and the console outputs relevant information in real time;

[0023] Step S4: Code saving. Users can save their written programs to the cloud server using the save function of the online programming platform.

[0024] Furthermore, the specific process of configuring the Raspberry Pi development board to connect to the local area network in step S1 is as follows: In a WiFi environment, use a terminal device connected to the target WiFi network to access the Raspberry Pi development board's network configuration service by entering the specified URL in a browser, selecting the target WiFi network and entering the password to complete the connection between the Raspberry Pi development board and the local area network. The terminal device can be a computer, mobile phone, tablet, etc., as long as it can connect to WiFi and use a browser. The operation is flexible and convenient, without the need for a complicated configuration process.

[0025] Furthermore, in step S2, the target programming language is Scratch, Python, or C++. When Scratch is selected, programs are written by assembling blocks, and the code interpretation service calls specific functions according to the blocks. When Python is selected, the code interpretation service uses the Python interpreter to parse the code. When C++ is selected, the code interpretation service uses a C++ compiler to compile the code and then executes it. Different programming languages ​​are suitable for students of different ages and learning needs. Students in grades 1-3 can choose Scratch for graphical programming to cultivate their interest in programming and basic logical thinking. Students in grade 4 and above can choose Python or C++ for code programming to learn programming knowledge in depth and cultivate logical thinking and problem-solving abilities.

[0026] The online hardware programming system and its usage method based on an online editor and Raspberry Pi of the present invention have the following beneficial effects:

[0027] The core advantage of this technical solution is that it builds an integrated programming learning system suitable for students of all ages through software and hardware integration and multi-language adaptation. This not only solves the pain points of existing solutions such as single programming language and software and hardware separation, but also lowers the threshold for learning programming and enhances the fun and continuity of learning.

[0028] Deep integration of software and hardware enriches learning scenarios. The same platform supports both pure software programming and hardware control, allowing students to simultaneously manipulate virtual characters and physical peripherals (such as LED lights and fans) through code, combining abstract code with intuitive physical phenomena and expanding the scope for creative expression.

[0029] Multi-language support to adapt to varying learning needs. Supports Scratch, Python, and C++, perfectly matching the learning path from graphical programming for grades 1-3 to advanced code programming for grades 4 and above, allowing for knowledge transfer without switching platforms.

[0030] Real-time interactive feedback enhances the learning experience. The program supports dynamic input parameters during runtime, and the console outputs error messages, debugging logs, and hardware data (such as temperature and distance) in real time, helping students adjust their code promptly and increasing their engagement in the learning process.

[0031] Reduce the difficulty of learning and enhance motivation to persevere. By leveraging the intuitive effects of Raspberry Pi hardware, abstract programming concepts (such as loops and conditional statements) are transformed into perceptible hardware actions, reducing the frustration caused by English vocabulary and grammar and helping students continue learning.

[0032] With cloud storage support, it offers greater flexibility and convenience. Code can be saved to the cloud server in real time, supporting multi-terminal login for viewing and editing, breaking time and space limitations, and allowing students to learn anytime, anywhere.

[0033] The architecture is stable and easy to operate, making it suitable for teaching scenarios. The browser-based online platform requires no additional software installation, the Raspberry Pi network setup process is simple, and the service program ensures stable data transmission through mature protocols, lowering the barrier to entry for teachers and students. Attached Figure Description

[0034] Figure 1 This is an architecture diagram of the online hardware programming system in an embodiment of the present invention;

[0035] Figure 2 This is a schematic diagram of a Scratch programming example in an embodiment of the present invention;

[0036] Figure 3 This is a schematic diagram illustrating a Python code programming example in an embodiment of the present invention;

[0037] Figure 4 This is a schematic diagram of a C++ code programming example in an embodiment of the present invention;

[0038] Figure 5 This is a schematic diagram illustrating an example of using Scratch programming to control a touch-sensitive light switch in an embodiment of the present invention.

[0039] Figure 6 This is a schematic diagram illustrating an example of using Scratch programming to control the gradual change of an LED light in an embodiment of the present invention.

[0040] Figure 7 This is a schematic diagram illustrating an example of implementing ultrasonic ranging using Python programming in an embodiment of the present invention;

[0041] Figure 8 This is a schematic diagram illustrating an example of controlling fan rotation using Python programming in an embodiment of the present invention;

[0042] Figure 9 This is a schematic diagram illustrating an example of controlling fan rotation using C++ programming in an embodiment of the present invention;

[0043] Figure 10 This is a schematic diagram illustrating an example of C++ programming to control a tri-color LED light in an embodiment of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0045] Example 1

[0046] An online hardware programming system based on an online editor and Raspberry Pi, such as Figure 1 As shown, it includes a Raspberry Pi development board, external electronic devices, a service program installed on the Raspberry Pi, a browser-based online programming platform, and a cloud server.

[0047] The Raspberry Pi development board is designed to popularize computer programming education. The Raspberry Pi development board is about the size of a credit card, comes pre-installed with a Linux-based operating system, and has the advantages of small size, low cost, and stable performance, making it suitable as a hardware platform for programming education in primary and secondary schools.

[0048] External electronic devices connect to the Raspberry Pi development board, including sensors and output devices. Sensors can be temperature sensors, humidity sensors, ultrasonic sensors, etc., used to acquire relevant signals from the external environment; output devices can be LEDs, buzzers, fans, tri-color LEDs, etc., used to execute instructions sent by the Raspberry Pi development board and demonstrate the programming results.

[0049] The services installed on the Raspberry Pi include network configuration service, code interpretation service, and basic services:

[0050] The Network Configuration Service is used for network setup of Raspberry Pi hardware, helping the Raspberry Pi connect to the current local area network. The Network Configuration Service listens on port 8888, based on the HTTP protocol. When an HTTP request accesses port 8888, it returns scanned Wi-Fi information for the user to configure the connection. Users can access the Network Configuration Service by entering the specified URL in a browser using a computer, mobile phone, or other terminal device connected to the same Wi-Fi network. They can then select the target Wi-Fi network, enter the password, and complete the network setup for the Raspberry Pi development board.

[0051] The code interpretation service is used to interpret the code sent by the browser line by line and send instructions to the Raspberry Pi development board. The code interpretation service listens on port 5000 and transmits data using the WebSocket protocol. The WebSocket protocol enables bidirectional communication between the client and server, ensuring the real-time performance and stability of code transmission. When a message is received, the code interpretation service parses the message using the specified encoding and, depending on the programming language selected in the programming area (Scratch, Python, or C++), calls specific functions block by block, interprets the code using the Python interpreter, or uses the C++ compiler to interpret and execute the code line by line.

[0052] The basic services are used for OTA upgrades of service programs on the Raspberry Pi development board and device binding. The OTA upgrade function enables remote updates of service programs, allowing users to obtain the latest features and bug fixes without manual operation. The device binding function can bind the Raspberry Pi development board to a user account, ensuring that only the bound user can control the Raspberry Pi development board, thus improving system security.

[0053] A browser-based online programming platform consists of a menu bar, a programming area, and a console:

[0054] The menu bar includes functions such as device management, file management, and code saving. The device management function can be used to view the status of connected Raspberry Pi development boards and external electronic devices, such as whether they are online and their device models; the file management function supports operations such as creating, deleting, renaming, copying, and pasting programming files; the code saving function can save the written programs to the cloud server for easy viewing and editing later.

[0055] The programming area includes Scratch, Python, and C++ programming sub-areas:

[0056] The Scratch programming sub-section builds upon the standard Scratch by adding support for the Raspberry Pi development board. It provides dedicated building blocks for controlling the Raspberry Pi and external electronic devices. Students can write programs by assembling these blocks to control the hardware and perform corresponding operations. Figure 2 The example shown is a Scratch programming example that sets port 20 of the Raspberry Pi development board to a high level (if an LED is connected to port 20, the LED will light up), and simultaneously displays the ultrasonic ranging data.

[0057] The Python programming sub-area supports Python code editing, keyword highlighting, and provides features such as code auto-completion and syntax checking, offering students a superior programming experience. Figure 3 The example shown is a Python code example that uses the RPi.GPIO module to control the voltage of port 20 on the Raspberry Pi development board to a high level (if an LED is connected to port 20, the LED will light up), and outputs the status data of port 20.

[0058] The C++ programming sub-area supports C++ code editing, also supports keyword color display, and provides code compilation and execution functions. For example... Figure 4 The example shown is a C++ code example that uses the wiringPi module to control the voltage of port 20 to a high level (if an LED is connected to port 20, the LED will light up).

[0059] The console serves as an input / output area, allowing users to input data needed during program execution, output program error messages and debugging logs, or print acquired hardware data (such as temperature values ​​returned by temperature sensors or distance values ​​returned by ultrasonic sensors). When errors occur during program execution, the console displays the corresponding error messages and error locations, helping students quickly troubleshoot. When the program requires user input parameters, input boxes appear on the console for users to enter data. Data returned by hardware devices is also displayed on the console in real time, allowing students to easily view the programming results.

[0060] The cloud server communicates with the online programming platform to store student-written program code, user information, device binding information, and other data. The cloud server employs high-performance storage devices and a secure database management system to ensure data security and reliability. Students can save their programs to the cloud server at any time, and can also retrieve previously saved programs from the cloud server for editing and running.

[0061] Example 2

[0062] A method for using an online hardware programming system based on an online editor and a Raspberry Pi, applied to the system described in Example 1, includes the following steps:

[0063] Step S1: Environmental Preparation

[0064] 1) Burn the service programs (including network configuration service, code interpretation service, and basic services) to the TF card. You can use common TF card burning software such as Etcher. During the burning process, ensure a stable connection between the TF card and the computer to avoid burning failure.

[0065] 2) Insert the TF card into the card slot of the Raspberry Pi development board and turn on the power to start the Raspberry Pi. The power interface of the Raspberry Pi development board is MicroUSB or Type-C. After the power is turned on, the Raspberry Pi will start automatically. The indicator light will flash during the startup process, and will remain on after successful startup.

[0066] 3) Configure the network for the Raspberry Pi: In a WiFi environment, use a computer (or mobile phone, tablet, or other terminal device) connected to the same WiFi network to access the Raspberry Pi's network configuration service by entering the URL (e.g., http: / / raspberrypi.local:8888) in a browser. The network configuration service will return a list of nearby WiFi networks. Select the target WiFi network, enter the password, and click the connect button. The Raspberry Pi will then successfully connect to the network. After successful connection, the Raspberry Pi will obtain an IP address within the local area network. Users can then connect to the Raspberry Pi development board through the online programming platform using this IP address.

[0067] Step S2: Code Writing and Running

[0068] 1) Students log in to the online programming platform using browsers on computers, mobile phones, or other terminal devices. Login methods include account and password login, WeChat login, QQ login, etc. After successful login, students will enter the main interface of the online programming platform.

[0069] 2) Connecting Smart Hardware: In the device management function of the online programming platform, enter the IP address of the Raspberry Pi development board and click the connect button to establish a communication connection between the online programming platform and the Raspberry Pi development board. After a successful connection, the platform will display the status information of the Raspberry Pi development board and external electronic devices.

[0070] 3) Choose the target programming language: Based on the student's age and learning needs, choose Scratch, Python, or C++. Students in grades 1-3 can choose Scratch for graphical programming; students in grade 4 and above can choose Python or C++ for code programming.

[0071] 4) Write the program in the programming area:

[0072] If you choose the Scratch programming language, you can write programs by dragging and dropping blocks in the Scratch programming sub-area. For example, Figure 5 The Scratch program example shown connects an LED to port 25 of the Raspberry Pi development board and a touch switch to port 26. The program sets port 25 to output mode (OUT) and port 26 to input mode (IN). It continuously monitors port 26. If it is high, the switch is pressed. If port 25 is high (LED is on), the LED is turned off (set to low level). If port 25 is low (LED is off), the LED is turned on (set to high level).

[0073] For example Figure 6 The Scratch program example shown connects an LED to port 22 of the Raspberry Pi development board. The program sets port 22 to output mode (OUT), first setting the PWM value of port 22 to 100 (the dimmest light), and then looping 50 times, changing the output value each time to gradually brighten the light.

[0074] If you choose the Python programming language, write your Python code in the Python programming sub-section. For example, Figure 7The Python program example shown connects an ultrasonic sensor to a Raspberry Pi development board. Port 20 of the development board is connected to the ultrasonic transmitter, and port 21 is connected to the ultrasonic receiver. The program sets port 20 to output mode and port 21 to input mode, allowing the output port to emit ultrasonic waves and record the time, the receiver to receive the ultrasonic waves and record the time, and calculates and outputs the distance based on the ultrasonic ranging principle.

[0075] For example Figure 8 The Python program example shown connects a fan module to a Raspberry Pi development board. The development board's pin 25 is connected to the fan module's INA port, and pin 2 is connected to the fan module's INB port. The program sets both pins 25 and 2 as output ports, sets pin 25 to a high level and pin 2 to a low level to make the fan rotate in the forward direction. After 10 seconds, it sets both ports to a low level to stop the fan from rotating.

[0076] If you choose the C++ programming language, write your C++ code in the C++ programming sub-area. For example, Figure 9 The C++ program example shown connects a fan module to a Raspberry Pi development board. The development board's pin 25 is connected to the fan module's INA port, and pin 2 is connected to the fan module's INB port. The program sets both pins 25 and 2 as output ports, sets pin 25 to a high level and pin 2 to a low level to make the fan rotate in the forward direction, and finally sets both ports to a low level to stop the fan from rotating.

[0077] For example Figure 10 The C++ program example shown connects a tri-color LED to a Raspberry Pi development board. Port 3 is connected to the R output (red) of the tri-color LED, port 4 to the G output (green), and port 5 to the B output (blue). The program calls the C++ SoftPwm library to precisely control the brightness of the three LEDs. The user inputs three numbers, corresponding to the brightness of the red, green, and blue LEDs, and controls the brightness of the three LEDs according to the user's input, creating different colors.

[0078] 5) Click the Run button in the programming area to send the written code to the Raspberry Pi development board's code interpretation service.

[0079] Step S3: The code interpretation service parses the code and controls the Raspberry Pi development board to drive external electronic devices to perform corresponding operations, and the console outputs relevant information in real time.

[0080] After receiving the code from the online programming platform, the code interpretation service parses it according to the programming language type:

[0081] When the programming language is Scratch, the code interpretation service calls specific functions according to the building blocks, generates instructions that the Raspberry Pi development board can recognize, controls the Raspberry Pi development board to drive external electronic devices to perform corresponding operations, such as turning LEDs on and off, and rotating fans, and at the same time feeds the operation results and hardware return data back to the console of the online programming platform in real time.

[0082] When the programming language is Python, the code interpretation service uses the Python interpreter to parse the code, execute code instructions line by line, control the Raspberry Pi development board and external electronic devices, and output error messages, debugging logs and hardware data during program execution to the console.

[0083] When the programming language is C++, the code interpretation service uses a C++ compiler to compile the code into an executable file, and then runs the executable file on the Raspberry Pi development board to drive external electronic devices to perform corresponding operations, while outputting the results to the console.

[0084] Students can check the program's running status through the console. If an error occurs, they can troubleshoot and modify the code based on the error message displayed on the console. If the program runs normally, they can observe the actions of the external electronic device and the hardware data output by the console to verify the programming effect.

[0085] Step S4: Save the code

[0086] While writing programs, students can click the save button in the online programming platform's menu bar at any time to save their programs to the cloud server. When saving, students can name the program, choose the save path, and select a version for easy retrieval and management later. Programs saved to the cloud server are linked to the student's account, allowing them to view and edit saved programs on any internet-connected device.

[0087] In summary, the core advantage of this technical solution is that it builds an integrated programming learning system suitable for students of all ages through software and hardware integration and multi-language adaptation. This not only solves the pain points of existing solutions such as single programming language and software and hardware separation, but also lowers the threshold for learning programming and enhances the fun and continuity of learning.

[0088] Integrating software and hardware programming for unified learning: This invention allows students to perform pure software programming on a single platform, experiencing the charm of code-based algorithms and data structures, while also controlling the Raspberry Pi development board and external electronic devices. The intuitive hardware effects provide a better understanding of how the code works. For example, when using graphical programming, students can make characters on a stage perform corresponding actions while simultaneously lighting up LEDs on the development board, providing greater room for imagination and creativity, and stimulating their learning interest and innovative thinking.

[0089] Supports multilingual programming, adaptable to students of different ages: This invention's online programming platform supports three programming languages: Scratch, Python, and C++, meeting the learning needs of students at different age levels. Lower elementary school students (grades 1-3) have weaker abstract thinking skills and are well-suited for graphical programming with Scratch; students in grade 4 and above, whose abstract thinking is gradually developing, can learn Python or C++ code programming to cultivate logical thinking abilities. Students progress from graphical programming to code programming on a familiar platform, aligning with their psychological and cognitive development, reducing frustration caused by English vocabulary and fixed grammar, and achieving a smooth transfer of knowledge.

[0090] Real-time input / output enhances the programming experience: The program of this invention provides real-time input / output functionality. Students can input parameters during program execution, dynamically control hardware devices, and obtain data returned by the hardware in real time. For example, in ultrasonic ranging programming, students can view the distance data returned by the sensor in real time; in tri-color LED programming, students can input different brightness values ​​and observe the color changes of the LED in real time. Real-time interactive feedback allows students to understand the program's running effect immediately, increasing the fun and engagement of programming.

[0091] By leveraging intuitive hardware effects, the learning curve is reduced: For students just beginning to learn programming, abstract programming concepts can be difficult to grasp. This invention utilizes the intuitive physical circuit phenomena of the Raspberry Pi development board and external electronic devices to transform abstract programming concepts into concrete hardware actions, making them easier for students to understand. For example, controlling an LED to turn on and off helps them understand conditional statements, and controlling a fan to turn on helps them understand loop statements, making programming learning more vivid and engaging, reducing the learning difficulty, and improving learning efficiency.

[0092] Supports cloud-based code saving for convenient and flexible use: Students can save their code to the cloud server at any time during the programming process, without worrying about code loss due to local device malfunctions. Simultaneously, students can log in to the online programming platform from any internet-connected device to view and edit the saved code, enabling them to learn programming anytime, anywhere, thus improving the flexibility and convenience of their learning.

[0093] The system architecture is stable and the operation is simple and quick: The system of this invention uses a Raspberry Pi development board as the hardware core, pre-installed with a Linux operating system, which is highly stable and highly compatible; the service program implements data transmission based on HTTP and WebSocket protocols, ensuring the real-time performance and reliability of data transmission; the online programming platform is developed based on a browser, requiring no additional software installation, and students can log in and use it through browsers on terminal devices such as computers and mobile phones, making the operation simple and quick and lowering the threshold for use.

[0094] In addition, the online programming platform also supports program sharing, allowing students to share their programs with other users and receive programs shared by other users, thus facilitating learning exchange and resource sharing.

[0095] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An online hardware programming system based on an online editor and a Raspberry Pi, characterized in that, The system includes a Raspberry Pi development board, external electronic devices, service programs installed on the Raspberry Pi, a browser-based online programming platform, and a cloud server. The external electronic devices are connected to the Raspberry Pi development board. The online programming platform communicates with the service programs on the Raspberry Pi via a network, and the cloud server communicates with the online programming platform. The service programs include network configuration services, code interpretation services, and basic services. The online programming platform supports programming operations in at least three programming languages, including graphical programming languages, scripting programming languages, and compiled programming languages.

2. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The Raspberry Pi development board comes pre-installed with a Linux-based operating system. The external electronic devices include sensors and output devices. The sensors are used to acquire external signals, and the output devices are used to execute instructions sent by the Raspberry Pi development board.

3. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The network configuration service listens to a preset port and connects the Raspberry Pi development board to the local area network based on the HTTP protocol. When it receives an HTTP request to access the preset port, it returns the scanned WiFi information for the user to set up the connection.

4. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The code interpretation service listens on a specified port, transmits data based on the WebSocket protocol, receives code sent by the online programming platform, calls the corresponding parsing method according to the programming language type to interpret the code line by line, and sends execution instructions to the Raspberry Pi development board.

5. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The basic services are used to enable OTA upgrades and device binding functions for service programs on the Raspberry Pi development board. The menu bar of the online programming platform includes device management, file management, and code saving functions.

6. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The programming area of ​​the online programming platform includes a graphical programming sub-area, a script programming sub-area, and a compiled programming sub-area. The graphical programming sub-area adds support for the Raspberry Pi development board on the basis of standard graphical programming tools. The script programming sub-area and the compiled programming sub-area support keyword color display.

7. The online hardware programming system based on an online editor and Raspberry Pi according to claim 1, characterized in that, The console of the online programming platform has input and output functions, which are used to input the data required for program execution, output program error information, debugging logs, and data returned by the hardware.

8. A method of using an online hardware programming system based on an online editor and a Raspberry Pi, applied to the system described in any one of claims 1-7, characterized in that, Includes the following steps: Step S1: Environment preparation. Burn the service program containing network configuration service, code interpretation service and basic service to the TF card. Insert the TF card into the Raspberry Pi development board and start it. Configure the Raspberry Pi development board to connect to the local area network. Step S2: Code writing and running. Users log in to the online programming platform through a browser, select the target programming language, write the program in the programming area, and click the run button to send the code to the code interpretation service of the Raspberry Pi development board. Step S3: The code interpretation service parses the code and controls the Raspberry Pi development board to drive external electronic devices to perform corresponding operations, and the console outputs relevant information in real time; Step S4: Code saving. Users can save their written programs to the cloud server using the save function of the online programming platform.

9. The method of use according to claim 8, characterized in that, The specific process of configuring the Raspberry Pi development board to connect to the local area network in step S1 is as follows: In a WiFi environment, use a terminal device connected to the target WiFi to access the network configuration service of the Raspberry Pi development board by entering the specified URL in a browser, select the target WiFi and enter the password to complete the connection between the Raspberry Pi development board and the local area network.

10. The method of use according to claim 8, characterized in that, In step S2, the target programming language is Scratch, Python, or C++. When Scratch is selected, the program is written by piecing together blocks, and the code interpretation service calls specific functions according to the blocks. When Python is selected, the code interpretation service uses the Python interpreter to parse the code. When C++ is selected, the code interpretation service uses the C++ compiler to compile the code and then executes it.