CN110417789A - Server connection method, electronic equipment, system and medium - Google Patents

Server connection method, electronic equipment, system and medium Download PDF

Info

Publication number
CN110417789A
CN110417789A CN201910708646.8A CN201910708646A CN110417789A CN 110417789 A CN110417789 A CN 110417789A CN 201910708646 A CN201910708646 A CN 201910708646A CN 110417789 A CN110417789 A CN 110417789A
Authority
CN
China
Prior art keywords
address
server
hardware device
port
random
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910708646.8A
Other languages
Chinese (zh)
Other versions
CN110417789B (en
Inventor
陈志兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910708646.8A priority Critical patent/CN110417789B/en
Publication of CN110417789A publication Critical patent/CN110417789A/en
Application granted granted Critical
Publication of CN110417789B publication Critical patent/CN110417789B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Abstract

The present invention provides a kind of server connection method, electronic equipment, system and media, which comprises when receiving server link order, the determination each hardware device to be connected;Random delay is carried out respectively to the attended operation of each hardware device;The first IP address of certificate server is parsed at the end of detecting hardware device delay for each hardware device;When parsing failure, the second IP address is obtained at random from preset operator's IP address;When applicable, target protocol is obtained at random from preset agreement;Request the third IP address of the certificate server distribution destination server;When getting the third IP address, target port is obtained at random from preset port list;By the target port and the third IP address, controls the hardware device and connect the destination server, solve the connectivity problem of hardware device and server under complicated network environment, improve the success rate that hardware device is connect with server.

Description

Server connection method, electronic equipment, system and medium
Technical field
The present invention relates to Internet technical field more particularly to server connection method, electronic equipment, system and media.
Background technique
Currently, more and more users such as play objective cloud intelligence firmly to realize that the digital entertainment of high-quality lives in use Part equipment as privately owned cloud disk product, can allow user pass through whenever and wherever possible application program of mobile phone distal end complete video playing, The operation such as picture browsing, file download, file management.
Since these intelligent hardware devices are to access public network, intelligent hardware devices sheet by subscriber household router Public network address is not present in body, it means that the mobile terminal of user can not be directly connected to intelligent hardware devices whenever and wherever possible.In order to This problem is solved, intelligent hardware devices pass through Transmission Control Protocol usually by presetting certificate server domain name (Transmission Control Protocol, transmission control protocol) is connected to public network server (such as equipment management service Device).
And there are following drawbacks for above-mentioned solution:
1. if will be unable to be connected to intelligent hardware devices parse the failure of certificate server domain name under locating network environment Device management server.
2. if will be unable to be connected to equipment management clothes network environment locating for intelligent hardware devices limits 80 port TCP Business device.
3. if cannot connect to equipment pipe network environment locating for user limits device management server listening port Manage server.
4. if all intelligent hardware devices are performed simultaneously company when restoring service computer room locating for device management server has a power failure Operation is connect, then may cause SYN extensive aggression (SYN Flooding), device management server is caused to can not work normally.
Summary of the invention
The main purpose of the present invention is to provide server connection method, electronic equipment, system and media, it is intended to solve multiple The connectivity problem of hardware device and server under miscellaneous network environment, and then improve the success that hardware device is connect with server Rate.
To achieve the above object, the present invention provides a kind of server connection method, which comprises
When receiving server link order, the determination each hardware device to be connected;
Random delay is carried out respectively to the attended operation of each hardware device;
The first IP of certificate server is parsed at the end of detecting hardware device delay for each hardware device Address;
When first IP address parses failure, the second IP address is obtained at random from preset operator's IP address;
When second IP address is available, target protocol is obtained at random from preset agreement;
Based on second IP address, the certificate server distribution destination server is requested using the target protocol Third IP address;
When getting the third IP address, target port is obtained at random from preset port list;
By the target port and the third IP address, controls the hardware device and connect the destination server.
Preferably, the method also includes:
When second IP address is unavailable, second IP address is forbidden to be acquired in next attended operation.
Preferably, the method also includes:
When not getting the third IP address, the target protocol is forbidden to be acquired in next attended operation.
Preferably, the method also includes:
When detecting that the hardware device is not successfully connected the destination server, forbid the target port in next time It is acquired in attended operation.
Preferably, the method also includes:
Obtain used all of the port;
Determine the success rate of the attended operation of all of the port;
Obtain the port that success rate is more than or equal to preset threshold;
The port list is configured according to the port of acquisition.
Preferably, the method also includes:
When second IP address is unavailable, the third IP address is not got perhaps or detects the hardware Equipment is not successfully connected the destination server, or detects that the hardware device is disconnected with the destination server When, re-execute the server link order.
To achieve the above object, the present invention further provides a kind of electronic equipment, the electronic equipment includes:
Memory stores at least one instruction;And
Processor executes the instruction stored in the memory to realize the server connection method.
Preferably, the electronic equipment is the node of component content distribution network or block chain network.
To achieve the above object, the present invention further provides a kind of servers to connect system, the system comprises:
Determination unit, for when receiving server link order, the determination each hardware device to be connected;
Delay unit carries out random delay for the attended operation to each hardware device respectively;
Resolution unit, for for each hardware device, at the end of detecting hardware device delay, parsing certification to be taken First IP address of business device;
Acquiring unit, for being obtained at random from preset operator's IP address when first IP address parses failure Take the second IP address;
The acquiring unit is also used to obtain target at random from preset agreement when second IP address is available Agreement;
Request unit requests the certificate server point using the target protocol for being based on second IP address Third IP address with destination server;
The acquiring unit is also used to obtain at random from preset port list when getting the third IP address Take target port;
Control unit, for controlling described in hardware device connection by the target port and the third IP address Destination server.
Preferably, the system also includes:
Forbid unit, for when second IP address is unavailable, forbidding second IP address in connection next time behaviour It is acquired in work.
Preferably, described to forbid unit, it is also used to when not getting the third IP address, the target is forbidden to assist View is acquired in next attended operation.
Preferably, described to forbid unit, it is also used to detect that the hardware device is not successfully connected the destination service When device, the target port is forbidden to be acquired in next attended operation.
Preferably, the acquiring unit is also used to obtain used all of the port;
The determination unit is also used to determine the success rate of the attended operation of all of the port;
The acquiring unit is also used to obtain the port that success rate is more than or equal to preset threshold;
The system also includes:
Configuration unit, for configuring the port list according to the port of acquisition.
Preferably, the system also includes:
Execution unit, for when second IP address it is unavailable, do not get perhaps the third IP address or It detects that the hardware device is not successfully connected the destination server, or detects the hardware device and the destination service When device disconnects, the server link order is re-executed.
To achieve the above object, the present invention further provides a kind of computer program products, including computer instruction, when it When running on computers, computer is allowed to execute the server connection method.
In conclusion the present invention can be when receiving server link order, the determination each hardware device to be connected, And random delay is carried out respectively to the attended operation of each hardware device, for each hardware device, when detecting that this is hard At the end of part equipment is delayed, the first IP address of certificate server is parsed, when first IP address parses failure, from default Operator's IP address in obtain the second IP address at random, it is random from preset agreement when second IP address is available Target protocol is obtained, second IP address is based further on, requests the certificate server to distribute using the target protocol The third IP address of destination server obtains mesh from preset port list when getting the third IP address at random Port is marked, and by the target port and the third IP address, controls the hardware device and connects the destination server, into And the connectivity problem of hardware device and server under complicated network environment is solved, improve what hardware device was connect with server Success rate.
Detailed description of the invention
Fig. 1 is the flow diagram of one embodiment of the invention;
Fig. 2 is the schematic diagram of internal structure for the electronic equipment that one embodiment of the invention discloses;
Fig. 3 is the functional block diagram that server of the present invention connects system;
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Main element symbol description
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
The description and claims of this application and term " first ", " second ", " third ", " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims Protection scope within.
The present invention provides a kind of server connection method.
Referring to Fig.1, Fig. 1 is the flow diagram of one embodiment of the invention.According to different requirements, in the flow diagram The sequence of step can change, and certain steps can be omitted.
The server connection method is applied in one or more electronic equipment, and the electronic equipment is that one kind can According to the instruction for being previously set or storing, the automatic equipment for carrying out numerical value calculating and/or information processing, the electronic equipment it is hard Part equipment includes but is not limited to microprocessor, specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processing unit (Digital Signal Processor, DSP), embedded device etc..
The electronic equipment can be any electronic product that human-computer interaction can be carried out with user, for example, personal meter Calculation machine, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game machine, friendship Mutual formula Web TV (Internet Protocol Television, IPTV), intellectual wearable device etc..
The electronic equipment can also include the network equipment and/or user equipment.Wherein, the network equipment includes, but It is not limited to single network server, the server group of multiple network servers composition or based on cloud computing (Cloud Computing the cloud being made of a large amount of hosts or network server).
Network locating for the electronic equipment include but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, it is virtual specially With network (Virtual Private Network, VPN) etc..
In one embodiment, this method comprises:
S10, when receiving server link order, the determination each hardware device to be connected.
In at least one embodiment of the present invention, all hardware equipment includes intelligent hardware devices, such as plays objective cloud Deng.By the hardware device, the shared of Internet resources can be realized.
In at least one embodiment of the present invention, described when having detected that hardware device connects the electronic equipment Electronic equipment determination receives the server link order.
S11 carries out random delay to the attended operation of each hardware device respectively.
Such as: when having 3 hardware devices while connecting, the electronic equipment can control 3 hardware devices point Other random delay 10 seconds, 20 seconds and 30 seconds.
By above embodiment, all hardware equipment can be made to execute respectively in the unused time to destination service The attended operation of device, avoided within the same time while the hardware device for connecting the destination server is excessive, gave the target Server causes operating pressure, and then effectively prevents causing the destination server SYN extensive aggression (SYN Flooding)。
S12 at the end of detecting hardware device delay, parses the of certificate server for each hardware device One IP address (Internet Protocol Address, Internet protocol address).
In at least one embodiment of the present invention, the certificate server may include Portal server, described to recognize Card server is used to distribute the IP address of the destination server.
S13, when first IP address parses failure, from preset operator's IP address with obtaining the 2nd IP at random Location.
In at least one embodiment of the present invention, due to the influence of network environment, first IP address is different surely Enough successfully resolveds, therefore, in order to avoid unsuccessfully to cannot connect to the hardware device described due to first IP address parsing Destination server, when first IP address parses failure, the electronic equipment is random from preset operator's IP address The second IP address is obtained, and first IP address is replaced with second IP address.
In at least one embodiment of the present invention, the method also includes:
The electronic equipment is pre-configured with the operator IP.
Specifically, the electronic equipment can configure an IP for each operator, although in this way, can not confirm current fortune Quotient is sought, but by repetition test, the probability of IP adaptation can be effectively improved, and then improve the probability of server connection.
S14 obtains target protocol from preset agreement when second IP address is available at random.
In at least one embodiment of the present invention, the preset agreement may include http protocol (Hyper Text Transfer Protocol, hypertext transfer protocol) and HTTPS agreement (Hyper Text Transfer Protocol Over Secure Socket, Hyper text transfer security protocol).
In at least one embodiment of the present invention, due to the influence of network environment, second IP address not necessarily may be used With.
Therefore, the method also includes:
When second IP address is unavailable, the electronic equipment forbids second IP address in next attended operation In be acquired.
By above embodiment, it can effectively avoid not available IP address from being repeated acquisition, delay connection progress.
S15 is based on second IP address, requests the certificate server to distribute destination service using the target protocol The third IP address of device.
In at least one embodiment of the present invention, the third IP address is for connecting the destination server.
S16 obtains target port from preset port list when getting the third IP address at random.
In at least one embodiment of the present invention, store in the port list be proved to connect into power it is higher Port.
Specifically, the electronic equipment configuration port list includes:
The electronic equipment obtains used all of the port, and determines the success of the attended operation of all of the port Rate, the electronic equipment obtain the port that success rate is more than or equal to preset threshold, and according to the configuration of the port of acquisition Port list.
Wherein, the preset threshold can be custom-configured, for example, in order to preferably connect the destination service Device, the electronic equipment can configure the higher preset threshold, and the preset threshold can be configured as 95%.
In at least one embodiment of the present invention, due to the influence of network environment, the third IP address is likely to obtain Take less than.
Therefore, the method also includes:
When not getting the third IP address, the electronic equipment forbids the target protocol in connection next time behaviour It is acquired in work.
It by above embodiment, can effectively avoid invalid target protocol from being reused, and then improve connection Efficiency.
S17 controls the hardware device and connects the destination service by the target port and the third IP address Device.
In at least one embodiment of the present invention, the destination server refers to public network server, hard by controlling this Part equipment connects the destination server, so that the hardware device and the destination server is in connection slave mode, in this way, working as When user opens the corresponding application programs of mobile terminal, the mobile terminal can access distal end by the destination server Other hardware devices enable the mobile terminal of user to connect the hardware device whenever and wherever possible.
In at least one embodiment of the present invention, since the influence of network environment, the hardware device and the target take Business device is likely to connection failure.
Therefore, the method also includes:
When detecting that the hardware device is not successfully connected the destination server, the electronic equipment forbids the mesh Mark port is acquired in next attended operation.
By above embodiment, it can effectively avoid not available target port from being repeated acquisition, delay connection progress.
In at least one embodiment of the present invention, when there is flow operations failure in above-mentioned process, in order to avoid hair Raw logic error, causes the hardware device that can not normally connect the destination server, the method also includes:
When detecting predeterminable event, the electronic equipment re-executes the server link order.
In at least one embodiment of the present invention, the predeterminable event may include, but be not limited to it is following a kind of or The combination of a variety of events:
(1) second IP address is unavailable.
(2) electronic equipment does not get the third IP address.
(3) electronic equipment detects that the hardware device is not successfully connected the destination server.
(4) electronic equipment detects that the hardware device is disconnected with the destination server.
(5) electronic equipment detects that the connection of the hardware device and the destination server is abnormal.
By above embodiment, the server link order can be re-executed when detecting anomalous event, led to After taking responsive measures in time, avoids influencing user to the normal use of Internet resources, influence user experience.
In conclusion the present invention can be when receiving server link order, the determination each hardware device to be connected, And random delay is carried out respectively to the attended operation of each hardware device, for each hardware device, when detecting that this is hard At the end of part equipment is delayed, the first IP address of certificate server is parsed, when first IP address parses failure, from default Operator's IP address in obtain the second IP address at random, it is random from preset agreement when second IP address is available Target protocol is obtained, second IP address is based further on, requests the certificate server to distribute using the target protocol The third IP address of destination server obtains mesh from preset port list when getting the third IP address at random Port is marked, and by the target port and the third IP address, controls the hardware device and connects the destination server, into And the connectivity problem of hardware device and server under complicated network environment is solved, improve what hardware device was connect with server Success rate.
Referring to fig. 2, in the present embodiment, the electronic equipment 1 be it is a kind of can according to the instruction for being previously set or storing, The automatic equipment for carrying out numerical value calculating and/or information processing, hardware device includes but is not limited to microprocessor, dedicated integrated electricity Road (Application Specific Integrated Circuit, ASIC), programmable gate array (Field- Programmable Gate Array, FPGA), it is digital processing unit (Digital Signal Processor, DSP), embedded Equipment etc..
The electronic equipment 1, which can also be but not limited to any one, to pass through keyboard, mouse, remote controler, touching with user The modes such as template or voice-operated device carry out the electronic product of human-computer interaction, for example, personal computer (Personal Computer, PC), tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game machine, friendship Mutual formula Web TV (Internet Protocol Television, IPTV), intellectual wearable device, palm PC, just The calculating such as computer, intelligent router, mine machine, network storage equipment terminal device, desktop PC, cloud server are taken to set It is standby etc..
Network locating for the electronic equipment 1 include but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, it is virtual specially With network (Virtual Private Network, VPN) etc..
The electronic equipment 1 can be the node of component content distribution network or block chain network.
The electronic equipment 1 may include memory 12, processor 13 and bus, can also include being stored in the storage In device 12 and the computer program that can be run on the processor 13, such as server linker.
It will be understood by those skilled in the art that the schematic diagram is only the example of electronic equipment 1, not structure paired electrons The restriction of equipment 1 may include perhaps combining certain components or different components, example than illustrating more or fewer components Such as described electronic equipment 1 can also include input-output equipment, network access equipment.
Wherein, memory 12 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Mobile hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Storage Device 12 can be the internal storage unit of electronic equipment 1, such as the mobile hard disk of the electronic equipment 1 in some embodiments.It deposits What reservoir 12 was also possible to be equipped on the External memory equipment of electronic equipment 1, such as electronic equipment 1 in further embodiments inserts Formula mobile hard disk, intelligent memory card (Smart Media Card, SMC) are connect, secure digital (Secure Digital, SD) blocks, Flash card (Flash Card) etc..Further, memory 12 can also both include the internal storage unit of electronic equipment 1 or wrap Include External memory equipment.Memory 12 can be not only used for the application software and Various types of data that storage is installed on electronic equipment 1, example Such as code of server linker can be also used for temporarily storing the data that has exported or will export.
Processor 13 can be in some embodiments a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 12 Code or processing data, such as execute server linker etc..
The processor 13 executes the operating system of the electronic equipment 1 and the types of applications program of installation.The place Reason device 13 executes the application program to realize the step in above-mentioned each server connection method embodiment, such as shown in Fig. 1 Step S10, S11, S12, S13, S14, S15, S16, S17.
Alternatively, the processor 13 realizes each module in above-mentioned each Installation practice/mono- when executing the computer program The function of member, such as when receiving server link order, the determination each hardware device to be connected;To each hardware The attended operation of equipment carries out random delay respectively;For each hardware device, tied when detecting that the hardware device is delayed Shu Shi parses the first IP address of certificate server;When first IP address parses failure, from preset operator IP The second IP address is obtained in location at random;When second IP address is available, target protocol is obtained at random from preset agreement; Based on second IP address, with requesting the 3rd IP of the certificate server distribution destination server using the target protocol Location;When getting the third IP address, target port is obtained at random from preset port list;Pass through the target side Mouth and the third IP address control the hardware device and connect the destination server.
The bus can be Peripheral Component Interconnect standard (peripheral component interconnect, abbreviation PCI) bus or expanding the industrial standard structure (extended industry standard architecture, abbreviation EISA) Bus etc..The bus can be divided into address bus, data/address bus, control bus etc..For convenient for indicating, only with an arrow in Fig. 2 Head indicates, it is not intended that an only bus or a type of bus.
Illustratively, the computer program can be divided into one or more module/units, one or more A module/unit is stored in the memory 12, and is executed by the processor 13, to complete the present invention.It is one Or multiple module/units can be the series of computation machine program instruction section that can complete specific function, the instruction segment is for retouching State implementation procedure of the computer program in the electronic equipment 1.For example, the computer program can be divided into really Order member 110, resolution unit 112, acquiring unit 113, request unit 114, control unit 115, forbids list at delay unit 111 Member 116, configuration unit 117 and execution unit 118.
Further, electronic equipment can also include network interface, network interface optionally may include wireline interface and/ Or wireless interface (such as WI-FI interface, blue tooth interface), commonly used in being built between the electronic equipment 1 and other electronic equipments Vertical communication connection.
Optionally, the electronic equipment 1 can also include user interface, user interface may include display (Display), Input unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface and wireless interface.It can Selection of land, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Wherein, display can also be appropriate Referred to as display screen or display unit, for showing the information handled in the electronic device 1 and for showing visual user Interface.
If the integrated module/unit of the electronic equipment 1 is realized in the form of SFU software functional unit and as independent Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention is real All or part of the process in existing above-described embodiment method, can also be instructed by computer program relevant hardware device come It completes, the computer program can be stored in a computer readable storage medium, which holds by processor When row, it can be achieved that the step of above-mentioned each embodiment of the method.
Wherein, the computer program includes computer program code, and the computer program code can be source code Form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium may include: can Carry any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer of the computer program code Memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer-readable medium The content for including can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as in certain departments Method administrative area does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
Fig. 2 illustrates only the electronic equipment 1 with component 12-13 and server linker, those skilled in the art It is understood that Fig. 2 shows structure do not constitute the restriction to the electronic equipment 1, may include than illustrate it is less or The more components of person perhaps combine certain components or different component layouts.
In conjunction with Fig. 1, the memory 12 in the electronic equipment 1 stores multiple instruction to realize a kind of server connection The multiple instruction can be performed to realize in method, the processor 13: when receiving server link order, determination will connect The each hardware device connect;Random delay is carried out respectively to the attended operation of each hardware device;For described each hard Part equipment parses the first IP address of certificate server at the end of detecting hardware device delay;As the first IP When the parsing failure of location, the second IP address is obtained at random from preset operator's IP address;When second IP address is available, Target protocol is obtained at random from preset agreement;Based on second IP address, recognize using described in target protocol request Demonstrate,prove the third IP address of server distribution destination server;When getting the third IP address, from preset port list In obtain target port at random;By the target port and the third IP address, controls the hardware device and connect the mesh Mark server.
Preferred embodiment according to the present invention, the processor 13 also execute multiple instruction and include:
When second IP address is unavailable, second IP address is forbidden to be acquired in next attended operation.
Preferred embodiment according to the present invention, the processor 13 also execute multiple instruction and include:
When not getting the third IP address, the target protocol is forbidden to be acquired in next attended operation.
Preferred embodiment according to the present invention, the processor 13 also execute multiple instruction and include:
When detecting that the hardware device is not successfully connected the destination server, forbid the target port in next time It is acquired in attended operation.
Preferred embodiment according to the present invention, the processor 13 also execute multiple instruction and include:
Obtain used all of the port;
Determine the success rate of the attended operation of all of the port;
Obtain the port that success rate is more than or equal to preset threshold;
The port list is configured according to the port of acquisition.
Preferred embodiment according to the present invention, the processor 13 also execute multiple instruction and include:
When second IP address is unavailable, the third IP address is not got perhaps or detects the hardware Equipment is not successfully connected the destination server, or detects that the hardware device is disconnected with the destination server When, re-execute the server link order.
Referring to Fig. 3, the functional block diagram of system is connected for server of the present invention.The server connection system 11 is wrapped It includes determination unit 110, delay unit 111, resolution unit 112, acquiring unit 113, request unit 114, control unit 115, prohibit Stop element 116, configuration unit 117 and execution unit 118.So-called module/the unit of the present invention refers to that one kind can be by processor Performed by 13, and the series of computation machine program segment of fixed function can be completed, storage is in memory 12.In this implementation In example, the function about each module/unit will be described in detail in subsequent embodiment.
When receiving server link order, 110 determination of the determination unit each hardware device to be connected.
In at least one embodiment of the present invention, all hardware equipment includes intelligent hardware devices, such as plays objective cloud Deng.By the hardware device, the shared of Internet resources can be realized.
In at least one embodiment of the present invention, when having detected that hardware device connects electronic equipment, the determination The determination of unit 110 receives the server link order.
Delay unit 111 carries out random delay to the attended operation of each hardware device respectively.
Such as: when having 3 hardware devices while connecting, the delay unit 111 can control 3 hardware devices Random delay 10 seconds, 20 seconds and 30 seconds respectively.
By above embodiment, all hardware equipment can be made to execute respectively in the unused time to destination service The attended operation of device, avoided within the same time while the hardware device for connecting the destination server is excessive, gave the target Server causes operating pressure, and then effectively prevents causing the destination server SYN extensive aggression (SYN Flooding)。
For each hardware device, at the end of detecting hardware device delay, resolution unit 112 parses authentication service The first IP address (Internet Protocol Address, Internet protocol address) of device.
In at least one embodiment of the present invention, the certificate server may include Portal server, described to recognize Card server is used to distribute the IP address of the destination server.
When first IP address parses failure, acquiring unit 113 obtains at random from preset operator's IP address Second IP address.
In at least one embodiment of the present invention, due to the influence of network environment, first IP address is different surely Enough successfully resolveds, therefore, in order to avoid unsuccessfully to cannot connect to the hardware device described due to first IP address parsing Destination server, when first IP address parse failure when, the acquiring unit 113 from preset operator's IP address with Machine obtains the second IP address, and replaces first IP address with second IP address.
In at least one embodiment of the present invention, the method also includes:
Configuration unit 117 is pre-configured with the operator IP.
Specifically, the configuration unit 117 can configure an IP for each operator, although working as in this way, can not confirm Preceding operator, but by repetition test, the probability of IP adaptation can be effectively improved, and then improve the probability of server connection.
When second IP address is available, the acquiring unit 113 obtains target protocol from preset agreement at random.
In at least one embodiment of the present invention, the preset agreement may include http protocol (Hyper Text Transfer Protocol, hypertext transfer protocol) and HTTPS agreement (Hyper Text Transfer Protocol Over Secure Socket, Hyper text transfer security protocol).
In at least one embodiment of the present invention, due to the influence of network environment, second IP address not necessarily may be used With.
Therefore, the method also includes:
When second IP address is unavailable, unit 116 is forbidden to forbid second IP address in next attended operation In be acquired.
By above embodiment, it can effectively avoid not available IP address from being repeated acquisition, delay connection progress.
Request unit 114 is based on second IP address, requests the certificate server to distribute using the target protocol The third IP address of destination server.
In at least one embodiment of the present invention, the third IP address is for connecting the destination server.
When getting the third IP address, the acquiring unit 113 obtains mesh from preset port list at random Mark port.
In at least one embodiment of the present invention, store in the port list be proved to connect into power it is higher Port.
Specifically, the configuration unit 117 configures the port list and includes:
The configuration unit 117 obtains used all of the port, and determine all of the port attended operation at Power, the configuration unit 117 obtains the port that success rate is more than or equal to preset threshold, and is configured according to the port of acquisition The port list.
Wherein, the preset threshold can be custom-configured, for example, in order to preferably connect the destination service Device, the configuration unit 117 can configure the higher preset threshold, and the preset threshold can be configured as 95%.
In at least one embodiment of the present invention, due to the influence of network environment, the third IP address is likely to obtain Take less than.
Therefore, the method also includes:
It is described to forbid unit 116 that the target protocol is forbidden to connect in next time when not getting the third IP address It connects in operation and is acquired.
It by above embodiment, can effectively avoid invalid target protocol from being reused, and then improve connection Efficiency.
Control unit 115 controls the hardware device and connects the mesh by the target port and the third IP address Mark server.
In at least one embodiment of the present invention, the destination server refers to public network server, hard by controlling this Part equipment connects the destination server, so that the hardware device and the destination server is in connection slave mode, in this way, working as When user opens the corresponding application programs of mobile terminal, the mobile terminal can access distal end by the destination server Other hardware devices enable the mobile terminal of user to connect the hardware device whenever and wherever possible.
In at least one embodiment of the present invention, since the influence of network environment, the hardware device and the target take Business device is likely to connection failure.
Therefore, the method also includes:
It is described that unit 116 is forbidden to forbid institute when detecting that the hardware device is not successfully connected the destination server Target port is stated to be acquired in next attended operation.
By above embodiment, it can effectively avoid not available target port from being repeated acquisition, delay connection progress.
In at least one embodiment of the present invention, when there is flow operations failure in above-mentioned process, in order to avoid hair Raw logic error, causes the hardware device that can not normally connect the destination server, the method also includes:
When detecting predeterminable event, execution unit 118 re-executes the server link order.
In at least one embodiment of the present invention, the predeterminable event may include, but be not limited to it is following a kind of or The combination of a variety of events:
(1) second IP address is unavailable.
(2) acquiring unit 113 does not get the third IP address.
(3) detect that the hardware device is not successfully connected the destination server.
(4) detect that the hardware device is disconnected with the destination server.
(5) detect that the connection of the hardware device and the destination server is abnormal.
By above embodiment, the server link order can be re-executed when detecting anomalous event, led to After taking responsive measures in time, avoids influencing user to the normal use of Internet resources, influence user experience.
In conclusion the present invention can be when receiving server link order, the determination each hardware device to be connected, And random delay is carried out respectively to the attended operation of each hardware device, for each hardware device, when detecting that this is hard At the end of part equipment is delayed, the first IP address of certificate server is parsed, when first IP address parses failure, from default Operator's IP address in obtain the second IP address at random, it is random from preset agreement when second IP address is available Target protocol is obtained, second IP address is based further on, requests the certificate server to distribute using the target protocol The third IP address of destination server obtains mesh from preset port list when getting the third IP address at random Port is marked, and by the target port and the third IP address, controls the hardware device and connects the destination server, into And the connectivity problem of hardware device and server under complicated network environment is solved, improve what hardware device was connect with server Success rate.
In the above-described embodiments, can come wholly or partly by software, hardware device, firmware or any combination thereof It realizes.When implemented in software, it can entirely or partly realize in the form of a computer program product.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present invention.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave) mode to another website Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit Any usable medium of storage either includes that the data storages such as one or more usable mediums integrated server, data center are set It is standby.The usable medium can be magnetic medium, (for example, floppy disk, mobile hard disk, tape), optical medium (for example, DVD) or Semiconductor medium (such as solid-state mobile hard disk Solid State Disk (SSD)) etc..
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member can both be realized in the form of hardware device, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the application Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element Or there is also other identical elements in method.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of server connection method, which is characterized in that the described method includes:
When receiving server link order, the determination each hardware device to be connected;
Random delay is carried out respectively to the attended operation of each hardware device;
The first IP of certificate server is parsed at the end of detecting hardware device delay for each hardware device Address;
When first IP address parses failure, the second IP address is obtained at random from preset operator's IP address;
When second IP address is available, target protocol is obtained at random from preset agreement;
Based on second IP address, the third of the certificate server distribution destination server is requested using the target protocol IP address;
When getting the third IP address, target port is obtained at random from preset port list;
By the target port and the third IP address, controls the hardware device and connect the destination server.
2. server connection method as described in claim 1, which is characterized in that the method also includes:
When second IP address is unavailable, second IP address is forbidden to be acquired in next attended operation.
3. server connection method as described in claim 1, which is characterized in that the method also includes:
When not getting the third IP address, the target protocol is forbidden to be acquired in next attended operation.
4. server connection method as described in claim 1, which is characterized in that the method also includes:
When detecting that the hardware device is not successfully connected the destination server, the target port is forbidden to connect in next time It is acquired in operation.
5. server connection method as described in claim 1, which is characterized in that the method also includes:
Obtain used all of the port;
Determine the success rate of the attended operation of all of the port;
Obtain the port that success rate is more than or equal to preset threshold;
The port list is configured according to the port of acquisition.
6. the server connection method as described in any one of claims 1 to 5, which is characterized in that the method also includes:
When second IP address is unavailable, the third IP address is not got perhaps or detects the hardware device When not being successfully connected the destination server, or detecting that the hardware device and the destination server disconnect, weight Newly execute the server link order.
7. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Memory stores at least one instruction;And
Processor executes the instruction stored in the memory to realize the service as described in any one of claim 1 to 6 Device connection method.
8. electronic equipment according to claim 7, which is characterized in that the electronic equipment be component content distribution network or The node of person's block chain network.
9. a kind of server connects system, which is characterized in that the system comprises:
Determination unit, for when receiving server link order, the determination each hardware device to be connected;
Delay unit carries out random delay for the attended operation to each hardware device respectively;
Resolution unit, for parsing certificate server at the end of detecting hardware device delay for each hardware device The first IP address;
Acquiring unit, for obtaining the at random from preset operator's IP address when first IP address parses failure Two IP address;
The acquiring unit is also used to obtain target protocol at random from preset agreement when second IP address is available;
Request unit requests the certificate server to distribute mesh for being based on second IP address using the target protocol Mark the third IP address of server;
The acquiring unit is also used to obtain mesh at random from preset port list when getting the third IP address Mark port;
Control unit, for controlling the hardware device and connecting the target by the target port and the third IP address Server.
10. a kind of computer readable storage medium, which is characterized in that be stored with server on the computer readable storage medium Linker, the server linker can be executed by one or more processor, to realize as in claim 1 to 6 Described in any item server connection methods.
CN201910708646.8A 2019-08-01 2019-08-01 Server connection method, electronic device, system and medium Active CN110417789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910708646.8A CN110417789B (en) 2019-08-01 2019-08-01 Server connection method, electronic device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910708646.8A CN110417789B (en) 2019-08-01 2019-08-01 Server connection method, electronic device, system and medium

Publications (2)

Publication Number Publication Date
CN110417789A true CN110417789A (en) 2019-11-05
CN110417789B CN110417789B (en) 2021-12-03

Family

ID=68365122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910708646.8A Active CN110417789B (en) 2019-08-01 2019-08-01 Server connection method, electronic device, system and medium

Country Status (1)

Country Link
CN (1) CN110417789B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110839034A (en) * 2019-11-15 2020-02-25 腾讯科技(深圳)有限公司 Communication connection control method and related equipment
CN111082996A (en) * 2019-12-29 2020-04-28 山东英信计算机技术有限公司 Automatic configuration method, device and medium for in-band monitoring software
CN111803925A (en) * 2019-12-03 2020-10-23 厦门雅基软件有限公司 Scheduling method and device of forwarding server of cloud game and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101361326A (en) * 2007-03-30 2009-02-04 香港应用科技研究院有限公司 Method of simultaneously providing data to two or more devices on the same network
CN104756126A (en) * 2012-10-29 2015-07-01 三菱电机株式会社 Facility management device, facility management system and program
US20190013968A1 (en) * 2016-02-23 2019-01-10 Huawei Technologies Co., Ltd. Access control method, apparatus, and system
CN109274735A (en) * 2018-09-11 2019-01-25 腾讯科技(深圳)有限公司 A kind of peer-to-peer network connection method and relevant device
CN109347997A (en) * 2018-12-18 2019-02-15 深圳创维数字技术有限公司 Domain name analytic method, device, server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101361326A (en) * 2007-03-30 2009-02-04 香港应用科技研究院有限公司 Method of simultaneously providing data to two or more devices on the same network
CN104756126A (en) * 2012-10-29 2015-07-01 三菱电机株式会社 Facility management device, facility management system and program
US20190013968A1 (en) * 2016-02-23 2019-01-10 Huawei Technologies Co., Ltd. Access control method, apparatus, and system
CN109274735A (en) * 2018-09-11 2019-01-25 腾讯科技(深圳)有限公司 A kind of peer-to-peer network connection method and relevant device
CN109347997A (en) * 2018-12-18 2019-02-15 深圳创维数字技术有限公司 Domain name analytic method, device, server and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄宝~: "智能家居系统中网关与服务器如何连接?", 《CSDN,HTTPS://BLOG.CSDN.NET/FOREBE/ARTICLE/DETAILS/77448888》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110839034A (en) * 2019-11-15 2020-02-25 腾讯科技(深圳)有限公司 Communication connection control method and related equipment
CN111803925A (en) * 2019-12-03 2020-10-23 厦门雅基软件有限公司 Scheduling method and device of forwarding server of cloud game and readable storage medium
CN111803925B (en) * 2019-12-03 2023-04-18 厦门雅基软件有限公司 Scheduling method and device of forwarding server of cloud game and readable storage medium
CN111082996A (en) * 2019-12-29 2020-04-28 山东英信计算机技术有限公司 Automatic configuration method, device and medium for in-band monitoring software
CN111082996B (en) * 2019-12-29 2022-05-27 山东英信计算机技术有限公司 Automatic configuration method, device and medium for in-band monitoring software

Also Published As

Publication number Publication date
CN110417789B (en) 2021-12-03

Similar Documents

Publication Publication Date Title
US20240015084A1 (en) Policy utilization analysis
CN109933420A (en) Node tasks dispatching method, electronic equipment and system
CN110417789A (en) Server connection method, electronic equipment, system and medium
US20140040875A1 (en) Federated system automatic update communication to enable selective update of critical firmware elements
CN105049502B (en) The method and apparatus that device software updates in a kind of cloud network management system
CN105550051A (en) Asynchronous processing method and device of business request
CN109981415A (en) Condition judgement method, electronic equipment, system and medium
CN106059959A (en) Bandwidth prioritization
CN109617959A (en) A kind of data load method, device, system and storage medium
US9110861B2 (en) Managing host computing devices with a host control component
CN109618174A (en) A kind of live data transmission method, device, system and storage medium
CN110708366A (en) Plug-in process management method, related method and related device
CN110278278A (en) A kind of data transmission method, system, device and computer media
CN110177102A (en) Anti-attack method, electronic equipment, system and medium based on fringe node
CN110109765A (en) Storage device recognition methods, electronic equipment, system and medium
CN109951562A (en) NAT penetrating method and system, electronic equipment and storage medium
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN110855784A (en) Proxy server node selection method, electronic device, system and medium
CN109639801A (en) Back end distribution and data capture method and system
CN106302519A (en) The method of a kind of internet security management and terminal
CN110535977B (en) File distribution method and device, computer device and storage medium
CN109413191A (en) Data transmission method, electronic equipment and storage medium
CN110213132A (en) Network connectivity methods, electronic equipment, system and medium
CN110324426A (en) A kind of data capture method, device and system
CN110099121A (en) Public cloud service processing method, computer installation and storage 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
GR01 Patent grant
GR01 Patent grant