CN104836683B - A kind of method and device of thread reconnection - Google Patents

A kind of method and device of thread reconnection Download PDF

Info

Publication number
CN104836683B
CN104836683B CN201510152124.6A CN201510152124A CN104836683B CN 104836683 B CN104836683 B CN 104836683B CN 201510152124 A CN201510152124 A CN 201510152124A CN 104836683 B CN104836683 B CN 104836683B
Authority
CN
China
Prior art keywords
thread
reconnection
threads
corresponding connection
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510152124.6A
Other languages
Chinese (zh)
Other versions
CN104836683A (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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201510152124.6A priority Critical patent/CN104836683B/en
Publication of CN104836683A publication Critical patent/CN104836683A/en
Application granted granted Critical
Publication of CN104836683B publication Critical patent/CN104836683B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of method and devices of thread reconnection, in this scenario, when determining that the corresponding connection of any one thread of terminal occurs abnormal, judge to whether there is in other threads of the terminal state of corresponding connection for normal thread;If it is determined that the state in other described threads there is no corresponding connection is normal thread, and when determining to meet preset condition, stop connect corresponding to any one thread and carry out reconnection, that is, if there is exception in corresponding connect of any one thread, if also there is exception in the corresponding connection of other threads, when determining to meet preset condition, stop connect corresponding to any one thread and carry out reconnection, connection not corresponding to the thread carries out reconnection, therefore, avoid waste of resource in the prior art, influence the defects of other connect normal thread.

Description

A kind of method and device of thread reconnection
Technical field
The present invention relates to field of communication technology, more particularly to a kind of method and device of thread reconnection.
Background technology
With the development of network technology, network has become a part indispensable in people's life, therefore, to network Optimizing also seems most important.In the network optimization, it usually needs carry out multithreading download by terminal, measure the peak of download Speed and Mean Speed, optimize network according to measurement result, for example, peak speed and Mean Speed are relatively low, then it is excellent to carry out network Change.
In practical applications, using thread download carry out the network optimization when, if thread download be operation vehicle it is enterprising If row, carrying out the change in location of the terminal of thread download can cause terminal to carry out network switching, the signal of terminal present position The variation of car speed in the variation of intensity or even vehicle operation can cause thread connection to occur abnormal.
In the prior art, if exception occurs in thread connection, terminal all can carry out reconnection to there is abnormal thread, But in some cases, terminal how reconnection occur abnormal thread all can not successful connection, if at this point, terminal one If highly seasoned company, not only can waste of resource, can also influence other and connect normal thread.
At present, it is often base when downloading progress network test using thread, and the network optimization being carried out according to test result Download what is measured in multiple threads, if exception occurs in the connection of any one thread carries out simple reconnection in the manner described above If, there are serious waste resource and the defects of other connect normal thread can be influenced,
The content of the invention
The embodiment of the present invention provides a kind of method and device of thread reconnection, to solve waste in the prior art Resource is more serious and influences the defects of other connect normal thread.
Specific technical solution provided in an embodiment of the present invention is as follows:
A kind of method of thread reconnection, including:
When determining that the corresponding connection of any one thread of terminal occurs abnormal, judge in other threads of the terminal whether State there are corresponding connection is normal thread;
When judging that the state in other described threads there is no corresponding connection is normal thread, and determine to meet default During condition, stop connect corresponding to any one thread and carry out reconnection.
In this way, if exception occurs in the corresponding connection of any one thread, the corresponding connection of other threads also occurs abnormal If, when determining to meet preset condition, stop connect corresponding to any one thread and carry out reconnection, i.e., not to the line The corresponding connection of journey carries out reconnection, that is to say, that as long as not being that the corresponding connection of thread disconnects, reconnection will be carried out, therefore, Avoid waste of resource in the prior art, influence the states of other corresponding connections the defects of being normal thread.
Preferably, determining to meet preset condition, specifically include:
Determine that there are the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
The number for determining any one thread is non-designated number.
Further, stop after connection corresponding to any one thread carries out reconnection, further including:
After determining that the thread reconnection that reconnection is carried out to corresponding connection in other described threads is successful, to any one line The corresponding connection of journey carries out reconnection.
Further, further include:
When judging that the state in other described threads there is no corresponding connection is normal thread, and it is unsatisfactory for described pre- If during condition, connect corresponding to any one thread carries out reconnection;
After the corresponding connection reconnection success of any one thread, connection corresponding to other described threads carries out weight Even.
Preferably, determining to be unsatisfactory for preset condition, specifically include:
Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
The number for determining any one thread is to specify number.
Further, further include:
If it is determined that the state in other described threads there are corresponding connection is normal thread, to any one line The corresponding connection of journey carries out reconnection.
Preferably, carrying out reconnection to the corresponding thread of any one thread, specifically include:
If the state in other described threads there are corresponding connection is not up to thread connection for the quantity of normal thread Threshold value carries out reconnection using connect corresponding to any one thread of the first reconnection interval;
If reach the thread connection there are corresponding connection status for the quantity of normal thread in other described threads Threshold value carries out reconnection using connect corresponding to any one thread of the second reconnection interval;
The duration at the first reconnection interval is less than the duration at the second reconnection interval.
A kind of device of thread reconnection, including:
Determination unit, for determining that it is abnormal that the corresponding connection of any one thread of terminal occurs;
Judging unit, when connecting appearance exception for determining that any one thread of terminal is corresponding in the determination unit, Judge to whether there is in other threads of the terminal state of corresponding connection for normal thread;
Reconnection unit judges that the state in other described threads there is no corresponding connection is for working as the judging unit Normal thread, the and when determination unit determines to meet preset condition, stop it is corresponding to any one thread connect into Row reconnection.
In this way, if exception occurs in the corresponding connection of any one thread, the corresponding connection of other threads also occurs abnormal If, when determining to meet preset condition, stop connect corresponding to any one thread and carry out reconnection, not to the thread Corresponding connection carries out reconnection, that is to say, that as long as not being that the corresponding connection of thread disconnects, reconnection will be carried out, therefore, Avoid waste of resource in the prior art, influence the states of other corresponding connections the defects of being normal thread.
Preferably, when the determination unit determines to meet preset condition, it is specially:
Determine that there are the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
The number for determining any one thread is non-designated number.
Further, the reconnection unit is additionally operable to:
After corresponding connection carries out the thread reconnection success of reconnection in the determination unit determines to other described threads, Connect corresponding to any one thread carries out reconnection.
Further, the reconnection unit is additionally operable to:
When the judging unit judges that the state in other described threads there is no corresponding connection is the normal line of connection Journey, the and when determination unit determines to be unsatisfactory for the preset condition carries out reconnection to the corresponding connection of any one thread;
After any one thread reconnection success, connection corresponding to other described threads carries out reconnection.
Preferably, when the determination unit determines to be unsatisfactory for preset condition, it is specially:
Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
The number for determining any one thread is to specify number.
Further, the reconnection unit is additionally operable to:
If the judging unit judges that the state there are corresponding connection is normal thread in other described threads, to institute It states the corresponding connection of any one thread and carries out reconnection.
Preferably, when reconnection unit connection corresponding to any one thread carries out reconnection, it is specially:
If the state in other described threads there are corresponding connection is not up to thread connection for the quantity of normal thread Threshold value carries out reconnection using connect corresponding to any one thread of the first reconnection interval;
Reach the line there are the state of corresponding connection for the quantity of normal thread if existing in other described threads Journey connection threshold carries out reconnection using connect corresponding to any one thread of the second reconnection interval;
The duration at the first reconnection interval is less than the duration at the second reconnection interval.
The present invention has the beneficial effect that:
In the prior art, as long as the corresponding connection of any one thread occurs abnormal, reconnection can be all carried out, is so existed The problem of thread that the wasting of resources and influence normally connect, in the embodiment of the present invention, determine that any one thread of terminal is corresponding When connection occurs abnormal, judge to whether there is in other threads of the terminal state of corresponding connection for normal thread; If it is determined that the state in other described threads there is no corresponding connection is normal thread, and when determining to meet preset condition, Stop connect corresponding to any one thread and carry out reconnection, that is to say, that if the corresponding connection of any one thread occurs It is abnormal, if the corresponding thread of other threads also exception occurs, when determining to meet preset condition, stop arbitrary to this The corresponding thread of one thread carries out reconnection, and connection not corresponding to the thread carries out reconnection, therefore, avoids unrestrained in the prior art Expense resource influences the defects of other connect normal thread.
Description of the drawings
Fig. 1 is the flow chart of thread reconnection of the embodiment of the present invention;
Fig. 2 is the embodiment of thread reconnection of the embodiment of the present invention;
Fig. 3 is the illustrative view of functional configuration of inventive embodiments thread reconnection device.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art All other embodiments obtained without creative efforts belong to the scope of protection of the invention.
In addition, the terms " system " and " network " are often used interchangeably herein.The terms " and/ Or ", it is only a kind of incidence relation for describing affiliated partner, expression may have three kinds of relations, for example, A and/or B, it can be with table Show:Individualism A exists simultaneously A and B, these three situations of individualism B.In addition, letter "/" herein, typicallys represent front and rear Affiliated partner is a kind of relation of "or".
The preferred embodiment of the present invention is described in detail with reference to Figure of description, it should be understood that this place The preferred embodiment of description is merely to illustrate and explain the present invention, and is not intended to limit the present invention, and in situation about not conflicting Under, the feature in embodiment and embodiment in the application can be mutually combined.
As shown in fig.1, in the embodiment of the present invention, a kind of flow of thread reconnection is as follows:
Step 100:When determining that the corresponding connection of any one thread of terminal occurs abnormal, in other threads for judging terminal State with the presence or absence of corresponding connection is normal thread;
Step 110:When judging that the state in other threads there is no corresponding connection is the normal thread of connection, and determine When meeting preset condition, stop connection corresponding to any one thread and carry out reconnection.
In practical applications, when the corresponding connection connection of a certain thread disconnects, it may be possible to entering signal blind area, other The corresponding connection of thread may also disconnect, at this point, it is corresponding connection disconnect thread no matter how reconnection, be all that can not connect Connect successfully, if all reconnections of all threads disconnected, can there is a situation where waste of resource, then, can allow to Corresponding connect of a few thread first carries out reconnection, and after reconnection success, then threads that other connections are disconnected carry out reconnection, and The all reconnections immediately of all threads disconnected are not allowed for, in this way, the wasting of resources can be reduced.
In the embodiment of the present invention, any one thread corresponds to a connection, is no longer described in detail herein.
In the embodiment of the present invention, there are four types of states for any one thread:1st, connecting;2:Connection normally (represents that this is One normal thread connection, can carry out data transmission or carry out data transmission);3:Connection is abnormal;4:Connection is Through closing.Under normal circumstances, state change is:Connecting->Connection is normal->Connection has been switched off, that is to say, that first It is to connect (state 1), after successful connection, the state of thread becomes connection normally (state 2), then, after the completion of download, closes Connection is closed, then state becomes:Connection has been switched off (state 4).
In the embodiment of the present invention, there are many modes that determine to meet preset condition, optionally, following manner may be employed:
Determine that there are the positive threads for carrying out reconnection of corresponding connection in other threads, that is to say, that seen whether other lines Journey is corresponding to be connected to carry out reconnection.
Certainly, in order to reduce implementation complexity, thread number can also be given, no matter specifies the corresponding connection of the thread numbered When disconnect and all carry out reconnection immediately, accordingly, it is determined that when meeting preset condition, it can also be in the following way:
The number for determining any one thread is non-designated number.
Such as:Share 10 threads:Thread is carried out respectively by [[NSThread currentThread] setName] Number, number be respectively 1,2,3 ..., 10, it is assumed that setting thread 1 it is corresponding connection when disconnect all immediately Carry out reconnection, then, when the corresponding connection of thread 2 disconnects, whether first check the corresponding connection of other 9 threads It all disconnects, if disconnected, then checks whether the number of the thread is 1, due to numbering for 1, stop pair The corresponding connection of thread 2 carries out reconnection.
In the embodiment of the present invention, after stopping connection progress reconnection corresponding to any one thread, following operation is further included:
After determining that corresponding connection carries out the thread reconnection success of reconnection in other threads, connection corresponding to any one line Cheng Jinhang reconnections.
Although that is, stop in step 110 to the corresponding connection reconnection of any one thread described in step 100 It afterwards, be to the corresponding connection of any one thread of stopping reconnection in step 110 if the thread reconnection success for carrying out reconnection Carry out reconnection.
It is still illustrated exemplified by above-mentioned, shares 10 threads:Thread 1, thread 2, thread 3 ..., thread 10, it is assumed that When the corresponding connection of setting thread 1 disconnects and all carries out reconnection immediately, then, when the corresponding connection of thread 2 is disconnected It when opening connection, first checks whether the corresponding connection of other 9 threads all disconnects, if disconnected, then checks Whether the number of the thread is 1, is not 1 due to numbering, stop connection corresponding to thread 2 and carry out reconnection, still, when It, connection progress reconnection corresponding to thread 2 after the corresponding connection reconnection success of thread 1.
Following code may be employed in realization to realize:
(1) thread 1 notifies other threads to carry out reconnection
(2) other threads (such as thread 2) carry out reconnection after the notice of reconnect is received
It is above-mentioned to tell about, when thread it is corresponding connection disconnect when without reconnection situation, in practical applications, some In the case of, after the corresponding connection of thread disconnects, reconnection is carried out immediately.
Therefore, in the embodiment of the present invention, further include:
When judging that it is normal thread that corresponding connection status is not present in other threads, and being unsatisfactory for preset condition, Connection corresponding to any one thread carries out reconnection;
After the corresponding connection reconnection success of any one thread, connection corresponding to other threads carries out reconnection.
In the embodiment of the present invention, there are many modes that determine to be unsatisfactory for preset condition, optionally, may be employed such as lower section Formula:
Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other threads;Or
The number for determining any one thread is to specify number.
In the embodiment of the present invention, following operation is further included:
If it is determined that the state in other threads there are corresponding connection is normal thread, weight is carried out to any one thread Even.
In a practical situation, for each terminal, server single thread may only be allowed to download or specify and hair line Number of passes, in this case, if the Thread Count that terminal is initiated is if it exceeds the permitted number of threads of server, is more than service There is also the situations of waste of resource if the corresponding connection progress reconnection of other threads outside the permitted number of threads of device.
Such as:Present period, the permitted number of threads of server are 10, and still, terminal is initiated 15 threads and corresponded to Connection, then have 5 thread threads it is corresponding connection can not successful connection, if this 5 to corresponding connection failure If thread carries out reconnection, can there is a situation where the wasting of resources.
But in practical applications, the number of the permitted thread of server may change, and plan is downloaded in such as change Summary or other reasons so that the number of the permitted thread of server increases, because, in order to enable the thread of connection failure Connection in time, the thread of these connection failures is corresponding to connect the also reconnection to be carried out, and only reconnection interval is greater than, and connects When the number of normal thread is not up to thread connection threshold, between the reconnection that when thread of failure corresponding connection reconnection uses Every.
Therefore, in the embodiment of the present invention, connection corresponding to any one thread is carried out there are many modes of reconnection, optional , following manner may be employed:
If the state in other threads there are corresponding connection is not up to thread for the quantity of normal thread and connects thresholding Value carries out reconnection using the connection corresponding to any one thread of the first reconnection interval;
If reaching thread connection threshold there are corresponding connection status for the quantity of normal thread in other threads, adopt Reconnection is carried out with the connection corresponding to any one thread of the second reconnection interval;
The duration at the first reconnection interval is less than the duration at the second reconnection interval.
Such as:Corresponding connect of a certain thread disconnects, but corresponding connection status does not reach for the quantity of normal thread To thread connection threshold, then the state of the corresponding connection is that the time interval that the thread disconnected carries out reconnection is 5s, still, If corresponding connection status reaches thread connection threshold for the quantity of normal thread, the state of the corresponding connection is The time interval that the thread of disconnection carries out reconnection is 20s.In this way, when server changes download policy, the shape of corresponding connection State can also timely successful connection for the thread disconnected.
In the embodiment of the present invention, thread can be the thread in FTP downloading process or HTTP (Hyper-Text Transport Protocol, hypertext transfer protocol) thread in downloading process, it can also be the thread during other, It is no longer described in detail one by one herein.
Embodiment for a better understanding of the present invention is given below concrete application scene, for the process of thread reconnection, does Go out to be described in further detail, it is specific as shown in Figure 2:
Step 200:Terminal, which is created, builds 10 threads, thread 1, thread 2, thread 3 ..., thread 10, and to per thread Establish corresponding connection;
Step 210:When the corresponding connection of thread 1 occurs abnormal, judge to whether there is corresponding connection in other 9 threads State for normal thread, if so, performing step 220, otherwise, perform step 230;
Step 220:Connection corresponding to thread 1 carries out reconnection;
Step 230:Judge with the presence or absence of the positive thread for carrying out reconnection of corresponding connection in other 9 threads, if so, performing Step 250;Otherwise, step 240 is performed;
Step 240:Connection corresponding to any one thread carries out reconnection, in the corresponding connection reconnection success of any one thread Afterwards, connection corresponding to other threads carries out reconnection respectively;
Step 250:After determining that corresponding connection carries out the thread reconnection success of reconnection in other threads, to any one thread Corresponding connection carries out reconnection.
As shown in figure 3, a kind of device of thread reconnection provided in an embodiment of the present invention, the device of the thread reconnection is included really Order member 300, judging unit 310 and reconnection unit 320, wherein:
Determination unit 300, for determining that it is abnormal that the corresponding connection of any one thread of terminal occurs;
Judging unit 310, for determining that it is abnormal that the corresponding connection of any one thread of terminal occurs in determination unit 300 When, judge to whether there is in other threads of terminal the state of corresponding connection for normal thread;
Reconnection unit 320 judges that the state in other threads there is no corresponding connection is just for working as judging unit 310 Normal thread, and when determination unit 300 determines to meet preset condition, stop connection corresponding to any one thread and carry out reconnection.
In the embodiment of the present invention, preferably, when determination unit 300 determines to meet preset condition, it is specially:
Determine that there are the positive threads for carrying out reconnection of corresponding connection in other threads;Or
The number for determining any one thread is non-designated number.
Further, reconnection unit 320 is additionally operable to:
After determination unit determines to corresponding connection carries out the thread reconnection success of reconnection in other threads, to any one The corresponding connection of thread carries out reconnection.
Further, reconnection unit 320 is additionally operable to:
When judging unit 310 judges state in other threads there is no corresponding connection for normal thread, and determine When unit 300 determines to be unsatisfactory for preset condition, connection corresponding to any one thread carries out reconnection;
After the corresponding connection reconnection success of any one thread, connection corresponding to other threads carries out reconnection.
Preferably, when determination unit 300 determines to be unsatisfactory for preset condition, it is specially:
Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other threads;Or
The number for determining any one thread is to specify number.
Further, reconnection unit 320 is additionally operable to:
If judging unit 310 judges that the state there are corresponding connection is normal thread in other threads, to any one The corresponding connection of thread carries out reconnection.
Preferably, when the connection corresponding to any one thread of reconnection unit 320 carries out reconnection, it is specially:
If the state in other threads there are corresponding connection is not up to thread for the quantity of normal thread and connects thresholding Value carries out reconnection using the connection corresponding to any one thread of the first reconnection interval;
If the state in other threads there are corresponding connection reaches thread for the quantity of normal thread and connects thresholding Value carries out reconnection using the connection corresponding to any one thread of the second reconnection interval;
The duration at the first reconnection interval is less than the duration at the second reconnection interval.
In conclusion in the embodiment of the present invention, when determining that the corresponding connection of any one thread of terminal occurs abnormal, judge Whether there is corresponding connection status in other threads of the terminal is normal thread;If it is determined that in other described threads not It is normal thread there are corresponding connection status, and when determining to meet preset condition, stops corresponding to any one thread Connection carry out reconnection, that is to say, that if there is abnormal, the corresponding connection of other threads in the corresponding connection of any one thread If there is exception, when determining to meet preset condition, stop connect corresponding to any one thread and carry out reconnection, Therefore, avoid in the prior art waste of resource, influence other connect normal threads the defects of.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real Present one flow of flow chart or one box of multiple flows and/or block diagram or the device of the function in multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or Function in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one The step of function in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation Property concept, then can make these embodiments other change and modification.So appended claims be intended to be construed to include it is excellent It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, those skilled in the art can carry out the embodiment of the present invention various modification and variations without departing from this hair The spirit and scope of bright embodiment.In this way, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention And its within the scope of equivalent technologies, then the present invention is also intended to comprising including these modification and variations.

Claims (12)

  1. A kind of 1. method of thread reconnection, which is characterized in that including:
    When determining that the corresponding connection of any one thread of terminal occurs abnormal, judge to whether there is in other threads of the terminal The state of corresponding connection is normal thread;
    When judging that the state in other described threads there is no corresponding connection is normal thread, and determine to meet preset condition When, stop connect corresponding to any one thread and carry out reconnection;
    It determines to meet preset condition, specifically include:
    Determine that there are the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
    The number for determining any one thread is non-designated number.
  2. 2. the method as described in claim 1, which is characterized in that stop connect corresponding to any one thread and carry out reconnection Afterwards, further include:
    After determining that the thread reconnection that reconnection is carried out to corresponding connection in other described threads is successful, to any one thread pair The connection answered carries out reconnection.
  3. 3. the method as described in claim 1, which is characterized in that further include:
    When judging that the state in other described threads there is no corresponding connection is normal thread, and it is unsatisfactory for the default item During part, connect corresponding to any one thread carries out reconnection;
    After the corresponding connection reconnection success of any one thread, connection corresponding to other described threads carries out reconnection.
  4. 4. method as claimed in claim 3, which is characterized in that determine to be unsatisfactory for preset condition, specifically include:
    Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
    The number for determining any one thread is to specify number.
  5. 5. the method as described in claim 1, which is characterized in that further include:
    If it is determined that the state in other described threads there are corresponding connection is normal thread, to any one thread pair The connection answered carries out reconnection.
  6. 6. method as claimed in claim 2, which is characterized in that connect corresponding to any one thread carries out reconnection, tool Body includes:
    If the state in other described threads there are corresponding connection is not up to thread for the quantity of normal thread and connects thresholding Value carries out reconnection using connect corresponding to any one thread of the first reconnection interval;
    If reaching the thread there are corresponding connection status for the quantity of normal thread in other described threads connects thresholding Value carries out reconnection using connect corresponding to any one thread of the second reconnection interval;
    The duration at the first reconnection interval is less than the duration at the second reconnection interval.
  7. 7. a kind of device of thread reconnection, which is characterized in that including:
    Determination unit, for determining that it is abnormal that the corresponding connection of any one thread of terminal occurs;
    Judging unit when connecting appearance exception for determining that any one thread of terminal is corresponding in the determination unit, judges State in other threads of the terminal with the presence or absence of corresponding connection is normal thread;
    Reconnection unit judges that the state in other described threads there is no corresponding connection is normal for working as the judging unit Thread, and when the determination unit determines to meet preset condition, stop carrying out weight to the corresponding connection of any one thread Even;
    When the determination unit determines to meet preset condition, it is specially:
    Determine that there are the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
    The number for determining any one thread is non-designated number.
  8. 8. device as claimed in claim 7, which is characterized in that the reconnection unit is additionally operable to:
    After corresponding connection carries out the thread reconnection success of reconnection in the determination unit determines to other described threads, to institute It states the corresponding connection of any one thread and carries out reconnection.
  9. 9. device as claimed in claim 7, which is characterized in that the reconnection unit is additionally operable to:
    State in other threads described in judging when the judging unit there is no corresponding connection is normal thread, and described When determination unit determines to be unsatisfactory for the preset condition, connect corresponding to any one thread carries out reconnection;
    After the corresponding connection reconnection success of any one thread, connection corresponding to other described threads carries out reconnection.
  10. 10. device as claimed in claim 9, which is characterized in that when the determination unit determines to be unsatisfactory for preset condition, specifically For:
    Determine that there is no the positive threads for carrying out reconnection of corresponding connection in other described threads;Or
    The number for determining any one thread is to specify number.
  11. 11. device as claimed in claim 7, which is characterized in that the reconnection unit is additionally operable to:
    If the judging unit judges that the state there are corresponding connection is normal thread in other described threads, to described The corresponding connection of a thread of anticipating carries out reconnection.
  12. 12. device as claimed in claim 8, which is characterized in that the reconnection unit is to the corresponding company of any one thread When tapping into row reconnection, it is specially:
    If the state in other described threads there are corresponding connection is not up to thread for the quantity of normal thread and connects thresholding Value carries out reconnection using connect corresponding to any one thread of the first reconnection interval;
    If the state in other described threads there are corresponding connection reaches the thread for the quantity of normal thread and connects door Limit value carries out reconnection using connect corresponding to any one thread of the second reconnection interval;
    The duration at the first reconnection interval is less than the duration at the second reconnection interval.
CN201510152124.6A 2015-04-01 2015-04-01 A kind of method and device of thread reconnection Active CN104836683B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510152124.6A CN104836683B (en) 2015-04-01 2015-04-01 A kind of method and device of thread reconnection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510152124.6A CN104836683B (en) 2015-04-01 2015-04-01 A kind of method and device of thread reconnection

Publications (2)

Publication Number Publication Date
CN104836683A CN104836683A (en) 2015-08-12
CN104836683B true CN104836683B (en) 2018-06-05

Family

ID=53814336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510152124.6A Active CN104836683B (en) 2015-04-01 2015-04-01 A kind of method and device of thread reconnection

Country Status (1)

Country Link
CN (1) CN104836683B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1863091A (en) * 2006-02-15 2006-11-15 华为技术有限公司 Method for maintaining network entity interface state
CN101730086A (en) * 2009-12-02 2010-06-09 北京盈通创新数字技术有限公司 High speed downloading method of mobile terminal connecting multiple gateways and starting multiple threads
EP2323344A1 (en) * 2008-09-01 2011-05-18 ZTE Corporation Method for preventing thread hanging in a multi-thread communication program
CN103178984A (en) * 2011-12-26 2013-06-26 中国电信股份有限公司 Communication device and abnormality processing method
CN103873472A (en) * 2014-03-18 2014-06-18 广州市纬志电子科技有限公司 Method for automatically having access to network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1863091A (en) * 2006-02-15 2006-11-15 华为技术有限公司 Method for maintaining network entity interface state
EP2323344A1 (en) * 2008-09-01 2011-05-18 ZTE Corporation Method for preventing thread hanging in a multi-thread communication program
CN101730086A (en) * 2009-12-02 2010-06-09 北京盈通创新数字技术有限公司 High speed downloading method of mobile terminal connecting multiple gateways and starting multiple threads
CN103178984A (en) * 2011-12-26 2013-06-26 中国电信股份有限公司 Communication device and abnormality processing method
CN103873472A (en) * 2014-03-18 2014-06-18 广州市纬志电子科技有限公司 Method for automatically having access to network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《智能车载终端的GPRS多路连接通信的研究》;任峥峥等;《测控技术》;20130131(第01期);全文 *

Also Published As

Publication number Publication date
CN104836683A (en) 2015-08-12

Similar Documents

Publication Publication Date Title
CN103196209B (en) A kind of air-conditioning automatic switching method and device
CN107360239A (en) A kind of client connection status detection method and system
CN102088679A (en) Working method and system of intelligent short message firewall of self-learning mobile terminal
CN107404740B (en) Method for switching network, device and the terminal device of safety
CN106790523A (en) A kind of information push method and server
CN103826008B (en) A kind of mobile terminal notification message reminding method, device and mobile terminal
CN107948063B (en) Method for establishing aggregation link and access equipment
CN112579492A (en) Connection method of universal serial bus hub device with different types of connection ports
CN108833126A (en) Electronic device, data link method for prewarning risk and storage medium
CN107395451B (en) Processing method, device and equipment for internet traffic abnormity and storage medium
CN106375152A (en) Method for processing communication abnormality of Client/Server (C/S) architecture
CN105091186A (en) Phase sequence protection method and system of air conditioning unit
CN103001822B (en) The processing method of Network Abnormal and device
CN107423196A (en) A kind of more neck condition detection method, detection device and mobile terminals
CN107231314B (en) CAN channel self-adaptation method, device and system and automobile
CN107332740B (en) A kind of network detecting method, network detection device and intelligent terminal
CN104836683B (en) A kind of method and device of thread reconnection
CN102353118B (en) Control method for judging master-slave relation of double wire controllers of air conditioner
CN112583617B (en) Fault determination method, server, control terminal and storage medium
CN102761485B (en) Method and system for processing connections by network equipment
CN107808106A (en) A kind of session content methods of exhibiting and device with scene handoff functionality
CN106301708A (en) Processing method and processing device when a kind of information sends unsuccessfully
CN105187274A (en) Method for judging port state and selecting good port communication
CN101114929B (en) Method of establishing interlinkage for preventing communication abnormality between network management terminal and equipment
CN109462423B (en) Method, device, equipment and medium for checking data transmission unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant