CN120956722B - A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology - Google Patents
A Programming Teaching Method and System Based on Real-Time Bidirectional Communication TechnologyInfo
- Publication number
- CN120956722B CN120956722B CN202511468115.8A CN202511468115A CN120956722B CN 120956722 B CN120956722 B CN 120956722B CN 202511468115 A CN202511468115 A CN 202511468115A CN 120956722 B CN120956722 B CN 120956722B
- Authority
- CN
- China
- Prior art keywords
- instruction
- teaching
- server
- authentication token
- user authentication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09B—EDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
- G09B23/00—Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes
- G09B23/02—Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes for mathematics
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/20—Network architectures or network communication protocols for network security for managing network security; network security policies in general
- H04L63/205—Network architectures or network communication protocols for network security for managing network security; network security policies in general involving negotiation or determination of the one or more network security mechanisms to be used, e.g. by negotiation between the client and the server or between peers or by selection according to the capabilities of the entities involved
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Educational Technology (AREA)
- Educational Administration (AREA)
- Business, Economics & Management (AREA)
- Computer Hardware Design (AREA)
- Algebra (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Electrically Operated Instructional Devices (AREA)
Abstract
The application relates to the technical field of online programming education, in particular to a programming teaching method and system based on a real-time two-way communication technology, comprising the following steps of receiving a websocket connection request initiated by a client and establishing secure connection, wherein the client comprises a teacher end and a student end; based on the established connection, the application has the advantages of ultra-low delay bidirectional interaction, real-time closed loop of instruction programming content and execution feedback, and fine-granularity programming process perception and teaching decision support, and is characterized by receiving a teaching instruction packet initiated by a teacher end and sending the teaching instruction packet to a student end of a target, receiving a disconnection request, deleting a corresponding record in strong association, wherein the disconnection request is initiated by a client end or detected by a server.
Description
Technical Field
The application relates to the technical field of online programming education, in particular to a programming teaching method and system based on a real-time two-way communication technology.
Background
With the continuous development of internet technology, online education is becoming an important component of the education field. Particularly online programming education, is receiving increasing attention from learners. The current mainstream online programming education platform generally adopts a universal live broadcast classroom architecture, and the architecture is mainly based on an audio and video live broadcast technology and is used for general discipline teaching.
The universal live broadcast classroom architecture mainly comprises a basic interaction module and a static resource distribution mechanism. The basic interaction module provides the functions of text chat, wheat connection, screen sharing and the like, aims at promoting communication between teachers and students, and the static resource distribution mechanism is to upload files such as PPT, PDF, video and the like to CDN (content distribution network), so that the students can download the static files for learning.
However, in the actual use process, the existing online programming education platform exposes a plurality of problems, which seriously affect the teaching effect and the user experience:
The programming environment is fractured, teaching continuity is interrupted, and the existing platform lacks an embedded code editor and a sandbox execution environment. This has the effect that the learner has to manually switch to the local tool for code writing and execution while performing programming learning. The frequent switching operation causes the programming environment to be incoherent, breaks the continuity of the teaching process, makes the learner difficult to keep concentrating, and influences the learning efficiency.
Programming exclusive real-time interaction capability is lost, that is, a teacher cannot push down a standardized task package containing questions and compiler configuration, and a learner can only manually paste completed codes to a chat frame or submit the codes through mail. The method is not only separated from real-time supervision, but also excessively depends on manual code checking of teachers, cannot realize real-time interaction required in programming teaching, and reduces timeliness and accuracy of teaching feedback.
The learning state perception blind area is that the platform can not provide an effective means to enable a teacher to know key data information such as a problem solving thought of a student in real time, and compile and report errors in real time, so that the teacher is difficult to accurately grasp the knowledge grasping condition of the student, and the teaching rhythm can not be adjusted in time, so that the teaching process is lack of pertinence, and the individualized learning requirement of the student can not be met.
Disclosure of Invention
In order to solve at least one of the above technical problems, the present application provides a programming teaching method and system based on a real-time two-way communication technology.
In a first aspect, the present application provides a programming teaching method based on a real-time bidirectional communication technology, which adopts the following technical scheme:
a programming teaching method based on a real-time two-way communication technology comprises the following steps:
Receiving a websocket connection request initiated by a client, and establishing secure connection, wherein the client comprises a teacher end and a student end;
receiving a teaching instruction packet initiated by a teacher end and sending the teaching instruction packet to a student end of the target based on the established connection;
Receiving a disconnection request, deleting a corresponding record in the strong association, wherein the disconnection request is initiated by a client or detected by a server;
The teaching instruction packet at least comprises an instruction name, instruction content, user ID, class ID, a target object and an instruction version, and the data structure of the feedback instruction packet is the same as that of the teaching instruction packet.
In one embodiment, the step of receiving a websocket connection request initiated by a client and establishing a secure connection specifically includes:
receiving a websocket connection request initiated by a client, wherein a request header of the connection request carries an encrypted user authentication token;
decrypting and analyzing the user authentication token, and verifying whether the user authentication token is a valid token;
If verification fails, refusing to establish websocket connection, and simultaneously recording detailed error logs, wherein the error logs comprise source IP, a requested user authentication token and failure reasons;
If verification is successful, establishing a websocket long connection channel based on a websocket connection request;
The key information analyzed in the user authentication token is strongly correlated with the long connection channel, wherein the key information comprises user ID, role information and class ID;
The method comprises the steps of providing a data structure of a user, wherein the data structure of strong association is to maintain a global and thread-safe connection session mapping table, the core structure of the mapping table is a mapping, a mapping key is designed to be capable of uniquely identifying the connection of the user in a class, and a mapping value comprises an object reference, a user ID, role information and a class ID of a corresponding long connection channel.
In one embodiment, the verification method of the user authentication token sequentially comprises the following steps:
Checking the validity of the signature in the user authentication token and whether the signature is within the validity period;
Checking whether a role field in the user authentication token accords with expectations;
Checking whether a class exists in the user authentication token and whether a user of the user authentication token belongs to the class.
In one embodiment, the steps of receiving a teaching instruction packet initiated by a teacher end and sending the teaching instruction packet to a student end of a target based on the established connection, and receiving a feedback instruction packet initiated by the student end and sending the feedback instruction packet to the teacher end of the target specifically comprise:
Acquiring a teaching instruction packet sent by a teacher end;
Analyzing the teaching instruction packet, and verifying whether the user ID obtained by analysis is a teacher based on the mapping table, if so, pushing the teaching instruction packet to a long connecting channel corresponding to the target in a high-efficiency and concurrent manner based on the mapping table through the target object obtained after analysis;
acquiring a feedback instruction packet of a student end;
And analyzing the feedback instruction packet, and pushing the feedback instruction packet to a long connecting channel corresponding to the target based on the mapping table through the target object obtained after analysis.
In one embodiment, the programming teaching method further comprises the steps of monitoring the sending state of the instruction after the instruction is sent, storing the failure instruction and metadata thereof into a persistent queue to be retried, and retransmitting the failure instruction based on a preset rule of the queue to be retried;
The metadata comprises the current retry times and priority level identifiers;
the preset rule comprises an instruction priority and a retry strategy, and the retry strategy of the queue to be retried is configured differently according to the instruction priority.
In one embodiment, the step of retransmitting the failure instruction based on the preset rule of the queue to be retried specifically includes:
Starting one or more background timing task scanning waiting queues;
Calculating the time point of the next retry according to the retry level and the current retry times of the instruction, and when the instruction reaches the retry time point, the background timing task retries to send the instruction;
if the transmission is successful, removing the instruction from the queue to be retried;
If the sending fails, updating the metadata of the instruction, and putting the metadata back into a queue to be retried to wait for the next retry;
When the retry times of the instruction reach the maximum retry times set corresponding to the priority levels of the instruction, removing the queue to be retried, not retried, and recording a detailed failure log, and marking the detailed failure log as final delivery failure, wherein the failure log comprises instruction content, a target, failure reasons and retry history;
and when the instruction is marked as the final delivery failure, sending prompt information to a client receiving the instruction.
In one embodiment, the programming teaching method further comprises a reconnection mechanism based on an exponential backoff algorithm between the server and the client, wherein the reconnection mechanism specifically comprises:
when the client monitors that the connection state of the websocket is disconnected, immediately performing a first reconnection attempt;
If the first attempt fails, the subsequent reconnection attempt interval is calculated according to any one of the following formulas *;
Current delay =** (1 + jitter * (random() * 2 - 1));
In the formula,Referring to initial delay, a refers to backoff factor, e refers to current retry number, jitter is a coefficient between 0 and 1, and random () generates a random number between 0 and 1;
and when the connection is successfully established, the preset maximum reconnection times are reached, or the client actively cancels reconnection, terminating reconnection.
In a second aspect, the present application provides a programming teaching method based on a real-time two-way communication technology, which adopts the following technical scheme:
a programming teaching method based on a real-time two-way communication technology comprises the following steps:
A websocket connection request is sent to a server through a teacher end to initiate a classroom;
Creating a teaching instruction through a teacher end, and packaging the teaching instruction into a structured and standardized teaching instruction packet, wherein the teaching instruction comprises question pushing, code editing, document displaying, screen sharing starting/stopping and voice control;
based on the connection established with the server, sending a teaching instruction packet to the server and receiving a feedback instruction packet sent by the server;
Analyzing the received feedback instruction packet based on the connection established with the server, and visually presenting the learning condition of the student after rendering, wherein the feedback instruction packet is characterized by the state and the result of interactive operation of the student based on the teaching instruction packet;
and when the teaching instruction packet fails to be sent, receiving prompt information sent by the server.
In a third aspect, the present application provides a programming teaching method based on a real-time bidirectional communication technology, which adopts the following technical scheme:
a programming teaching method based on a real-time two-way communication technology is characterized by comprising the following steps:
a websocket connection request is sent to a server through a student terminal to enter a class;
receiving a teaching instruction packet sent by a server based on connection established with the server, wherein the teaching instruction packet comprises an instruction name, instruction content, user ID, class ID, a target object and an instruction version;
Analyzing the teaching instruction packet to obtain instruction names and instruction contents and triggering local operation, wherein the local operation comprises the steps of requesting the details of the questions from a data storage module, rendering an integrated editor window in a browser to display programming questions, starting a screen sharing function and receiving video streams of a teacher end;
The interactive operation is carried out based on the teaching instruction packet, and the state and the result of the interactive operation are packaged into a feedback instruction packet, wherein the state and the result of the interactive operation comprise the steps of submitting a programming question answer, running a code result, sending a text message, automatically testing a report, editing a code and applying for speaking by voice;
based on the connection established with the server, sending a feedback instruction packet to the server;
and when the feedback instruction packet fails to be sent, receiving prompt information sent by the server.
In a fourth aspect, the present application provides a programming teaching system based on a real-time bidirectional communication technology, which adopts the following technical scheme:
A programming teaching system based on real-time two-way communication technology, comprising:
the teacher end is used for establishing websocket connection with the server end to initiate a classroom, generating a teaching instruction packet to a student end corresponding to a target through the server end, receiving a feedback instruction packet sent from the server end, and visually presenting the feedback instruction packet;
The student end is used for establishing websocket connection with the server end, receiving a teaching instruction packet through the server end and triggering corresponding local operation;
The server side comprises a data storage module and a Websocket communication service module based on a Netty framework, wherein the data storage module is used for storing static data and interactive data, and the Websocket communication service module is used for establishing connection with a student side and a teacher side and realizing data transmission between the student side and the teacher side.
In summary, the application has the following beneficial effects:
1. programming-driven ultra-low delay bidirectional interaction, namely millisecond-level interaction with surrounding codes as cores between teachers and students is realized. The key support teacher end pushes programming questions and online IDE environment in real time, dynamically issues code examples/fragments, accurately starts/stops code execution environment and the like. Timely feeding back code editing behaviors, triggering code running and submitting programming answers by a student end;
2. The instruction programming content and the real-time closed loop for executing feedback are that core elements of programming teaching such as title description, initial code skeleton, test case set, sandbox environment configuration and code control command are packaged into standardized light instructions, and the standardized light instructions are pushed to a student end Integrated Development Environment (IDE) in real time and accurately through a websocket channel;
Meanwhile, core programming behavior feedback of a student end is timely captured and returned, particularly, a code sandbox execution result day standard output, compiling/running errors, debugging information, resource consumption and the like are achieved, and automatic test reports such as use case passing rate, detailed error information and the like and answer codes submitted finally are reported;
3. The fine-granularity programming process perception and teaching decision support is that in the programming practice process of students, a system collects and analyzes programming behavior data streams such as code editing frequency and mode, operation/debugging try times and results, specific error types such as grammar, logic, conditions occurrence frequency during operation and the like, test cases pass through conditions, answer time and the like, and visual presentation is performed through a teacher interface, so that teachers can be capable of observing understanding depth and practice barriers of students in whole class to current programming knowledge points in real time, accurately identifying student groups trapped in dilemma or having a common error mode, and based on real and dynamic programming process data, timely adjusting teaching rhythm and contents such as specific common errors, pushing auxiliary code fragments and adjusting question difficulty, thereby remarkably improving programming teaching efficiency and learning success rate and reducing learning frustration caused by feedback delay.
Drawings
FIG. 1 is a flow chart of a programming teaching method based on a real-time two-way communication technique provided by one embodiment;
FIG. 2 is a flowchart of a programming teaching method based on a teacher-side real-time two-way communication technology according to another embodiment;
FIG. 3 is a flowchart of a method for programming teaching based on a student-side real-time two-way communication technique according to one embodiment;
fig. 4 is a logic block diagram of a programming teaching system based on a real-time bi-directional communication technique provided by an embodiment.
In the figure, 10 parts of teacher end, 20 parts of student end, 30 parts of Websocket communication service module and 40 parts of data storage module.
Detailed Description
The present application will be described in further detail with reference to the accompanying drawings.
The present application will be described and illustrated with reference to the accompanying drawings and examples for a clearer understanding of the objects, technical solutions and advantages of the present application. However, it will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In some instances, well known methods, procedures, systems, components, and/or circuits have been described at a high-level so as not to obscure aspects of the present application with unnecessary description. It will be apparent to those having ordinary skill in the art that various changes can be made to the disclosed embodiments of the application and that the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the application. Thus, the present application is not limited to the embodiments shown, but is to be accorded the widest scope consistent with the scope of the application as claimed.
The description of these embodiments is provided to assist understanding of the present invention, but is not intended to limit the present invention. In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
In the description of the present application, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number. The description of the first and second is only for the purpose of distinguishing between technical features and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present application, the descriptions of the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic line representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
As shown in fig. 1, a programming teaching method based on a real-time two-way communication technology includes the following steps:
S100, receiving a websocket connection request initiated by a client, and establishing secure connection, wherein the client comprises a teacher end 10 and a student end 20.
In this step, the establishment of the secure connection specifically comprises the steps of:
Receiving a websocket connection request initiated by a client, wherein a request head of the connection request carries an encrypted user authentication token, the user authentication token comprises a user ID, role information, a classroom ID and the like, and the role information comprises two types of students and teachers. In addition, in this embodiment, the request header refers to specific information carried in the request message header of the connection request.
Decrypting and parsing the user authentication token and verifying whether the user authentication token is a valid token. The verification method of the user authentication token sequentially comprises the steps of checking the validity of a signature in the user authentication token and whether the signature is in a validity period, checking whether a role field in the user authentication token accords with expectations, checking whether a class exists in the user authentication token and whether a user of the user authentication token belongs to the class.
If verification fails, the websocket connection is refused to be established, and meanwhile, a detailed error log is recorded, wherein the error log comprises a source IP, a requested user authentication token and a failure reason, and is used for security audit and problem investigation in the step.
If verification is successful, a websocket long connection channel is established based on a websocket connection request, wherein verification is judged to be successful only when three steps of verification pass in the verification method.
And carrying out strong association on the long connection channel and key information analyzed in the user authentication token, wherein the key information comprises user ID, role information and class ID.
The core structure of the mapping table is a mapping, and the mapped key is designed to be capable of uniquely identifying the connection of a user in a class, in this embodiment, the key is a combined string of class ID and user ID. The mapped values contain the object reference, user ID, role information, and class ID of the corresponding long connection channel.
By way of example, taking teacher T123 as an example to establish a connection in class C1001, its key is C1001:T123, whose value is:
{channel:channel,useId:T123,role:teacher,classroomId:C1001}。
if student S456 establishes a connection in class C1001, then the key is C1001:S456, which has the value:
{channel:channel,useId:S456,role:student,classroomId:C1001}。
S200, based on the established connection, receiving a teaching instruction packet initiated by the teacher end 10 and sending the teaching instruction packet to the student end 20 of the target, and receiving a feedback instruction packet initiated by the student end 20 and sending the feedback instruction packet to the teacher end 10 of the target.
The method specifically comprises the following steps:
The method comprises the steps of obtaining a teaching instruction packet sent by a teacher end 10, analyzing the teaching instruction packet, verifying whether a user ID obtained through analysis is a teacher based on a mapping table, and if so, pushing the teaching instruction packet to a long connecting channel corresponding to a target in a high-efficiency and concurrent mode based on the mapping table through a target object obtained through analysis.
And analyzing the feedback instruction packet, and pushing the feedback instruction packet to a long connecting channel corresponding to the target based on the mapping table through the target object obtained after analysis.
In this embodiment, the instruction for teaching is initiated by the teacher end 10, and includes instructions for question pushing, code editing, document showing, screen sharing start/stop, voice control, text message, roll call, and the like. The instruction package is formed after the instruction is packaged in the teacher end 10, and at least comprises an instruction name, instruction content, user ID, class ID, a target object and an instruction version.
When verifying whether the user ID is a teacher, comparing the user ID obtained after analysis according to the user ID, role information and the channel in the class stored in the mapping table, and verifying whether the role information corresponding to the user ID is the teacher. This step is set up for the purpose of preventing malicious clients from forging teacher instructions.
Preferably, the data structure of the feedback instruction packet is the same as the data structure of the teaching instruction packet.
And S300, receiving a disconnection request, and deleting a corresponding record in the strong association, wherein the disconnection request is initiated by the client or detected by the server.
In this step, the disconnection request is mainly initiated by the client, or detected by the server due to the client being offline, powered off, etc.
In one embodiment, the programming teaching method further includes the steps of:
after an instruction is sent, the sending state of the instruction is monitored, the failure instruction and metadata thereof are stored into a persistent queue to be retried, and the failure instruction is resent based on a preset rule of the queue to be retried.
Wherein, the instructions in the steps above refer to feedback instruction packets and teaching instruction packets sent by webocket communication modules.
The main purpose of this step is to strictly monitor the sending state of the instruction packet, if the channel asynchronously returns to the successful state, the instruction has been successfully sent, and record the sending success log. If a channel is detected as unwritable or thrown exception, the transmission fails.
In addition, the metadata includes a current retry number and a priority level identification. The preset rule comprises an instruction priority and a retry strategy, and the retry strategy of the queue to be retried is configured differently according to the instruction priority, wherein the retry strategy comprises an initial interval, a backoff factor and a maximum number of times.
In the embodiment, the high priority is a real-time interaction instruction with high timeliness requirements such as starting lessons, ending lessons, forcing winding and the like, the medium priority is answer feedback, screen sharing and the like, and the low priority is a non-key state synchronization and log instruction.
For retry strategies, it is preferred that high priority instructions use a shorter initial interval, a larger backoff factor, a larger number of times. In addition, the retry interval calculation may be performed by an exponential backoff, but the parameter may be set in a priority level.
In addition, the step of retransmitting the failure instruction based on the preset rule of the queue to be retried in the present embodiment specifically includes:
Starting one or more background timing task scanning waiting queues;
Calculating the time point of the next retry according to the retry level and the current retry times of the instruction, and when the instruction reaches the retry time point, the background timing task retries to send the instruction;
if the transmission is successful, removing the instruction from the queue to be retried;
If the sending fails, updating the metadata of the instruction, and putting the metadata back into a queue to be retried to wait for the next retry;
When the retry times of the instruction reach the maximum retry times set corresponding to the priority levels of the instruction, removing the queue to be retried, not retried, and recording a detailed failure log, and marking the detailed failure log as final delivery failure, wherein the failure log comprises instruction content, a target, failure reasons and retry history;
and when the instruction is marked as the final delivery failure, sending prompt information to a client receiving the instruction.
In another embodiment, the programming teaching method further includes providing a reconnection mechanism between the server and the client based on an exponential backoff algorithm.
The reconnection mechanism specifically comprises:
when the client monitors that the connection state of the websocket is disconnected, immediately performing a first reconnection attempt;
If the first attempt fails, the subsequent reconnection attempt interval is calculated according to any one of the following formulas *;
Current delay =** (1 + jitter * (random() * 2 - 1));
In the formula,Referring to initial delay, a refers to backoff factor, e refers to current retry number, jitter is a coefficient between 0 and 1, and random () generates a random number between 0 and 1;
and when the connection is successfully established, the preset maximum reconnection times are reached, or the client actively cancels reconnection, terminating reconnection.
In this embodiment, the calculation is preferably performed by using the formula two, in which jitter is introduced, and the main purpose of the formula is to increase a random jitter value on the calculated basic interval in order to avoid that a plurality of clients are reconnected at exactly the same interval due to simultaneous disconnection, which leads to the instantaneous load increase of the server.
The embodiment systematically designs a mechanism combining automatic reconnection of the client and reliable delivery of the server instruction through the end-to-end enhancement system design facing the weak network environment. The key to this embodiment is to sink the retry logic to the communication module core layer rather than simply processing at the application layer.
As shown in fig. 2, in another embodiment, a programming teaching method based on a real-time two-way communication technology is disclosed, which includes the following steps:
S101, a websocket connection request is sent to a server through a teacher end 10 to initiate a classroom.
S201, a teaching instruction is created through a teacher end 10 and is packaged into a structured and standardized teaching instruction packet, wherein the teaching instruction comprises question pushing, code editing, document displaying, screen sharing starting/stopping and voice control, and the teaching instruction packet comprises an instruction name, instruction content, a user ID, a class ID, a target object and an instruction version.
S301, based on connection established with the server, a teaching instruction packet is sent to the server, and a feedback instruction packet sent by the server is received.
S401, analyzing the received feedback instruction packet based on connection established with the server, and visually presenting the learning condition of the student after rendering, wherein the feedback instruction packet is characterized as a state and a result of interactive operation of the student terminal 20 based on the teaching instruction packet.
S501, when the instruction packet fails to be sent, receiving prompt information sent by the server.
In this embodiment, the client provides a teaching console interface based on the application of the browser. The function comprises the steps of initiating/managing a classroom, creating/sending teaching instructions, receiving real-time feedback data of students and visually presenting learning conditions of the students.
Specifically, websocket connection is performed with the server, and efficient transmission is performed through Websocket long connection. The core elements of programming teaching such as title description, initial code skeleton, test case set, sandbox environment configuration and code control command are packaged into standardized lightweight instructions, and the standardized lightweight instructions are precisely pushed to a student end 20 Integrated Development Environment (IDE) in real time through a websocket channel. The problems of single interaction form, poor real-time performance and complicated state synchronization of the traditional teaching platform are solved.
And timely captures and returns core programming behavior feedback of the student end 20, particularly daily standard output of code sandboxes execution results, compiling/runtime errors, debugging information, resource consumption and the like, and automated test reports such as use case passing rate, detailed error information and the like, and finally submitted answer codes.
The visual presentation of rendering on the teacher interface is performed by calling the UI component, so that a teacher can be in real time insight into understanding depth and practice obstacle of students in the whole class to the current programming knowledge point, accurately identify student groups which are in dilemma or have a common error mode, and timely adjust teaching rhythm and content such as pertinence explanation common errors, pushing auxiliary code fragments and adjusting question difficulty based on real and dynamic programming process data, thereby remarkably improving programming teaching efficiency and learning effect and reducing learning frustration caused by feedback delay.
As shown in fig. 3, in another embodiment, a programming teaching method based on a real-time two-way communication technology is disclosed, which includes the following steps:
S102, sending a websocket connection request to a server through a student terminal to enter a class;
s202, receiving a teaching instruction packet sent by a server based on connection established with the server, wherein the teaching instruction packet comprises an instruction name, instruction content, user ID, class ID, a target object and an instruction version;
S302, analyzing a teaching instruction packet to obtain an instruction name and instruction content, and triggering local operation, wherein the local operation comprises the steps of requesting the detail of the title from a data storage module, rendering an integrated editor window in a browser to display a programming title, starting a screen sharing function, and receiving a video stream of a teacher end;
S402, carrying out interactive operation based on a teaching instruction packet, and packaging the state and the result of the interactive operation into a feedback instruction packet, wherein the state and the result of the interactive operation comprise the steps of submitting a programming question answer, running a code result, sending a text message, automatically testing a report, editing a code and applying for speaking by voice;
S502, based on connection established with a server, sending a feedback instruction packet to the server;
s602, when the feedback instruction packet fails to be sent, receiving prompt information sent by the server.
The student end 20 in this embodiment provides a student learning interface based on the application of the browser or desktop end. The function comprises the steps of receiving and rendering teaching instructions pushed by teachers, carrying out interactive operation and feeding back operation results/states to the server in real time.
Specifically, after receiving the teaching instruction packet, the structured data related to the programming questions is converted into an interactive programming operation interface through local operation. Meanwhile, in the programming practice process of students, the system collects and analyzes programming behavior data streams such as code editing frequency and mode, running/debugging try times and results, specific error types such as grammar, logic, running time and the like, test case passing conditions, answering time and the like in real time.
As shown in fig. 4, in another embodiment, a programming teaching system based on a real-time two-way communication technology is disclosed, comprising:
The teacher end 10 is used for establishing websocket connection with the server end to initiate a classroom, generating a teaching instruction packet to the student end 20 corresponding to the target through the server end, receiving a feedback instruction packet sent from the server end, and visually presenting the feedback instruction packet;
The student end 20 is used for establishing websocket connection with the server end, receiving a teaching instruction packet through the server end and triggering corresponding local operation;
The server side comprises a data storage module 40 and a Websocket communication service module 30 based on a Netty framework, wherein the data storage module 40 is used for storing static data and interactive data, and the Websocket communication service module 30 is used for establishing connection with the student side 20 and the teacher side 10 and realizing data transmission between the student side 20 and the teacher side 10.
By adopting a high-performance and high-reliability communication engine driven by netty asynchronous events and adopting a websocket communication core constructed by a netty framework, the Reactor thread model is fully utilized, and mass concurrency can be managed by using a small number of threads. Meanwhile, all network operations such as connection establishment, authentication, instruction reading and writing and the like are asynchronous, thread blocking is avoided, and throughput and resource utilization rate are greatly improved.
The static data comprises course outline, question library such as question ID, question content, standard answer, knowledge point label, compiler template configuration, etc., and teaching data, etc. The interaction data includes class instance information, student answer records such as student ID, question ID, submitted answer/code, running results, time spent, score, time stamp, etc., instruction logs such as for auditing and retrying, user connection status logs, etc.
The Websocket communication service module 30 based on the Netty framework is used for realizing programming-driven ultralow-delay bidirectional interaction, and realizing millisecond-level interaction with surrounding codes as cores between teachers and students. The key support is that the teacher end 10 pushes programming questions and online IDE environments in real time, dynamically issues code examples/fragments, accurately starts/stops code execution environments, and the like. And the student terminal 20 feeds back the code editing behavior, triggers the code running and submits the programming answers in time.
The embodiments of the present application are all preferred embodiments of the present application, and are not limited in scope by the present application, so that all equivalent changes according to the structure, shape and principle of the present application are covered by the scope of the present application.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202511468115.8A CN120956722B (en) | 2025-10-15 | 2025-10-15 | A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202511468115.8A CN120956722B (en) | 2025-10-15 | 2025-10-15 | A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN120956722A CN120956722A (en) | 2025-11-14 |
| CN120956722B true CN120956722B (en) | 2026-01-30 |
Family
ID=97613421
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202511468115.8A Active CN120956722B (en) | 2025-10-15 | 2025-10-15 | A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120956722B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111245705A (en) * | 2019-12-31 | 2020-06-05 | 中国电力科学研究院有限公司 | A method for real-time communication between server and client for training simulation |
| WO2020168571A1 (en) * | 2019-02-22 | 2020-08-27 | 深圳市欢太科技有限公司 | Device control method, apparatus, system, electronic device and cloud server |
| CN113518105A (en) * | 2021-03-31 | 2021-10-19 | 阿里巴巴新加坡控股有限公司 | Data transfer method, device and system |
| CN120768652A (en) * | 2025-07-30 | 2025-10-10 | 广州朗国电子科技股份有限公司 | A system for dynamically adjusting grouping across devices in real time |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9866545B2 (en) * | 2015-06-02 | 2018-01-09 | ALTR Solutions, Inc. | Credential-free user login to remotely executed applications |
| CA3002977C (en) * | 2015-11-04 | 2019-01-08 | Screening Room Media, Inc. | Digital content delivery system |
| WO2020168499A1 (en) * | 2019-02-20 | 2020-08-27 | 深圳市鹰硕技术有限公司 | Screen-sharing teaching method, apparatus and system, and smart device and storage medium |
| CN117519626A (en) * | 2023-11-07 | 2024-02-06 | 鸿湖万联(江苏)科技发展有限公司 | Collaborative display method and system based on graphical programming platform |
| AU2025200851A1 (en) * | 2024-02-09 | 2025-08-28 | Touchless Holdings, L.P. | Systems, methods, and devices for optimized web content delivery |
-
2025
- 2025-10-15 CN CN202511468115.8A patent/CN120956722B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020168571A1 (en) * | 2019-02-22 | 2020-08-27 | 深圳市欢太科技有限公司 | Device control method, apparatus, system, electronic device and cloud server |
| CN111245705A (en) * | 2019-12-31 | 2020-06-05 | 中国电力科学研究院有限公司 | A method for real-time communication between server and client for training simulation |
| CN113518105A (en) * | 2021-03-31 | 2021-10-19 | 阿里巴巴新加坡控股有限公司 | Data transfer method, device and system |
| CN120768652A (en) * | 2025-07-30 | 2025-10-10 | 广州朗国电子科技股份有限公司 | A system for dynamically adjusting grouping across devices in real time |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120956722A (en) | 2025-11-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6654699B2 (en) | Computer network testing system and method using client playback of edited network information | |
| CN111949822A (en) | An intelligent educational video service system based on cloud computing and mobile terminal and its operation method | |
| CN106844667B (en) | A method of mobile terminal test question distribution and answering based on MQTT protocol | |
| US20030182446A1 (en) | Data communication method, data communication system, data communication program and recording medium | |
| CN112187585A (en) | Network protocol testing method and device | |
| CN106488301A (en) | Screen recording method and device, and video playback method and device | |
| CN103473297A (en) | Multimedia question-answering system and method based on intelligent mobile terminal | |
| CN113672502B (en) | Program multi-system testing method and its corresponding devices, equipment and media | |
| US20030120463A1 (en) | Scenario based testing and load generation for web applications | |
| KR20210038971A (en) | Curriculum package development method and device, system, device and storage medium | |
| CN115225410B (en) | An independent dynamic network security shooting range system, equipment and application method thereof | |
| CN115134553A (en) | Data transmission method and device, electronic equipment and storage medium | |
| US20040172253A1 (en) | Capture and playback web automation tool | |
| CN120956722B (en) | A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology | |
| CN113077670A (en) | Interactive online training method | |
| CN114390112B (en) | Rail transit emergency response method, device, electronic equipment and storage medium | |
| CN108200452A (en) | A kind of online play system of web video and its control method for preventing from downloading | |
| CN107071535A (en) | The Android players and its automation check system and method downloaded based on multiple spot | |
| CN107632935A (en) | A kind of software systems method for testing pressure, device, equipment and storage medium | |
| CN1624678A (en) | interactive learning system | |
| CN114416597B (en) | Method and device for generating test case records | |
| CN101809535A (en) | Method for providing contents to client and server using the same | |
| CN109446102B (en) | An event-based test script scheduling method and system | |
| JP4696744B2 (en) | Program test apparatus, method, and program | |
| CN114443497A (en) | Counter system test method, device, equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |