CN103067777A - Method and device of prompting of network state - Google Patents

Method and device of prompting of network state Download PDF

Info

Publication number
CN103067777A
CN103067777A CN2012105681819A CN201210568181A CN103067777A CN 103067777 A CN103067777 A CN 103067777A CN 2012105681819 A CN2012105681819 A CN 2012105681819A CN 201210568181 A CN201210568181 A CN 201210568181A CN 103067777 A CN103067777 A CN 103067777A
Authority
CN
China
Prior art keywords
network state
network
current network
page
current
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.)
Granted
Application number
CN2012105681819A
Other languages
Chinese (zh)
Other versions
CN103067777B (en
Inventor
陈澄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201210568181.9A priority Critical patent/CN103067777B/en
Publication of CN103067777A publication Critical patent/CN103067777A/en
Application granted granted Critical
Publication of CN103067777B publication Critical patent/CN103067777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device of prompting of a network state. The method of the prompting of the network state includes that network checking threads are started, detection functions of the network state are transferred, whether a network interface at present is opened and an internet protocol (IP) address is obtained or not is judged, if not, the network state at present is recorded and prompting information of the network state at present is returned back, and if so, communication variable socket is established, whether the communication variable socket and an internet server are communicated or not is judged, and the network state at present is obtained according to results of judgment. Whether the network state at present is the same to a prior network state or not is judged, if so, the network checking threads exit, and if not, the network state at present is recorded and the prompting information of the network state at present is returned back. The method of the prompting of the network state has the advantages of further identifying and prompting a connection state with the internet under the conditions of normal operation of the network interface at present, improving accuracy of identification of network connection, and enriching functions of a terminal.

Description

The reminding method of network state and device
Technical field
The present invention relates to Internet technical field, relate in particular to a kind of reminding method and device of network state.
Background technology
Along with making constant progress of Internet technology, various network applications have also been increased in the intelligent television.When using these network applications, being connected with the Internet is primary prerequisite; But in using the process of using, owing to all uncertainties, the phenomenon of Network Abnormal, network interruption may occur, this moment need to be according to current network state to prompting of user.A lot of platforms commonly used can be closed the monitoring to resource after starting some and using, namely after starting network application, monitoring state of network no longer more can't continue to judge network state and to the relevant prompting of user.
The suspension of general platform only judge by judge the current network port open and running status concludes whether the connection of current network state normal, and this scheme is problematic.Because this decision logic is only used for judging whether normal operation of current network interface, do not judge current whether linking to each other with the Internet.For example: the user with TV link to each other with router, router links to each other in this case with modulator-demodulator, the IP address of the actual network allocation of obtaining of TV is the router that links to each other with modulator-demodulator, and but router can issue to coupled networked devices an IP address, TV can use this IP address to carry out internet access by router like this, but actual transmission the Internet request is router.If this moment occurs some unusual (can't be connected to network, cut off the power supply, disconnect the router connection of being connected with modulator-demodulator etc. to modulator-demodulator such as modulator-demodulator) situation, cause router or modulator-demodulator suspension, this moment, router can lose the IP address that sends under the modulator-demodulator, and then can't access the Internet; But because router can also normally move other functions this moment, TV is not also lost from the IP address that router obtains, continue to judge the current network state of TV with this top network decision logic, can still point out network connection normal, but but can't access the Internet this moment.
Summary of the invention
Main purpose of the present invention provides a kind of reminding method and device of network state, is intended to identify and show the network connection state of TV.
The invention discloses a kind of reminding method of network state, may further comprise the steps:
Start the Network Check thread, call the network state detection function, judge the IP address is opened and obtained to the current network interface whether; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state;
Judge whether current network state is identical with front primary network state;
If not, then connect when normal in current network, if the inspection thread then exits network; If not, then record current network state and return the information of current network state.
Preferably, described record current network state and return and also comprise step after the step of information of current network state:
The information that shows described current network state by browser or the page.
Preferably, describedly judge whether described socket is communicated with Internet Server, and according to judged result, the step of obtaining current network state comprises:
When described socket was communicated with Internet Server, it was normal for connecting to obtain current network state;
When described socket was not communicated with Internet Server, it was unusual for connecting to obtain current network state.。
Preferably, described information by the described current network state of browser display comprises:
Resolve and download the page elements that to draw, according to the loading sequence of described page elements, described page elements is loaded in the internal memory, and the described page elements formation that superposes successively in described internal memory shows image;
Judge whether described current network state is in the network connection abnormality;
If then the superiors' stacking network at described demonstration image connects unusual picture element, and the final demonstration image that obtains is shown by described browser;
If not, then refresh current page and load the page of user request.
Preferably, describedly show that by the page information of described current network state comprises:
Invoke script language extension JSE obtains current network state;
Judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, then not display network connect abnormal prompt information.
Preferably, describedly show that by the page information of described current network state comprises:
Described browser starts one and is used for the thread whether the recognition network state changes, and when recognizing network state and change, sends a key assignments to the described page;
The described page receives described key assignments, judges whether described key assignments is network mark key assignments;
If then according to described network mark key assignments, judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, do not show that then the existing network network connects abnormal prompt information.
The present invention also discloses a kind of suggestion device of network state, comprising:
The network state acquisition module is used for starting the Network Check thread, calls the network state detection function, judges the IP address is opened and obtained to the current network interface whether; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state;
The network state identification module is used for judging whether current network state is identical with front primary network state; If the inspection thread then exits network; If not, then record current network state and return the information of current network state.
Preferably, the suggestion device of described network state also comprises:
The network state display module is for the information that shows described current network state by browser or the page.
Preferably, described network state acquisition module also is used for:
When described socket was communicated with Internet Server, it was normal for connecting to obtain current network state;
When described socket was not communicated with Internet Server, it was unusual for connecting to obtain current network state.
Preferably, described network state display module shows that the mode of the information of described current network state comprises:
Resolve and download the page elements that to draw, according to the loading sequence of described page elements, described page elements is loaded in the internal memory, and the described page elements formation that superposes successively in described internal memory shows image;
Judge whether described current network state is in the network connection abnormality;
If then the superiors' stacking network at described demonstration image connects unusual picture element, and the final demonstration image that obtains is shown by described browser;
If not, then refresh current page and load the page of user request;
Perhaps:
Invoke script language extension JSE obtains current network state;
Judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, then not display network connect abnormal prompt information;
Perhaps:
Start one and be used for the thread whether the recognition network state changes, when recognizing network state and change, obtain key assignments corresponding to network state, judge whether described key assignments is network mark key assignments;
If then according to described network mark key assignments, judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, do not show that then the existing network network connects abnormal prompt information.
The present invention calls the network state detection function by starting the Network Check thread, judges the IP address is opened and obtained to the current network interface whether; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state; Judging current network state and front primary network state not simultaneously, the record current network state is also returned the method for the information of current network connection status, have in the situation of current network interface normal operation, the beneficial effect of further identification and prompting and the Internet connection status, improved the accuracy of network connection identification, made the function of terminal abundanter.
Description of drawings
Fig. 1 is the reminding method one embodiment schematic flow sheet of network state of the present invention;
Fig. 2 is the another embodiment schematic flow sheet of the reminding method of network state of the present invention;
Fig. 3 is the information one embodiment schematic flow sheet by the browser display current network state in the reminding method of network state of the present invention;
Fig. 4 is the information one embodiment schematic flow sheet that shows current network state in the reminding method of network state of the present invention by the page;
Fig. 5 is the another embodiment schematic flow sheet of information that shows current network state in the reminding method of network state of the present invention by the page;
Fig. 6 is the suggestion device one example structure schematic diagram of network state of the present invention;
Fig. 7 is the another example structure schematic diagram of the suggestion device of network state of the present invention.
The realization of the object of the invention, functional characteristics and advantage are described further with reference to accompanying drawing in connection with embodiment.
Embodiment
Further specify technical scheme of the present invention below in conjunction with Figure of description and specific embodiment.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
With reference to Fig. 1, Fig. 1 is the reminding method one embodiment schematic flow sheet of network state of the present invention; As shown in Figure 1, the reminding method of network state of the present invention may further comprise the steps:
Step S01, startup Network Check thread call the network state detection function, judge the IP address is opened and obtained to the current network interface whether; If not, execution in step S02 then; If, execution in step S03 then;
Step S02, record current network state and return the information of current network state;
Step S03, foundation communication variable socket judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state;
When the Sampling network connection status, start a Network Check thread, judge whether the network port is opened and the network port whether normal operation, whether can obtain the IP address; If the network port is unusual, judge directly that then network connection is unusual, the record current network state is unusual for connecting, and returns current network state for connecting unusual information.
In the situation of network port normal operation, set up a communication variable socket(socket), and judge whether socket can be connected with the Internet; According to the connection status of socket and the Internet, judge current network state; If socket can be connected with the Internet, it is normal for connecting then to return current network state, if socket can not be connected with the Internet, it is unusual for connecting then to return current network state.This be because, if terminal is when networking by the modulator-demodulator that Internet service provider (such as the telecommunication supplier) provides, in the situation of network port normal operation, terminal also is communicated with the Internet, namely this moment terminal network state for connection normally; If but terminal is not directly to network by modulator-demodulator, but by inner local area network (LAN) such as the router in certain company with after modulator-demodulator is connected, when networking by modulator-demodulator again, under this connection scene, if modulator-demodulator operation irregularity, but detect the network port normal operation of terminal, be terminal with router be connected and router is connected in the normal situation with modulator-demodulator, although network is set in terminal, can obtain the prompting of " network connection is normal ", but terminal and router always can't connecting Internets always.Therefore, in the situation of Sampling network port normal operation, need to judge whether socket can be connected with the Internet that only in network port normal operation and socket and situation that the Internet can normally be connected, the network connection state of terminal just normally.
The reason of first network port being judged is: socket communication adopts the socket describing word to link to each other with server in the Internet, thereby judges current network state; The time of implementation that socket communication is judged network is longer, and if there is Network Abnormal, needing so to wait for the connection request of socket, overtime to conclude that just current network connects unusual.But very fast to opening with normal operation whether this judgement execution of the network port; Therefore, if the netting twine that current suspension actual conditions are terminals disconnects, just can learn after the judgement of the network port that so the current network port opens or operation exception, this moment, terminal necessarily was in not connecting Internet state, so just do not need to be again socket and judged, reduced network and judged the time.
Step S04, judge whether current network state is identical with front primary network state; If, execution in step S05 then; If not, then return execution in step S02;
Step S05, the inspection thread exits network;
Connect when normal in current network, the record current network state is also returned current network and is connected normal information; Connect when unusual in current network, the record current network state is also returned current network and is connected abnormal information;
Current network state and front primary network state that step S03 is obtained compare, and judge whether the two is identical; If current network state is identical with the judged result of front primary network state, such as being network connection normally or connecting unusually, then ignore this judgement, the inspection thread exits network; This be because, network prompting is carried out when only unusual these two states of and network connection normal in network connection switch and get final product, if this network state with last time network state the same, namely network state does not have change, then do not need to repeat same prompting operation, saving resource.
If current network state is not identical with the judged result of front primary network state, then connect when normal in current network, primary network connects unusually before illustrating, then records current network state and returns current network and connect normal information; Primary network connects normally before current network connects when unusual, illustrates, then records current network state and returns current network and connect abnormal information.
Present embodiment calls the network state detection function by starting the Network Check thread, judges whether the current network driving opens and normal operation; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state; Judging current network state and front primary network state not simultaneously, the record current network state is also returned the method for the information of current network connection status, have in the situation of current network interface normal operation, further the beneficial effect of identification and the Internet connection status has improved the accuracy of network connection identification.
With reference to Fig. 2, Fig. 2 is the another embodiment schematic flow sheet of the reminding method of network state of the present invention; This enforcement is only to have increased step S06 with the difference of the described embodiment of Fig. 1; Present embodiment is only done specific descriptions to step S06, and other related steps of the reminding method of network state of the present invention please refer to the specific descriptions of the described embodiment of Fig. 1, do not repeat them here.
As shown in Figure 2, the reminding method of network state of the present invention also comprises step after step S02 or step S05:
The information of step S06, the described current network state of demonstration.
If current network state is unusual, the information that then shows current network state at the page of user's request of loading, such as eject a picture window at current page, show " please check network connection " or informations such as " current network connect unusual ", this information capable of dynamic or static the demonstration, the picture window of this information can be translucent or opaque etc., and the display mode of information can arbitrarily arrange as required.If current network state is normal, then refresh current interface, load the page of user's request.
In a preferred embodiment, can show by browser or the page information of current network state.
With reference to Fig. 3, Fig. 3 is the information one embodiment schematic flow sheet by the browser display current network state in the reminding method of network state of the present invention; As shown in Figure 3, in the reminding method of network state of the present invention, the information by the browser display current network state may further comprise the steps:
The page elements that needs drafting is also downloaded in step S11, parsing, according to the loading sequence of described page elements, described page elements is loaded in the internal memory, and the described page elements that superposes successively in described internal memory forms the demonstration image;
Resolve the page, need to determine the page elements of drafting; The process of resolving the page is: sent the request of load page the user after, browser can be accessed the server that this address is pointed to according to load address, and obtaining need to be to the page of user's demonstration; In obtaining the process of the page, at first obtain a DOM (Document Object Model, document dbject model) file; It is a layout that this DOM file can be understood as, and what elements namely notify in current this page that needs to show of browser has need to represent to the user, and each element need to be put into which position of the page, the information such as size that each element need to show.Browser downloads arranges the drafting position of all elements and the process of drawing order to this DOM file by the DOM file in internal memory.Page elements is all elements that can see in the page, being anything that the users such as literal, picture, animation effect can see, determining page elements, is exactly in the process of downloading page, resolve the page, get access to the process that all need to be shown to user's information data.Because the suspension prompting also is to see to the user, therefore the information of picture of reminding user current network state or passage need to be placed on all more than the page elements, this just need to be according to the loading sequence of page elements, load all page elements, and the information that guarantees current network state can be presented at the top of the page, so that the user sees.
The loading sequence of each element of the page self refers to the DISPLAY ORDER of all elements, such as, for a concrete page, we can see that it has the information such as a background red and white and the advertisement above the background, literal, in the loading procedure of this page, all elements does not once load and puts in place, but piecemeal loading, namely load first this background red and white, and then the frame that carrying advertisement, literal show is carried, then being the demonstration of literal, is the demonstration of the elements such as picture, flash at last, and this is exactly loading sequence.The reason that is loaded in the internal memory is, if the display screen that the user can see is regarded final painting canvas, it then is a foul papers with internal memory, all elements is loaded in the internal memory, be exactly first that each element is drawn in order on foul papers, then disposable being shown to " final painting canvas " is on the display screen that can see of user.The reason of doing like this is because the situation of various aberration, color addition confusion may occur in drawing process.The element loading sequence of definition when writing according to the page, above-mentioned page elements successively superposes.Load the higher element of relative importance value and can be placed to least significant end, the element that then loads can cover the element that has loaded, and so in layer is superimposed as the demonstration image of the page that the user finally sees.
Step S12, judge whether described current network state is in the network connection abnormality; If, execution in step S13 then; If not, execution in step S14 then;
Step S13, connect unusual picture element at the superiors stacking network of described demonstration image, the final demonstration image that obtains is shown by described browser;
Step S14, refresh current page and load the page of user request.
Start network and judge thread, judge whether current network state is in the network connection abnormality, namely judge current whether suspension; If the superiors' stacking network of the demonstration image of then drawing at step S11 connects unusual picture element.
Because the suspension prompting need to be shown to the user, and a lot of TV platforms self are without the suspension prompt facility, so this suspension prompting majority oneself is drawn out by the TV browser, if the user wants to see this prompting, must guarantee, no matter the user browses any page, this prompting is forever in the superiors of drawing picture out, so just need to guarantee when drawing that suspension points out this one deck topmost, namely draw at last, the user just can see the suspension prompting so again.In the present embodiment, the suspension prompting is that browser self is realized, so browser need to be known the page and when all elements be drawn end, after the element of the page self is completed, browser is pointed out suspension above all elements that this element is plotted in the page again, and the user just can see the suspension prompting like this.
After the whole loadings of all page newtoniums were finished, browser carried out corresponding operating again according to current network state.If current network state is suspension, then the picture element of a suspension of browser loading is superimposed upon the picture element of this suspension the superiors of all elements again in internal memory, merges a new image that comprises suspension, is shown at last the user again; If current network state is normal for connecting, then browser directly refreshes current page, and loads the page of user's request.In a preferred embodiment; connect when normal in current network, browser also can load a picture element that recovers network, and the picture element that will recover network is superimposed upon the superiors of all elements; merge the image that the protection that makes new advances recovers network, be shown at last the user.
With reference to Fig. 4, Fig. 4 is the information one embodiment schematic flow sheet that shows current network state in the reminding method of network state of the present invention by the page; As shown in Figure 4, in the reminding method of network state of the present invention, show that by the page information of current network state may further comprise the steps:
Step S21, call JSE, obtain current network state;
The page realizes that the suspension prompting need to use the JSE(JavaScript Extension of browser, script language extensions) technology, be to be used in the browser providing some non-HTML(Hyper Text Mark-up Language, HTML to the page) a kind of technology of standard.The effect of JSE is according to user's demand in browser, pre-defined better privately owned method, and realize the inner distinctive object of a browser for the page, the page can directly directly call the self-defining private method of some developers by the self-defining object of these browsers like this.Browser provides a method that is used for judging current network state for the page in JSE, and the page acquires current state after calling this method.
Step S22, judge whether described current network state is in the network connection abnormality; If, execution in step S23 then; If not, execution in step S24 then;
Step S23, display network connect abnormal prompt information;
Step S24, display network connects abnormal prompt information.
According to network state, judge whether current network state is in the network connection abnormality, and point out to show suspension or networking according to the current page status of judged result change.If current network connects abnormality, then display network connects abnormal prompt information; If the current network connection status is normal, then display network does not connect abnormal information; In a preferred embodiment, when the current network connection status is normal, can shows the networking information or not show any information, directly refresh the page, load the page info of user's request.
With reference to Fig. 5, Fig. 5 is the another embodiment schematic flow sheet of information that shows current network state in the reminding method of network state of the present invention by the page; As shown in Figure 5, in the reminding method of network state of the present invention, show that by the page information of current network state may further comprise the steps:
Step S31, browser start one and are used for the thread whether the recognition network state changes, and when recognizing network state and change, send a key assignments to the page;
Step S32, the page receive the key assignments of input, judge whether described key assignments is network mark key assignments; If, execution in step S33 then; If not, then return execution in step S32;
The page realizes that the another kind of method of suspension prompting is, is used for judging current network state in network thread of the inner startup of browser, when network state changes, sends a key assignments to the page; At this moment, the page receives the key assignments of input, and judges that whether this key assignments is the key assignments for the network mark of token network connection status; If this key assignments is not network mark key assignments, then continue to carry out the key assignments that receives input and judge whether this key assignments is the step of network mark key assignments.
Step S33, according to described network mark key assignments, judge whether described current network state is in the network connection abnormality; If, execution in step S34 then; If not, execution in step S35 then;
Step S34, display network connect abnormal prompt information;
Step S35, do not show that the existing network network connects abnormal prompt information.
According to network state, judge whether current network state is in the network connection abnormality, and point out to show suspension or networking according to the current page status of judged result change.If current network connects abnormality, then display network connects abnormal prompt information; If the current network connection status is normal, then display network does not connect abnormal information; In a preferred embodiment, when the current network connection status is normal, can shows the networking information or not show any information, directly refresh the page, load the page info of user's request.
Present embodiment has the beneficial effect of pointing out intuitively the current network connection status by showing the method for current network state information, makes the function of terminal abundanter.
With reference to Fig. 6, Fig. 6 is the suggestion device one example structure schematic diagram of network state of the present invention.As shown in Figure 6, the suggestion device of network state of the present invention comprises: network state acquisition module 01 and network state identification module 02.
Network state acquisition module 01 is used for starting the Network Check thread, calls the network state detection function, judges whether the current network driving opens and normal operation; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state.
When the Sampling network connection status, network state acquisition module 01 starts a Network Check thread, judges whether the network port is opened and network port normal operation whether; If the network port is unusual, judge directly that then network connection is unusual.In the situation of network port normal operation, network state acquisition module 01 is set up a communication variable socket, and judges whether socket can be connected with the Internet; According to the connection status of socket and the Internet, judge current network state; If socket can be connected with the Internet, it is normal for connecting then to return current network state, if socket can not be connected with the Internet, it is unusual for connecting then to return current network state.This be because, if terminal is when networking by the modulator-demodulator that Internet service provider (such as the telecommunication supplier) provides, in the situation of network port normal operation, terminal also is communicated with the Internet, namely this moment terminal network state for connection normally; If but terminal is not directly to network by modulator-demodulator, but by inner local area network (LAN) such as the router in certain company with after modulator-demodulator is connected, when networking by modulator-demodulator again, under this connection scene, if modulator-demodulator operation irregularity, but detect the network port normal operation of terminal, be terminal with router be connected and router is connected in the normal situation with modulator-demodulator, although network is set in terminal, can obtain the prompting of " network connection is normal ", but terminal and router always can't connecting Internets always.Therefore, network state acquisition module 01 is in the situation of Sampling network port normal operation, need to judge whether socket can be connected with the Internet that only in network port normal operation and socket and situation that the Internet can normally be connected, the network connection state of terminal just normally.
Network state acquisition module 01 to the reason that the network port is judged is first: socket communication adopts the socket describing word to link to each other with server in the Internet, thereby judges current network state; The time of implementation that socket communication is judged network is longer, and if there is Network Abnormal, needing so to wait for the connection request of socket, overtime to conclude that just current network connects unusual; But opening with normal operation whether this judgement execution of 01 pair of network port of network state acquisition module is very fast; Therefore, if being television set netting twines, current suspension actual conditions disconnect, network state acquisition module 01 can learn just that after the judgement of the network port current network port opens or operation exception so, this moment, TV necessarily was in not connecting Internet state, network state acquisition module 01 has been judged with regard to not needing to be socket again so, has reduced network and has judged the time.
Network state identification module 02 is used for judging whether current network state is identical with front primary network state; If the inspection thread then exits network; If not, then record current network state and return the information of current network state.
Network state identification module 02 compares current network state and the front primary network state that network state acquisition module 01 obtains, and judges whether the two is identical; If current network state is identical with the judged result of front primary network state, such as being network connection normally or connecting unusually, 02 of network state identification module is ignored this judgement, and the inspection thread exits network; This be because, the network prompting is carried out when only unusual these two states of and network connection normal in network connection switch and is got final product, if this network state with last time network state the same, be that network state does not change, 03 of network state display module does not need to repeat same prompting operation, saving resource.
If network state identification module 02 identification current network state is not identical with the judged result of front primary network state, then connect when normal in current network, primary network connects unusually before illustrating, 02 record of network state identification module current network state is also returned current network and connected normal information; Primary network connects normally before current network connects when unusual, illustrates, 02 record of network state identification module current network state is also returned current network and connected abnormal information.
Present embodiment calls the network state detection function by starting the Network Check thread, judges whether the current network driving opens and normal operation; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state; Judging current network state and front primary network state not simultaneously, the record current network state is also returned the information of current network connection status, have in the situation of current network interface normal operation, further the beneficial effect of identification and the Internet connection status has improved the accuracy of network connection identification.
With reference to Fig. 7, Fig. 7 is the another example structure schematic diagram of the suggestion device of network state of the present invention; The difference of present embodiment and the described embodiment of Fig. 6 is only to have increased network state display module 03; Present embodiment only is described specifically network state display module 03, and other related modules of the suggestion device of network state of the present invention please refer to the specific descriptions of related embodiment, do not repeat them here.
As shown in Figure 7, the suggestion device of network state of the present invention also comprises:
Network state display module 03 is for the information that shows described current network state.
If network state identification module 02 identification current network state is unusual, then network state display module 03 shows the information of current network state at the page of user's request of loading, such as eject a picture window at current page, show " please check network connection " or informations such as " current network connect unusual ", this information capable of dynamic or static the demonstration, the picture window of this information can be translucent or opaque etc., and the display mode of network state display module 03 display reminding information can arbitrarily arrange as required.If current network state is normal, network state display module 03 directly refreshes current interface, loads the page of user's request.
In a preferred embodiment, network state display module 03 can show by browser or the page information of current network state.
Network state display module 03 can be by the browser display current network state the detailed process of information as follows:
Network state display module 03 is resolved the page, need to determine the page elements of drafting; The process that network state display module 03 is resolved the page is: sent the request of load page the user after, browser can be accessed the server that this address is pointed to according to load address, and obtaining need to be to the page of user's demonstration; Obtain in the process of the page at network state display module 03, at first obtain a DOM file; It is a layout that this DOM file can be understood as, and what elements namely notify in current this page that needs to show of browser has need to represent to the user, and each element need to be put into which position of the page, the information such as size that each element need to show.Browser downloads arranges the drafting position of all elements and the process of drawing order to this DOM file by the DOM file in internal memory.Page elements is all elements that can see in the page, being anything that the users such as literal, picture, animation effect can see, determining page elements, is exactly in the process of downloading page, resolve the page, get access to the process that all need to be shown to user's information data.Because the suspension prompting also is to see to the user, therefore network state display module 03 is placed on all more than the page elements with picture of reminding user current network state or the information of passage, this just needs network state display module 03 according to the loading sequence of page elements, load all page elements, and the information that guarantees current network state can be presented at the top of the page, so that the user sees.
The loading sequence of each element of the page self refers to the DISPLAY ORDER of all elements, such as, for a concrete page, we can see that it has a background red and white and the advertisement above the background, the information such as literal, in the loading procedure of network state display module 03 to this page, all elements does not once load and puts in place, but piecemeal loading, be that network state display module 03 loads first this background red and white, and then carrying advertisement, the frame that literal shows is carried, then being the demonstration of literal, is picture at last, the demonstration of the elements such as flash, this is exactly loading sequence.Network state display module 03 with the reason that page elements is loaded in the internal memory is, if the display screen that the user can see is regarded final painting canvas, it then is a foul papers with internal memory, network state display module 03 is loaded into all elements in the internal memory, be exactly first that each element is drawn in order on foul papers, then disposable being shown to " final painting canvas " is on the display screen that can see of user.The reason of doing like this is because the situation of various aberration, color addition confusion may appear in network state display module 03 in drawing process.The element loading sequence of definition when network state display module 03 is write according to the page, above-mentioned page elements successively superposes; Load the higher element of relative importance value and can be placed to least significant end, the element that then loads can cover the element that has loaded, and so in layer is superimposed as the demonstration image of the page that the user finally sees.
After loading was finished, network state display module 03 started network and judges thread, judges whether current network state is in the network connection abnormality, namely judged current whether suspension; If then the superiors' stacking network at the demonstration image of drawing connects unusual picture element.
Because the suspension prompting need to be shown to the user, and a lot of TV platforms self are without the suspension prompt facility, so this suspension prompting majority oneself is drawn out by the TV browser, if the user wants to see this prompting, must guarantee, no matter the user browses any page, this prompting is forever in the superiors of drawing picture out, so just need network state display module 03 to guarantee that when drawing suspension points out this one deck topmost, namely draw at last, the user just can see the suspension prompting so again.In the present embodiment, the suspension prompting realizes by browser, so browser need to be known the page and when all elements be drawn end, after the element of the page self is completed, network state display module 03 is pointed out suspension above all elements that this element is plotted in the page again, and the user just can see the suspension prompting like this.
After the whole loadings of all page newtoniums were finished, network state display module 03 carried out corresponding operating again according to current network state.If current network state is suspension, then network state display module 03 loads the picture element of a suspension in internal memory, again the picture element of this suspension is superimposed upon the superiors of all elements, merges a new image that comprises suspension, be shown to again at last the user; If current network state is normal for connecting, then network state display module 03 directly refreshes current page, and loads the page of user's request.In a preferred embodiment; connect when normal in current network; network state display module 03 also can load a picture element that recovers network; and the picture element that will recover network is superimposed upon the superiors of all elements; merge the image that the protection that makes new advances recovers network, be shown at last the user.
Network state display module 03 can show that the detailed process of information of current network state is as follows by the page:
Network state display module 03 utilizes the page to realize that the suspension prompting need to use the JSE technology of browser, namely is used for providing a kind of technology of some non-HTML standards to the page in the browser.The effect of JSE is according to user's demand in browser, pre-defined better privately owned method, and realize the inner distinctive object of a browser for the page, the page can directly directly call the self-defining private method of some developers by the self-defining object of these browsers like this.Browser provides a method that is used for judging current network state for the page in JSE, and network state display module 03 acquires current state after utilizing this method of page invocation.
Network state display module 03 utilizes the page to realize that the another kind of method of suspension prompting is, is used for judging current network state in network thread of the inner startup of browser, when network state changes, sends a key assignments to the page; At this moment, network state display module 03 receives the key assignments of input by the page, and judges that whether this key assignments is the key assignments for the network mark of token network connection status; If this key assignments is not network mark key assignments, 03 of network state display module continues to carry out the key assignments that receives input and judge whether this key assignments is network mark key assignments.
Network state display module 03 judges according to network state whether current network state is in the network connection abnormality, and points out to show suspension or networking according to the current page status of judged result change.If current network connects abnormality, 03 display network of network state display module connects abnormal prompt information; If the current network connection status is normal, 03 of network state display module not display network connects abnormal information; In a preferred embodiment, when the current network connection status was normal, network state display module 03 can show the networking information or not show any information, directly refreshes the page, loads the page info of user's request.
Present embodiment has the beneficial effect of pointing out intuitively the current network connection status by showing the current network state information, makes the function of terminal abundanter.
The above only is the preferred embodiments of the present invention; be not so limit its claim; every equivalent structure or equivalent flow process conversion that utilizes specification of the present invention and accompanying drawing content to do; directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.

Claims (10)

1. the reminding method of a network state is characterized in that, may further comprise the steps:
Start the Network Check thread, call the network state detection function, judge the IP address is opened and obtained to the current network interface whether; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state;
Judge whether described current network state is identical with front primary network state; If the inspection thread then exits network; If not, then record current network state and return the information of current network state.
2. the method for claim 1 is characterized in that, described record current network state is also returned and also comprised step after the step of information of current network state:
The information that shows described current network state by browser or the page.
3. the method for claim 1 is characterized in that, describedly judges whether described socket is communicated with Internet Server, and according to judged result, the step of obtaining current network state comprises:
When described socket was communicated with Internet Server, it was normal for connecting to obtain current network state;
When described socket was not communicated with Internet Server, it was unusual for connecting to obtain current network state.
4. method as claimed in claim 2 is characterized in that, described information by the described current network state of browser display comprises:
Resolve and download the page elements that to draw, according to the loading sequence of described page elements, described page elements is loaded in the internal memory, and the described page elements formation that superposes successively in described internal memory shows image;
Judge whether described current network state is in the network connection abnormality;
If then the superiors' stacking network at described demonstration image connects unusual picture element, and the final demonstration image that obtains is shown by described browser;
If not, then refresh current page and load the page of user request.
5. method as claimed in claim 2 is characterized in that, describedly shows that by the page information of described current network state comprises:
Invoke script language extension JSE obtains current network state;
Judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, then not display network connect abnormal prompt information.
6. method as claimed in claim 2 is characterized in that, describedly shows that by the page information of described current network state comprises:
Described browser starts one and is used for the thread whether the recognition network state changes, and when recognizing network state and change, sends a key assignments to the described page;
The described page receives described key assignments, judges whether described key assignments is network mark key assignments;
If then according to described network mark key assignments, judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, do not show that then the existing network network connects abnormal prompt information.
7. the suggestion device of a network state is characterized in that, comprising:
The network state acquisition module is used for starting the Network Check thread, calls the network state detection function, judges the IP address is opened and obtained to the current network interface whether; If not, then record current network state and return the current network state information; If, then set up communication variable socket, judge that whether described socket is communicated with Internet Server, according to judged result, obtains current network state;
The network state identification module is used for judging whether current network state is identical with front primary network state; If the inspection thread then exits network; If not, then record current network state and return the information of current network state.
8. device as claimed in claim 7 is characterized in that, also comprises:
The network state display module is for the information that shows described current network state by browser or the page.
9. device as claimed in claim 7 is characterized in that, described network state acquisition module also is used for:
When described socket was communicated with Internet Server, it was normal for connecting to obtain current network state;
When described socket was not communicated with Internet Server, it was unusual for connecting to obtain current network state.
10. device as claimed in claim 8 is characterized in that, described network state display module shows that the mode of the information of described current network state comprises:
Resolve and download the page elements that to draw, according to the loading sequence of described page elements, described page elements is loaded in the internal memory, and the described page elements formation that superposes successively in described internal memory shows image;
Judge whether described current network state is in the network connection abnormality;
If then the superiors' stacking network at described demonstration image connects unusual picture element, and the final demonstration image that obtains is shown by described browser;
If not, then refresh current page and load the page of user request;
Perhaps:
Invoke script language extension JSE obtains current network state;
Judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, then not display network connect abnormal prompt information;
Perhaps:
Start one and be used for the thread whether the recognition network state changes, when recognizing network state and change, obtain key assignments corresponding to network state, judge whether described key assignments is network mark key assignments;
If then according to described network mark key assignments, judge whether described current network state is in the network connection abnormality;
If then display network connects abnormal prompt information;
If not, do not show that then the existing network network connects abnormal prompt information.
CN201210568181.9A 2012-12-24 2012-12-24 The reminding method and device of network state Active CN103067777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210568181.9A CN103067777B (en) 2012-12-24 2012-12-24 The reminding method and device of network state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210568181.9A CN103067777B (en) 2012-12-24 2012-12-24 The reminding method and device of network state

Publications (2)

Publication Number Publication Date
CN103067777A true CN103067777A (en) 2013-04-24
CN103067777B CN103067777B (en) 2017-07-25

Family

ID=48110210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210568181.9A Active CN103067777B (en) 2012-12-24 2012-12-24 The reminding method and device of network state

Country Status (1)

Country Link
CN (1) CN103067777B (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103596041A (en) * 2013-11-20 2014-02-19 乐视致新电子科技(天津)有限公司 Information prompt method and device
CN103596060A (en) * 2013-11-20 2014-02-19 乐视致新电子科技(天津)有限公司 Information prompt method and device
CN104298494A (en) * 2013-07-19 2015-01-21 深圳市同洲电子股份有限公司 Browsing method and device based on JS framework
CN106068020A (en) * 2016-05-26 2016-11-02 腾讯科技(深圳)有限公司 Hinting abnormal states method and device
CN107294812A (en) * 2017-08-03 2017-10-24 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107332739A (en) * 2017-07-28 2017-11-07 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107360059A (en) * 2017-07-28 2017-11-17 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107682212A (en) * 2017-11-14 2018-02-09 北京遥测技术研究所 A kind of embedded device multiple-user network communication abnormality processing method
CN107734528A (en) * 2017-11-03 2018-02-23 广东欧珀移动通信有限公司 Wireless network detection method, device, storage medium and terminal
CN107846330A (en) * 2017-12-18 2018-03-27 深圳创维数字技术有限公司 A kind of network fault detecting method, terminal and computer-readable medium
CN109361571A (en) * 2018-12-03 2019-02-19 郑州云海信息技术有限公司 A kind of network port detection method, device, equipment and readable storage medium storing program for executing
CN109743722A (en) * 2019-01-03 2019-05-10 中国联合网络通信集团有限公司 It is connected to the network treating method and apparatus
CN109995619A (en) * 2017-12-29 2019-07-09 佛山市顺德区美的电热电器制造有限公司 A kind of state prompt method and device and storage medium
CN110248186A (en) * 2019-07-22 2019-09-17 中国联合网络通信集团有限公司 Holographic video communication diagnosing method, receiving device, holographic video communication system
CN112422365A (en) * 2020-11-06 2021-02-26 海信视像科技股份有限公司 Display device and method for automatically monitoring network state
CN113064568A (en) * 2021-03-31 2021-07-02 联想(北京)有限公司 Output method and output device
CN114337900A (en) * 2021-12-29 2022-04-12 中国电信股份有限公司 Communication control method and device, electronic equipment and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1798060A (en) * 2004-12-24 2006-07-05 联想(北京)有限公司 Method and device for detecting conflict of IP addresses in networked computers
CN1866853A (en) * 2005-05-19 2006-11-22 黄宁宁 LAN node fault alarming method, system and interface module for the system
CN101316203A (en) * 2008-07-10 2008-12-03 四川长虹电器股份有限公司 Method for monitoring embedded IP terminal internetwork connection condition
CN102111639A (en) * 2009-12-29 2011-06-29 康佳集团股份有限公司 Network detection method of network television and network television
CN102510523A (en) * 2011-10-13 2012-06-20 青岛海信宽带多媒体技术有限公司 Socket communication interactive testing method and network television testing system using same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1798060A (en) * 2004-12-24 2006-07-05 联想(北京)有限公司 Method and device for detecting conflict of IP addresses in networked computers
CN1866853A (en) * 2005-05-19 2006-11-22 黄宁宁 LAN node fault alarming method, system and interface module for the system
CN101316203A (en) * 2008-07-10 2008-12-03 四川长虹电器股份有限公司 Method for monitoring embedded IP terminal internetwork connection condition
CN102111639A (en) * 2009-12-29 2011-06-29 康佳集团股份有限公司 Network detection method of network television and network television
CN102510523A (en) * 2011-10-13 2012-06-20 青岛海信宽带多媒体技术有限公司 Socket communication interactive testing method and network television testing system using same

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298494A (en) * 2013-07-19 2015-01-21 深圳市同洲电子股份有限公司 Browsing method and device based on JS framework
CN103596041A (en) * 2013-11-20 2014-02-19 乐视致新电子科技(天津)有限公司 Information prompt method and device
CN103596041B (en) * 2013-11-20 2016-11-16 乐视致新电子科技(天津)有限公司 A kind of information cuing method and device
CN103596060A (en) * 2013-11-20 2014-02-19 乐视致新电子科技(天津)有限公司 Information prompt method and device
CN106068020A (en) * 2016-05-26 2016-11-02 腾讯科技(深圳)有限公司 Hinting abnormal states method and device
CN107360059A (en) * 2017-07-28 2017-11-17 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107360059B (en) * 2017-07-28 2019-03-01 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN107332739A (en) * 2017-07-28 2017-11-07 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107332739B (en) * 2017-07-28 2019-01-15 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN107294812A (en) * 2017-08-03 2017-10-24 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
CN107294812B (en) * 2017-08-03 2019-04-12 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN107734528A (en) * 2017-11-03 2018-02-23 广东欧珀移动通信有限公司 Wireless network detection method, device, storage medium and terminal
CN107682212A (en) * 2017-11-14 2018-02-09 北京遥测技术研究所 A kind of embedded device multiple-user network communication abnormality processing method
CN107682212B (en) * 2017-11-14 2021-04-13 北京遥测技术研究所 Multi-user network communication exception handling method for embedded equipment
CN107846330A (en) * 2017-12-18 2018-03-27 深圳创维数字技术有限公司 A kind of network fault detecting method, terminal and computer-readable medium
CN109995619A (en) * 2017-12-29 2019-07-09 佛山市顺德区美的电热电器制造有限公司 A kind of state prompt method and device and storage medium
CN109361571A (en) * 2018-12-03 2019-02-19 郑州云海信息技术有限公司 A kind of network port detection method, device, equipment and readable storage medium storing program for executing
CN109743722A (en) * 2019-01-03 2019-05-10 中国联合网络通信集团有限公司 It is connected to the network treating method and apparatus
CN110248186A (en) * 2019-07-22 2019-09-17 中国联合网络通信集团有限公司 Holographic video communication diagnosing method, receiving device, holographic video communication system
CN110248186B (en) * 2019-07-22 2021-02-02 中国联合网络通信集团有限公司 Holographic video communication diagnosis method, receiving end equipment and holographic video communication system
CN112422365A (en) * 2020-11-06 2021-02-26 海信视像科技股份有限公司 Display device and method for automatically monitoring network state
CN112422365B (en) * 2020-11-06 2022-06-28 海信视像科技股份有限公司 Display device and method for automatically monitoring network state
CN113064568A (en) * 2021-03-31 2021-07-02 联想(北京)有限公司 Output method and output device
CN114337900A (en) * 2021-12-29 2022-04-12 中国电信股份有限公司 Communication control method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN103067777B (en) 2017-07-25

Similar Documents

Publication Publication Date Title
CN103067777A (en) Method and device of prompting of network state
CN106990952B (en) Form verification method and system based on Vue
CN101605175B (en) Method and apparatus for displaying colorful desktop text by mobile terminal
US20100083098A1 (en) Streaming Information that Describes a Webpage
CN102662966B (en) Method and system for obtaining subject-oriented dynamic page content
CN102207967B (en) Method and system for automatically providing new browser plugin
CN105260318A (en) Automatic testing method and device based on web pages
CN104965829B (en) Terminal applies classification method, server and system
US20150169600A1 (en) Interface display method and system for home gateway applicable to various display types
CN102761628B (en) Pan-domain name identification and processing device and method
CN102981902A (en) Intelligent mobile terminal and screen protection method based on same
CN107066496A (en) A kind of page access method of compatible different browsers and terminal device
CN107145598A (en) Quick Response Code associates page method and terminal
CN106686148A (en) Method and system for increasing uploading speed of objects in object storage system
CN102316163B (en) Method for realizing Web container expansion and Web container
CN104021127A (en) Information processing method and electronic device
CN102880492A (en) Extensive makeup language (XML) script resolver based on analysis server (AS) and method for script resolver
CN105516269B (en) The configuration method of application and the configuration device of application
CN108153527A (en) A kind of configuration method of equipment output resolution ratio
CN108809896A (en) A kind of information calibration method, device and electronic equipment
CN103581315A (en) Weather display system and method of mobile terminal
CN102970601A (en) Television based automatic drive loading processing method and television
CN109446648A (en) Service of simulation method for building up and device
CN108874373A (en) Method and device, display terminal and the storage medium of information are inserted into webpage
CN106888250A (en) For method, the method and apparatus for representing push content realizing pushing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant