Remote teaching method, scheduling device, server and electronic device
The server cluster load information is obtained through middleware devices, the candidate server is selected and the backup server is automatically switched to the backup server when the main server is abnormal, which solves the problem of manual intervention in video failure in distance education, realizes seamless continuity and load balancing of teaching tasks, and improves teaching stability and efficiency.
Patent Information
- Application Number
- CN202010845105.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-20
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2040-08-20
AI Technical Summary
The existing distance education methods cannot automatically recover video failures when facing large-scale and long-term teaching, and require manual intervention, resulting in instability in teaching.
Obtain the load information of the server cluster through middleware devices, select candidate servers for multiple backup processing, and automatically switch to the backup server when an abnormality of the primary server is detected, ensuring that the teaching tasks continue seamlessly and reducing manual intervention.
It realizes lossless switching to the standby server when the server is abnormal, maintains the continuity of teaching tasks, avoids students' perception of abnormalities, ensures server load balancing, and improves the stability and efficiency of remote teaching.
Smart Images

Figure CN111897657B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of online education technology. Specifically, this application relates to a remote teaching method, a scheduling device, a server, and an electronic device. Background Art
[0002] Remote teaching is an educational form in which students, teachers, and students and educational organizations mainly use various media methods for systematic teaching and communication. It is an education that transmits courses to one or more places of students. Modern distance education refers to the education that transmits courses outside the campus through audio, video (live or recorded), and computer technology including real-time and non-real-time.
[0003] Existing distance education methods require manual intervention in the recovery of videos and the recovery of machine failures, and single-point failures cannot be perceived. Therefore, manual monitoring is required. It can be seen that existing distance education methods are more suitable for single-person and short-time video teaching, and are not suitable for large-scale and long-time video teaching. Summary of the Invention
[0004] Embodiments of this application provide a remote teaching method, a scheduling device, a server, and an electronic device that overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect, a remote teaching method is provided, which is applied to a main scheduling device. The remote teaching method includes:
[0006] Obtain a teaching task whose execution time is a preset duration after the current time as a target teaching task. Obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device. Determine candidate servers related to the target teaching task from the server cluster according to the first load of each server at the current time, and send the download address of the target teaching task to the candidate servers, so that the candidate servers download the target teaching task according to the download address;
[0007] Determine a main server for executing the target teaching task from the candidate servers according to the second load of the candidate servers at the execution time of the target teaching task, and send a third instruction to the main server, so that the main server executes the target teaching task according to the third instruction;
[0008] If it is determined that the main server is abnormal according to the second load of the main server when executing the target teaching task, determine a standby server from the candidate servers according to the second load of the candidate servers when the main server is abnormal;
[0009] Send a first instruction to the primary server and a second instruction to the standby server, so that the primary server stops executing the target teaching task at the preset task node according to the first instruction, and the standby server continues to execute the target teaching task from the preset task node after the primary server stops executing the target teaching task;
[0010] Among them, the teaching method further includes: sending heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the primary scheduling device stored in the middleware device is abnormal, and performs the primary-standby switch of the scheduling device when the heartbeat information is abnormal; the first load includes the load related to the downloaded teaching task, and the second load includes the load related to the executed teaching task.
[0011] Further, after sending the third instruction to the primary server, it further includes:
[0012] Obtain the teacher information associated with the target teaching task as the target teacher information, obtain the teacher information associated with the teaching tasks being executed by the server cluster, and use the teaching tasks being executed whose associated teacher information is the target teacher information and the target teaching task as the teaching tasks to be screened;
[0013] Select one server from the servers executing the teaching tasks to be screened as the server to be retained;
[0014] Send a fourth instruction to the other servers among the servers executing the teaching tasks to be screened except the server to be retained, so that the servers receiving the fourth instruction stop executing the teaching tasks to be screened.
[0015] In a second aspect, a remote teaching method is provided, which is applied to the primary server. The remote teaching method includes:
[0016] Report the first load at the current moment to the middleware device, so that the primary scheduling device sends the download address of the target teaching task to the primary server according to the first load of the primary server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment;
[0017] Download the target teaching task according to the download address;
[0018] Report the second load at the execution moment of the target teaching task to the middleware device, so that the primary scheduling device determines the primary server as the primary server for executing the target teaching task according to the second load of the primary server at the execution moment of the target teaching task, and sends a third instruction to the primary server;
[0019] Receive the third instruction, execute the target teaching task according to the third instruction, and report the second payload when executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server's execution of the target teaching task based on the second payload when executing the target teaching task, it sends the first instruction;
[0020] Receive the first instruction and stop executing the target teaching task at the preset task node according to the first instruction;
[0021] The first payload includes the payload related to the downloaded teaching task, and the second payload includes the payload related to the executed teaching task.
[0022] Further, the remote teaching method further includes:
[0023] If a fourth instruction sent by the main scheduling device is received during the execution of the target teaching task, stop executing the target teaching task according to the fourth instruction;
[0024] Among them, the fourth instruction is obtained according to the teacher information associated with the target teaching task.
[0025] Further, the target teaching task includes pre-recorded audio and video data and interaction data; the interaction data is used to represent the interaction operations initiated by the teacher to the students when recording the target teaching task, and the interaction data includes the frame number information of the audio and video data corresponding to the moment when the teacher initiates the interaction operation to the students;
[0026] Executing the target teaching task includes:
[0027] Play the audio and video data, and when playing to the frame number corresponding to the moment when the teacher initiates the interaction operation to the students, execute the interaction data simultaneously.
[0028] In a third aspect, a remote teaching method is provided, which is applied to a standby server. The remote teaching method includes:
[0029] Report the first payload at the current moment to the middleware device, so that the main scheduling device sends the download address of the target teaching task to the standby server according to the first payload of the standby server obtained from the middleware device at the current moment; the execution moment of the target teaching task is the moment after a preset duration from the current moment;
[0030] Download the target teaching task according to the download address;
[0031] Report the second payload when the main server has an abnormality to the middleware device, so that the main scheduling device sends the second instruction according to the second payload of the standby server obtained from the middleware device when the main server has an abnormality;
[0032] Receive a second instruction, determine the preset task node at which the master server stops executing the target teaching task, and after the master server stops executing the target teaching task, continue to execute the target teaching task from the preset task node;
[0033] The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0034] Fourthly, provide a master scheduling device, including;
[0035] A candidate server determination module, configured to obtain a teaching task whose execution time is a time after a preset duration from the current moment as the target teaching task, obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device, and determine a candidate server related to the target teaching task from the server cluster according to the first load of each server at the current moment, and send the download address of the target teaching task to the candidate server, so that the candidate server downloads the target teaching task according to the download address;
[0036] A master server determination module, configured to determine a master server for executing the target teaching task from the candidate servers according to the second load of the candidate servers at the execution time of the target teaching task, and send a third instruction to the master server, so that the master server executes the target teaching task according to the third instruction;
[0037] A standby server acquisition module, configured to, if it is determined that the master server is abnormal according to the second load of the master server when executing the target teaching task, determine a standby server from the candidate servers according to the second load of the candidate servers when the master server is abnormal;
[0038] A switching module, configured to send a first instruction to the master server and a second instruction to the standby server, so that the master server stops executing the target teaching task at the preset task node according to the first instruction and the standby server continues to execute the target teaching task from the preset task node after the master server stops executing the target teaching task;
[0039] A heartbeat information sending module, configured to send heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the master scheduling device stored in the middleware device is abnormal, and performs the master-backup switching of the scheduling device when the heartbeat information is abnormal;
[0040] The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0041] Furthermore, the master scheduling device further includes:
[0042] A teacher information acquisition module, configured to acquire teacher information associated with a target teaching task as target teacher information, acquire teacher information associated with teaching tasks being executed by a server cluster, and use the teaching tasks being executed whose associated teacher information is the target teacher information and the target teaching task as teaching tasks to be filtered;
[0043] A filtering module, configured to select one server from the servers executing the teaching tasks to be filtered as the server to be retained;
[0044] A fourth instruction sending module, configured to send a fourth instruction to servers other than the server to be retained among the servers executing the tasks to be filtered, so that the servers receiving the fourth instruction stop executing the teaching tasks to be filtered.
[0045] In a fifth aspect, a main server is provided, including:
[0046] A main first load sending module, configured to report a first load at the current moment to a middleware device, so that a main scheduling device sends a download address of a target teaching task to the main server according to the first load of the main server at the current moment obtained from the middleware device; the execution moment of the target teaching task is a moment after a preset duration from the current moment;
[0047] A main task download module, configured to download the target teaching task according to the download address;
[0048] A main second load sending module, configured to report a second load at the execution moment of the target teaching task to the middleware device, so that the main scheduling device determines the main server as the main server for executing the target teaching task according to the second load of the main server at the execution moment of the target teaching task, and sends a third instruction to the main server;
[0049] A task execution module, configured to receive the third instruction, execute the target teaching task according to the third instruction, and report the second load at the time of executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server executing the target teaching task according to the second load at the time of executing the target teaching task, a first instruction is sent;
[0050] A stop execution module, configured to receive the first instruction and stop executing the target teaching task at a preset task node according to the first instruction;
[0051] The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0052] Further, the main server further includes:
[0053] A fourth instruction execution module, configured to stop executing the target teaching task according to a fourth instruction if the fourth instruction sent by the main scheduling device is received during the execution of the target teaching task;
[0054] wherein, the fourth instruction is obtained according to the teacher information associated with the target teaching task.
[0055] Furthermore, the target teaching task includes pre-recorded audio and video data and interaction data; the interaction data is used to represent the interaction operations initiated by the teacher to the students during the recording of the target teaching task, and the interaction data includes the frame number information of the audio and video data corresponding to the moment when the teacher initiates the interaction operation to the students;
[0056] The task execution module executes the target teaching task, including:
[0057] Playing the audio and video data, and when playing to the frame number corresponding to the moment when the teacher initiates the interaction operation to the students, simultaneously execute the interaction data.
[0058] In a sixth aspect, a standby server is provided, including:
[0059] A standby first load sending module, configured to report the first load at the current moment to the middleware device, so that the main scheduling device sends the download address of the target teaching task to the standby server according to the first load of the standby server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment;
[0060] A standby task download module, configured to download the target teaching task according to the download address;
[0061] A standby second load sending module, configured to report the second load when an exception occurs in the main server to the middleware device, so that the main scheduling device sends a second instruction according to the second load of the standby server when the exception occurs in the main server obtained from the middleware device;
[0062] A continue execution module, configured to receive the second instruction, determine the preset task node at which the main server stops executing the target teaching task, and continue to execute the target teaching task from the preset task node after the main server stops executing the target teaching task;
[0063] The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0064] In a seventh aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.
[0065] In an eighth aspect, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method provided in the first aspect, the second aspect or the third aspect.
[0066] The remote teaching method, scheduling device, server, electronic device and computer program provided by the embodiments of the present application obtain the load of the server through the middleware device, so that when the server cluster needs to be expanded, the information of the local machine can be directly registered in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing one's own address to the main scheduling device. The main scheduling device obtains the first load of the server cluster at the current moment, selects multiple candidate servers, and provides the candidate servers for multi-backup processing when downloading resources. In this way, when an exception occurs in the live broadcast task, it can be seamlessly switched to the standby machine without the need to download various resources separately, and the whole process does not require manual intervention. It also makes the load of the server cluster relatively balanced when downloading teaching tasks, which is beneficial to the long-term and healthy operation of the server. When it is detected that the main server executes the target teaching task abnormally, the first instruction and the second instruction are respectively sent to the main server and the standby server, so that the main server stops executing the teaching task at the preset task node, and the standby server continues to execute the teaching task at the preset task node, making the student side unaware of the abnormality of the teaching task, so as to be more focused on learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for description in the embodiments of the present application.
[0068] Figure 1 Schematic diagram of the implementation environment related to the remote teaching method of the embodiments of the present application;
[0069] Figure 2 Schematic flowchart of the remote teaching method according to an embodiment of the present application;
[0070] Figure 3 Schematic diagram of the implementation environment related to the remote teaching method of the embodiments of the present application
[0071] Figure 4 Schematic diagram of the implementation environment related to the remote teaching method according to another embodiment of the present application;
[0072] Figure 5 Schematic flowchart of the remote teaching method according to another embodiment of the present application;
[0073] Figure 6 Schematic flowchart of the remote teaching method according to still another embodiment of the present application;
[0074] Figure 7 Schematic diagram of the interaction between the scheduling device and the server cluster according to an embodiment of the present application;
[0075] Figure 8 Schematic diagram of the structure of a main scheduling device according to an embodiment of the present application;
[0076] Figure 9 Schematic diagram of the structure of a main server according to an embodiment of the present application;
[0077] Figure 10 Schematic diagram of the structure of a standby server according to an embodiment of the present application;
[0078] Figure 11 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0079] The embodiments of the present application will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be construed as a limitation to the present application.
[0080] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application means the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more related listed items.
[0081] To make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0082] The remote teaching method, scheduling device, server, electronic device and computer program provided by the present application are intended to solve the above technical problems in the prior art.
[0083] The following uses specific embodiments to elaborate in detail on the technical solutions of this application and how the technical solutions of this application solve the above technical problems. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below in conjunction with the accompanying drawings.
[0084] Figure 1 It is a schematic diagram of the implementation environment involved in the remote teaching method of the embodiment of this application. As Figure 1 shown, it includes a main scheduling device 110, a server cluster 120, and student clients 130;
[0085] The main scheduling device 110 is used to count teaching tasks, calculate the resources required for teaching tasks, monitor the load of each server in the server cluster 120, and send instructions to the designated server in the server cluster 120 according to the load of the server, such as instructions to download teaching tasks, execute teaching tasks, etc. This can make the entire cluster in a load balancing state, prevent a single machine from overheating, and schedule abnormal teaching tasks in the server cluster 120.
[0086] The server cluster 120 includes at least two servers. In the figure, 3 servers are shown, namely server 1201, server 1202, and server 1203. Each server can download or execute multiple teaching tasks simultaneously, and each teaching task is deployed on multiple servers simultaneously before execution. It should be understood that a server is a computer device that provides remote teaching tasks to the teacher client 130. The server cluster reports its own load to the main scheduling device 110 in real time, receives and executes the instructions sent by the main scheduling device 110, such as downloading teaching tasks or executing teaching tasks, etc. When the main server 1201 and server 1202 receive an instruction to download a certain teaching task, they download the teaching task according to the storage address indicated in the instruction. After that, when server 1201 receives an instruction to execute the teaching task, server 1201 determines itself as the main server for executing the teaching task and executes the teaching task. When executing the teaching task, server 1201 pushes the downloaded teaching task to the student client 130 for students to learn through the student client 130.
[0087] The student client 130 in the embodiment of this application can be in the form of an application or a web page, and can receive the teaching tasks pushed by the server for students to attend classes and study.
[0088] Figure 2 It is a schematic flowchart of the remote teaching method of an embodiment of this application. The execution subject of the remote teaching method of the embodiment of this application is the main scheduling device. As Figure 2 shown, it includes:
[0089] S101. Obtain a teaching task whose execution time is a preset duration after the current moment, and use it as the target teaching task. Obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device. According to the first load of each server at the current moment, determine candidate servers related to the target teaching task from the server cluster, and send the download address of the target teaching task to the candidate servers, so that the candidate servers can download the target teaching task according to the download address.
[0090] The teaching tasks in the embodiments of the present application can be teaching-related audio, video, PPT, documents, etc. For example, a video of a teacher explaining junior high school grade three mathematics. The teaching task can be either pre-recorded or live broadcast in real time.
[0091] To ensure the smooth execution of the teaching task, in the preset duration before the execution time of the teaching task, the embodiments of the present application will deploy the execution of the teaching task. For example, if the execution time of the teaching task is 2 pm, then at 1 pm, the main scheduling device will obtain the teaching task to be executed one hour later, that is, at 2 pm, as the target teaching task, and at the same time, it will also obtain the first load of the server cluster at 1 pm.
[0092] Each server in the server cluster of the embodiments of the present application reports the first load and the second load to the middleware device in real time. The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task. The first load is the load generated by the interaction between the server and the data source storing the teaching task, and the second load is the load generated by the interaction between the server and the teacher client. The two loads are relatively independent. Considering that the teaching task needs to be downloaded first when determining the main server, the main scheduling device uses the first load as the consideration for selecting candidate servers.
[0093] By classifying the loads into two categories, it is possible to more reasonably determine the server for downloading the teaching task and the server for executing the teaching task. More importantly, by adding a middleware device, when the server cluster needs to be expanded, the device only needs to register its own information in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device.
[0094] Optionally, the middleware device in the embodiments of the present application may be a zookeeper cluster, an etcd cluster, a Eureka cluster, etc. It should be understood that the zookeeper cluster is a distributed, open-source distributed application coordination service, etcd is an open-source distributed key-value storage system, and Eureka is a service discovery component open-sourced by Netflix. The zookeeper cluster, etcd cluster, and Eureka cluster can all implement the functions of the above middleware device. Further, when the middleware device adopts a zookeeper cluster, by utilizing the strong consistency feature of the zookeeper cluster, when any server in the server cluster goes offline, it can immediately broadcast to the main scheduling device to prevent teaching tasks from being sent to the server that has already left the server cluster.
[0095] When defining the first load in the embodiments of the present application, the hardware consumption of the server during the download of teaching tasks can be comprehensively considered, such as CPU usage rate, memory usage rate, disk usage rate, and the number of teaching tasks currently downloaded by the server, etc.
[0096] In the embodiments of the present application, the first loads of each server at the current moment can be sorted from small to large, and then at least two servers with the top rankings can be used as subsequent servers, and the download address of the target teaching task is sent to the candidate servers, so that the candidate servers can download the target teaching task according to the download address. By selecting candidate servers based on the first load of each server at the current moment, such a setting can make the load of the server cluster relatively balanced during the download of teaching tasks, which is beneficial to the long-term and healthy operation of the servers. By sending the download address of the target teaching task to all candidate servers, all candidate servers can download the target teaching task and save it in the local storage space of the server, laying a foundation for quickly switching to a standby server when an exception occurs during the execution of the target teaching task by the main server.
[0097] S102. Determine the main server for executing the target teaching task from the candidate servers according to the second load of the candidate servers at the execution moment of the target teaching task, and send a third instruction to the main server, so that the main server executes the target teaching task according to the third instruction.
[0098] Specifically, in the embodiments of the present application, at the execution moment of the target teaching task, the second load of each candidate server can be obtained from the middleware device, and the server with the smallest second load is selected as the main server. The main scheduling device sends a third instruction to the main server, so that the main server executes the target teaching task according to the third instruction. Since the other servers in the candidate servers do not receive the third instruction, they will not execute the teaching task at the execution moment of the target teaching task.
[0099] S103. If it is determined that the primary server is abnormal based on the second load of the primary server when executing the target teaching task, then determine a standby server from the candidate servers according to the second load of the candidate servers when the primary server is abnormal.
[0100] When the primary server executes the teaching task, it can adopt the method of pushing audio / video frame by frame. On this basis, if it is detected that there are situations such as freezing or disconnection during the frame-by-frame push of audio / video, it can be considered that the primary server is abnormal when executing the teaching task. For another example, if it is detected that there is network jitter or machine downtime on the primary server, it can also be considered that the primary server is abnormal when executing the teaching task. All the above information that makes the primary server abnormal can be obtained through the second load of the primary server.
[0101] When it is detected that the primary server is abnormal when executing the target teaching task, it is necessary to determine a standby server. The standby server can be a candidate server with the smallest second load when the primary server is abnormal.
[0102] It should be understood that the standby server is selected from the candidate servers. By obtaining the second load of each candidate server when the primary server executes the target teaching task abnormally, that is, the load related to the execution of the teaching task, a server with the smallest second load when the primary server executes the target teaching task abnormally is selected as the standby server. Although the primary server also belongs to the candidate servers, since the primary server has already been abnormal, its first load is necessarily high, so the standby server will not be selected as the primary server either.
[0103] S104. Send a first instruction to the primary server and a second instruction to the standby server, so that the primary server stops executing the target teaching task at the preset task node according to the first instruction, and the standby server continues to execute the target teaching task from the preset task node after the primary server stops executing the target teaching task.
[0104] Specifically, when the primary server executes the target teaching task abnormally, the main scheduling device can determine the task node that the primary server is executing at this time. The task node can be the specific frame number in the audio / video, or the specific page number or line number of the PPT or teaching document, etc. According to the task node executed at this time, the task node at which the primary server stops executing can be further determined. The task node at which the primary server stops executing can be the task node executed when the abnormality just occurred, or the task node after the task node executed when the abnormality just occurred. It should be understood that the time interval from detecting the abnormality of the primary server's execution to the primary server's stop of execution should be relatively short, such as within 1 second.
[0105] In the embodiments of the present application, the middleware device is used to obtain the load of the server. When the server cluster needs to be expanded, the information of the local machine can be directly registered in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, thus avoiding the drawback of large changes caused by directly exposing its own address to the main scheduling device. The main scheduling device obtains the first load of the server cluster at the current moment, selects multiple candidate servers, and provides the candidate servers for multi-backup processing when downloading resources. In this way, when an exception occurs in the live broadcast task, it can be seamlessly switched to the standby machine without the need to download various resources again, and the whole process does not require manual intervention. It also makes the load of the server cluster relatively balanced when downloading teaching tasks, which is beneficial to the long-term and healthy operation of the server. When it is detected that the main server executes the target teaching task abnormally, the first instruction and the second instruction are respectively sent to the main server and the standby server, so that the main server stops executing the teaching task at the preset task node, and the standby server continues to execute the teaching task at the preset task node, making the student side unaware of the abnormality of the teaching task and thus enabling them to focus more on learning.
[0106] Based on the above embodiments, as an optional embodiment, the remote teaching method further includes:
[0107] Sending heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the main scheduling device stored in the middleware device is abnormal, and performs the primary / standby switch of the scheduling device when the heartbeat information is abnormal; the first load includes the load related to downloading teaching tasks, and the second load includes the load related to executing teaching tasks.
[0108] The standby scheduling device can execute the remote teaching method of the main scheduling device. However, the standby scheduling device only senses the heartbeat of the main scheduling device before the main scheduling device fails. Only when the main scheduling device fails, will it switch to the main scheduling device to execute the remote teaching method. By setting the standby scheduling device in the embodiments of the present application, the stability of remote teaching can be further enhanced.
[0109] The standby scheduling device determines whether the heartbeat information of the main scheduling device is abnormal according to whether the heartbeat information sent by the main server in the middleware device conforms to the preset heartbeat frequency. If the heartbeat information does not conform to the heartbeat frequency, for example, the main server does not send heartbeat information for a long time, it is known that the main scheduling device has failed, and the standby scheduling device performs the primary / standby switch, that is, the original main scheduling device is switched to the standby scheduling device, and the original standby scheduling device is switched to the main scheduling device.
[0110] Based on the above embodiments, the candidate servers selected in the embodiments of the present application at least include: the server with the smallest first load in the server cluster at the current moment and the server with the least same teaching tasks downloaded as the server with the smallest first load.
[0111] For example, there are 4 servers, distributed as Servers 1 to 4. If teaching tasks 1, 2, and 3 are downloaded in Server 1, teaching tasks 3, 4, and 5 are downloaded in Server 2, teaching tasks 1, 3, and 5 are downloaded in Server 3, and teaching tasks 2, 4, and 5 are downloaded in Server 4. If two candidate servers are selected from the above servers and Server 1 is the server with the second smallest load, then Server 4 is taken as the second candidate server because the number of same teaching tasks in Server 4 and Server 1 is 0.
[0112] By the above method, the embodiments of the present application select at least two candidate servers. On the one hand, a server with the smallest load can be selected, so that the download tasks on the server are more balanced, and the hardware resources can be utilized more reasonably. On the other hand, a machine with the least same teaching tasks is selected, so that the task similarity between the two servers is low, which can prevent the overload of a single machine and ensure the long-term stable state of the server.
[0113] The video playback live stream technology is a technology that is becoming increasingly popular in the field of remote teaching. This technology can be understood as recording the remote teaching content when the teacher conducts remote teaching live, and then playing back the recorded video at a preset future moment, so as to use the played-back video instead of the live broadcast. In order to make the played-back video more like the teacher's real-time live broadcast, a teacher client used by the teacher is usually created. When the preset future moment is reached, the teacher client obtains the pre-recorded video from the server and then distributes it to the student client used by the students. Since the students see the video sent by the teacher client on the student client, they will feel that the video is a real-time live broadcast video from a visual sense.
[0114] Based on the above embodiments, as an optional embodiment, the main scheduling device of the present application is also involved in the conflict detection of teaching tasks. As can be seen from the above embodiments, each teaching task corresponds to a teacher, and a teacher can only live broadcast one course at the same time. If there are multiple teaching tasks from the same teacher, then the main scheduling device will control the server (which may be one server or multiple servers) to only retain the execution of one teaching task. Specifically, after sending the third instruction to the main server, the following also includes:
[0115] S105. Obtain the teacher information associated with the target teaching task as the target teacher information. Obtain the teacher information associated with the teaching tasks being executed by the server cluster, and use the teaching tasks being executed whose associated teacher information is the target teacher information and the target teaching task as the teaching tasks to be filtered.
[0116] For example, if the teacher information associated with the target teaching task is Zhang San, then use Zhang San as the target teacher information. At the same time, obtain the teacher information associated with the teaching tasks being executed by the server cluster. If the teacher information associated with one of the teaching tasks being executed is also Zhang San, then use this teaching task being executed as a teaching task to be filtered. Obviously, the target teaching task also belongs to the teaching tasks to be filtered.
[0117] S106. Select one server from the servers executing the teaching tasks to be filtered as the server to be retained.
[0118] S107. Send a fourth instruction to the servers executing the teaching tasks to be filtered except the server to be retained, so that the servers receiving the fourth instruction stop executing the teaching tasks to be filtered.
[0119] Since the main scheduling device sends a fourth instruction to the servers executing the teaching tasks to be filtered except the server to be retained, only the server to be retained can continue to execute the teaching tasks to be filtered, making the recorded teaching tasks more in line with the objective laws of live broadcasts. The main scheduling device uses the first load, that is, the load related to the execution of teaching tasks, as the basis for retaining the only teaching task to be filtered, which can make more reasonable use of the server's hardware resources and ensure the long-term stability of the server.
[0120] Figure 3 Schematic diagram of the implementation environment involved in the remote teaching method according to the embodiments of the present application, as Figure 3As shown in the figure, the number of scheduling devices in the embodiment of the present application is 2, namely scheduling device 1 and scheduling device 2. Scheduling device 1 and scheduling device 2 send heartbeats to the zookeeper cluster, and at the same time each scheduling device senses the heartbeat of the other scheduling device from the zookeeper cluster. When the heartbeat of the primary scheduling device is abnormal, the standby scheduling device performs the primary-standby switch, so as to achieve the disaster tolerance of the scheduling device. Moreover, the primary scheduling device will also obtain the real-time health information uploaded by the server and the real-time status of the task from the zookeeper cluster. The health information is also the load information of the server, including the load of the server for downloading teaching tasks and the load of executing teaching tasks. The load can be specifically characterized by memory usage, CPU usage, disk usage, and the number of tasks. The real-time status of the task includes whether the task is in the download stage or the execution stage, and information such as the progress in the corresponding stage (for example, 60% has been downloaded, and the download speed is 50MB / s). The primary scheduling device issues commands to the corresponding servers in the server cluster according to the health information uploaded by the server and the real-time status of the task, and the executor in the server specifically downloads and executes the target teaching task. When the primary scheduling device finds that the server is abnormal from the health information, it sends an alarm message to the monitor, and the developer learns the alarm message through the monitor and processes the abnormal server. In this embodiment, the middleware device specifically uses a zookeeper cluster, and the zookeeper cluster includes multiple (2 in the figure) zookeepers. On the one hand, the zookeeper accepts the monitoring information reported by the server cluster and the real-time status of the task, and on the other hand, it also accepts the heartbeat sent by the scheduling device. The number of servers in the server cluster in this embodiment is not specifically limited. 3 servers are shown in the figure, and each server is configured with an executor to specifically execute reporting the load information, downloading and executing teaching tasks. When the executor executes the teaching task, it specifically sends a command to the teacher client, and the teacher client pushes the video corresponding to the teaching task to the user side through the cloud platform at the specified time of teaching. In this embodiment, the teaching tasks downloaded by the executor are stored in the cloud database in Tencent Cloud, so that the teacher client pushes the teaching tasks stored in the cloud database in the cloud to the user side. Further, the cloud platform in the embodiment of the present application can use Tencent Cloud, also known as Tencent Cloud Computing, which is a cloud computing service launched by Tencent, providing basic cloud services such as cloud servers, cloud storage, cloud databases, and elastic web engines.
[0121] Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that combines a large number of different types of storage devices (storage devices are also called storage nodes) in the network through cluster applications, grid technology, and distributed storage file systems, etc., and works together through application software or application interfaces to jointly provide data storage and business access functions to the outside world.
[0122] Currently, the storage method of the storage system is as follows: Create a logical volume. When creating a logical volume, physical storage space is allocated for each logical volume. This physical storage space may be composed of the disks of a certain storage device or several storage devices. The client stores data on a certain logical volume, that is, stores the data on the file system. The file system divides the data into many parts, and each part is an object. The object not only contains the data but also contains additional information such as data identification (ID, ID entity), etc. The file system writes each object into the physical storage space of the logical volume respectively, and the file system will record the storage location information of each object. Thus, when the client requests to access the data, the file system can enable the client to access the data according to the storage location information of each object.
[0123] The process of the storage system allocating physical storage space for a logical volume is specifically as follows: According to the capacity estimation of the objects stored in the logical volume (this estimation often has a large margin relative to the actual capacity of the objects to be stored) and the group of redundant array of independent disks (RAID, Redundant Array of Independent Disk), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space for the logical volume.
[0124] In the embodiment of the present application, by introducing cloud platform storage for teaching tasks and pushing relevant content of teaching tasks to student clients through the cloud platform, cloud computing education (abbreviation: CCEDU) is realized, which refers to an educational platform service based on the cloud computing business model application. On the cloud platform, all educational institutions, training institutions, enrollment service institutions, publicity institutions, industry associations, management institutions, industry media, legal structures, etc. are centrally integrated into a resource pool, and each resource displays and interacts with each other, exchanges as needed, reaches an intention, thereby reducing educational costs and improving efficiency.
[0125] Figure 4 It is a schematic diagram of the implementation environment involved in the remote teaching method of another embodiment of the present application. Compared with Figure 1 , the embodiment of the present application adds a standby scheduling device 111, a middleware device 140, and a teacher client 150;
[0126] The standby scheduling device 111 is a scheduling device with the same functions as the main scheduling device 110. Both the main scheduling device 110 and the standby scheduling device 111 send heartbeat information to the middleware device 140 according to a preset heartbeat frequency, and at the same time, each monitors whether the heartbeat information of the other scheduling device is abnormal. If the standby scheduling device 111 monitors that the heartbeat information of the main scheduling device 110 is abnormal, a primary-backup switch is performed, the main scheduling device 110 is switched to the standby scheduling device, and the standby scheduling device 111 is switched to the main scheduling device.
[0127] In addition to storing the heartbeat information sent by the main scheduling device 110 and the standby scheduling device 111, the middleware device 140 also stores the loads uploaded by the server cluster 120 in real time, so that the main scheduling device 110 obtains the loads of the servers in the server cluster 120 from the middleware device.
[0128] The servers in the server cluster 120 upload the loads to the middleware device 140 in real time, receive and execute the instructions issued by the main scheduling device 110. For example, when the main server 1201 and the server 1202 receive the instruction to download a certain teaching task, they download the teaching task according to the storage address indicated in the instruction. After that, when the server 1201 receives the instruction to execute the teaching task, the server 1201 knows that it is the main server for executing the teaching task and executes the teaching task. When executing the teaching task, the server 1201 drives the teacher client 150 corresponding to the teaching task to start and pushes the teaching task to the teacher client 150 for live broadcast.
[0129] The number of teacher clients in the embodiments of the present application is not specifically limited. In Figure 4 one teacher client 150 is taken as an example to illustrate the functions of the teacher client. The teacher information is pre-stored in the teacher client 150, so that it can correspond to the teaching task. The teacher client 150 can be driven by the server to start, receive the teaching task at a preset live broadcast time point, and perform a live broadcast to the student client 130, so that the student client 130 obtains the viewing experience of the live broadcast. It should be understood that the number of student clients 130 can be 1 or multiple, which is not specifically limited in this embodiment.
[0130] Based on the above embodiments, as an embodiment, when the main scheduling device initiates a live broadcast at the appointed time for a live broadcast task, but the teacher client fails to initiate the live broadcast, a warning will be triggered. For another example, when the hardware resources of the server reach the bottleneck, an alarm will also be initiated. If it is a disk alarm, a cleaning action will be initiated. When a server in the server cluster fails to report the load to the middleware device for more than a preset time, an alarm will also be initiated. The main scheduling device can comprehensively understand the running status and health status of the entire on-demand system. At the same time, the main scheduling device is communicatively connected to the background of the enterprise WeChat. The main scheduling device sends the alarm to the enterprise WeChat, and the WeChat of the developer has pre-followed the enterprise WeChat, so as to realize the connection between WeChat and the enterprise WeChat. The enterprise WeChat will immediately deliver the received alarm to the developer, and the developer will immediately handle the fault and recover the on-demand cluster.
[0131] The present application also provides a remote teaching method, which is applied to the main server in the server cluster for executing the target teaching task. Figure 5 As shown in the flowchart of the remote teaching method according to another embodiment of the present application, as Figure 5 shown, the method includes:
[0132] S201. Report the first load at the current moment to the middleware device, so that the main scheduling device sends the download address of the target teaching task to the main server according to the first load of the main server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment.
[0133] By the server of the embodiment of the present application sending the first load to the main scheduling device in real time, the main scheduling device selects candidate servers according to the first loads of the servers in the server cluster, and the main scheduling device only sends the download address of the target teaching task to the candidate servers.
[0134] S202. Download the target teaching task according to the download address.
[0135] Before receiving the third instruction, the main server of the embodiment of the present application is also involved in the process of downloading the target teaching task. Only when the server downloads the target teaching task, it is possible for the main scheduling device to send the third instruction to the server later. The main server first sends the second load to the main scheduling device. As can be seen from the above embodiments, the first load is the load related to downloading the teaching task. The main scheduling device selects the server for downloading the target teaching task, that is, the candidate server, from the server cluster by obtaining the first loads of the servers in the server cluster. It can be seen that before serving as the main server for a teaching task, the server needs to first serve as a candidate server to download the teaching task.
[0136] S203. Report the second load at the execution time of the target teaching task to the middleware device, so that the main scheduling device determines the main server for executing the target teaching task based on the second load of the main server at the execution time of the target teaching task, and sends a third instruction to the main server.
[0137] The candidate server enables the main scheduling device to select a main server for executing the target teaching task from the candidate servers by sending the second load to the main scheduling device, and sends a third instruction to the main server.
[0138] S204. Receive the third instruction, execute the target teaching task according to the third instruction, and report the second load when executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server executing the target teaching task based on the second load when executing the target teaching task, send a first instruction.
[0139] S205. Receive the first instruction and stop executing the target teaching task at the preset task node according to the first instruction.
[0140] It should be understood that whether a server in the server cluster of the present application embodiment is a main server is for the teaching task. Combining the fact that the server stores several teaching tasks in the above embodiment, at any moment, a server can be both the main server of a certain teaching task and the standby server of a certain teaching task. When the server receives the third instruction sent by the main scheduling device, it knows that it is the main server for executing the target teaching task, and then executes the target teaching task.
[0141] During the process of the main server executing the target teaching task, the main scheduling device will monitor in real time whether there is an abnormality when the main server is executing. If an abnormality occurs, the main scheduling device will send a first instruction to the main server. The first instruction can indicate the preset task node at which the main server stops executing the target teaching task, so that the main server stops executing the target teaching task at the preset task node according to the first instruction.
[0142] The remote teaching method of the embodiment of the present application enables when the server cluster needs to be expanded, directly register the information of the local machine in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device, and being able to stop executing in time at the preset task node when an abnormality occurs in executing the target teaching task, thus laying a foundation for switching to the standby server to continue executing the teaching task.
[0143] Based on the above embodiments, when the main server executes the target teaching task, if it receives the fourth instruction sent by the main scheduling device, it stops executing the target teaching task according to the fourth instruction. As can be seen from the above embodiments, the fourth instruction is obtained based on the teacher information associated with the target teaching task. When the main scheduling device detects that multiple teaching tasks with the same teacher information are being executed, it will select one teaching task from these multiple teaching tasks for retention, and for the teaching tasks that are not retained, the main scheduling device will send the fourth instruction to the server executing the teaching task to stop continuing to execute the task.
[0144] The existing video playback live stream technology can only play videos without the interactive operations between teachers and students, which has the drawback that students are not restricted by teachers during remote learning. However, in the embodiments of the present application, the interactive operations initiated by teachers to students are stored during video recording, so that the in-class interactions can be played simultaneously when playing the video. That is to say, the teaching tasks of the present application include not only pre-recorded audio and video data, but also interactive data, where the interactive data is used to represent the interactive operations initiated by teachers to students during recording, and the interactive data includes the frame number information of the audio and video data corresponding to the moment when the interactive operations are initiated by teachers to students.
[0145] In the embodiments of the present application, when recording the teaching task, the frame number of the audio and video corresponding to the interactive operation initiated by the teacher to the student can be stored. Thus, when the server executes the teaching task, when the audio and video data in the teaching task is played to the above frame number, the interactive data is executed simultaneously. For example, when a teacher distributes a test card to students during a remote teaching live broadcast, during the recording of the teacher's remote teaching, it is recorded that the interactive operation of the teacher sending the test card to the students is located at the 500th frame of the recorded video. In this way, when the server reaches the 500th frame of the video, it instructs the teacher client to distribute the test card to the student client.
[0146] In the embodiments of the present application, the interactive data is stored in a structured manner. Specifically, the specific information of the interactive data is divided into the following sub-information: the frame number information of the audio-visual data corresponding to the moment when the teacher initiates an interactive operation to the student, the interaction content, the target user, and the interaction result. For each piece of interactive information, by parsing the specific content of each sub-information in the interactive information, the specific content is respectively stored in the corresponding storage directory, thereby realizing structured storage. For example, in a piece of interactive data, the frame number information of the audio-visual data corresponding to the moment when the teacher initiates an interactive operation to the student is the 100th frame, the interaction content is to answer a multiple-choice question, the target user is a student with a previous score less than 60 points, and the interaction result is the reply statistics of the target user to the interaction content. For example, 80% of the people answered correctly. Then, when storing this interactive data in a structured manner, 100 is stored in the storage directory of the frame number information of the audio-visual data corresponding to the moment when the teacher initiates an interactive operation to the student, the multiple-choice question is stored in the storage directory of the interaction content, the unique identifier of the student with a previous score less than 60 points is stored in the storage directory of the target user, and 80% is stored in the storage directory of the interaction result.
[0147] Based on the above embodiments, each server in the server cluster of the embodiments of the present application has the function of automatically cleaning the storage space. Specifically, the remote teaching method further includes: after downloading a teaching task each time, determining whether the remaining storage capacity in the local storage space is lower than a first preset threshold;
[0148] If it is lower than the first preset threshold, then in the order from far to near according to the time when the teaching task is downloaded, delete the downloaded teaching tasks in the local storage space until the remaining storage capacity is higher than a second preset threshold.
[0149] Optionally, the first preset threshold may be 10% of the total storage capacity of the local storage space, and the second preset threshold may be 80% of the total storage capacity of the local storage space. The embodiments of the present application do not further limit the specific size range of the first preset threshold and the second preset threshold. It should be understood that each server itself has a storage space for storing teaching tasks, which is also called the local storage space. In practical applications, each server itself may have a storage space of 100 TB (Terabyte, trillion bytes). For example, when the remaining storage capacity in the local storage space is less than 10 TB, then in the order from far to near according to the time when the teaching task is downloaded, delete the teaching tasks in the local storage space until the remaining storage capacity is higher than 80 TB.
[0150] Based on the above embodiments, as an optional embodiment, in order to further save storage capacity, when the server of the embodiments of the present application receives the download address of the target teaching task, it first queries whether the target teaching task exists in the local storage space. If not, it downloads the target teaching task.
[0151] The present application also provides a remote teaching method, which is applied to a standby server in a server cluster. Figure 6 It is a schematic flowchart of the remote teaching method according to another embodiment of the present application. As Figure 6 shown, the method includes:
[0152] S301. Report a first load at the current moment to the middleware device, so that the main scheduling device sends a download address of a target teaching task to the standby server according to the first load of the standby server at the current moment obtained from the middleware device; the execution moment of the target teaching task is a moment after a preset duration from the current moment.
[0153] The server according to an embodiment of the present application makes the main scheduling device select candidate servers according to the first loads of the servers in the server cluster by sending the first load to the main scheduling device in real time, and the main scheduling device only sends the download address of the target teaching task to the candidate servers.
[0154] S302. Download the target teaching task according to the download address;
[0155] S303. Report a second load when the main server has an exception to the middleware device, so that the main scheduling device sends a second instruction according to the second load of the standby server when the main server has an exception obtained from the middleware device.
[0156] S304. Receive the second instruction, determine a preset task node at which the main server stops executing the target teaching task, and continue to execute the target teaching task from the preset task node after the main server stops executing the target teaching task.
[0157] It should be understood that whether a server in the server cluster according to an embodiment of the present application is a standby server is also relative to a teaching task. Combining the fact that the server stores several teaching tasks in the above embodiment, at any moment, a server can be both the main server of a certain teaching task and the standby server of a certain teaching task. When the server receives the second instruction sent by the main scheduling device, it knows that it is the standby server for continuing to execute the target teaching task and the preset task node at which the main server stops executing the target teaching task, so as to continue to execute the target teaching task from the preset task node after the main server stops executing the target teaching task.
[0158] The remote teaching method according to the embodiment of the present application can, when the server cluster needs to be expanded, directly register the information of the local machine in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device. When an exception occurs in the main server during the execution of the target teaching task, the standby server timely continues to execute the target teaching task at the preset task node, thus laying a foundation for switching to the standby server to continue executing the teaching task, so that when students learn through the student client, they can perceive as little as possible that an exception occurs in the teaching task and study more attentively.
[0159] Figure 7 It is an interaction schematic diagram of the scheduling device and the server cluster according to the embodiment of the present application. For the convenience of understanding, in the embodiment of the present application, the number of servers in the server cluster is three, namely the first server, the second server, and the third server. As Figure 7 shown, the interaction process includes:
[0160] The scheduling device obtains the teaching task at a moment whose execution moment is a preset duration after the current moment, and uses it as the target teaching task;
[0161] The first server, the second server, and the third server send the first load at the current moment to the scheduling device;
[0162] The scheduling device receives the first load of the first server, the second server, and the third server at the current moment, and uses the first server and the second server as candidate servers according to the first load of the first server, the second server, and the third server;
[0163] Send the download address of the target teaching task to the first server and the second server;
[0164] The first server and the second server download the target teaching task according to the download address of the target teaching task;
[0165] When the execution moment of the target teaching task is reached, the scheduling device determines the first server as the main server according to the second load sent by the first server and the second server;
[0166] The scheduling device sends a third instruction to the first server;
[0167] The first server executes the target teaching task according to the third instruction;
[0168] When the scheduling device detects that an exception occurs in the first server during the execution of the target teaching task, it sends a first instruction to the first server and a second instruction to the second server;
[0169] The first server stops executing the target teaching task at a preset task node according to the first instruction;
[0170] After the first server stops executing the target teaching task according to the first instruction, the second server continues to execute the target teaching task from the preset task node according to the second instruction.
[0171] Figure 8 It is a schematic structural diagram of a main scheduling device according to an embodiment of the present application. As Figure 8 shown, the main scheduling device includes: a candidate server determination module 101, a primary server determination module 102, a standby server acquisition module 103, a switching module 104, and a heartbeat information sending module 105. Specifically:
[0172] The candidate server determination module 101 is configured to obtain a teaching task whose execution time is a preset duration after the current moment, and use it as the target teaching task. Obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device. According to the first load of each server at the current moment, determine candidate servers related to the target teaching task from the server cluster, and send the download address of the target teaching task to the candidate servers, so that the candidate servers download the target teaching task according to the download address; the first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0173] The primary server determination module 102 is configured to determine a primary server for executing the target teaching task from the candidate servers according to the second load of the candidate servers at the execution time of the target teaching task, and send a third instruction to the primary server, so that the primary server executes the target teaching task according to the third instruction;
[0174] The standby server acquisition module 103 is configured to, if it is determined according to the second load of the primary server when executing the target teaching task that the primary server has an abnormality, determine a standby server from the candidate servers according to the second load of the candidate servers when the primary server has an abnormality;
[0175] The switching module 104 is configured to send a first instruction to the primary server and a second instruction to the standby server, so that the primary server stops executing the target teaching task at a preset task node according to the first instruction, and the standby server continues to execute the target teaching task from the preset task node after the primary server stops executing the target teaching task according to the second instruction;
[0176] The heartbeat information sending module 105 is configured to send heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the main scheduling device stored in the middleware device is abnormal, and performs the primary / standby switching of the scheduling device when the heartbeat information is abnormal.
[0177] The main scheduling device provided by the embodiment of the present invention specifically executes the process of the above method embodiment. For specific details, please refer to the content of the above remote teaching method applied to the main scheduling device, which will not be elaborated here. The main scheduling device provided by the embodiment of the present invention obtains the load of the server through the middleware device, so that when the server cluster needs to be expanded, the information of the local machine can be directly registered in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device. The main scheduling device obtains the first load of the server cluster at the current moment, selects multiple candidate servers, and provides candidate servers for multi-backup processing when downloading resources. In this way, when an abnormality occurs in the live broadcast task, it can be switched to the standby machine without loss, and there is no need to download various resources separately. The whole process does not require manual intervention, and it also makes the load of the server cluster relatively balanced when downloading teaching tasks, which is beneficial to the long-term and healthy operation of the server. When it is detected that the main server executes the target teaching task abnormally, the first instruction and the second instruction are respectively sent to the main server and the standby server, so that the main server stops executing the teaching task at the preset task node, and the standby server continues to execute the teaching task at the preset task node, so that the student side cannot perceive that the teaching task has an abnormality, and thus can study more attentively.
[0178] Further, the main scheduling device further includes:
[0179] A teacher information acquisition module, configured to acquire the teacher information associated with the target teaching task as the target teacher information, acquire the teacher information associated with the teaching task being executed by the server cluster, and use the teaching task being executed and the target teaching task whose associated teacher information is the target teacher information as the teaching tasks to be screened;
[0180] A screening module, configured to select one server from the servers executing the teaching tasks to be screened as the server to be retained;
[0181] A fourth instruction sending module, configured to send a fourth instruction to the servers other than the server to be retained among the servers executing the teaching tasks to be screened, so that the servers receiving the fourth instruction stop executing the teaching tasks to be screened.
[0182] Figure 9 It is a schematic structural diagram of a main server according to an embodiment of the present application. As Figure 9 shown, the main server includes: a main first load sending module 201, a main task downloading module 202, a main second load sending module 203, a task execution module 204, and a stop execution module 205. Specifically:
[0183] The main first load sending module 201 is used to report the first load at the current moment to the middleware device, so that the main scheduling device can send the download address of the target teaching task to the main server according to the first load of the main server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment, the first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0184] The main task download module 202 is used to download the target teaching task according to the download address.
[0185] The main second load sending module 203 is used to report the second load at the execution moment of the target teaching task to the middleware device, so that the main scheduling device can determine the main server as the main server for executing the target teaching task according to the second load of the main server at the execution moment of the target teaching task, and send the third instruction to the main server.
[0186] The task execution module 204 is used to receive the third instruction, execute the target teaching task according to the third instruction, and report the second load when executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server executing the target teaching task according to the second load when executing the target teaching task, the first instruction is sent.
[0187] The stop execution module 205 is used to receive the first instruction and stop executing the target teaching task at the preset task node according to the first instruction.
[0188] The main server provided by the embodiment of the present invention specifically executes the process of the above method embodiment. For details, please refer to the content of the above remote teaching method applied to the main server, which will not be elaborated here. The main server provided by the embodiment of the present invention enables, when the server cluster needs to be expanded, directly registering the information of the local machine in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device, and being able to stop executing in a timely manner at the preset task node when an abnormality occurs in the execution of the target teaching task, thus laying a foundation for switching to the standby server to continue executing the teaching task.
[0189] Based on the above embodiments, as an optional embodiment, the main server further includes:
[0190] The fourth instruction execution module is used to stop executing the target teaching task according to the fourth instruction if the fourth instruction sent by the main scheduling device is received during the execution of the target teaching task;
[0191] wherein, the fourth instruction is obtained according to the teacher information associated with the target teaching task.
[0192] Based on the above embodiments, as an alternative embodiment, the target teaching task includes pre-recorded audio-visual data and interaction data; the interaction data is used to represent the interaction operations initiated by the teacher to the students during the recording of the target teaching task, and the interaction data includes the frame number information of the audio-visual data corresponding to the moment when the teacher initiates the interaction operation to the students.
[0193] The task execution module executes the target teaching task, including:
[0194] Play the audio-visual data, and when playing to the frame number corresponding to the moment when the teacher initiates the interaction operation to the students, simultaneously execute the interaction data.
[0195] Figure 10 It is a schematic structural diagram of a standby server according to an embodiment of the present application, as Figure 10 shown, the standby server includes: a standby first load sending module 301, a standby task downloading module 302, a standby second load sending module 303, and a continue execution module 304. Specifically:
[0196] The standby first load sending module 301 is used to report the first load at the current moment to the middleware device, so that the main scheduling device sends the download address of the target teaching task to the standby server according to the first load of the standby server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment, the first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task.
[0197] The standby task downloading module 302 is used to download the target teaching task according to the download address.
[0198] The standby second load sending module 303 is used to report the second load when the main server has an exception to the middleware device, so that the main scheduling device sends a second instruction according to the second load of the standby server when the main server has an exception obtained from the middleware device.
[0199] The continue execution module 304 is used to receive the second instruction, determine the preset task node at which the main server stops executing the target teaching task, and continue to execute the target teaching task from the preset task node after the main server stops executing the target teaching task.
[0200] When the server cluster needs to be expanded, the standby server according to the embodiment of the present application can directly register the information of the local machine in the middleware device to send the load information and receive the instructions sent by the main scheduling device, without the need to update the main scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the main scheduling device. When an exception occurs in the main server during the execution of the target teaching task, the standby server timely continues to execute the target teaching task at the preset task node, thus laying a foundation for switching to the standby server to continue executing the teaching task, so that when students learn through the student client, they can perceive as little as possible that an exception occurs in the teaching task and can study more attentively.
[0201] In an embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor; at least one program stored in the memory and used to be executed by the processor, which can achieve, compared with the prior art: when it is detected that an exception occurs in the main server during the execution of the target teaching task, a first instruction and a second instruction are respectively sent to the main server and the standby server, so that the main server stops executing the teaching task at the preset task node, and the standby server continues to execute the teaching task at the preset task node, making the student side not perceive that an exception occurs in the teaching task, so as to study more attentively.
[0202] In an optional embodiment, an electronic device is provided, as Figure 11 shown Figure 11 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. Among them, the processor 4001 and the memory 4003 are connected, such as connected through a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiment of the present application.
[0203] The processor 4001 may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in combination with the disclosure of the present application. The processor 4001 may also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0204] The bus 4002 may include a path for transmitting information among the above components. The bus 4002 can be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 11 only one line is used in Figure 11 , but it does not mean that there is only one bus or one type of bus.
[0205] The memory 4003 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0206] The memory 4003 is used to store the application program code for implementing the solution of this application, and is controlled by the processor 4001 to execute. The processor 4001 is used to execute the application program code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0207] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When it runs on a computer, the computer can execute the corresponding content in the foregoing method embodiment. Compared with the prior art, the load of the server is obtained through the middleware device, so that when the server cluster needs to be expanded, the information of the local machine can be directly registered in the middleware device to send the load information and receive the instructions sent by the master scheduling device, without the need to update the master scheduling device, avoiding the disadvantage of large changes caused by directly exposing its own address to the master scheduling device. The master scheduling device obtains the first load of the server cluster at the current moment, selects multiple candidate servers, and provides candidate servers for multi-backup processing when downloading resources. In this way, when an exception occurs in the live broadcast task, it can be seamlessly switched to the standby machine without the need to download various resources separately, and no manual intervention is required throughout the process. It also makes the load of the server cluster relatively balanced when downloading teaching tasks, which is beneficial to the long-term and healthy operation of the server. When it is detected that the main server executes the target teaching task abnormally, the first instruction and the second instruction are respectively sent to the main server and the standby server, so that the main server stops executing the teaching task at the preset task node, and the standby server continues to execute the teaching task at the preset task node, making the student side unaware of the abnormality of the teaching task, so as to study more attentively.
[0208] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0209] The above are only some embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A remote teaching method, characterized in that, Applied to the main scheduling device, the remote teaching method includes: Obtain a teaching task whose execution time is a preset duration after the current moment, and use it as the target teaching task. Obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device. According to the first load of each server at the current moment, determine candidate servers related to the target teaching task from the server cluster, and send the download address of the target teaching task to the candidate servers, so that the candidate servers download the target teaching task according to the download address; the candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server with the least number of downloaded and identical teaching tasks as the server with the smallest first load; According to the second load of the candidate servers at the execution time of the target teaching task, determine the main server for executing the target teaching task from the candidate servers, and send a third instruction to the main server, so that the main server executes the target teaching task according to the third instruction; If it is determined that the main server is abnormal according to the second load of the main server when executing the target teaching task, then determine a standby server from the candidate servers according to the second load of the candidate servers when the main server is abnormal; Send a first instruction to the main server and a second instruction to the standby server, so that the main server stops executing the target teaching task at a preset task node according to the first instruction, and the standby server continues to execute the target teaching task from the preset task node after the main server stops executing the target teaching task; Among them, the remote teaching method further includes: sending heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the main scheduling device stored in the middleware device is abnormal, and performs the main-standby switch of the scheduling device when the heartbeat information is abnormal; the first load includes the load related to downloading teaching tasks, and the second load includes the load related to executing teaching tasks.
2. The remote teaching method according to claim 1, characterized in that, After sending the third instruction to the main server, it further includes: Obtain the teacher information associated with the target teaching task as the target teacher information, obtain the teacher information associated with the teaching tasks being executed in the server cluster, and use the teaching tasks being executed whose associated teacher information is the target teacher information and the target teaching task as the teaching tasks to be screened; Select one server from the servers executing the teaching tasks to be screened as the server to be retained; Send a fourth instruction to the other servers among the servers executing the teaching tasks to be screened except the server to be retained, so that the servers receiving the fourth instruction stop executing the teaching tasks to be screened.
3. A remote teaching method, characterized in that, Applied to the main server, the remote teaching method includes: Report the first load at the current moment to the middleware device, so that the main scheduling device can send the download address of the target teaching task to the candidate server according to the first loads of each server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment; Download the target teaching task according to the download address; Report the second load at the execution moment of the target teaching task to the middleware device, so that the main scheduling device can determine the main server for executing the target teaching task based on the second load of the main server at the execution moment of the target teaching task, and send a third instruction to the main server; Receive the third instruction, execute the target teaching task according to the third instruction, and report the second load when executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server executing the target teaching task based on the second load when executing the target teaching task, it sends a first instruction; Receive the first instruction and stop executing the target teaching task at a preset task node according to the first instruction; The first load includes the load related to downloading the teaching task, and the second load includes the load related to executing the teaching task; Among them, the main server is determined by the main scheduling device from the candidate servers according to the second load of the candidate servers at the execution moment of the target teaching task. The candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server that has downloaded the least number of the same teaching tasks as the server with the smallest first load.
4. The remote teaching method according to claim 3, characterized in that It further includes: If receiving the fourth instruction sent by the main scheduling device when executing the target teaching task, stop executing the target teaching task according to the fourth instruction; Among them, the fourth instruction is obtained according to the teacher information associated with the target teaching task.
5. The remote teaching method according to claim 3, characterized in that, The target teaching task includes pre-recorded audio and video data and interactive data; the interactive data is used to represent the interactive operations initiated by the teacher to the students when recording the target teaching task, and the interactive data includes the frame number information of the audio and video data corresponding to the moment when the teacher initiates the interactive operation to the students; Executing the target teaching task includes: Playing the audio and video data, and when playing to the frame number corresponding to the moment when the teacher initiates the interactive operation to the students, simultaneously execute the interactive data.
6. A remote teaching method, characterized in that, Applied to a standby server, the remote teaching method includes: Report the first load at the current moment to the middleware device, so that the main scheduling device can send the download address of the target teaching task to the candidate server according to the first loads of each server at the current moment obtained from the middleware device; the execution moment of the target teaching task is the moment after a preset duration from the current moment; Download the target teaching task according to the download address; Report the second load when an exception occurs in the primary server to the middleware device, so that the primary scheduling device sends a second instruction according to the second load of the standby server obtained from the middleware device when an exception occurs in the primary server; Receive the second instruction, determine the preset task node at which the primary server stops executing the target teaching task, and after the primary server stops executing the target teaching task, continue to execute the target teaching task from the preset task node; The first load includes the load related to the download teaching task, and the second load includes the load related to the execution teaching task; Among them, the standby server is determined by the primary scheduling device from the candidate servers according to the second load of the candidate servers when the primary server has an exception during the execution of the target teaching task. The candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server with the least same downloaded teaching tasks as the server with the smallest first load.
7. A master scheduling device, characterized in that, Include: A candidate server determination module, configured to obtain the teaching task whose execution time is a preset duration after the current moment as the target teaching task, obtain the first load and the second load reported in real time by each server in the server cluster from the middleware device, and determine the candidate servers related to the target teaching task from the server cluster according to the first load of each server at the current moment, and send the download address of the target teaching task to the candidate servers, so that the candidate servers download the target teaching task according to the download address; The candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server with the least same downloaded teaching tasks as the server with the smallest first load; A primary server determination module, configured to determine the primary server for executing the target teaching task from the candidate servers according to the second load of the candidate servers at the execution time of the target teaching task, and send a third instruction to the primary server, so that the primary server executes the target teaching task according to the third instruction; A standby server acquisition module, configured to, if it is determined that the primary server has an exception according to the second load of the primary server during the execution of the target teaching task, determine the standby server from the candidate servers according to the second load of the candidate servers when the primary server has an exception; A switching module, configured to send a first instruction to the primary server and a second instruction to the standby server, so that the primary server stops executing the target teaching task at the preset task node according to the first instruction and the standby server continues to execute the target teaching task from the preset task node after the primary server stops executing the target teaching task; A heartbeat information sending module, configured to send heartbeat information to the middleware device according to a preset heartbeat frequency, so that the standby scheduling device monitors whether the heartbeat information of the primary scheduling device stored in the middleware device is abnormal, and performs the primary and standby switching of the scheduling device when the heartbeat information is abnormal; The first load includes a load related to downloading teaching tasks, and the second load includes a load related to executing teaching tasks.
8. A master server, characterized in that, It includes: A main first-load sending module, configured to report the first load at the current moment to a middleware device, so that a main scheduling device sends a download address of a target teaching task to a candidate server according to the first loads of each server at the current moment obtained from the middleware device; the execution moment of the target teaching task is a moment at a preset duration after the current moment; A main task downloading module, configured to download the target teaching task according to the download address; A main second-load sending module, configured to report the second load at the execution moment of the target teaching task to the middleware device, so that the main scheduling device determines the main server as the main server for executing the target teaching task according to the second load of the main server at the execution moment of the target teaching task, and sends a third instruction to the main server; A task execution module, configured to receive the third instruction, execute the target teaching task according to the third instruction, and report the second load at the time of executing the target teaching task to the middleware device, so that if the main scheduling device determines that there is an abnormality in the main server executing the target teaching task according to the second load at the time of executing the target teaching task, a first instruction is sent; A stop execution module, configured to receive the first instruction and stop executing the target teaching task at a preset task node according to the first instruction; The first load includes a load related to downloading teaching tasks, and the second load includes a load related to executing teaching tasks; Wherein, the main server is determined by the main scheduling device from the candidate servers according to the second load of the candidate servers at the execution moment of the target teaching task, and the candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server with the least same downloaded teaching tasks as the server with the smallest first load.
9. A standby server, characterized in that, It includes: A standby first-load sending module, configured to report the first load at the current moment to a middleware device, so that a main scheduling device sends a download address of a target teaching task to a candidate server according to the first loads of each server at the current moment obtained from the middleware device; the execution moment of the target teaching task is a moment at a preset duration after the current moment; A standby task downloading module, configured to download the target teaching task according to the download address; A standby second-load sending module, configured to report the second load when the main server has an abnormality to the middleware device, so that the main scheduling device sends a second instruction according to the second load of the standby server when the main server has an abnormality obtained from the middleware device; A continue execution module, configured to receive the second instruction, determine the preset task node at which the main server stops executing the target teaching task, and continue to execute the target teaching task from the preset task node after the main server stops executing the target teaching task; The first load includes a load related to downloading teaching tasks, and the second load includes a load related to executing teaching tasks; Among them, the standby server is determined by the main scheduling device from the candidate servers according to the second load of the candidate servers when the main server has an exception in executing the target teaching task. The candidate servers at least include the server with the smallest first load in the server cluster at the current moment and the server with the least same downloaded teaching tasks as the server with the smallest first load.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause the computer to execute the steps of the remote teaching method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Cluster task coordination method, system and device
CN107341051A