CN113992952A - Network dual-stack connection method and device, network set top box and storage medium - Google Patents

Network dual-stack connection method and device, network set top box and storage medium Download PDF

Info

Publication number
CN113992952A
CN113992952A CN202111282511.3A CN202111282511A CN113992952A CN 113992952 A CN113992952 A CN 113992952A CN 202111282511 A CN202111282511 A CN 202111282511A CN 113992952 A CN113992952 A CN 113992952A
Authority
CN
China
Prior art keywords
connection
ipv6
priority
ipv4
weight
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111282511.3A
Other languages
Chinese (zh)
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.)
Beijing Chaoge Digital Technology Co ltd
Original Assignee
Beijing Chaoge Digital 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 Beijing Chaoge Digital Technology Co ltd filed Critical Beijing Chaoge Digital Technology Co ltd
Priority to CN202111282511.3A priority Critical patent/CN113992952A/en
Publication of CN113992952A publication Critical patent/CN113992952A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4108Peripherals receiving signals from specially adapted client devices characterised by an identification number or address, e.g. local network address
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/64322IP

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a network dual-stack connection method, a device, a network set-top box and a storage medium, wherein the method selects IPv4 to try connection when the priority connection weight of IPv4 is greater than or equal to a preset weight value, if the connection is successful, the priority connection weight of IPv4 is increased by a set value, and if the connection is failed, IPv6 is selected to try connection; when the priority connection weight of the IPv6 is larger than or equal to a preset weight value, selecting IPv6 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of the IPv6, and if the connection is failed, selecting IPv4 to attempt connection. When one of IPv4 and IPv6 network connection is abnormal, the invention adds the IP network with abnormal variable judgment, preferentially selects the normal IP network in the subsequent connection, avoids the time consumption of connection failure and improves the network connection speed.

Description

Network dual-stack connection method and device, network set top box and storage medium
Technical Field
The embodiment of the invention relates to the technical field of network connection, in particular to a network dual-stack connection method, a network dual-stack connection device, a network set top box and a storage medium.
Background
With the development of the information age, network connection technology and TCP/IP protocol are widely popularized, and the network set top box gradually replaces the traditional set top box with better user experience. The use of network set-top boxes requires equipping the network set-top boxes with an IP network environment, and in recent years, IP networks have gradually transited from the mainstream IPv4 protocol to the IPv6, and from the aspect of network protocol design, the network set-top boxes are more likely to be required to preferentially use the IPv6 to connect servers. However, the replacement of the connection protocol may cause the network environment of the network set-top box to be different, and sometimes the IP network environment where the network set-top box is located may not support the IPv6 protocol, or the IPv6 network environment where the network set-top box is located may have an abnormality. When the existing dual-stack network connection method is abnormal in the IPv6 environment, the IPv4 connection is automatically switched, but the subsequent connection still tries the IPv6 connection, and the dual-stack network connection method always tries the IPv4 and the IPv6 connection according to a fixed sequence consumes a large amount of time for each connection.
The above problems are urgently needed to be solved.
Disclosure of Invention
In order to solve the related technical problems, the present invention provides a network dual-stack connection method, device, network set-top box and storage medium, so as to solve the problems mentioned in the background art.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a network dual-stack connection method, including the following steps:
s101, judging whether the priority connection weight of the IPv4 and the priority connection weight of the IPv6 in the dual-stack network environment are larger than or equal to a preset weight value or not;
s102, according to the judgment result of the step S101, if the priority connection weight of the IPv4 is greater than or equal to a preset weight value, executing a step S103;
s103, selecting IPv4 to try connection, if the connection is successful, increasing a set value for the priority connection weight of IPv4, and if the connection is failed, selecting IPv6 to try connection;
s104, according to the judgment result of the step S101, if the priority connection weight of the IPv6 is greater than or equal to a preset weight value, executing a step S105;
and S105, selecting IPv6 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of IPv6, and if the connection is failed, selecting IPv4 to attempt connection.
Further, the network dual-stack connection method further includes the following steps:
s106, according to the judgment result of the step S101, if the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, executing a step S103 when the connection priority set by the user is that the IPv4 is preferentially selected to try to connect; when the connection priority set by the user is to preferentially select IPv6 for attempting connection, step S105 is performed.
Further, the increasing of the priority connection weight set value of IPv4 in step S103 specifically includes: the priority connection weight of IPv4 is increased by 1.
Further, the increasing of the priority connection weight set value of IPv6 in step S105 specifically includes: the priority connection weight of IPv6 is increased by 1.
Further, if the connection fails in step S103, selecting IPv6 to attempt connection, which specifically includes: if the connection fails, the priority connection weight of the IPv4 is reset to zero, and IPv6 is selected to attempt connection.
Further, if the connection fails in step S105, selecting IPv4 to attempt connection, which specifically includes: if the connection fails, the priority connection weight of the IPv6 is reset to zero, and IPv4 is selected to attempt connection.
In a second aspect, an embodiment of the present invention further provides a network dual-stack connection apparatus, including:
a priority connection weight judging unit, configured to judge whether a priority connection weight of IPv4 and a priority connection weight of IPv6 in a dual stack network environment are greater than or equal to a preset weight value, if the judgment result is that the priority connection weight of IPv4 is greater than or equal to the preset weight value, the IPv4 connection selecting unit is started, and if the judgment result is that the priority connection weight of IPv6 is greater than or equal to the preset weight value, the IPv6 connection selecting unit is started;
the IPv4 connection selection unit is used for selecting IPv4 to attempt connection, if the connection is successful, the priority connection weight of the IPv4 is increased by a set value, and if the connection is failed, the IPv6 connection selection unit selects IPv6 to attempt connection;
an IPv6 connection selection unit, configured to select IPv6 to attempt connection, where if the connection is successful, the priority connection weight of IPv6 is increased by a set value, and if the connection is failed, the IPv4 connection selection unit selects IPv4 to attempt connection.
Further, the network dual-stack connection device further includes:
the connection priority setting unit is used for setting connection priorities of IPv4 and IPv6 for the user; when the priority connection weight judging unit judges that the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, the IPv4 connection selecting unit or the IPv6 connection selecting unit is determined to be started according to the connection priority set by the user through the connection priority setting unit.
In a third aspect, an embodiment of the present invention further provides a network set top box, where the network set top box includes the network dual-stack connection device.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the program, when executed by a processor, implements the above-mentioned network dual-stack connection method.
The technical scheme of the embodiment of the invention solves the problem that when the existing double-stack network connection method faces a double-stack network environment, the IPv4 and the IPv6 are always tried to be connected according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. The technical scheme of the embodiment of the invention is that two variables of IPv4 priority connection weight and IPv6 priority connection weight are set, if the IPv4 priority connection weight is larger than or equal to a preset weight value, IPv4 is selected for trying connection, if the connection is successful, the IPv4 priority connection weight is increased by a set value, and if the connection is failed, IPv6 is selected for trying connection; if the priority connection weight of the IPv6 is larger than or equal to the preset weight value, selecting IPv6 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of the IPv6, and if the connection is failed, selecting IPv4 to attempt connection; if the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, whether IPv4 is preferentially selected to try connection or IPv6 is preferentially selected to try connection is determined according to the connection priority set by a user; when one of the IPv4 and the IPv6 network connection is abnormal under the dual-stack network, the network dual-stack connection scheme provided by the invention is adopted, the IP network with abnormal variable judgment is added, and the normal IP network is preferentially selected in the subsequent connection, so that the time consumption of connection failure is avoided, and the network connection speed is improved.
Drawings
In order to more clearly illustrate and understand the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the background and the embodiments of the present invention will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present invention and the drawings without creative efforts.
Fig. 1 is a flowchart of a network dual stack connection method according to an embodiment of the present invention;
fig. 2 is a flowchart of a network dual-stack connection method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a network dual-stack connection device according to a third embodiment of the present invention;
fig. 4 is a block diagram of a network dual-stack connection device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
As shown in fig. 1, fig. 1 is a flowchart of a network dual stack connection method according to an embodiment of the present invention.
The network dual-stack connection method in the embodiment comprises the following steps:
s101, judging whether the priority connection weight of the IPv4 and the priority connection weight of the IPv6 in the dual-stack network environment are larger than or equal to a preset weight value, wherein the preset weight value is set by considering the following steps: if the stability of the local network is high, or the priority set by the user is required to be considered preferentially, but not the network connection efficiency, X can be set to be a large value, and the network is connected according to the priority preset by the user in most cases; if the stability of the network is low or the network connection efficiency is prioritized, instead of the priority set by the user, X may be set to a small value, and a network protocol with higher efficiency is selected according to the actual connection success rate in most cases.
S102, according to the judgment result of the step S101, if the priority connection weight of the IPv4 is greater than or equal to the preset weight value, the step S103 is executed.
S103, selecting IPv4 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of IPv4, and if the connection is failed, selecting IPv6 to attempt connection.
S104, according to the judgment result of the step S101, if the priority connection weight of the IPv6 is greater than or equal to the preset weight value, executing a step S105.
And S105, selecting IPv6 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of IPv6, and if the connection is failed, selecting IPv4 to attempt connection.
The technical scheme of the embodiment of the invention solves the problem that when the existing double-stack network connection method faces a double-stack network environment, the IPv4 and the IPv6 are always tried to be connected according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. When one of the IPv4 and the IPv6 network connection is abnormal under the dual-stack network, the network dual-stack connection scheme provided by the invention is adopted, the variable (the priority connection weight of the IPv4 and the priority connection weight of the IPv 6) is added to judge the abnormal IP network, and the normal IP network is preferentially selected in the subsequent connection, so that the time consumption of connection failure is avoided, and the network connection speed is improved.
Example two
As shown in fig. 2, fig. 2 is a flowchart of a network dual stack connection method according to a second embodiment of the present invention.
The network dual-stack connection method in the embodiment specifically comprises the following steps:
s201, determining whether the priority connection weight of IPv4 and the priority connection weight of IPv6 in the dual stack network environment are greater than or equal to a preset weight value (X in fig. 2), where the preset weight value X is set in consideration of the following: if the stability of the local network is high, or the priority set by the user is required to be considered preferentially, but not the network connection efficiency, X can be set to be a large value, and the network is connected according to the priority preset by the user in most cases; if the stability of the network is low or the network connection efficiency is prioritized, instead of the priority set by the user, X may be set to a small value, and a network protocol with higher efficiency is selected according to the actual connection success rate in most cases.
S202, according to the judgment result of the step S201, if the priority connection weight of the IPv4 is greater than or equal to the preset weight value, the step S203 is executed.
S203, selecting IPv4 to try connection, if the connection is successful, increasing a set value for the priority connection weight of IPv4, and if the connection is failed, selecting IPv6 to try connection.
And S204, according to the judgment result in the step S201, if the priority connection weight of the IPv6 is greater than or equal to the preset weight value, executing a step S205.
S205, selecting IPv6 to try connection, if the connection is successful, increasing a set value for the priority connection weight of IPv6, and if the connection is failed, selecting IPv4 to try connection.
Illustratively, in this embodiment, the network dual-stack connection method further includes the following steps:
s206, according to the judgment result of the step S201, if the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, executing a step S203 when the connection priority set by the user is that the IPv4 is preferentially selected to attempt connection; when the connection priority set by the user is to preferentially select IPv6 for attempting connection, step S205 is performed.
For example, in this embodiment, the increasing of the priority connection weight setting value of IPv4 in step S203 specifically includes: the priority connection weight of IPv4 is increased by 1, and it should be noted that the setting value is not limited to 1, and its size may be specifically determined according to the actual application.
For example, in this embodiment, the increasing of the priority connection weight by the IPv6 in step S205 specifically includes: the priority connection weight of IPv6 is increased by 1, and it should be noted that the setting value is not limited to 1, and its size may be specifically determined according to the actual application.
For example, in this embodiment, if the connection fails in step S203, selecting IPv6 to attempt connection, specifically including: if the connection fails, the priority connection weight of IPv4 is set to zero, IPv6 is selected to attempt connection, it should be noted that "if the connection fails, the priority connection weight of IPv4 is set to zero" is only a preferable mode, as long as the problems in the prior art can be solved, the scheme without being set to zero is also applicable to the present invention, for example, the connection weight of IPv4 may be subtracted by 1 (also not limited to 1) in case of connection failure, and this mode can obtain a more optimized network priority, but needs more connection times.
For example, in this embodiment, if the connection fails in step S205, selecting IPv4 to attempt connection includes: if the connection fails, the priority connection weight of IPv6 is set to zero, IPv4 is selected to attempt connection, it should be noted that "if the connection fails, the priority connection weight of IPv6 is set to zero" is only a preferable mode, as long as the problems in the prior art can be solved, the scheme without being set to zero is also applicable to the present invention, for example, the connection weight of IPv6 may be subtracted by 1 (also not limited to 1) in case of connection failure, and this mode can obtain a more optimized network priority, but needs more connection times.
Specifically, when the scheme of this embodiment is applied to a network set-top box, the set-top box uses a domain name address to connect a server, and firstly needs DNS domain name resolution to obtain an IP address, and if the domain name corresponds to a plurality of servers, the set-top box will obtain a plurality of IP addresses, and determine whether there are IPv4 and IPv6 addresses at the same time. If the IPv4 and IPv6 addresses exist at the same time, the network set top box belongs to a dual-stack network environment, and the network set top box uses the scheme of this embodiment: in an initial state, the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are both zero, the IPv4 is preferentially selected to attempt connection, or the IPv6 is preferentially selected to attempt connection, which preference is initially set by a user is used for determining, 1 is added to the corresponding IP protocol priority connection weight after connection is successful each time, and the priority connection weight of the IP protocol is cleared when connection is failed; and when the weight is greater than the preset weight value, the IP protocol is preferentially selected for connection, and the priority of protocol connection does not depend on the setting of the user any more. For example: the current environment does not have an IPv6 connection environment, but a user sets that the set-top box preferentially uses IPv6 for connection, the set-top box preferentially tries to connect with an IPv6 address and fails to try to connect with IPv4, the preferential connection weight of IPv4 rises after connection succeeds, when the preferential connection weight of IPv4 rises to a preset weight value, the current environment is considered to not have an IPv6 environment, the network set-top box preferentially uses IPv4 for connection in subsequent network connection, the IPv6 connection cannot be tried, time consumed by connection failure is avoided, and network connection speed is improved.
The invention solves the problem that when the existing dual-stack network connection method faces the dual-stack network environment, the IPv4 and the IPv6 are always tried to be connected according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. When one of the IPv4 and the IPv6 network connection is abnormal under the dual-stack network, the network dual-stack connection scheme provided by the invention is adopted, the variable (the priority connection weight of the IPv4 and the priority connection weight of the IPv 6) is added to judge the abnormal IP network, and the normal IP network is preferentially selected in the subsequent connection, so that the time consumption of connection failure is avoided, and the network connection speed is improved.
EXAMPLE III
As shown in fig. 3, fig. 3 is a block diagram of a network dual-stack connection device 300 according to a third embodiment of the present invention.
The network dual-stack connection apparatus 300 in this embodiment includes:
a priority connection weight determining unit 301, configured to determine whether a priority connection weight of IPv4 and a priority connection weight of IPv6 in the dual stack network environment are greater than or equal to a preset weight value, if the determination result is that the priority connection weight of IPv4 is greater than or equal to the preset weight value, the IPv4 connection selecting unit 302 is started, and if the determination result is that the priority connection weight of IPv6 is greater than or equal to the preset weight value, the IPv6 connection selecting unit 303 is started. Wherein, the setting of the preset weight value is considered as follows: if the stability of the local network is high, or the priority set by the user is required to be considered preferentially, but not the network connection efficiency, X can be set to be a large value, and the network is connected according to the priority preset by the user in most cases; if the network stability is low or the network connection efficiency is prioritized, but the user-set priority is not, X can be set to a small value, and a network protocol with higher efficiency is selected according to the actual connection success rate in most cases
An IPv4 connection selecting unit 302, configured to select IPv4 to attempt connection, where if the connection is successful, the priority connection weight of IPv4 is increased by a set value, and if the connection is failed, the IPv6 connection selecting unit 303 selects IPv6 to attempt connection.
An IPv6 connection selecting unit 303, configured to select IPv6 to attempt connection, where if the connection is successful, the priority connection weight of IPv6 is increased by a set value, and if the connection is failed, the IPv4 connection selecting unit 302 selects IPv4 to attempt connection.
The invention solves the problem that when the existing dual-stack network connection method faces the dual-stack network environment, the IPv4 and the IPv6 are always tried to be connected according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. When one of the IPv4 and the IPv6 network connection is abnormal under the dual-stack network, the network dual-stack connection scheme provided by the invention is adopted, the variable (the priority connection weight of the IPv4 and the priority connection weight of the IPv 6) is added to judge the abnormal IP network, and the normal IP network is preferentially selected in the subsequent connection, so that the time consumption of connection failure is avoided, and the network connection speed is improved.
Example four
As shown in fig. 4, fig. 4 is a block diagram of a network dual-stack connection device 400 according to a fourth embodiment of the present invention.
The network dual-stack connection device 400 in this embodiment specifically includes:
a priority connection weight determining unit 401, configured to determine whether a priority connection weight of IPv4 and a priority connection weight of IPv6 in the dual stack network environment are greater than or equal to a preset weight value, if the determination result is that the priority connection weight of IPv4 is greater than or equal to the preset weight value, the IPv4 connection selecting unit 402 is started, and if the determination result is that the priority connection weight of IPv6 is greater than or equal to the preset weight value, the IPv6 connection selecting unit 403 is started. Wherein, the setting of the preset weight value is considered as follows: if the stability of the local network is high, or the priority set by the user is required to be considered preferentially, but not the network connection efficiency, X can be set to be a large value, and the network is connected according to the priority preset by the user in most cases; if the stability of the network is low or the network connection efficiency is prioritized, instead of the priority set by the user, X may be set to a small value, and a network protocol with higher efficiency is selected according to the actual connection success rate in most cases.
An IPv4 connection selecting unit 402, configured to select IPv4 to attempt connection, if the connection is successful, the priority connection weight of IPv4 is increased by a set value, and if the connection is failed, the IPv6 connection selecting unit 403 selects IPv6 to attempt connection.
An IPv6 connection selecting unit 403, configured to select IPv6 for attempting connection, where if the connection is successful, the priority connection weight of IPv6 is increased by a set value, and if the connection is failed, the IPv4 connection selecting unit 402 selects IPv4 for attempting connection.
Illustratively, in this embodiment, the network dual-stack connection apparatus 400 further includes: a connection priority setting unit 404; the connection priority setting unit 404 is used for setting connection priorities of IPv4 and IPv6 for a user; when the priority connection weight judgment unit 401 determines that the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, the IPv4 connection selection unit 402 or the IPv6 connection selection unit 403 is determined to be started according to the connection priority set by the user through the connection priority setting unit 404.
Illustratively, in this embodiment, the setting value for increasing the priority connection weight of IPv4 specifically includes: the priority connection weight of IPv4 is increased by 1, and it should be noted that the setting value is not limited to 1, and its size may be specifically determined according to the actual application. The setting value for increasing the priority connection weight of the IPv6 specifically includes: the priority connection weight of IPv6 is increased by 1, and it should be noted that the setting value is not limited to 1, and its size may be specifically determined according to the actual application.
For example, in this embodiment, if the connection fails, the IPv6 connection selecting unit 403 selects IPv6 to attempt connection, which specifically includes: if the connection fails, the priority connection weight of IPv4 is set to zero, and the IPv6 connection selecting unit 403 selects IPv6 to attempt connection. It should be noted that "if the connection fails, the priority connection weight of IPv4 is reset to zero" is only a preferable mode, and a scheme not reset to zero is also applicable to the present invention as long as the problems in the prior art can be solved, and for example, in the case of a connection failure, the connection weight of IPv4 may be subtracted by 1 (similarly, not limited to 1), which can obtain a more optimized network priority, but requires a larger number of connections. If the connection fails, the IPv4 connection selecting unit 402 selects IPv4 to attempt connection, which specifically includes: if the connection fails, the priority connection weight of IPv6 is set to zero, and the IPv4 connection selecting unit 402 selects IPv4 to attempt connection. It should be noted that "if the connection fails, the priority connection weight of IPv6 is reset to zero" is only a preferable mode, and a scheme not reset to zero is also applicable to the present invention as long as the problems in the prior art can be solved, and for example, in the case of a connection failure, the connection weight of IPv6 may be subtracted by 1 (similarly, not limited to 1), which can obtain a more optimized network priority, but requires a larger number of connections.
When the scheme of the embodiment is applied to a network set top box, the set top box uses a domain name address to connect a server, firstly, DNS domain name resolution is needed to obtain IP addresses, if the domain name corresponds to a plurality of servers, the set top box can obtain a plurality of IP addresses, and whether IPv4 and IPv6 addresses exist simultaneously or not is judged. If the IPv4 and IPv6 addresses exist at the same time, the network set top box belongs to a dual-stack network environment, and the network set top box uses the scheme of this embodiment: in an initial state, the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are both zero, the IPv4 is preferentially selected to attempt connection, or the IPv6 is preferentially selected to attempt connection, which preference is initially set by a user is used for determining, 1 is added to the corresponding IP protocol priority connection weight after connection is successful each time, and the priority connection weight of the IP protocol is cleared when connection is failed; and when the weight is greater than the preset weight value, the IP protocol is preferentially selected for connection, and the priority of protocol connection does not depend on the setting of the user any more. For example: the current environment does not have an IPv6 connection environment, but a user sets that the set-top box preferentially uses IPv6 for connection, the set-top box preferentially tries to connect with an IPv6 address and fails to try to connect with IPv4, the preferential connection weight of IPv4 rises after connection succeeds, when the preferential connection weight of IPv4 rises to a preset weight value, the current environment is considered to not have an IPv6 environment, the network set-top box preferentially uses IPv4 for connection in subsequent network connection, the IPv6 connection cannot be tried, time consumed by connection failure is avoided, and network connection speed is improved.
The technical scheme of the embodiment of the invention solves the problem that when the existing double-stack network connection method faces a double-stack network environment, the IPv4 and the IPv6 are always tried to be connected according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. When one of the IPv4 and the IPv6 network connection is abnormal under the dual-stack network, the network dual-stack connection scheme provided by the invention is adopted, the variable (the priority connection weight of the IPv4 and the priority connection weight of the IPv 6) is added to judge the abnormal IP network, and the normal IP network is preferentially selected in the subsequent connection, so that the time consumption of connection failure is avoided, and the network connection speed is improved.
EXAMPLE five
The embodiment of the invention further provides a network set top box, which comprises the double-stack network connecting device in any one of the third embodiment and the fourth embodiment.
When the network set-top box works, the domain name address is used for connecting the servers, firstly, DNS domain name resolution is carried out to obtain IP addresses, if the domain name corresponds to a plurality of servers, the network set-top box can obtain a plurality of IP addresses, and whether IPv4 and IPv6 addresses exist simultaneously or not is judged. If there are IPv4 and IPv6 addresses at the same time, the network device belongs to a dual-stack network environment, and for example, in this embodiment, the network set-top box uses the scheme of the fourth embodiment as an example: in an initial state, the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are both zero, and the IPv4 is preferentially selected to attempt connection or the IPv6 is preferentially selected to attempt connection, which preference is initially set by a user is determined, the priority connection weight of the corresponding IP protocol is increased by 1 after connection is successful each time, and the priority connection weight of the IP protocol is cleared when connection is failed, but not limited thereto, for example, the priority connection weight of the protocol may be subtracted by 1 (but not limited to 1) in the case of connection failure, which can obtain a more optimized network priority but requires more connection times; when the weight is greater than a preset weight value, the IP protocol is preferentially selected for connection, the priority of protocol connection does not depend on the setting of a user any more, wherein the preset weight value is set by considering the following steps: if the stability of the local network is high, or the priority set by the user is required to be considered preferentially, but not the network connection efficiency, X can be set to be a large value, and the network is connected according to the priority preset by the user in most cases; if the stability of the network is low or the network connection efficiency is prioritized, instead of the priority set by the user, X may be set to a small value, and a network protocol with higher efficiency is selected according to the actual connection success rate in most cases. For example: the current environment does not have an IPv6 connection environment, but a user sets that the set-top box preferentially uses IPv6 for connection, the set-top box preferentially tries to connect with an IPv6 address and fails to try to connect with IPv4, the preferential connection weight of IPv4 rises after connection succeeds, when the preferential connection weight of IPv4 rises to a preset weight value, the current environment is considered to not have an IPv6 environment, the network set-top box preferentially uses IPv4 for connection in subsequent network connection, the IPv6 connection cannot be tried, time consumed by connection failure is avoided, and network connection speed is improved.
The network set-top box provided by the embodiment of the invention solves the problem that when the existing set-top box faces a dual-stack network environment, the connection of IPv4 and IPv6 is always tried according to a fixed sequence, so that when a certain network connection is abnormal for a long time, each connection consumes a large amount of time, and the user experience is influenced. When the invention is adopted to judge the abnormal IP network by increasing the variables (the priority connection weight of IPv4 and the priority connection weight of IPv 6) when one of the IPv4 and IPv6 network connection is abnormal under the double-stack network, the normal IP network is preferentially selected in the subsequent connection, the time consumption of connection failure is avoided, and the network connection speed is improved.
EXAMPLE six
The embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the program is executed by a processor to implement the dual stack network connection method in any one of the first and second embodiments.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A network dual-stack connection method is characterized by comprising the following steps:
s101, judging whether the priority connection weight of the IPv4 and the priority connection weight of the IPv6 in the dual-stack network environment are larger than or equal to a preset weight value or not;
s102, according to the judgment result of the step S101, if the priority connection weight of the IPv4 is greater than or equal to a preset weight value, executing a step S103;
s103, selecting IPv4 to try connection, if the connection is successful, increasing a set value for the priority connection weight of IPv4, and if the connection is failed, selecting IPv6 to try connection;
s104, according to the judgment result of the step S101, if the priority connection weight of the IPv6 is greater than or equal to a preset weight value, executing a step S105;
and S105, selecting IPv6 to attempt connection, if the connection is successful, increasing a set value for the priority connection weight of IPv6, and if the connection is failed, selecting IPv4 to attempt connection.
2. The network dual-stack connection method according to claim 1, further comprising the steps of:
s106, according to the judgment result of the step S101, if the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, executing a step S103 when the connection priority set by the user is that the IPv4 is preferentially selected to try to connect; when the connection priority set by the user is to preferentially select IPv6 for attempting connection, step S105 is performed.
3. The method according to claim 1, wherein the step S103 of increasing the priority connection weight of the IPv4 by a setting value specifically includes: the priority connection weight of IPv4 is increased by 1.
4. The method according to claim 1, wherein the step S105 of increasing the priority connection weight of the IPv6 by a setting value specifically includes: the priority connection weight of IPv6 is increased by 1.
5. The method according to claim 1, wherein if the connection fails in step S103, selecting IPv6 for attempting connection, specifically includes: if the connection fails, the priority connection weight of the IPv4 is reset to zero, and IPv6 is selected to attempt connection.
6. The method according to any one of claims 1 to 5, wherein if the connection fails in step S105, selecting IPv4 for attempting connection includes: if the connection fails, the priority connection weight of the IPv6 is reset to zero, and IPv4 is selected to attempt connection.
7. A network dual stack connection device, comprising:
a priority connection weight judging unit, configured to judge whether a priority connection weight of IPv4 and a priority connection weight of IPv6 in a dual stack network environment are greater than or equal to a preset weight value, if the judgment result is that the priority connection weight of IPv4 is greater than or equal to the preset weight value, the IPv4 connection selecting unit is started, and if the judgment result is that the priority connection weight of IPv6 is greater than or equal to the preset weight value, the IPv6 connection selecting unit is started;
the IPv4 connection selection unit is used for selecting IPv4 to attempt connection, if the connection is successful, the priority connection weight of the IPv4 is increased by a set value, and if the connection is failed, the IPv6 connection selection unit selects IPv6 to attempt connection;
an IPv6 connection selection unit, configured to select IPv6 to attempt connection, where if the connection is successful, the priority connection weight of IPv6 is increased by a set value, and if the connection is failed, the IPv4 connection selection unit selects IPv4 to attempt connection.
8. The network dual-stack connection device according to claim 7, further comprising:
the connection priority setting unit is used for setting connection priorities of IPv4 and IPv6 for the user; when the priority connection weight judging unit judges that the priority connection weight of the IPv4 and the priority connection weight of the IPv6 are smaller than the preset weight value, the IPv4 connection selecting unit or the IPv6 connection selecting unit is determined to be started according to the connection priority set by the user through the connection priority setting unit.
9. A network set-top box comprising the network dual-stack connection device of any one of claim 7 or claim 8.
10. A storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the network dual stack connection method of any one of claims 1 to 6.
CN202111282511.3A 2021-11-01 2021-11-01 Network dual-stack connection method and device, network set top box and storage medium Pending CN113992952A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111282511.3A CN113992952A (en) 2021-11-01 2021-11-01 Network dual-stack connection method and device, network set top box and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111282511.3A CN113992952A (en) 2021-11-01 2021-11-01 Network dual-stack connection method and device, network set top box and storage medium

Publications (1)

Publication Number Publication Date
CN113992952A true CN113992952A (en) 2022-01-28

Family

ID=79745287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111282511.3A Pending CN113992952A (en) 2021-11-01 2021-11-01 Network dual-stack connection method and device, network set top box and storage medium

Country Status (1)

Country Link
CN (1) CN113992952A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685281A (en) * 2013-12-18 2014-03-26 中国联合网络通信集团有限公司 Network address protocol switching method and device
US20140173123A1 (en) * 2012-12-14 2014-06-19 Apple Inc. Address family preference in multiple network interface environments
CN105812283A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Queue scheduling method and queue scheduling device
CN106658477A (en) * 2015-10-28 2017-05-10 中兴通讯股份有限公司 PGW dual stack address selection method and apparatus
CN111277676A (en) * 2020-01-20 2020-06-12 苏州浪潮智能科技有限公司 Double-stack unified access method and system based on HTTP (hyper text transport protocol)
CN112787936A (en) * 2020-12-25 2021-05-11 深圳创维数字技术有限公司 Play failure recovery method, device and storage medium under IPv4/IPv6 dual-stack environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140173123A1 (en) * 2012-12-14 2014-06-19 Apple Inc. Address family preference in multiple network interface environments
CN103685281A (en) * 2013-12-18 2014-03-26 中国联合网络通信集团有限公司 Network address protocol switching method and device
CN105812283A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Queue scheduling method and queue scheduling device
CN106658477A (en) * 2015-10-28 2017-05-10 中兴通讯股份有限公司 PGW dual stack address selection method and apparatus
CN111277676A (en) * 2020-01-20 2020-06-12 苏州浪潮智能科技有限公司 Double-stack unified access method and system based on HTTP (hyper text transport protocol)
CN112787936A (en) * 2020-12-25 2021-05-11 深圳创维数字技术有限公司 Play failure recovery method, device and storage medium under IPv4/IPv6 dual-stack environment

Similar Documents

Publication Publication Date Title
US20130036453A1 (en) System, method and user interface for network status reporting
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
CN108924272B (en) Port resource allocation method and device
EP1742446B1 (en) Information processing device and program
CN103124240B (en) Gateway configuration method, gateway device and network system
CN112311907B (en) ARP request response method, load balancing equipment and related device
CN112948128A (en) Target terminal selection method, system and computer readable medium
CN106060131B (en) A kind of method and apparatus for distributing dns server
CN105450540A (en) Load balancing method and device as well as DHCP (dynamic host configuration protocol) server
CN104754070A (en) Method and device for learning address resolution protocol table entries and network device
CN111371880A (en) Dialing cloud server capable of dynamically switching IP
CN111756573A (en) CTDB double-network-card fault monitoring method in distributed cluster and related equipment
CN112272244B (en) Router WAN end IPv6 internet mode configuration method and device
CN106357836A (en) Connection establishing method and connection establishing device
CN113992952A (en) Network dual-stack connection method and device, network set top box and storage medium
CN107017998B (en) Method and system for implementing CGN flexible backup
US10999151B2 (en) Apparatus, system, and method for topology discovery across geographically redundant gateway devices
CN104539537B (en) A kind of method for searching route and device
CN102291313B (en) Method, device and equipment for finding virtual router redundancy protocol (VRRP) network topology
US20230179566A1 (en) Method and Device for Switching Internet Access mode of Gateway Device
US7209481B2 (en) System and method for automated network address cloning for routers
CN107528788A (en) Realize the method and apparatus stacked automatically between the network equipment
JP4195657B2 (en) Network address assignment device, network address assignment method, and network address assignment program
CN111314198B (en) Method and equipment for setting port IP of white box switch
CN114945047B (en) Intelligent terminal APP Internet protocol selection method, system, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination