Offline detection method and device, equipment and storage medium

By generating probe messages on the student side and sending them to other clients on the LAN, the problem of the student side being unable to determine whether they are offline or the teacher side is offline in time, and the effect of quickly determining the reason for offline and solving the connection problem is achieved.

CN119922102APending Publication Date: 2025-05-02GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311426659.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the online teaching scenario, the student side cannot determine whether he is offline or the teacher side is offline in time, resulting in the inability to quickly solve the connection problem.

Method used

By generating probe messages on the student side and sending them to other clients on the LAN, monitoring whether they respond to probe messages, thereby determining whether the server side is offline.

Benefits of technology

It enables the ability to quickly determine whether the server is offline or itself when the client is disconnected from the server, thereby quickly solving the connection problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922102A_ABST
    Figure CN119922102A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an offline detection method and device, equipment and a storage medium, and in the embodiment of the invention, when a first client is disconnected from a server, the first client generates a first probe message and sends the first probe message to a second client in a local area network. And after the second client receives the first probe message, if the second client is connected with the server at the moment, the second client generates a second probe message and sends the second probe message. The first client can determine whether the server is offline or not by determining whether the second probe message sent by the second client is monitored or not. According to the embodiment of the invention, under the condition that the client and the server are disconnected, the client can determine whether the server is offline or the client is offline by inquiring other clients, so that the offline reason can be quickly determined, and the problem that the offline reason cannot be quickly determined when the student is offline in the prior art is solved. The technical problem that a student side cannot determine an offline reason in time exists.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communications, and in particular to an offline detection method, apparatus, device and storage medium. Background Art

[0002] At present, in the scenario of online teaching, a teacher's computer device is connected to several student's computer devices through a local area network. The teacher's end is the server and the student's end is the client. The teacher's end can control the student's end, such as sending teaching, student demonstration, black screen control, homework collection, etc. However, in the prior art, when the communication connection between the student and the teacher is disconnected, the student cannot perceive whether it is offline or the teacher is offline, and can only perceive that the connection is disconnected.

[0003] In summary, in the prior art, when a student terminal is offline, there is a technical problem that the student terminal cannot determine the offline reason in time. Summary of the invention

[0004] The embodiments of the present invention provide an offline detection method, an offline detection device, and a storage medium, which can promptly determine the offline cause when the student is offline, thereby solving the technical problem in the prior art that the student end cannot promptly determine the offline cause when the student end is offline.

[0005] In a first aspect, an embodiment of the present invention provides an offline detection method, the method being applicable to a first client connected to a server via a local area network, and the server being connected to the first client and at least one second client, the method comprising:

[0006] In the case of determining that the connection with the server is disconnected, generating a first probe message;

[0007] Sending the first probe message to the second client and listening for a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message;

[0008] In the case where no second probe message sent by any second client is monitored, determining that the server is offline;

[0009] generating a fourth probe message when monitoring a third probe message sent by any one of the second clients and being connected to the server, wherein the third probe message is generated by the second client when the connection with the server is disconnected;

[0010] The fourth probe message is sent to the second client, so that the second client that sends the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0011] In a second aspect, an embodiment of the present invention provides an offline detection device, the device is applicable to a first client connected to a server via a local area network, and the server is connected to the first client and at least one second client, the device comprising:

[0012] A first message generating module, configured to generate a first probe message when it is determined that the connection with the server is disconnected;

[0013] A first sending module, used for sending the first probe message to the second client and monitoring a second probe message, wherein the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message;

[0014] An offline determination module, configured to determine that the server is offline when no second probe message sent by any second client is monitored;

[0015] A message monitoring module, used for generating a fourth probe message when monitoring a third probe message sent by any one of the second clients and connected to the server, wherein the third probe message is generated by the second client when the connection with the server is disconnected;

[0016] The second sending module is used to send the fourth probe message to the second client, so that the second client that sends the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0017] In a third aspect, an embodiment of the present invention provides an offline detection device, wherein the offline detection device includes a processor and a memory;

[0018] The memory is used to store a computer program and transmit the computer program to the processor;

[0019] The processor is used to execute an offline detection method as described in the first aspect according to instructions in the computer program.

[0020] In a fourth aspect, an embodiment of the present invention provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute an offline detection method as described in the first aspect.

[0021] As described above, the embodiment of the present invention provides an offline detection method, device, equipment and storage medium. In the embodiment of the present invention, when the first client is disconnected from the server, the first client generates a first probe message and sends the first probe message to the second client in the local area network. After the second client receives the first probe message, if the second client is connected to the server at this time, the second client generates a second probe message and sends it. The first client can determine whether the server is offline by determining whether the second probe message sent by the second client is monitored. In addition, the first client can also generate a fourth probe message when it monitors the third probe message sent by the second client disconnected from the server and is connected to the server, and send the fourth probe message to the corresponding second client. In the embodiment of the present invention, when the client is disconnected from the server, the client can determine whether the server is offline or it is offline by asking the second client in the same local area network, thereby quickly determining the offline reason, solving the technical problem in the prior art that the student end cannot determine the offline reason in time when the student end is offline. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of a server provided in an embodiment of the present invention being connected to multiple clients.

[0023] Figure 2 A schematic flow chart of an offline detection method provided by an embodiment of the present invention.

[0024] Figure 3 A schematic diagram of a multicast group provided by an embodiment of the present invention.

[0025] Figure 4 A schematic diagram of a framework of an offline detection method provided by an embodiment of the present invention.

[0026] Figure 5 A schematic flow chart of another offline detection method provided by an embodiment of the present invention.

[0027] Figure 6 A schematic diagram of a preset message structure of a first probe message provided in an embodiment of the present invention.

[0028] Figure 7 A schematic diagram of a framework for a client to determine whether a server is offline provided by an embodiment of the present invention.

[0029] Figure 8 A schematic structural diagram of an offline detection device provided in an embodiment of the present invention.

[0030] Fig. 9 A schematic diagram of the structure of an off-line detection device provided in an embodiment of the present invention.

[0031] Reference numerals:

[0032] Server 10, client 20. DETAILED DESCRIPTION

[0033] The following description and accompanying drawings fully illustrate the specific embodiments of the present application so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operation can vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is disclosed in fact, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0034] The offline detection method provided in this embodiment is applicable to online teaching scenarios. In online teaching scenarios, at least one client and server are added to the same local area network. The local area network is a regional network formed in a local area. Its characteristics are that the distribution area is limited and can be large or small. The local area network itself has a faster transmission speed than other networks, more stable performance, a simple framework, and is closed.

[0035] In this embodiment, the client refers to a program (also referred to as an application program, software program, or APP, etc.) in a learning device used by students to implement local services for online teaching. The learning devices used by students include but are not limited to: mobile phones, tablet computers, laptops, learning machines, and desktop computers.

[0036] In one embodiment, the learning device used by the student includes a processor, a display screen, a memory, and a communication module. The processor, the display screen, the memory, and the communication module may be connected via a communication bus or other means.

[0037] The processor may include processing units such as an application processor (AP), a graphics processing unit (GPU), and a central processing unit (CPU). The processor executes various functional applications and data processing of the learning device by running computer executable programs (such as software programs, instructions, and modules, etc.) stored in the memory. For example, the processor runs a program as a client to realize the function of online teaching.

[0038] The memory can be used to store computer executable programs of the learning device, etc., and the computer executable programs include instructions. The memory may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application required for at least one function. The data storage area can store data created according to the use of the learning device, etc. The memory may include a high-speed random access memory and may also include a non-volatile memory. For example, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the learning device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0039] The number of display screens may be one or more. The display screen may be a liquid crystal display (Liquid Crystal Display), an LED display (LED display), an organic light-emitting diode (OLED) display screen, or a flexible light-emitting diode (FLED) display screen, etc. The display screen may display based on instructions from a processor.

[0040] In some cases, the display screen may also have a touch function, that is, a touch display screen, which includes a display panel and a touch panel. The display panel is used to complete the visual output. The touch panel may be a component that supports infrared touch, electromagnetic touch, capacitive touch, or resistive touch. The touch panel may transmit touch data corresponding to the detected touch operation to the processor, and the display panel may provide visual output related to the touch operation.

[0041] The communication module may include a wired communication module and / or a wireless communication module. The wired communication module includes at least one communication interface, such as a Universal Serial Bus (USB) interface, a network interface, etc. The wireless communication module includes one or more of a Bluetooth module, an infrared module, a Wireless Fidelity (Wi-Fi) module, and a Near Field Communication (NFC) module. Currently, the processor can communicate with external devices through the communication module, such as communicating with a server in the background, communicating with other devices, and communicating with an external device adapted for the learning device. Among them, the external device can be one or more of a writing pen (also called a smart pen, stylus, etc.), a keyboard, and a mouse.

[0042] Based on the above structure, the learning device supports at least one type of operating system, wherein the operating system may be an Android system, a Windows system, a Linux system, an IOS system, or a macOS system, etc. The learning device installs at least one application under the operating system. The application may be an application that comes with the operating system, or an application downloaded from a third-party device or server. For example, the learning device is installed with an application (i.e., a client) for implementing online teaching.

[0043] In some cases, the learning devices used by students can also serve as servers.

[0044] The server refers to the program (also known as application, software program or APP, etc.) used to implement local services for online teaching in the teaching equipment used by teachers. The teaching equipment used by teachers includes but is not limited to: mobile phones, tablet computers, laptops, learning machines, desktop computers and other devices.

[0045] In one embodiment, the teaching device used by the teacher includes a processor, a display screen, a memory, and a communication module. The processor, the display screen, the memory, and the communication module may be connected via a communication bus or other means. The relevant functions of the processor, the display screen, the memory, and the communication module may refer to the relevant functions of the processor, the display screen, the memory, and the communication module in the aforementioned student device, and will not be described in detail at present.

[0046] On the basis of the above structure, the teaching device supports at least one type of operating system, wherein the operating system may be an Android system, a Windows system, a Linux system, an IOS system or a macOS system, etc. The operating system installed on the teaching device may be the same as or different from the operating system installed on the learning device, and the embodiment does not limit this. In one embodiment, the teaching device installs at least one application under the operating system. Among them, the application may be an application that comes with the operating system, or an application downloaded from a third-party device or server. For example, the teaching device is installed with an application for implementing online teaching (i.e., the server).

[0047] In some cases, the teaching equipment used by teachers can also serve as clients.

[0048] It is understandable that currently, both the client and the server need to log in to an account before they can be used. At this time, students indicate their student identity when registering an account, and teachers indicate their teacher identity when registering an account, so as to determine whether it is for students or teachers by the identity of the currently used account, that is, to distinguish between the server and the client. Alternatively, there are two programs for implementing online teaching, one is the server, which can only log in to an account with a teacher's identity, and the other is the client, which can only log in to an account with a student's identity. On this basis, the server and the client have different functional permissions to ensure the teacher's control over online teaching, while avoiding students' miscontrol that affects online teaching.

[0049] like Figure 1 As shown, the server 10 and multiple clients 20 are all connected to the same local area network, and the server 10 can communicate with multiple clients 20, and the clients 20 can also communicate with each other. Among them, the implementation method of communication is not currently limited. For example, communication is implemented through the HyperText Transfer Protocol (HTTP), and for another example, communication is implemented through WebSocket, where WebSocket is a protocol for full-duplex communication on a single TCP connection. In one embodiment, the server and the client can use multiple communication methods, and different implementation methods can be selected based on different communication requirements. For example, when the immediacy of communication is very high, WebSocket can be used to implement communication, and when the immediacy of communication is not so high, HTTP can be used to implement communication.

[0050] In the prior art, in the scenario of online teaching, teachers can control the client through the server, such as black screen control, etc. For some disobedient students, the client screen can be blackened, which is the behavior of the server actively blackening the screen. In some abnormal scenarios, the client will automatically blacken the screen if it is abnormally offline. There are two situations when the client is offline. One is that the client disconnects from the LAN, causing the client to be offline; the other is that the server disconnects and causes all clients to be offline. If the server is offline, all clients connected to it will be offline. If only a client is offline and the server is still online, other clients are still connected to the server. In this case, the offline client cannot perceive whether it is offline itself or the server is offline.

[0051] In order to solve the above technical problems, the embodiment of the present invention provides an offline detection method, such as Figure 2 As shown, Figure 2 A flowchart of an offline detection method provided in an embodiment of the present invention. The offline detection method provided in an embodiment of the present invention is applicable to a first client connected to a server via a local area network, and the server is connected to the first client and at least one second client. In addition, it should be understood that the first client and the second client are both clients that can implement the present solution. In the specific description, the first client is described as the main body. This is only to describe the present solution more clearly. Any one of the clients is taken as the main body, which is the first client, and the others are the second clients. All clients cooperate to implement the offline detection method in the embodiment of the present application. The offline detection method provided in an embodiment of the present invention includes:

[0052] Step 101: When it is determined that the connection with the server is disconnected, generate a first probe message.

[0053] In this embodiment, the first client detects the connection status with the server in real time. When the first client detects that it is disconnected from the server, that is, when the communication connection between it and the server is disconnected, the first client generates a first probe message, wherein the first probe message is used to trigger the second client in the local area network to detect the connection status with the server. For example, multiple clients establish a connection with the server through a websocket, and when a client detects that the websocket connection is disconnected, a first probe message is generated.

[0054] Step 102: Send a first probe message to the second client and monitor a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message.

[0055] After generating the first probe message, the first client will send the first probe message to the second client in the local area network. The way in which the first client sends the first probe message can be set according to actual needs, for example, it can be sent by multicast, or it can be sent by broadcast. In this embodiment, the multicast sending method is used as an example for explanation, where multicast, also known as multi-target broadcast or multicast, is a transmission method used in the network. It allows the sent message to be sent to a selected subset of all possible destinations, that is, to send information to a variety of clearly specified addresses. It is a method of communication between a multicaster and multiple receivers. In this embodiment, all subsets in the multicast group are clients, such as Figure 3 As shown, the user can pre-set the multicast address and port number of multicast communication, and then the user needs to write a program for establishing a multicast connection in each client, and the connection object of the program is all clients. For example, the program for multicast connection can be written using node.js. The dgram module provided in node.js can realize multicast communication. A socket object is created in the dgram module. The socket object is an interface for network programming, which can realize data transmission between different programs or devices. After that, the socket object is added to the multicast group. The multicast address and port number in the multicast group are the pre-set multicast address and port number. After all the settings are completed in all clients, the multicast function of all clients can be realized. It can be understood that the writing method of the program for multicast connection can be set according to actual needs, and is not specifically limited in this embodiment.

[0056] In this embodiment, the second client monitors the first probe message in real time. After monitoring the first probe message, the second client determines the connection status between itself and the server. If it is determined that it is connected to the server, the second client generates a second probe message, which is a message used to reply to the first probe message. Then the second probe message is sent to clients other than itself. When the second client determines that the connection between itself and the server is disconnected, there is no need to generate a second probe message.

[0057] Step 103: When no second probe message sent by any second client is monitored, it is determined that the server is offline.

[0058] After the first client sends the first probe message, if it does not monitor the second probe message sent by any second client, it means that all second clients are disconnected from the server at this time, and the first client can determine that the server is offline, where offline means disconnected from the local area network. When the first client monitors the second probe message sent by any second client, it determines that the server is not offline, but the connection between itself and the server is disconnected.

[0059] Step 104: When a third probe message sent by any second client is monitored and the client is connected to the server, a fourth probe message is generated. The third probe message is generated by the second client when the client is disconnected from the server.

[0060] In this embodiment, the first client will also monitor the third probe message sent by the second client in the local area network. The third probe message is generated by the second client and the server when the connection is disconnected. The specific generation process can refer to the above-mentioned process of the first client generating the first probe message, which will not be repeated in this embodiment. In one embodiment, the user can bind another message event to the socket object in the first client to monitor the third probe message. When the first client monitors the third probe message, it will parse the information carried by the third probe message, and the first client will determine whether it is connected to the server. If the first client determines that it is connected to the server, the first client generates a fourth probe message.

[0061] Step 105: Send a fourth probe message to the second client, so that the second client that sent the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0062] After generating the fourth probe message, the first client can send the fourth probe message to the second client, so that the second client that sent the third probe message can determine whether the server is offline or online by monitoring the fourth probe message. The specific process is as follows: Figure 4 shown.

[0063] Specifically, when there are client A, client B and client C in the local area network, in terms of data processing capabilities, client A, client B and client C can all be first clients. For the sake of clarity, when describing one of the clients as the main body, the client is defined as the first client, and the other clients are defined as second clients. Exemplarily, when client A is the first client, client B and client C are the second clients; when client B is the first client, client A and client C are the second clients. For client A, when client A determines that it is disconnected from the server, it generates a first probe message and sends the first probe message to client B and client C. Client B and client C determine the connection relationship between themselves and the server. When connected to the server, client B and client C generate a second probe message and multicast it. Client A determines whether the server is offline based on whether it monitors the second probe message. From the perspective of client A, client B or client C will generate a third probe message when disconnected from the server (when describing from the perspective of client B and client C, the first probe message is generated when disconnected from the server) and multicast it. Client A can also monitor the third probe message sent by client B or client C, and when connected to the server, generate a fourth probe message and then multicast it. Similarly, client B and client C also have the same functions as client A, that is, when client B and client C are the execution subjects, they can also implement the offline detection method provided in the embodiment of the present invention.

[0064] As described above, the embodiment of the present invention provides an offline detection method, device, equipment and storage medium. In the embodiment of the present invention, when the first client is disconnected from the server, the first client generates a first probe message and sends the first probe message to the second client in the local area network. After the second client receives the first probe message, if the second client is connected to the server at this time, the second client generates a second probe message and sends it. The first client can determine whether the server is offline by determining whether the second probe message sent by the second client is monitored. In addition, the first client can also generate a fourth probe message when it monitors the third probe message sent by the second client disconnected from the server and is connected to the server, and send the fourth probe message to the corresponding second client. In the embodiment of the present invention, when the client is disconnected from the server, the client can determine whether the server is offline or it is offline by asking the second client in the same local area network, thereby quickly determining the offline reason, solving the technical problem in the prior art that the student end cannot determine the offline reason in time when the student end is offline.

[0065] like Figure 5 As shown, Figure 5A flowchart of another offline detection method provided by an embodiment of the present invention is provided. The offline detection method provided by an embodiment of the present invention is a specific implementation of the above offline detection method. The offline detection method provided by an embodiment of the present invention includes:

[0066] Step 201: When it is determined that the connection with the server is disconnected, a first probe message is generated according to a preset message structure.

[0067] In this embodiment, when the first client determines to disconnect from the server, it will generate a first probe message according to a preset message structure. The preset message structure refers to a preset message structure. In this embodiment, the user can pre-set the message structure so that the first client can subsequently generate a first probe message according to the preset message structure. In one embodiment, the preset message structure includes length information, type information, and content information, wherein the length information stores the message length of the first probe message. The message length refers to the amount of valid information carried by the first probe message. In this embodiment, the amount of information included in the message length is the sum of the amount of type information and the amount of content information. The type information stores the message type of the first probe message, and the message type is the type of message; the content information stores the message content of the first probe message, that is, the content that needs to be transmitted in the first probe message. In one embodiment, the preset message structure of the first probe message is as follows: Figure 6 As shown, the length information is 4 bytes, the type is int32 (int means "basic integer"); the type information is 4 bytes, the type is int32; the content information is the message length minus 4 bytes, the type is json (JavaScript Object Notation, JS object notation) string.

[0068] In step 201, a first probe message is generated according to a preset message structure, including:

[0069] Step 2012: determine the message content of the first probe message, and determine the message length according to the message type and message content of the first probe message.

[0070] After generating the first initial message, the first client needs to further determine the message type and message content of the first probe message. Exemplarily, for different message types, an ID corresponding to each message type can be pre-set to distinguish different message types. For example, for the first probe message, its ID can be defined as 1000, and the ID is the message type of the first probe message. At the same time, the first client needs to determine the message content of the first probe message based on the information transmitted by the first probe message. In one embodiment, the message content includes first identification information of the first probe message, and the first identification information is the unique identifier of the first probe message. The corresponding first probe message can be determined by the first identification information. Exemplarily, the first identification information is a messageId value, and the generation method of the messageId value can be set according to actual needs. For example, the messageId value can be randomly generated, or generated according to a preset generation rule, such as UUID (Universally Unique Identifier), etc., which is not specifically limited in this embodiment. In one embodiment, the format of the first identification information can be:

[0071] {

[0072] "messageId": string; / / Unique identifier of the first probe message

[0073] }

[0074] After determining the message type and message content of the first probe message, the first client can determine the message length according to the message type and the amount of information in the message content.

[0075] Step 2013: Generate a first probe message with a preset message structure according to the message length, message type and message content.

[0076] After determining the message length, the first client needs to fill in the message length, message type and message content respectively. Figure 6 In the preset message structure shown, the ID is filled into the type information, the messageId value is filled into the content information, and the message length is filled into the length information to generate the first probe information.

[0077] Step 202: Send a first probe message to the second client and monitor a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message.

[0078] After generating the first probe message, the first client can send the first probe message to the second client in the local area network, and monitor whether the second probe message sent by any second client is received. In one embodiment, the user can bind a message event to each socket object to monitor the second probe message corresponding to the first probe message.

[0079] Step 203: If no second probe message sent by any second client is monitored within a preset time period, it is determined that the server is offline.

[0080] When the first client does not listen to the second probe message sent by any second client within the preset time, the first client can determine that the server is offline. The preset time is a pre-set time, and for example, the preset time can be set to 1 minute. If the first client does not listen to the second probe message within 1 minute after sending the first probe message, it can be determined that the server is offline.

[0081] On the basis of the above embodiment, the second probe message includes second identification information, and the second identification information is the same as the first identification information in the first probe message monitored by the second client.

[0082] In one embodiment, the second probe message sent by the second client includes second identification information, wherein the second identification information is a unique identifier of the second identification information, and the second identification information in the second probe message is the same as the first identification information in the first probe message monitored by the second client. That is, after the second client monitors the first probe message, it will parse the first identification information from the first probe message, and subsequently add the first identification information to the second probe message as the second identification information when generating the second probe message. In addition, the format of the second identification information is the same as the format of the first identification information, which will not be repeated in this embodiment.

[0083] The offline detection method provided in the embodiment of the present invention further includes:

[0084] Step 204: When monitoring the second probe message sent by the second client, determine the first probe message corresponding to the second probe message according to the second identification information in the second probe message.

[0085] When the first client monitors the second probe message sent by the second client, the first client will parse the second probe message, obtain the second identification information in the second probe message, and compare the second identification information with the first identification information of the first probe message sent previously, and determine the first probe message corresponding to the second probe message based on the comparison result. For example, after the first client parses the messageId value from the second probe message, it compares the messageId value of the second probe message with the messageId value of the first probe message sent previously, and by determining whether the messageId values ​​are the same, the first probe message corresponding to the second probe message can be determined.

[0086] Step 205: Determine that the detection result of the corresponding first probe message is that the server is online.

[0087] After the first client determines the first probe message corresponding to the second probe message, it can determine that the detection result of the first probe message corresponding to the second probe message is that the server is online, and it is offline due to its own fault. The specific process is as follows: Figure 7 shown.

[0088] Step 206: When a third probe message sent by any second client is monitored and the client is connected to the server, a fourth probe message is generated. The third probe message is generated by the second client when the client is disconnected from the server.

[0089] In one embodiment, the third probe message includes third identification information, and the fourth probe message is generated in step 206, including:

[0090] Step 2061: Determine the third identification information in the third probe message.

[0091] Step 2062: Generate a fourth probe message according to the third identification information.

[0092] In one embodiment, when the first client generates the fourth probe message, it can generate the fourth probe message according to the third identification information parsed from the third probe message. Specifically, after parsing the third identification information from the third probe message, when subsequently generating the fourth probe message, the client can use the third identification information as the fourth identification information of the fourth probe message, and add the fourth identification information to the fourth probe message. The structure of the fourth probe message in this embodiment is the same as the structure of the third probe message, and both are preset message structures. When the first client generates the fourth probe message, it can add the fourth identification information to the message content of the fourth probe message, and determine the message type and message length of the fourth probe message. For example, the ID of the message type of the fourth probe message can be 1001. In addition, relevant information on whether the server is online can also be added to the message content. For example, the structure of the message content in the fourth probe message is as follows:

[0093] {

[0094] "messageId": string; / / The unique identifier of the fourth probe message

[0095] "online": boolean; / / Whether the server is online, true means online, false means offline

[0096] }

[0097] Where boolean is a Boolean type.

[0098] Step 207: Send a fourth probe message to the second client, so that the second client that sent the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0099] As described above, an embodiment of the present invention provides an offline detection method. In the embodiment of the present invention, when the first client is disconnected from the server, the first client generates a first probe message according to a preset message structure and sends the first probe message to the second client in the local area network. After the second client receives the first probe message, if the second client is connected to the server at this time, the second client generates a second probe message and sends it. If the first client does not listen to the second probe message sent by the second client within the preset time, it can be determined that the server is offline; and if the first client listens to the second probe message sent by the second client within the preset time, it can be determined that the server is online and the offline is caused by its own problems. In addition, the first client can also generate a fourth probe message when it listens to the third probe message sent by the second client disconnected from the server and is connected to the server, and send the fourth probe message to the corresponding second client to inform the second client whether the server is offline. In the embodiment of the present invention, when the client is disconnected from the server, the client can determine whether the server is offline by listening to other clients, thereby quickly determining the reason for the offline. The embodiment of the present invention solves the technical problem in the prior art that when a student terminal is offline, the student terminal cannot determine the offline reason in time.

[0100] The embodiment of the present invention also provides an offline detection device, such as Figure 8 As shown, Figure 8 The present invention provides a schematic diagram of the structure of an offline detection device provided in an embodiment of the present invention. The offline detection device provided in an embodiment of the present invention is applicable to a first client connected to a server via a local area network, and the server is connected to the first client and at least one second client. The offline detection device includes:

[0101] The first message generating module 301 is used to generate a first probe message when it is determined that the connection with the server is disconnected;

[0102] The first sending module 302 is used to send a first probe message to the second client and monitor a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message;

[0103] An offline determination module 303, configured to determine that the server is offline when no second probe message sent by any second client is monitored;

[0104] The message monitoring module 304 is used to generate a fourth probe message when monitoring a third probe message sent by any second client and connected to the server, wherein the third probe message is generated by the second client when the connection with the server is disconnected;

[0105] The second sending module 305 is used to send a fourth probe message to the second client, so that the second client that sent the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0106] On the basis of the above embodiment, the offline determination module 303 is specifically configured to determine that the server is offline when no second probe message sent by any second client is monitored within a preset time period.

[0107] On the basis of the above embodiment, the first message generating module 301 is specifically configured to generate a first probe message according to a preset message structure.

[0108] Based on the above embodiment, the first message generating module 301 includes:

[0109] A message information determining unit, configured to determine the message content of the first probe message, and determine the message length according to the message type and message content of the first probe message;

[0110] The message production unit is used to generate a first probe message with a preset message structure according to the message length, message type and message content.

[0111] Based on the above embodiment, the message content includes the first identification information of the first probe message.

[0112] On the basis of the above embodiment, the second probe message includes second identification information, and the second identification information is the same as the first identification information in the first probe message monitored by the second client. The offline detection device further includes:

[0113] a corresponding message determining module, configured to determine, when monitoring a second probe message sent by a second client, a first probe message corresponding to the second probe message according to second identification information in the second probe message;

[0114] The detection result determination module is used to determine that the detection result of the corresponding first probe message is that the server is online.

[0115] Based on the above embodiment, the message monitoring module 304 includes:

[0116] an identification information determining unit, configured to determine third identification information in a third probe message;

[0117] The message generating unit is used to generate a fourth probe message according to the third identification information.

[0118] The offline detection device provided in the embodiment of the present invention is included in the offline detection equipment and can be used to execute the offline detection method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0119] It is worth noting that in the embodiment of the above-mentioned offline detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0120] This embodiment also provides an offline detection device, such as Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of an offline detection device provided in an embodiment of the present invention, wherein the offline detection device 40 includes a processor 400 and a memory 401;

[0121] The memory 401 is used to store the computer program 402 and transmit the computer program 402 to the processor 400;

[0122] The processor 400 is configured to execute the steps in the above-mentioned embodiment of an offline detection method according to instructions in the computer program 402 .

[0123] Exemplarily, the computer program 402 may be divided into one or more modules / units, one or more modules / units are stored in the memory 401, and are executed by the processor 400 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 402 in the offline detection device 40.

[0124] The offline detection device 40 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The offline detection device 40 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will appreciate that Fig. 9 It is only an example of the offline detection device 40 and does not constitute a limitation of the offline detection device 40. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the offline detection device 40 may also include input and output devices, network access devices, buses, etc.

[0125] The processor 400 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0126] The memory 401 may be an internal storage unit of the offline detection device 40, such as a hard disk or memory of the offline detection device 40. The memory 401 may also be an external storage device of the offline detection device 40, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the offline detection device 40. Further, the memory 401 may also include both an internal storage unit and an external storage device of the offline detection device 40. The memory 401 is used to store computer programs and other programs and data required by the offline detection device 40. The memory 401 may also be used to temporarily store data that has been output or is to be output.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0130] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store computer programs.

[0132] An embodiment of the present invention further provides a storage medium containing computer executable instructions, which are used to perform an offline detection method when executed by a computer processor. The method includes the following steps:

[0133] When it is determined that the connection with the server is disconnected, a first probe message is generated;

[0134] Sending a first probe message to the second client and listening for a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message;

[0135] In the case where no second probe message sent by any second client is monitored, determining that the server is offline;

[0136] In the case of monitoring a third probe message sent by any second client and being connected to the server, generating a fourth probe message, wherein the third probe message is generated by the second client when the connection with the server is disconnected;

[0137] A fourth probe message is sent to the second client, so that the second client that sent the third probe message determines whether the server is offline by monitoring the fourth probe message.

[0138] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims

1. An off-line detection method, characterized in that: The method is applicable to a first client connected to a server via a local area network, and the server is connected to the first client and at least one second client, and the method comprises: In the case of determining that the connection with the server is disconnected, generating a first probe message; Sending the first probe message to the second client and listening for a second probe message, where the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message; In the case where no second probe message sent by any second client is monitored, determining that the server is offline; generating a fourth probe message when monitoring a third probe message sent by any one of the second clients and being connected to the server, wherein the third probe message is generated by the second client when the connection with the server is disconnected; The fourth probe message is sent to the second client, so that the second client that sends the third probe message determines whether the server is offline by monitoring the fourth probe message.

2. An off-line detection method according to claim 1, characterized in that: The determining that the server is offline when no second probe message sent by any second client is monitored includes: If no second probe message sent by any second client is monitored within a preset time period, it is determined that the server is offline.

3. An off-line detection method according to claim 1, characterized in that: The generating of the first probe message comprises: Generate a first probe message according to a preset message structure.

4. An off-line detection method according to claim 3, characterized in that: The step of generating a first probe message according to a preset message structure includes: Determine the message content of the first probe message, and determine the message length according to the message type and the message content of the first probe message; A first probe message having a preset message structure is generated according to the message length, the message type, and the message content.

5. An off-line detection method according to claim 4, characterized in that: The message content includes first identification information of the first probe message.

6. An off-line detection method according to claim 5, characterized in that: The second probe message includes second identification information, and the second identification information is the same as the first identification information in the first probe message monitored by the second client. The method further includes: In a case where a second probe message sent by the second client is monitored, determining a first probe message corresponding to the second probe message according to second identification information in the second probe message; It is determined that the detection result of the corresponding first probe message is that the server is online.

7. An off-line detection method according to claim 1, characterized in that: The third probe message includes third identification information; The generating of the fourth probe message comprises: Determining third identification information in the third probe message; A fourth probe message is generated according to the third identification information.

8. An off-line detection device, characterized in that: The device is applicable to a first client connected to a server via a local area network, and the server is connected to the first client and at least one second client, and the device comprises: A first message generating module, configured to generate a first probe message when it is determined that the connection with the server is disconnected; A first sending module, used for sending the first probe message to the second client and monitoring a second probe message, wherein the second probe message is generated and sent by the second client when the second client is connected to the server and receives the first probe message; An offline determination module, configured to determine that the server is offline when no second probe message sent by any second client is monitored; A message monitoring module, used for generating a fourth probe message when monitoring a third probe message sent by any one of the second clients and connected to the server, wherein the third probe message is generated by the second client when the connection with the server is disconnected; The second sending module is used to send the fourth probe message to the second client, so that the second client that sends the third probe message determines whether the server is offline by monitoring the fourth probe message.

9. An off-line detection device, characterized in that: The offline detection device includes a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute an offline detection method according to any one of claims 1 to 7 according to instructions in the computer program.

10. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to perform an offline detection method according to any one of claims 1 to 7 when executed by a computer processor.