CN115190160A - Screen-off monitoring method and device for screen equipment, electronic device and storage medium - Google Patents
Screen-off monitoring method and device for screen equipment, electronic device and storage medium Download PDFInfo
- Publication number
- CN115190160A CN115190160A CN202210572559.6A CN202210572559A CN115190160A CN 115190160 A CN115190160 A CN 115190160A CN 202210572559 A CN202210572559 A CN 202210572559A CN 115190160 A CN115190160 A CN 115190160A
- Authority
- CN
- China
- Prior art keywords
- heartbeat
- server
- screen
- time
- monitoring
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 128
- 238000012544 monitoring process Methods 0.000 title claims abstract description 51
- 230000007246 mechanism Effects 0.000 claims abstract description 54
- 230000008569 process Effects 0.000 claims description 62
- 238000004590 computer program Methods 0.000 claims description 14
- 238000004891 communication Methods 0.000 claims description 13
- 238000011084 recovery Methods 0.000 claims description 12
- 230000002159 abnormal effect Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 230000002457 bidirectional effect Effects 0.000 claims description 7
- 238000004886 process control Methods 0.000 claims description 4
- 238000012806 monitoring device Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 238000001514 detection method Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 241000700605 Viruses Species 0.000 description 1
- 238000004040 coloring Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a method and a device for monitoring screen disconnection of screen equipment, an electronic device and a storage medium, wherein the method comprises the following steps: establishing a long link between a desktop application program in each screen device and a server, and establishing a heartbeat mechanism based on the long link; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet; determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time; and based on a heartbeat mechanism, transmitting a heartbeat packet between the screen equipment and the server through the long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment. Through the application, the problem that in the related art, a large number of clients send heartbeat packets to the server at the same time in a fixed time, so that the instant pressure of the server is too large and the server is easy to crash is solved, the instant pressure of the server is reduced, and the server is prevented from crashing.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for monitoring a screen device for network outage, an electronic apparatus, and a storage medium.
Background
Under the current heartbeat mechanism, a client sends a heartbeat packet to a server at a fixed time interval so as to monitor the heartbeat packet, and the heartbeat interval is usually a fixed heartbeat interval. For example, the heartbeat interval under the WIFI network is 2 minutes, and the heartbeat interval under the data network is 1 minute. The network break monitoring of the fixed heartbeat interval has the following defects: when the method is applied to multiple clients, a large number of clients send heartbeat packets to the server at fixed time, which causes the instant pressure of the server to be too high, and thus the server is easy to crash.
Aiming at the problem that in the related art, a large number of clients send heartbeat packets to a server at fixed time at the same time, which causes the instant pressure of the server to be overlarge and easily causes the crash of the server, no effective solution is provided at present.
Disclosure of Invention
The embodiment provides a method, a device, an electronic device and a storage medium for monitoring a disconnected network of a screen device, so as to solve the problem that in the related art, a large number of clients send heartbeat packets to a server at a fixed time at the same time, which causes the server to have an excessive instantaneous pressure and is easy to cause the server to crash.
In a first aspect, in this embodiment, a method for monitoring a screen device for a network outage is provided, including:
establishing a long link between a desktop application program in each screen device and a server, and establishing a heartbeat mechanism based on the long link; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time;
and based on the heartbeat mechanism, transmitting a heartbeat packet between the screen equipment and the server through the long chain connection at intervals of the second heartbeat time so as to monitor the corresponding screen equipment for network disconnection.
In some embodiments, the establishing of the long link between the desktop application and the server in each screen device includes:
when a desktop application program in each screen device is started, generating a main process corresponding to the desktop application program;
establishing the long link based on communication between the host process and a server.
In some embodiments, the monitoring of the screen device for a network outage includes:
monitoring the corresponding screen equipment for network disconnection by using the main process;
and when the network state of the screen equipment is monitored to be abnormal and the heartbeat packet transmitted by the receiving server side is abnormal, judging that the screen equipment is in a disconnected network state.
In some of these embodiments, the method further comprises:
after a main process corresponding to the desktop application program is generated, a browsing window is created by using the main process, and a sub-process corresponding to the browsing window is generated; and the main process is in communication connection with the corresponding sub-process.
In some of these embodiments, the method further comprises:
after the screen equipment is judged to be in the disconnected state, the sub-process is informed through the main process, so that the sub-process controls the browsing window to load preset disconnected content;
and after judging that the screen equipment is in the network disconnection recovery state, notifying the subprocess through the main process so that the subprocess controls the browsing window to load the playing content before the network disconnection.
In some of these embodiments, the method further comprises:
and when the master process monitors that the duration of the disconnected state is longer than the preset waiting time, sending a restart message to the router through the master process so as to restart the router according to the restart message.
In some of these embodiments, the heartbeat mechanism comprises a one-way heartbeat mechanism or a two-way heartbeat mechanism;
the one-way heartbeat mechanism is as follows: transmitting a heartbeat packet to the server by the screen device through the long link every second heartbeat time so as to monitor the screen device for network disconnection;
the bidirectional heartbeat mechanism is as follows: and transmitting a heartbeat packet to the server by the screen equipment through the long link at the interval of the second heartbeat time, and transmitting the heartbeat packet to the screen equipment by the server so as to monitor the disconnection of the screen equipment.
In a second aspect, in this embodiment, there is provided a device for monitoring a screen disconnection of a screen device, including: the system comprises an establishing module, a processing module and a monitoring module;
the establishing module is used for establishing long-chain connection between the desktop application program in each screen device and the server, and establishing a heartbeat mechanism based on the long-chain connection; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
the processing module is used for determining additional time corresponding to each screen device and generating second heartbeat time according to the additional time and the first heartbeat time;
and the monitoring module is used for transmitting heartbeat packets between the screen equipment and the server through the long chain at intervals of second heartbeat time based on the heartbeat mechanism so as to monitor the corresponding screen equipment for network disconnection.
In a third aspect, in this embodiment, an electronic apparatus is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for monitoring a screen device in a network interruption mode according to the first aspect is implemented.
In a fourth aspect, in the present embodiment, a storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement the method for monitoring a screen device for a network outage of the first aspect.
Compared with the related art, the method, the device, the electronic device and the storage medium for monitoring the network interruption of the screen equipment provided by the embodiment establish a long link between a desktop application program in each screen equipment and a server, and establish a heartbeat mechanism based on the long link; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet; determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time; on the basis of a heartbeat mechanism, transmitting heartbeat packets between the screen equipment and the server through a long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment; the problem that in the related art, a large number of clients send heartbeat packets to the server at fixed time at the same time, so that the instant pressure of the server is too high and the server is easy to crash is solved, and the sending time of the heartbeat packets of the large number of clients is staggered by using the second heartbeat time with additional time, so that the instant pressure of the server is reduced, and the server is prevented from crashing.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a network disconnection monitoring system of a screen device according to an embodiment of the present application;
fig. 2 is a flowchart of a method for monitoring a screen device for network outage according to an embodiment of the present application;
fig. 3 is a flowchart of a method for monitoring a screen device for network disconnection according to another embodiment of the present application;
fig. 4 is a block diagram of a structure of a network disconnection monitoring apparatus of a screen device according to an embodiment of the present application.
In the figure: 10. a screen device; 20. a server; 210. establishing a module; 220. a processing module; 230. and a monitoring module.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having" and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
Referring to fig. 1, an exemplary diagram of a network outage monitoring system of a screen device 10 is shown in this embodiment. The system comprises a screen device 10 and a server 20; the server 20 is connected with the screen device 10; the screen device 10 is arranged in a shopping center or mall.
In which the screen device 10 can be installed beside an elevator, at an entrance, at an exit, etc. of a shopping center or a mall at a place convenient for a user to use. The screen device 10 refers to a device with a screen; including but not limited to a guide device, an advertising device, a guidance device, etc. The shopping center may also be an activity center for shopping such as shopping malls and communities. Wherein the server 20 is configured to receive or transmit heartbeat packets.
The method provided in the present embodiment may be executed in an arithmetic device such as the screen device 10. When running on the screen device 10, the screen device 10 may comprise one or more processors and a memory for storing data, wherein the processors may comprise, but are not limited to, processing means such as a microprocessor MCU or a programmable logic device FPGA. The screen device 10 described above may also include a transmission device for communication functions and an input-output device. The screen device 10 may also have a different configuration, such as having multiple processors, etc.
The memory may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the traffic coloring method of the database in the embodiment, and the processor executes the computer programs stored in the memory, thereby executing various functional applications and data processing, that is, implementing the method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located from the processor, which may be connected to the screen device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the screen device 10. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for monitoring a screen device for network outage is provided, and fig. 2 is a flowchart of the method for monitoring a screen device for network outage in this embodiment, as shown in fig. 2, the process includes the following steps:
step S210, establishing long-chain connection between a desktop application program and a server in each screen device, and establishing a heartbeat mechanism based on the long-chain connection; the heartbeat mechanism comprises a first heartbeat time and a heartbeat packet;
step S220, determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time;
and step S230, based on a heartbeat mechanism, transmitting heartbeat packets between the screen equipment and the server through the long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment.
It should be noted that multiple screen devices may be installed in a shopping mall, and the desktop application in each screen device establishes a long link with the server. The long link is used for data communication between the desktop application program and the server in the screen device. The heartbeat mechanism is established based on a long-chain connection, and the heartbeat mechanism refers to a mechanism which regularly sends a self-defined heartbeat packet through the long-chain connection to enable the opposite side to know that the opposite side still lives so as to ensure the effectiveness of connection. In other embodiments, multiple screen devices may be located in different shopping malls, each screen device also establishing a long link with the server.
In this embodiment, the heartbeat mechanism includes a unidirectional heartbeat mechanism or a bidirectional heartbeat mechanism;
the one-way heartbeat mechanism is as follows: transmitting a heartbeat packet from the screen equipment to the server through the long link every second heartbeat time so as to monitor the screen equipment for network disconnection; or, transmitting the heartbeat packet to the screen device by the server through the long link at every second heartbeat time so as to monitor the screen device for network disconnection.
The bidirectional heartbeat mechanism is as follows: and transmitting a heartbeat packet to the server by the screen equipment through the long link at a second heartbeat time interval, and simultaneously transmitting the heartbeat packet to the screen equipment by the server so as to monitor the screen equipment for network disconnection. Such as: the heartbeat detection is started by a Resource Manager in the screen equipment, long-chain network call from the Resource Manager to the task execution Manager is triggered, the task execution Manager in the server receives a request and then updates the internal heartbeat time of the server and resets a heartbeat timer, then the long-chain network call from the task execution Manager to the Resource Manager is triggered, the Resource execution Manager receives the request and then updates the internal heartbeat time of the server and resets the heartbeat timer, and bidirectional detection of heartbeat is realized by using a loop detection chain. The accuracy of monitoring the broken network can be further improved through a bidirectional heartbeat mechanism, and false detection caused by unidirectional network fluctuation is avoided.
In order to avoid that a large number of clients send heartbeat packets to the server at the same fixed time, which can cause the instant pressure of the server to be too large and easily cause the crash of the server, an additional time is determined to be on the first heartbeat time to generate a second heartbeat time. Typically, the second heartbeat time is equal to the first heartbeat time plus the additional time. It is of course also possible that the second heartbeat time equals the first heartbeat time minus the additional time. The additional time may be generated by a random function built into each screen device; the additional time generated in each screen device is different; so that the time for transmitting the heartbeat packet between each screen device and the server is different. Further, the additional time can also be determined according to the pressure of the server, and when the pressure of the current server is greater than or equal to a preset pressure threshold value, the additional time is increased to delay the sending frequency of the heartbeat packet. And when the pressure of the current server is smaller than a preset pressure threshold value, reducing the additional time so as to improve the sending frequency of the heartbeat packet. Therefore, the heartbeat detection efficiency can be guaranteed, and meanwhile, too much pressure is not caused to the server. Specifically, the first heartbeat time may be 30 seconds to 1 hour; the additional time is 0.001 to 1 second.
Through the steps, on the basis of a heartbeat mechanism, heartbeat packets are transmitted between the screen equipment and the server through the long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment; the problem that in the related art, a large number of clients send heartbeat packets to the server at fixed time at the same time, so that the instant pressure of the server is too high and the server is easy to crash is solved, and the sending time of the heartbeat packets of the large number of clients is staggered by using the second heartbeat time with additional time, so that the instant pressure of the server is reduced, and the server is prevented from crashing.
In some embodiments, the establishing of the long link between the desktop application and the server in each screen device in step S210 includes the following steps:
when a desktop application program in each screen device is started, generating a main process corresponding to the desktop application program;
based on the communication between the host process and the server to establish a long link.
Specifically, the desktop application is installed on an operating system installed on the screen device, where the operating system may be a windows, linux, macos, or android system. Desktop applications correspond to host processes one-to-one, with one desktop application corresponding to one host process. When the desktop application program is started, the operating system generates a main process corresponding to the desktop application program by default, and the communication connection between the main process and the server is the established long link.
In some embodiments, the step S230 of monitoring the screen disconnection of the corresponding screen device includes the following steps:
step S231, monitoring the corresponding screen equipment for network disconnection by using the main process;
step S232, when the network state of the screen device is monitored to be abnormal and the heartbeat packet transmitted by the receiving server is abnormal, determining that the screen device is in the disconnected state.
Specifically, a host process corresponding to the desktop application in each screen device monitors the installed screen device for a network outage. The host process may monitor not only the network state of the operating system in the host process, but also the state of the heartbeat packet. Only when the network state of the screen equipment is monitored to be abnormal and the heartbeat packet transmitted by the receiving server side is abnormal, judging that the screen equipment is in a disconnected network state; therefore, the network state abnormity of the screen equipment caused by network fluctuation in an operating system is avoided, and the misjudgment of the broken network monitoring is further caused.
In some embodiments, the method for monitoring the screen disconnection of the screen device further includes the following steps:
after a main process corresponding to the desktop application program is generated, a browsing window is created by using the main process, and a sub-process corresponding to the browsing window is generated; and the main process is in communication connection with the corresponding sub-process.
Specifically, the browse window is created and launched by the main program calling chrome. The browse window corresponds to a sub-process. The main process is in communication connection with the corresponding sub-process; the main process manages each sub-process created by the main process, the sub-processes are isolated from each other, and the sub-processes need to transmit data to other sub-processes through the main process. The sub-process is responsible for managing the browse window in which page H5 can be loaded. Such as: and transmitting the window file acquired by the cloud server to the first sub-process through the main process. The sub-process is managed through the main process, the situation that the main process is influenced by the crash of the sub-process is avoided, and viruses in the sub-process cannot influence the main process and the server.
In some embodiments, as shown in fig. 3, the method for monitoring a screen device for network outage further includes, on the basis of fig. 2, the following steps:
step S401, after the screen device is judged to be in the disconnected state, the sub-process is informed through the main process, so that the sub-process controls the browsing window to load the preset disconnected content;
and step S402, after the screen device is judged to be in the network break recovery, the sub-process is informed through the main process so that the sub-process controls the browsing window to load the playing content before the network break.
Specifically, the disconnected network content is preset in a memory of the screen device, and the disconnected network content can be a disconnected network picture or a disconnected network video; or a complete picture or video played before the network is disconnected. The main process monitors the network state through the design of the main process and the sub-process, and the sub-process is responsible for controlling the browsing window to load the preset disconnected network content into the H5, so that the coupling of the H5 to the network is reduced. When the screen device is judged to be in the off-line state, the default off-line content is played, blue screens and white screens are reduced, and experience is improved.
After the network is disconnected, the main process can wait for the recovery of the network, when the network can be recovered (4G and 5G can have flash break and can be automatically connected or connected by means), and after the screen device is judged to be in the network disconnection recovery, the playing content before the network is disconnected is played again, so that the experience feeling is improved.
In some embodiments, the method for monitoring a screen device for a network outage further includes:
and when the main process monitors that the duration of the disconnected state is longer than the preset waiting time, sending a restart message to the router through the main process so as to restart the router according to the restart message.
Specifically, the preset waiting time is calculated as follows:
the last waiting automatic recovery time = | the host process receives the network disconnection time-the network recovery time |;
the last time of router restart recovery time = | event of restarting message sent by main process-network recovery time | after router restart;
this time wait time = Min (last wait automatic recovery time, last route restart recovery time).
And after the router is restarted according to the restart message, judging the network disconnection state of the screen equipment so as to carry out corresponding processing steps. Since most network problems can be solved by router reboots. The router is restarted to attempt to recover the network by a restart message, thereby solving most network problems.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
In this embodiment, a device for monitoring a screen disconnection of a screen device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. The terms "module," "unit," "sub-unit," and the like as used below may implement a combination of software and/or hardware of predetermined functions. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a structure of a network disconnection monitoring apparatus of a screen device according to this embodiment, and as shown in fig. 4, the apparatus includes: an establishing module 210, a processing module 220 and a monitoring module 230;
the establishing module 210 is configured to establish a long link between a desktop application and a server in each screen device, and establish a heartbeat mechanism based on the long link; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
the processing module 220 is configured to determine additional time corresponding to each screen device, and generate second heartbeat time according to the additional time and the first heartbeat time;
and the monitoring module 230 is configured to transmit a heartbeat packet between the screen device and the server through the long link at every second heartbeat time based on a heartbeat mechanism, so as to perform network disconnection monitoring on the corresponding screen device.
By the device, based on a heartbeat mechanism, heartbeat packets are transmitted between the screen equipment and the server through the long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment; the problem that in the related art, a large number of clients send heartbeat packets to the server at fixed time at the same time, so that the instant pressure of the server is too high and the server is easy to crash is solved, and the sending time of the heartbeat packets of the large number of clients is staggered by using the second heartbeat time with additional time, so that the instant pressure of the server is reduced, and the server is prevented from crashing.
In some embodiments, the establishing module 210 is further configured to generate a main process corresponding to a desktop application program when the desktop application program in each screen device is started;
based on the communication between the host process and the server to establish a long link.
In some embodiments, the monitoring module 230 is further configured to monitor, by using the host process, a network outage of the corresponding screen device;
and when the network state of the screen equipment is monitored to be abnormal and the heartbeat packet transmitted by the receiving server side is abnormal, judging that the screen equipment is in a disconnected network state.
In some embodiments, on the basis of fig. 4, a creating module is further included;
the creating module is used for creating a browsing window by using a main process after the main process corresponding to the desktop application program is generated, and generating a sub-process corresponding to the browsing window; and the main process is in communication connection with the corresponding sub-process.
In some embodiments, on the basis of fig. 4, a determination module is further included;
the judgment module is used for informing the subprocess through the main process after judging that the screen device is in the disconnected state, so that the subprocess controls the browsing window to load the preset disconnected content;
and after judging that the screen equipment is in the network disconnection recovery, informing the subprocess through the main process so that the subprocess controls the browsing window to load the playing content before the network disconnection.
In some embodiments, on the basis of fig. 4, a restart module is further included;
and the restarting module is used for sending a restarting message to the router through the main process when the main process monitors that the duration time of the disconnected state is longer than the preset waiting time so as to restart the router according to the restarting message.
In some of these embodiments, the heartbeat mechanism includes a one-way heartbeat mechanism or a two-way heartbeat mechanism;
the one-way heartbeat mechanism is as follows: transmitting a heartbeat packet from the screen equipment to the server through the long link every second heartbeat time so as to monitor the screen equipment for network disconnection;
the bidirectional heartbeat mechanism is as follows: and transmitting a heartbeat packet to the server by the screen equipment through the long link at a second heartbeat time interval, and transmitting the heartbeat packet to the screen equipment by the server so as to monitor the screen equipment in a disconnected mode.
It should be noted that the above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, establishing long-chain connection between a desktop application program and a server in each screen device, and establishing a heartbeat mechanism based on the long-chain connection; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
s2, determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time;
and S3, based on a heartbeat mechanism, transmitting heartbeat packets between the screen equipment and the server through the long chain connection at intervals of second heartbeat time so as to monitor the network disconnection of the corresponding screen equipment.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.
In addition, in combination with the method for monitoring the screen device for network interruption provided in the foregoing embodiment, a storage medium may also be provided in this embodiment. The storage medium having stored thereon a computer program; when being executed by a processor, the computer program realizes the method for monitoring the network disconnection of the screen device in any one of the above embodiments.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference throughout this application to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims (10)
1. A method for monitoring the network disconnection of screen equipment is characterized by comprising the following steps:
establishing a long link between a desktop application program in each screen device and a server, and establishing a heartbeat mechanism based on the long link; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
determining additional time corresponding to each screen device, and generating second heartbeat time according to the additional time and the first heartbeat time;
and based on the heartbeat mechanism, transmitting a heartbeat packet between the screen equipment and the server through the long chain connection at intervals of the second heartbeat time so as to monitor the corresponding screen equipment for network disconnection.
2. The method for monitoring the network disconnection of the screen device according to claim 1, wherein the establishing of the long link between the desktop application and the server in each screen device comprises:
when a desktop application program in each screen device is started, generating a main process corresponding to the desktop application program;
establishing the long link based on communication between the host process and a server.
3. The method for monitoring the network disconnection of the screen device according to claim 2, wherein the step of monitoring the network disconnection of the corresponding screen device comprises:
monitoring the corresponding screen equipment for network disconnection by using the main process;
and when the network state of the screen equipment is monitored to be abnormal and the heartbeat packet transmitted by the receiving server side is abnormal, judging that the screen equipment is in a disconnected state.
4. The method for monitoring the screen device for the network disconnection according to claim 2, wherein the method further comprises:
after a main process corresponding to the desktop application program is generated, a browsing window is created by using the main process, and a sub-process corresponding to the browsing window is generated; and the main process is in communication connection with the corresponding sub-process.
5. The method for monitoring the screen device for the network disconnection according to claim 4, wherein the method further comprises:
after the screen equipment is judged to be in the disconnected state, the sub-process is informed through the main process, so that the sub-process controls the browsing window to load preset disconnected content;
and after judging that the screen equipment is in the network disconnection recovery state, notifying the subprocess through the main process so that the subprocess controls the browsing window to load the playing content before the network disconnection.
6. The method for monitoring the screen device for the network disconnection according to claim 5, wherein the method further comprises:
and when the master process monitors that the duration of the disconnected state is longer than the preset waiting time, sending a restart message to the router through the master process so as to restart the router according to the restart message.
7. The method for monitoring the network disconnection of the screen device according to claim 1, wherein the heartbeat mechanism comprises a one-way heartbeat mechanism or a two-way heartbeat mechanism;
the one-way heartbeat mechanism is as follows: transmitting a heartbeat packet to the server by the screen equipment through the long link every other second heartbeat time so as to monitor the screen equipment for network breaking;
the bidirectional heartbeat mechanism is as follows: and transmitting a heartbeat packet to the server by the screen equipment through the long link at the interval of the second heartbeat time, and transmitting the heartbeat packet to the screen equipment by the server so as to monitor the disconnection of the screen equipment.
8. A disconnected net monitoring device of screen equipment which characterized in that includes: the system comprises an establishing module, a processing module and a monitoring module;
the establishing module is used for establishing long-chain connection between the desktop application program in each screen device and the server, and establishing a heartbeat mechanism based on the long-chain connection; the heartbeat mechanism includes a first heartbeat time and a heartbeat packet;
the processing module is used for determining additional time corresponding to each screen device and generating second heartbeat time according to the additional time and the first heartbeat time;
and the monitoring module is used for transmitting heartbeat packets between the screen equipment and the server through the long chain at intervals of second heartbeat time based on the heartbeat mechanism so as to monitor the corresponding screen equipment for network disconnection.
9. An electronic apparatus comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the steps of the method for monitoring a screen device according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for monitoring a screen device for network interruption of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210572559.6A CN115190160A (en) | 2022-05-25 | 2022-05-25 | Screen-off monitoring method and device for screen equipment, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210572559.6A CN115190160A (en) | 2022-05-25 | 2022-05-25 | Screen-off monitoring method and device for screen equipment, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115190160A true CN115190160A (en) | 2022-10-14 |
Family
ID=83512838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210572559.6A Pending CN115190160A (en) | 2022-05-25 | 2022-05-25 | Screen-off monitoring method and device for screen equipment, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115190160A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102722559A (en) * | 2012-05-31 | 2012-10-10 | 奇智软件(北京)有限公司 | Method, device and system for controlling processes of abnormal pages |
CN104079598A (en) * | 2013-03-27 | 2014-10-01 | 腾讯科技(深圳)有限公司 | Method and device for realizing collaborative browsing of webpages |
CN104144159A (en) * | 2014-06-26 | 2014-11-12 | 腾讯科技(深圳)有限公司 | Intelligent heartbeat keeping method and system |
CN105897813A (en) * | 2015-06-10 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Heartbeat message sending method, heartbeat message receiving method, heartbeat message sending device and heartbeat message receiving device |
CN107645529A (en) * | 2016-07-21 | 2018-01-30 | 腾讯科技(深圳)有限公司 | Heartbeat packet transmission method and device |
CN107786383A (en) * | 2016-08-30 | 2018-03-09 | 北京国双科技有限公司 | The sending method and device of heartbeat data packets |
CN109714202A (en) * | 2018-12-21 | 2019-05-03 | 郑州云海信息技术有限公司 | A kind of client off-line reason method of discrimination and concentrating type safety management system |
CN110474975A (en) * | 2019-08-08 | 2019-11-19 | 北京云中融信网络科技有限公司 | Heartbeat processing method, device, electronic equipment and the storage medium of application program |
CN111031598A (en) * | 2020-01-08 | 2020-04-17 | Oppo广东移动通信有限公司 | Network communication control method, device, communication equipment and storage medium |
CN114422571A (en) * | 2021-12-31 | 2022-04-29 | 广东国腾量子科技有限公司 | Quantum communication client disconnection reconnection system and method |
CN114500550A (en) * | 2021-12-31 | 2022-05-13 | 深圳市晨北科技有限公司 | Equipment heartbeat interval control method and device, Internet of things equipment and storage medium |
-
2022
- 2022-05-25 CN CN202210572559.6A patent/CN115190160A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102722559A (en) * | 2012-05-31 | 2012-10-10 | 奇智软件(北京)有限公司 | Method, device and system for controlling processes of abnormal pages |
CN104079598A (en) * | 2013-03-27 | 2014-10-01 | 腾讯科技(深圳)有限公司 | Method and device for realizing collaborative browsing of webpages |
CN104144159A (en) * | 2014-06-26 | 2014-11-12 | 腾讯科技(深圳)有限公司 | Intelligent heartbeat keeping method and system |
CN105897813A (en) * | 2015-06-10 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Heartbeat message sending method, heartbeat message receiving method, heartbeat message sending device and heartbeat message receiving device |
CN107645529A (en) * | 2016-07-21 | 2018-01-30 | 腾讯科技(深圳)有限公司 | Heartbeat packet transmission method and device |
CN107786383A (en) * | 2016-08-30 | 2018-03-09 | 北京国双科技有限公司 | The sending method and device of heartbeat data packets |
CN109714202A (en) * | 2018-12-21 | 2019-05-03 | 郑州云海信息技术有限公司 | A kind of client off-line reason method of discrimination and concentrating type safety management system |
CN110474975A (en) * | 2019-08-08 | 2019-11-19 | 北京云中融信网络科技有限公司 | Heartbeat processing method, device, electronic equipment and the storage medium of application program |
CN111031598A (en) * | 2020-01-08 | 2020-04-17 | Oppo广东移动通信有限公司 | Network communication control method, device, communication equipment and storage medium |
CN114422571A (en) * | 2021-12-31 | 2022-04-29 | 广东国腾量子科技有限公司 | Quantum communication client disconnection reconnection system and method |
CN114500550A (en) * | 2021-12-31 | 2022-05-13 | 深圳市晨北科技有限公司 | Equipment heartbeat interval control method and device, Internet of things equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW201944236A (en) | Task processing method, apparatus, and system | |
CN108430116B (en) | Disconnected network reconnection method, medium, device and computing equipment | |
CN107547589B (en) | Data acquisition processing method and device | |
JP7234402B2 (en) | Secondary link monitoring method for vehicle communication, vehicle communication terminal, electronic device and computer program | |
CN112953775B (en) | Vehicle machine upgrading system and method | |
CN109040295B (en) | Method and device for determining abnormal disconnection, terminal and storage medium | |
CN107919994B (en) | Method and server for realizing hot standby of network service dual-computer | |
CN109413612A (en) | A kind of communication connection method for building up and equipment | |
CN110908872B (en) | Method and system for detecting server state | |
CN108650667A (en) | Terminal scheduling method and apparatus | |
CN102637139A (en) | Method, device and single panel for feeding watchdog by embedded system | |
CN115835418A (en) | Continuous LBT failure processing method and device, terminal and network side equipment | |
CN109245974A (en) | Household electrical appliance distribution method, apparatus and computer readable storage medium | |
CN115190160A (en) | Screen-off monitoring method and device for screen equipment, electronic device and storage medium | |
KR102294882B1 (en) | Method, apparatus, terminal and recording medium for transmitting measurement report | |
CN110460520B (en) | Data message transmission method and whole vehicle network system | |
CN114143911B (en) | Method for automatically reconnecting wireless screen-on and screen-off based on Android platform | |
CN105930215A (en) | Control method and control device for mobile terminal | |
CN114826981B (en) | System and method for realizing application resident in cloud mobile phone | |
CN114995848B (en) | IoT device upgrade method, ioT device, and computer-readable storage medium | |
CN105677510A (en) | Monitoring method of communication processor and intelligent terminal | |
CN115431896A (en) | Control method and device, electronic equipment, storage medium, vehicle-mounted machine system and vehicle | |
CN116260747A (en) | Monitoring method and device of terminal test equipment and electronic equipment | |
CN104065626B (en) | The update method and device of web camera logging status | |
CN115396430A (en) | Cloud mobile phone management method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221014 |
|
RJ01 | Rejection of invention patent application after publication |