Terminal device and network connection method thereof, communication system and storage medium

By calculating the decimal difference between multiple IP addresses configured on the terminal device's network card and the IP address of the target server, the closest IP address is selected for connection, which solves the problem of network connection failure caused by IP address mismatch in the existing technology and improves efficiency. The network connection success rate of the terminal device.

CN114301964BActive Publication Date: 2024-09-10LAUNCH TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202111605838.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-25
Publication Date
2024-09-10
Estimated Expiration
2041-12-25

AI Technical Summary

Technical Problem

When an existing terminal device establishes a network connection with a server, it usually uses the first IP address in the IP list by default, which may not be in the same network segment as the server's IP address, causing network connection failure and reducing the success rate of network connection.

Method used

By obtaining multiple IP addresses configured on the terminal device's network card and the IP address of the target server, calculate the decimal difference between each IP address, and select the IP address closest to the target IP address for connection to improve the connection success rate.

Benefits of technology

It improves the success rate of network connection between terminal equipment and servers and ensures that the IP addresses are in the same network segment when connecting, thereby stabilizing network communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114301964B
    Figure CN114301964B
Patent Text Reader

Abstract

The present application is applicable to the field of communication technology, and provides a terminal device and a network connection method thereof, a communication system and a storage medium, wherein the network connection method comprises: obtaining a plurality of first network interconnection protocol addresses pre-configured for a network card of the terminal device; obtaining a second network interconnection protocol address of a target server; determining a target first network interconnection protocol address matching the second network interconnection protocol address from the plurality of first network interconnection protocol addresses; and establishing a network connection with the target server based on the target first network interconnection protocol address. Since the terminal device establishes a network connection with the target server based on the first network interconnection protocol address matching the second network interconnection protocol address of the target server, the success rate of the terminal device's connection to the network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a terminal device and a network connection method thereof, a communication system and a storage medium. Background Art

[0002] In order to enable the terminal device to connect to multiple network segments during network communication, a plurality of different types of Internet Protocol (IP) addresses are usually configured for the network card in the terminal device, and the plurality of different types of IP addresses are stored in the terminal device in the form of a list. When the terminal device is connected to the network, it can obtain an IP address from the IP list and connect to the server based on the obtained IP address.

[0003] However, when the existing terminal device establishes a network connection with the server, it will use the first IP address in the IP list to connect to the server by default. Since the order of the IP addresses in the IP list is usually randomly set, the first IP address in the IP list may not be in the same network segment as the server's IP address, which will cause the network connection between the terminal device and the server to fail. It can be seen that the existing network connection method will reduce the success rate of terminal devices connecting to the network. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a terminal device and a network connection method thereof, a communication system and a storage medium to solve the technical problem that the existing network connection method will reduce the success rate of terminal device connection.

[0005] In a first aspect, an embodiment of the present application provides a network connection method, including:

[0006] Acquire a plurality of first network interconnection protocol addresses pre-configured for a network card of a terminal device;

[0007] Obtaining a second network interconnection protocol address of the target server;

[0008] Determine a target first Internet Protocol address that matches the second Internet Protocol address from the plurality of first Internet Protocol addresses;

[0009] A network connection is established with the target server based on the target first Internet Protocol address.

[0010] Optionally, the first Internet Protocol address and the second Internet Protocol address are both represented by a binary number with a preset number of bits; correspondingly, determining a target first Internet Protocol address matching the second Internet Protocol address from the multiple first Internet Protocol addresses includes:

[0011] Determine a decimal number corresponding to each of the first network interconnection protocol addresses;

[0012] Determine a decimal number corresponding to the second network interconnection protocol address;

[0013] Calculate the difference between the decimal number corresponding to each of the first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address;

[0014] The first network interconnection protocol address having the smallest difference between the decimal number corresponding to the plurality of first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address is determined as the target first network interconnection protocol address.

[0015] Optionally, a network interconnection protocol address list is stored in a local memory of the terminal device, and the network interconnection protocol address list records binary numbers used to represent each of the first network interconnection protocol addresses; correspondingly, the step of obtaining a plurality of first network interconnection protocol addresses pre-configured for a network card of the terminal device includes:

[0016] Acquire a network interconnection protocol address list from a local memory of the terminal device;

[0017] A binary number representing each of the first Internet Protocol addresses is obtained from the Internet Protocol address list.

[0018] Optionally, a network interconnection protocol address list is stored in a local memory of the terminal device, and the network interconnection protocol address list is used to record the dotted decimal address of each first network interconnection protocol address; correspondingly, the obtaining of multiple first network interconnection protocol addresses pre-configured for the network card of the terminal device includes:

[0019] Acquire a network interconnection protocol address list from a local memory of the terminal device;

[0020] Acquire the dotted decimal address of each of the first Internet Protocol addresses from the Internet Protocol address list;

[0021] The dotted decimal addresses of the first Internet Protocol addresses are respectively converted into binary numbers for representing the first Internet Protocol addresses.

[0022] Optionally, a server address list is stored in a local memory of the terminal device, and the server address list records a second network interconnection protocol address of a server; correspondingly, obtaining the second network interconnection protocol address of the target server includes:

[0023] Acquire a server address list from a local memory of the terminal device;

[0024] Acquire a second network interconnection protocol address of the one server from the server address list;

[0025] The second Internet Protocol address of the one server is determined as the second Internet Protocol address of the target server.

[0026] Optionally, a server address list is stored in a local memory of the terminal device, and the server address list records a correspondence between identifiers of multiple servers and second network interconnection protocol addresses of the multiple servers; correspondingly, obtaining the second network interconnection protocol address of the target server includes:

[0027] Acquire a server address list from a local memory of the terminal device;

[0028] Based on the identifier of the server to be connected, acquiring from the server address list a second network interconnection protocol address corresponding to the identifier of the server to be connected;

[0029] A second network interconnection protocol address corresponding to the identifier of the server to be connected is determined as the second network interconnection protocol address of the target server.

[0030] In a second aspect, an embodiment of the present application provides a terminal device, including:

[0031] A first acquisition unit, used to acquire a plurality of first network interconnection protocol addresses pre-configured for a network card of a terminal device;

[0032] A second acquisition unit, used to acquire a second network interconnection protocol address of the target server;

[0033] A first determining unit, configured to determine a target first network interconnection protocol address matching the second network interconnection protocol address from the plurality of first network interconnection protocol addresses;

[0034] A communication unit is used to establish a network connection with the target server based on the target first Internet protocol address.

[0035] In a third aspect, an embodiment of the present application provides another terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the network connection method described in the first aspect above is implemented.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the network connection method as described in the first aspect above is implemented.

[0037] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the network connection method as described in the first aspect above.

[0038] The network connection method, terminal device, computer-readable storage medium, and computer program product provided by the embodiments of the present application have the following beneficial effects:

[0039] The network connection method provided by the embodiment of the present application obtains multiple first network interconnection protocol addresses pre-configured for the network card of the terminal device and the second network interconnection protocol address of the target server; determines the target first network interconnection protocol address that matches the second network interconnection protocol address from the multiple first network interconnection protocol addresses; and establishes a network connection with the target server based on the target first network interconnection protocol address. Since the terminal device establishes a network connection with the target server based on the first network interconnection protocol address that matches the second network interconnection protocol address of the target server, the network connection success rate of the terminal device is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 A schematic architecture diagram of a communication system provided in an embodiment of the present application;

[0042] Figure 2 A schematic flow chart of a network connection method provided in an embodiment of the present application;

[0043] Figure 3 A flowchart for the specific implementation of S23 in a network connection method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of a terminal device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0046] It should be noted that the terms used in the implementation methods of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.

[0047] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, it is defined that the "first" and "second" features may explicitly or implicitly include one or more of the features.

[0048] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0049] The network connection method provided in the embodiment of the present application can be applied to a communication system. Figure 1 , is a schematic architecture diagram of a communication system provided in an embodiment of the present application. Figure 1 As shown, the communication system may include at least one terminal device 11 and at least one server 12. Each terminal device 11 may establish a network connection with any server 12 via an Internet protocol (IP) address.

[0050] The terminal device may include but is not limited to mobile phones, tablet computers, laptop computers, and desktop computers.

[0051] An IP address is usually represented by a 32-bit binary number. In other words, an IP address is usually a 32-bit binary number. To facilitate user memory, the 32-bit binary number representing the IP address can usually be divided into four 8-bit binary numbers, each 8-bit binary number is converted into a corresponding decimal number, and separated by a decimal point to obtain an address in the format of "abcd". This address can be called the dotted decimal address of the IP address. Among them, a, b, c, and d are all decimal integers between 0 and 255.

[0052] For example, if the 32-bit binary number representing a certain IP address is 00000001 01100100 1010100011000000, then the dotted decimal address of the IP address is 1.100.168.192.

[0053] The embodiment of the present application provides a network connection method, the execution subject can be Figure 1 Any terminal device in the corresponding communication system. By configuring the target script file for the terminal device, the target script file describes the network connection method provided by the embodiment of the present application, so that the terminal device executes the target script file when it needs to establish a network connection with the server, and then executes each step in the network connection method provided by the embodiment of the present application. Please refer to Figure 2 , is a schematic flow chart of a network connection method provided in an embodiment of the present application. Figure 2 As shown, the network connection method may include S21 to S24, which are described in detail as follows:

[0054] S21: Acquire a plurality of first network interconnection protocol addresses pre-configured for the network card of the terminal device.

[0055] In an embodiment of the present application, multiple first IP addresses pre-configured for the network card of the terminal device may be recorded in an IP address list, and the IP address list may be stored in a local memory of the terminal device.

[0056] In one embodiment of the present application, the IP address list may record a binary number used to represent each first IP address. The number of digits of the binary number used to represent the first IP address may be a preset number of digits, which may be set according to actual needs and is not particularly limited here. For example, the preset number of digits may be 32 digits. Based on this, S21 may specifically include the following steps:

[0057] Acquire a network interconnection protocol address list from a local memory of the terminal device;

[0058] A binary number representing each of the first Internet Protocol addresses is obtained from the Internet Protocol address list.

[0059] In this embodiment, illustratively, the IP address list may be as shown in Table 1.

[0060] Table 1

[0061] 00000001 01100100 10101000 11000000 01100001 01100100 10101010 11000001 00011001 01100000 10101000 11000100 ……

[0062] In another embodiment of the present application, in order to facilitate the user to configure the first IP address, the IP address list may also record the dotted decimal address of each first IP address. Based on this, S21 may specifically include the following steps:

[0063] Acquire a network interconnection protocol address list from a local memory of the terminal device;

[0064] Acquire the dotted decimal address of each of the first Internet Protocol addresses from the Internet Protocol address list;

[0065] The dotted decimal addresses of the first Internet Protocol addresses are respectively converted into binary numbers for representing the first Internet Protocol addresses.

[0066] In this embodiment, illustratively, the IP address list may be as shown in Table 2.

[0067] Table 2

[0068] 1.100.168.192 97.100.170.193 25.96.168.196 ……

[0069] After the terminal device obtains the dotted decimal address of each first IP address from the IP address list, it can perform a decimal-binary conversion operation on the dotted decimal address of each first IP address to obtain a binary number used to represent each first IP address.

[0070] S22: Obtain a second network interconnection protocol address of the target server.

[0071] In an embodiment of the present application, the second IP addresses of one or more servers may be stored in the local memory of the terminal device, and the second IP addresses of the one or more servers may be recorded in a server address list in the local memory of the terminal device.

[0072] The target server may be a server to which the terminal device needs to connect. The number of the target servers may be one or more, which may be set according to actual needs and is not particularly limited herein.

[0073] In one embodiment of the present application, if the local memory of the terminal device stores only one second IP address of a server, the server address list may only record the second IP address of the one memory. Based on this, S22 may specifically include the following steps:

[0074] Acquire a server address list from a local memory of the terminal device;

[0075] Acquire a second network interconnection protocol address of the one server from the server address list;

[0076] The second Internet Protocol address of the one server is determined as the second Internet Protocol address of the target server.

[0077] In a possible implementation of this embodiment, the server address list may record a binary number for representing the second IP address of the server. Based on this, the terminal device may obtain the binary number for representing the second IP address of the server from the server address list, and determine the binary number for the second IP address of the server as the second IP address of the target server.

[0078] In another possible implementation of this embodiment, the server address list may record the dotted decimal address of the second IP address of the server. Based on this, the terminal device may obtain the dotted decimal address of the second IP address of the server from the server address list, and perform a decimal-binary conversion on the dotted decimal address of the second IP address to obtain a binary number representing the second IP address, and determine the binary number representing the second IP address as the second IP address of the target server.

[0079] In another embodiment of the present application, if the local memory of the terminal device stores the second IP addresses of multiple servers, the second IP addresses of different servers can be distinguished by the server identifiers. Based on this, the server address list can record the correspondence between the identifiers of the multiple servers and the second IP addresses of the multiple servers. Based on this, S22 can specifically include the following steps:

[0080] Acquire a server address list from a local memory of the terminal device;

[0081] Based on the identifier of the server to be connected, acquiring from the server address list a second network interconnection protocol address corresponding to the identifier of the server to be connected;

[0082] A second network interconnection protocol address corresponding to the identifier of the server to be connected is determined as the second network interconnection protocol address of the target server.

[0083] In this embodiment, as an example but not a limitation, the identifier of the server may be the name of the server.

[0084] In a possible implementation of this embodiment, the server address list may record the correspondence between the identifier of each server and the binary number used to represent the second IP address of each server. Based on this, the terminal device can obtain the binary number used to represent the second IP address corresponding to the identifier of the server to be connected from the server address list based on the identifier of the server to be connected, and determine the binary number of the second IP address as the second IP address of the target server.

[0085] In another possible implementation of this embodiment, the server address list may record the correspondence between the identifier of each server and the dotted decimal address of the second IP address of each server. Based on this, the terminal device may obtain the dotted decimal address of the second IP address corresponding to the identifier of the server to be connected from the server address list based on the identifier of the server to be connected, and perform a decimal-binary conversion on the dotted decimal address to obtain a binary number representing the second IP address corresponding to the identifier of the server to be connected, and determine the binary number as the second Internet Protocol address of the target server.

[0086] S23: Determine a target first Internet Protocol address that matches the second Internet Protocol address from the multiple first Internet Protocol addresses.

[0087] In the embodiment of the present application, the target first IP address that matches the second IP address refers to the first IP address among the multiple first IP addresses that is closest to the network segment where the second IP address is located.

[0088] In one embodiment of the present application, S23 can be specifically performed as follows: Figure 3 The implementation of S231 to S234 shown is described in detail as follows:

[0089] S231: Determine the decimal number corresponding to each of the first network interconnection protocol addresses.

[0090] In this embodiment, the terminal device may perform binary-to-decimal conversion processing on the binary numbers used to represent each first IP address to obtain a decimal number corresponding to each first IP address.

[0091] Exemplarily, if the binary number used to represent a first IP address is 00000001 0110010010101000 11000000, after the terminal device performs binary-to-decimal conversion on the binary number, the decimal number corresponding to the first IP address obtained is 23374016.

[0092] S232: Determine a decimal number corresponding to the second network interconnection protocol address.

[0093] In this embodiment, the terminal device may perform binary-to-decimal conversion processing on the second IP address of the target server to obtain a decimal number corresponding to the second IP address of the target server.

[0094] Exemplarily, if the binary number used to represent the second IP address of the target server is 0000000101100100 10101000 11000011, after the terminal device performs binary-to-decimal conversion on the binary number, the decimal number corresponding to the second IP address of the target server obtained is 23374019.

[0095] S233: Calculate the difference between the decimal numbers corresponding to the first network interconnection protocol addresses and the decimal numbers corresponding to the second network interconnection protocol addresses.

[0096] After the terminal device obtains the decimal numbers corresponding to each first IP address and the decimal number corresponding to the second IP address of the target server, it can perform a difference operation on the decimal number corresponding to each first IP address and the decimal number corresponding to the second IP address of the target server to obtain the difference between the decimal number corresponding to each first IP address and the decimal number corresponding to the second IP address of the target server.

[0097] S234: Determine the first network interconnection protocol address whose decimal number corresponding to the plurality of first network interconnection protocol addresses has the smallest difference with the decimal number corresponding to the second network interconnection protocol address as the target first network interconnection protocol address.

[0098] Exemplarily, if four first IP addresses are pre-configured for the network card of the terminal device, and the differences between the four first IP addresses and the second IP address of the target server are s1, s2, s3 and s4, respectively, where s1>s2>s3>s4, then the first IP address among the four first IP addresses whose corresponding decimal number has a difference of s4 with the second IP address of the target server can be determined as the target first IP address.

[0099] The target first IP address determined in this embodiment can make the target first Internet Protocol address and the second IP address of the target server be in the same network segment, thereby improving the networking success rate of the terminal device.

[0100] S24: Establishing a network connection with the target server based on the target first Internet Protocol address.

[0101] In an embodiment of the present application, the terminal device can connect to the server based on the determined target first network interconnection address, thereby establishing a network connection between the terminal device and the target server.

[0102] As can be seen from the above, the network connection method provided in this embodiment obtains multiple first network interconnection protocol addresses pre-configured for the network card of the terminal device and the second network interconnection protocol address of the target server; determines the target first network interconnection protocol address that matches the second network interconnection protocol address from the multiple first network interconnection protocol addresses; and establishes a network connection with the target server based on the target first network interconnection protocol address. Since the terminal device establishes a network connection with the target server based on the first network interconnection protocol address that matches the second network interconnection protocol address of the target server, the network connection success rate of the terminal device is improved.

[0103] It is understandable that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0104] Based on the network connection method provided in the above embodiment, the present invention further provides an embodiment of a terminal device that implements the above method embodiment. Figure 4 , is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. For ease of description, only the parts related to this embodiment are shown. Figure 4 As shown, the terminal device 40 may include: a first acquisition unit 41, a second acquisition unit 42, a first determination unit 43 and a communication unit 44. Among them:

[0105] The first acquisition unit 41 is used to acquire a plurality of first network interconnection protocol addresses pre-configured for the network card of the terminal device.

[0106] The second acquisition unit 42 is used to acquire a second Internet protocol address of the target server.

[0107] The first determining unit 43 is configured to determine a target first Internet Protocol address that matches the second Internet Protocol address from the plurality of first Internet Protocol addresses.

[0108] The communication unit 44 is used to establish a network connection with the target server based on the target first Internet Protocol address.

[0109] Optionally, the first network interconnection protocol address and the second network interconnection protocol address are both represented by a binary number with a preset number of bits; correspondingly, the first determination unit 43 may include a decimal determination unit, a first calculation unit, and a target address determination unit.

[0110] The decimal determination unit is used to determine the decimal number corresponding to each of the first network interconnection protocol addresses.

[0111] The decimal determination unit is further used to determine the decimal number corresponding to the second network interconnection protocol address.

[0112] The first calculation unit is used to calculate the difference between the decimal number corresponding to each of the first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address;

[0113] The target address determination unit is used to determine the first network interconnection protocol address having the smallest difference between the decimal number corresponding to the plurality of first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address as the target first network interconnection protocol address.

[0114] Optionally, a network interconnection protocol address list is stored in the local memory of the terminal device, and the network interconnection protocol address list records binary numbers used to represent each of the first network interconnection protocol addresses; correspondingly, the first acquisition unit may include a first list acquisition unit and a first address acquisition unit.

[0115] The first list acquisition unit is used to acquire a network interconnection protocol address list from the local memory of the terminal device.

[0116] The first address acquisition unit is used to acquire a binary number representing each of the first Internet Protocol addresses from the Internet Protocol address list.

[0117] Optionally, a network interconnection protocol address list is stored in the local memory of the terminal device, and the network interconnection protocol address list is used to record the dotted decimal address of each first network interconnection protocol address; correspondingly, the first acquisition unit may include a second list acquisition unit, a second address acquisition unit and an address conversion unit. Wherein:

[0118] The second list acquisition unit is used to acquire the network interconnection protocol address list from the local memory of the terminal device.

[0119] The second address acquisition unit is used to acquire the dotted decimal address of each of the first Internet Protocol addresses from the Internet Protocol address list.

[0120] The address conversion unit is used to convert the dotted decimal address of each of the first Internet Protocol addresses into a binary number used to represent each of the first Internet Protocol addresses.

[0121] Optionally, a server address list is stored in the local memory of the terminal device, and the server address list records a second network interconnection protocol address of a server; correspondingly, the second acquisition unit includes a third list acquisition unit, a third address acquisition unit and a second determination unit.

[0122] The third list acquisition unit is used to acquire the server address list from the local memory of the terminal device.

[0123] The third address obtaining unit is used to obtain the second Internet protocol address of the one server from the server address list.

[0124] The second determining unit is used to determine the second Internet Protocol address of the one server as the second Internet Protocol address of the target server.

[0125] Optionally, a server address list is stored in the local memory of the terminal device, and the server address list records the correspondence between the identifiers of multiple servers and the second network interconnection protocol addresses of the multiple servers; correspondingly, the second acquisition unit includes a fourth list acquisition unit, a fourth address acquisition unit and a third determination unit.

[0126] The fourth list acquisition unit is used to acquire the server address list from the local memory of the terminal device.

[0127] The fourth address acquisition unit is used to acquire, based on the identifier of the server to be connected, from the server address list a second network interconnection protocol address corresponding to the identifier of the server to be connected.

[0128] The third determining unit is used to determine the second network interconnection protocol address corresponding to the identifier of the server to be connected as the second network interconnection protocol address of the target server.

[0129] It should be noted that the information interaction, execution process and other contents between the above-mentioned units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be specifically referred to the method embodiment part and will not be repeated here.

[0130] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the terminal device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0131] See also Figure 5 , is a schematic diagram of the structure of a terminal device provided by another embodiment of the present application. Figure 5 As shown, the terminal device 5 provided in this embodiment may include: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50, such as a program corresponding to the network connection method. When the processor 50 executes the computer program 52, the steps in the above network connection method embodiment are implemented, such as Figure 2 Alternatively, when the processor 50 executes the computer program 52, the functions of each module / unit in the above terminal device embodiment are realized, for example Figure 4 The functions of the units 41 to 44 are shown.

[0132] Exemplarily, the computer program 52 may be divided into one or more modules / units, one or more modules / units are stored in the memory 51 and executed by the processor 50 to complete the present application. The one or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a first acquisition unit, a second acquisition unit, a first determination unit, and a communication unit. For the specific functions of each unit, please refer to Figure 4 The relevant descriptions in the corresponding embodiments are not repeated here.

[0133] Those skilled in the art will understand that Figure 5 It is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. The terminal device 5 may include more or less components than shown in the figure, or a combination of certain components, or different components.

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

[0135] The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card, etc., equipped on the terminal device 5. Further, the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device. The memory 51 is used to store computer programs and other programs and data required by the terminal device. The memory 51 may also be used to temporarily store data that has been output or is to be output.

[0136] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0137] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0139] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0140] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A network connection method, the execution subject is any terminal device in a communication system, by configuring a target script file for the terminal device, the target script file describes the network connection method, so that the terminal device executes the target script file when it needs to establish a network connection with a server, and then executes each step in the network connection method, characterized in that: include: Acquiring a plurality of first network interconnection protocol addresses pre-configured for a network card of a terminal device, including: Obtaining a network interconnection protocol address list from the local memory of the terminal device; obtaining a dotted decimal address of each first network interconnection protocol address from the network interconnection protocol address list; converting the dotted decimal address of each first network interconnection protocol address into a binary number for representing each first network interconnection protocol address; wherein a plurality of first network interconnection protocol addresses pre-configured for the network card of the terminal device are recorded in the network interconnection protocol address list, and the network interconnection protocol address list is stored in the local memory of the terminal device; Obtaining the second network interconnection protocol address of the target server includes: Obtaining a server address list from the local memory of the terminal device; obtaining a second network interconnection protocol address of a server from the server address list; determining the second network interconnection protocol address of the server as the second network interconnection protocol address of the target server; wherein the local memory of the terminal device stores the second network interconnection protocol addresses of one or more servers, and the second network interconnection protocol addresses of the one or more servers are recorded in the server address list in the local memory of the terminal device; Determining a target first Internet Protocol address matching the second Internet Protocol address from the plurality of first Internet Protocol addresses comprises: Determine a decimal number corresponding to each of the first network interconnection protocol addresses; Determine a decimal number corresponding to the second network interconnection protocol address; Calculate the difference between the decimal number corresponding to each of the first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address; Determine the first network interconnection protocol address whose decimal number corresponding to the plurality of first network interconnection protocol addresses has the smallest difference with the decimal number corresponding to the second network interconnection protocol address as the target first network interconnection protocol address; wherein the target first network interconnection protocol address matching the second network interconnection protocol address refers to the first network interconnection protocol address in the plurality of first network interconnection protocol addresses that is closest to the network segment where the second network interconnection protocol address is located; A network connection is established with the target server based on the target first Internet Protocol address.

2. A terminal device, which is any terminal device in a communication system, is configured with a target script file for the terminal device, and the target script file describes a network connection method, so that the terminal device executes the target script file when it needs to establish a network connection with a server, thereby executing each step in the network connection method, characterized in that: include: The first acquisition unit is used to acquire a plurality of first network interconnection protocol addresses pre-configured for the network card of the terminal device, including: Obtaining a network interconnection protocol address list from the local memory of the terminal device; obtaining a dotted decimal address of each first network interconnection protocol address from the network interconnection protocol address list; converting the dotted decimal address of each first network interconnection protocol address into a binary number for representing each first network interconnection protocol address; wherein a plurality of first network interconnection protocol addresses pre-configured for the network card of the terminal device are recorded in the network interconnection protocol address list, and the network interconnection protocol address list is stored in the local memory of the terminal device; The second acquisition unit is used to acquire a second network interconnection protocol address of the target server, including: Obtaining a server address list from the local memory of the terminal device; obtaining a second network interconnection protocol address of a server from the server address list; determining the second network interconnection protocol address of the server as the second network interconnection protocol address of the target server; wherein the local memory of the terminal device stores the second network interconnection protocol addresses of one or more servers, and the second network interconnection protocol addresses of the one or more servers are recorded in the server address list in the local memory of the terminal device; The first determining unit is configured to determine a target first network interconnection protocol address matching the second network interconnection protocol address from the plurality of first network interconnection protocol addresses, comprising: Determine a decimal number corresponding to each of the first network interconnection protocol addresses; Determine a decimal number corresponding to the second network interconnection protocol address; Calculate the difference between the decimal number corresponding to each of the first network interconnection protocol addresses and the decimal number corresponding to the second network interconnection protocol address; Determine the first network interconnection protocol address whose decimal number corresponding to the plurality of first network interconnection protocol addresses has the smallest difference with the decimal number corresponding to the second network interconnection protocol address as the target first network interconnection protocol address; wherein the target first network interconnection protocol address matching the second network interconnection protocol address refers to the first network interconnection protocol address in the plurality of first network interconnection protocol addresses that is closest to the network segment where the second network interconnection protocol address is located; A communication unit is used to establish a network connection with the target server based on the target first Internet protocol address.

3. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the network connection method according to claim 1 is implemented when the processor executes the computer program.

4. A communication system, characterized in that: It comprises at least one terminal device and at least one server; the terminal device is used to execute the network connection method as claimed in claim 1; the target server is one or more of the at least one server.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the network connection method according to claim 1 is implemented.

Citation Information

Cited By

  • Location clustering and routing for 5G drive testing

    US12167297B2

  • Location clustering and routing for 5G drive testing

    US12177696B2

  • Location clustering and routing for 5G drive testing

    US12323875B2

  • Location clustering and routing for 5G drive testing

    US12363501B2