[go: up one dir, main page]

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 Technology

Info

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
Application number
CN202511468115.8A
Other languages
Chinese (zh)
Other versions
CN120956722A (en
Inventor
韩潇
徐传泰
李淑英
邱立
葛乐波
余昭胜
马委斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Xiaoma Education Technology Co ltd
Original Assignee
Hangzhou Xiaoma Education Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Xiaoma Education Technology Co ltd filed Critical Hangzhou Xiaoma Education Technology Co ltd
Priority to CN202511468115.8A priority Critical patent/CN120956722B/en
Publication of CN120956722A publication Critical patent/CN120956722A/en
Application granted granted Critical
Publication of CN120956722B publication Critical patent/CN120956722B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B23/00Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes
    • G09B23/02Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes for mathematics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • H04L63/205Network 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation 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

Programming teaching method and system based on real-time two-way communication technology
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)

1.一种基于实时双向通信技术的编程教学方法,其特征是在于,包括以下步骤:1. A programming teaching method based on real-time bidirectional communication technology, characterized by comprising the following steps: 接收由客户端发起websocket连接请求,并建立安全连接,其中,客户端包括教师端与学生端;It receives WebSocket connection requests initiated by clients and establishes secure connections, where clients include both teacher and student clients; 基于建立的连接,接收由教师端发起的教学指令包、并发送至目标的学生端;以及接收由学生端发起反馈指令包、并发送至目标的教师端;Based on the established connection, the system receives teaching instruction packets initiated by the teacher and sends them to the target student's end; it also receives feedback instruction packets initiated by the student and sends them to the target teacher's end. 接收断开请求,删除强关联中对应的记录;所述断开请求由客户端发起、或服务器检测到;Receive a disconnect request and delete the corresponding record in the strong association; the disconnect request is initiated by the client or detected by the server; 其中,所述教学指令包至少包括指令名称、指令内容、用户ID、课堂ID、目标对象和指令版本;所述反馈指令包的数据结构和教学指令包的数据结构相同;The teaching instruction package includes at least the instruction name, instruction content, user ID, classroom ID, target object, and instruction version; the data structure of the feedback instruction package is the same as that of the teaching instruction package. 所述接收由客户端发起websocket连接请求,并建立安全连接的步骤具体包括:The steps of receiving a WebSocket connection request initiated by the client and establishing a secure connection specifically include: 接收客户端发起websocket连接请求,其中,连接请求的请求头携带经过加密的用户认证令牌;Receive a WebSocket connection request initiated by a client, wherein the request header of the connection request carries an encrypted user authentication token; 解密并解析所述用户认证令牌,并验证所述用户认证令牌是否为有效令牌;Decrypt and parse the user authentication token, and verify whether the user authentication token is a valid token; 若验证失败,则拒绝建立websocket连接,同时记录详细的错误日志,所述错误日志包括来源IP、请求的用户认证令牌、失败原因;If the verification fails, the WebSocket connection will not be established, and a detailed error log will be recorded, including the source IP, the requested user authentication token, and the reason for the failure. 若验证成功,基于websocket连接请求建立websocket长连接通道;If the verification is successful, a long-lived WebSocket connection channel is established based on the WebSocket connection request. 将所述长连接通道与用户认证令牌中解析出的关键信息进行强关联;所述关键信息包括用户ID,角色信息和课堂ID;The long connection channel is strongly associated with the key information parsed from the user authentication token; the key information includes user ID, role information and classroom ID. 其中,强关联的数据结构为维护一个全局的、线程安全的连接会话映射表;所述映射表的核心结构是一个映射,映射的键设计为能够唯一标识一个用户在一个课堂中的连接;映射的值包含对应的长连接通道的对象引用、用户ID、角色信息和课堂ID;The strongly associated data structure maintains a global, thread-safe connection session mapping table. The core structure of the mapping table is a mapping, where the key is designed to uniquely identify a user's connection in a classroom. The value of the mapping includes the object reference of the corresponding long connection channel, user ID, role information, and classroom ID. 所述用户认证令牌的验证方法依次包括以下步骤:The verification method for the user authentication token includes the following steps in sequence: 检查所述用户认证令牌中签名的有效性、以及是否在有效期内;Check the validity of the signature in the user authentication token and whether it is within the validity period; 检查所述用户认证令牌中角色字段是否符合预期;Check if the role field in the user authentication token meets expectations; 检查所述用户认证令牌中课堂是否存在,以及所述用户认证令牌的用户是否属于该课堂。Check whether the class exists in the user authentication token, and whether the user of the user authentication token belongs to the class. 2.根据权利要求1所述的一种基于实时双向通信技术的编程教学方法,其特征在于,所述基于建立的连接,接收由教师端发起的教学指令包、并发送至目标的学生端;以及接收由学生端发起反馈指令包、并发送至目标的教师端的步骤具体包括:2. The programming teaching method based on real-time bidirectional communication technology according to claim 1, characterized in that the steps of receiving teaching instruction packets initiated by the teacher end and sending them to the target student end based on the established connection; and receiving feedback instruction packets initiated by the student end and sending them to the target teacher end specifically include: 获取教师端发送的教学指令包;Obtain the teaching instruction packet sent by the teacher; 解析教学指令包,并基于映射表验证解析获得的用户ID是否为教师;若是,则通过解析后获取的目标对象,基于映射表高效并发地将教学指令包推送到目标对应的长连接通道上;Parse the teaching instruction packet and verify whether the user ID obtained by parsing is a teacher based on the mapping table; if so, push the teaching instruction packet to the long connection channel corresponding to the target efficiently and concurrently based on the target object obtained after parsing and the mapping table. 获取学生端的反馈指令包;Obtain feedback instruction packets from the student's end; 解析反馈指令包,并通过解析后获取的目标对象,基于映射表将反馈指令包推送到目标对应的长连接通道上。The feedback instruction packet is parsed, and the target object obtained after parsing is used to push the feedback instruction packet to the long connection channel corresponding to the target based on the mapping table. 3.根据权利要求1所述的一种基于实时双向通信技术的编程教学方法,其特征在于,所述编程教学方法还包括:发送指令后,监控指令的发送状态,并将失败指令及其元数据存入一个持久化的待重试队列,基于所述待重试队列的预设规则重新发送失败指令;3. The programming teaching method based on real-time bidirectional communication technology according to claim 1, characterized in that the programming teaching method further includes: after sending an instruction, monitoring the sending status of the instruction, storing the failed instruction and its metadata in a persistent retry queue, and resending the failed instruction based on the preset rules of the retry queue; 其中,所述元数据包括当前重试次数、优先等级标识;The metadata includes the current number of retries and the priority level identifier; 所述预设规则包括指令优先级和重试策略,所述待重试队列的重试策略根据指令优先级进行差异化配置。The preset rules include instruction priority and retry strategy, and the retry strategy of the queue to be retried is configured differently according to the instruction priority. 4.根据权利要求3所述的一种基于实时双向通信技术的编程教学方法,其特征在于,基于所述待重试队列的预设规则重新发送失败指令的步骤具体包括:4. The programming teaching method based on real-time bidirectional communication technology according to claim 3, characterized in that the step of resending the failure instruction based on the preset rules of the retry queue specifically includes: 启动一个或多个后台定时任务扫描等待队列;Start one or more background scheduled tasks to scan the waiting queue; 根据指令的重试等级和当前重试次数计算下次应重试的时间点,当指令到达重试时间点,后台定时任务再次尝试发送该指令;The time point for the next retry is calculated based on the retry level of the instruction and the current number of retries. When the instruction reaches the retry time point, the background scheduled task tries to send the instruction again. 如果发送成功,从待重试队列中移除该指令;If the transmission is successful, remove the instruction from the retry queue; 如果发送失败,则更新指令的元数据,将其放回待重试队列中等待下次重试;If the transmission fails, update the metadata of the instruction and put it back into the retry queue to wait for the next retry; 当指令的重试次数达到其优先等级对应设定的最大重试次数时,移出待重试队列,不再进行重试,并记录详细失败日志,标记为最终投递失败,其中,失败日志包括指令内容、目标、失败原因、重试历史;When the number of retries for an instruction reaches the maximum number of retries set for its priority level, it is removed from the retry queue and no further retries are performed. A detailed failure log is recorded and the instruction is marked as a final delivery failure. The failure log includes the instruction content, target, reason for failure, and retry history. 当指令被标记为最终投递失败时,向接收该指令的客户端发送提示信息。When an instruction is marked as a final delivery failure, a notification message is sent to the client that received the instruction. 5.根据权利要求1所述的一种基于实时双向通信技术的编程教学方法,其特征在于,所述编程教学方法还包括在服务端与客户端间设有基于指数退避算法的重连机制,所述重连机制具体包括:5. A programming teaching method based on real-time bidirectional communication technology according to claim 1, characterized in that the programming teaching method further includes a reconnection mechanism based on an exponential backoff algorithm between the server and the client, the reconnection mechanism specifically including: 当客户端监听到websocket的连接状态断开时,立即进行第一次重连尝试;When the client detects that the WebSocket connection is broken, it immediately makes its first reconnection attempt. 若首次尝试失败,后续的重连尝试间隔时间按以下公式中任一计算:当前延迟=*If the first attempt fails, the interval between subsequent reconnection attempts will be calculated using any of the following formulas: Current latency = * ; 当前延迟=** (1 + jitter * (random() * 2 - 1));Current delay = * * (1 + jitter * (random() * 2 - 1)); 式中,是指初始延迟,a是指退避因子,e是指当前重试次数,jitter 是一个 0 到 1之间的系数,random() 为生成 0 到 1 的随机数;In the formula, This refers to the initial delay, 'a' is the backoff factor, 'e' is the current number of retries, 'jitter' is a coefficient between 0 and 1, and 'random()' generates a random number between 0 and 1. 当连接成功建立、达到预设的最大重连次数或客户端主动取消重连时,终止重连。The reconnection process terminates when the connection is successfully established, the preset maximum number of reconnections is reached, or the client actively cancels the reconnection. 6.一种基于实时双向通信技术的编程教学方法,其特征是在于,包括以下步骤:6. A programming teaching method based on real-time bidirectional communication technology, characterized by comprising the following steps: 通过教师端向服务端发送websocket连接请求以发起课堂,以建立安全连接;The teacher initiates the class by sending a WebSocket connection request to the server to establish a secure connection. 通过教师端创建教学指令,并将教学指令封装为结构化、标准化的教学指令包;其中,教学指令包括题目推送、代码编辑、文档展示、屏幕共享启动/停止、语音控制;教学指令包包括指令名称、指令内容、用户ID、课堂ID、目标对象和指令版本;Teachers can create teaching instructions and encapsulate them into structured and standardized teaching instruction packages. These teaching instructions include tasks such as question assignment, code editing, document display, screen sharing start/stop, and voice control. Each teaching instruction package includes the instruction name, instruction content, user ID, classroom ID, target object, and instruction version. 基于与服务端建立的所述安全连接,向服务端发送教学指令包、以及接收由服务端发送的反馈指令包;Based on the secure connection established with the server, teaching instruction packets are sent to the server, and feedback instruction packets sent by the server are received. 基于与服务端建立的所述安全连接,解析接收的反馈指令包,渲染后可视化呈现学生的学习情况;其中,所述反馈指令包表征为学生端基于教学指令包进行互动操作的状态和结果;Based on the secure connection established with the server, the received feedback instruction packets are parsed, rendered, and then visualized to present the student's learning progress; wherein, the feedback instruction packets represent the status and results of the student's interactive operations based on the teaching instruction packets; 当教学指令包发送失败时,接收由服务端发送的提示信息;When the teaching instruction packet fails to be sent, receive the prompt message sent by the server; 所述建立安全连接的步骤具体包括:The steps for establishing a secure connection specifically include: 通过教师端向服务端发起websocket连接请求,其中,连接请求的请求头携带经过加密的用户认证令牌;The teacher initiates a WebSocket connection request to the server, and the request header of the connection request carries an encrypted user authentication token. 所述服务端解密并解析所述用户认证令牌,并验证所述用户认证令牌是否为有效令牌;The server decrypts and parses the user authentication token, and verifies whether the user authentication token is a valid token. 若验证失败,则拒绝建立websocket连接,同时记录详细的错误日志,所述错误日志包括来源IP、请求的用户认证令牌、失败原因;If the verification fails, the establishment of the WebSocket connection will be refused, and a detailed error log will be recorded, including the source IP, the requested user authentication token, and the reason for the failure. 若验证成功,基于websocket连接请求建立websocket长连接通道;If the verification is successful, a long-lived WebSocket connection channel is established based on the WebSocket connection request. 所述服务端将所述长连接通道与用户认证令牌中解析出的关键信息进行强关联;所述关键信息包括用户ID,角色信息和课堂ID;The server strongly associates the long connection channel with the key information parsed from the user authentication token; the key information includes user ID, role information, and class ID. 其中,强关联的数据结构为维护一个全局的、线程安全的连接会话映射表;所述映射表的核心结构是一个映射,映射的键设计为能够唯一标识一个用户在一个课堂中的连接;映射的值包含对应的长连接通道的对象引用、用户ID、角色信息和课堂ID;The strongly associated data structure maintains a global, thread-safe connection session mapping table. The core structure of the mapping table is a mapping, where the key is designed to uniquely identify a user's connection in a classroom. The value of the mapping includes the object reference of the corresponding long connection channel, user ID, role information, and classroom ID. 所述用户认证令牌的验证方法依次包括以下步骤:The verification method for the user authentication token includes the following steps in sequence: 检查所述用户认证令牌中签名的有效性、以及是否在有效期内;Check the validity of the signature in the user authentication token and whether it is within the validity period; 检查所述用户认证令牌中角色字段是否符合预期;Check if the role field in the user authentication token meets expectations; 检查所述用户认证令牌中课堂是否存在,以及所述用户认证令牌的用户是否属于该课堂。Check whether the class exists in the user authentication token, and whether the user of the user authentication token belongs to the class. 7.一种基于实时双向通信技术的编程教学方法,其特征是在于,包括以下步骤:7. A programming teaching method based on real-time bidirectional communication technology, characterized by comprising the following steps: 通过学生端向服务端发送websocket连接请求以进入课堂,以建立安全连接;Students send a WebSocket connection request to the server to enter the classroom and establish a secure connection. 基于与服务端建立的所述安全连接,接收由服务端发送的教学指令包;其中,教学指令包包括指令名称、指令内容、用户ID、课堂ID、目标对象和指令版本;Based on the secure connection established with the server, the system receives teaching instruction packets sent by the server; wherein the teaching instruction packet includes instruction name, instruction content, user ID, classroom ID, target object, and instruction version; 解析教学指令包以获取指令名称和指令内容,并触发本地操作;所述本地操作包括向数据存储模块请求题目详情、在浏览器中渲染集成编辑器窗口展示编程题目、启动屏幕共享功能、接收教师端的视频流;The teaching instruction package is parsed to obtain the instruction name and instruction content, and local operations are triggered. The local operations include requesting question details from the data storage module, rendering the integrated editor window in the browser to display the programming question, starting the screen sharing function, and receiving the video stream from the teacher's end. 基于教学指令包进行互动操作,并将互动操作的状态和结果封装为反馈指令包;其中,互动操作的状态和结果包括提交编程题答题、运行代码结果、发送文本消息、自动化测试报告、编辑代码、语音申请发言;反馈指令包的数据结构和教学指令包的数据结构相同;Interactive operations are based on teaching instruction packages, and the status and results of interactive operations are encapsulated into feedback instruction packages. The status and results of interactive operations include submitting answers to programming questions, running code results, sending text messages, generating automated test reports, editing code, and requesting to speak via voice. The data structure of the feedback instruction package is the same as that of the teaching instruction package. 基于与服务端建立的所述安全连接,将反馈指令包发送至服务端;Based on the secure connection established with the server, a feedback instruction packet is sent to the server; 当反馈指令包发送失败时,接收由服务端发送的提示信息;When the feedback instruction packet fails to be sent, receive the prompt message sent by the server; 所述建立安全连接的步骤具体包括:The steps for establishing a secure connection specifically include: 通过学生端向服务端发起websocket连接请求,其中,连接请求的请求头携带经过加密的用户认证令牌;The student initiates a WebSocket connection request to the server, and the request header of the connection request carries an encrypted user authentication token. 所述服务端解密并解析所述用户认证令牌,并验证所述用户认证令牌是否为有效令牌;The server decrypts and parses the user authentication token, and verifies whether the user authentication token is a valid token. 若验证失败,则拒绝建立websocket连接,同时记录详细的错误日志,所述错误日志包括来源IP、请求的用户认证令牌、失败原因;If the verification fails, the establishment of the WebSocket connection will be refused, and a detailed error log will be recorded, including the source IP, the requested user authentication token, and the reason for the failure. 若验证成功,基于websocket连接请求建立websocket长连接通道;If the verification is successful, a long-lived WebSocket connection channel is established based on the WebSocket connection request. 所述服务端将所述长连接通道与用户认证令牌中解析出的关键信息进行强关联;所述关键信息包括用户ID,角色信息和课堂ID;The server strongly associates the long connection channel with the key information parsed from the user authentication token; the key information includes user ID, role information, and class ID. 其中,强关联的数据结构为维护一个全局的、线程安全的连接会话映射表;所述映射表的核心结构是一个映射,映射的键设计为能够唯一标识一个用户在一个课堂中的连接;映射的值包含对应的长连接通道的对象引用、用户ID、角色信息和课堂ID;The strongly associated data structure maintains a global, thread-safe connection session mapping table. The core structure of the mapping table is a mapping, where the key is designed to uniquely identify a user's connection in a classroom. The value of the mapping includes the object reference of the corresponding long connection channel, user ID, role information, and classroom ID. 所述用户认证令牌的验证方法依次包括以下步骤:The verification method for the user authentication token includes the following steps in sequence: 检查所述用户认证令牌中签名的有效性、以及是否在有效期内;Check the validity of the signature in the user authentication token and whether it is within the validity period; 检查所述用户认证令牌中角色字段是否符合预期;Check if the role field in the user authentication token meets expectations; 检查所述用户认证令牌中课堂是否存在,以及所述用户认证令牌的用户是否属于该课堂。Check whether the class exists in the user authentication token, and whether the user of the user authentication token belongs to the class. 8.一种基于实时双向通信技术的编程教学系统,用于实现权利要求1所述的基于实时双向通信技术的编程教学方法,其特征在于,包括:8. A programming teaching system based on real-time bidirectional communication technology, used to implement the programming teaching method based on real-time bidirectional communication technology as described in claim 1, characterized in that it includes: 教师端(10),用于与服务端建立websocket连接以发起课堂,并通过服务端将教学指令包发生至目标对应的学生端(20)、接收从服务端发送的反馈指令包,以及对反馈指令包进行可视化呈现;The teacher's end (10) is used to establish a websocket connection with the server to initiate a class, and to send teaching instruction packets to the target student's end (20) through the server, receive feedback instruction packets sent from the server, and visualize the feedback instruction packets. 学生端(20),用于与服务端建立websocket连接,通过服务端接收教学指令包、并触发对应的本地操作;基于教学指令包进行互动操作形成反馈指令包,并将反馈指令包通过服务端发送至教师端(10);The student end (20) is used to establish a websocket connection with the server, receive teaching instruction packets through the server, and trigger corresponding local operations; perform interactive operations based on the teaching instruction packets to form feedback instruction packets, and send the feedback instruction packets to the teacher end (10) through the server. 服务端,包括数据存储模块(40)和基于Netty框架的Websocket通信服务模块(30),所述数据存储模块(40)用于存储静态数据和交互数据;所述Websocket通信服务模块(30)用于与学生端(20)和教师端(10)建立连接,并实现学生端(20)和教师端(10)间数据传输。The server includes a data storage module (40) and a Websocket communication service module (30) based on the Netty framework. The data storage module (40) is used to store static data and interactive data. The Websocket communication service module (30) is used to establish connections with the student end (20) and the teacher end (10) and realize data transmission between the student end (20) and the teacher end (10).
CN202511468115.8A 2025-10-15 2025-10-15 A Programming Teaching Method and System Based on Real-Time Bidirectional Communication Technology Active CN120956722B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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